/* ========================================================= * ADMIN ONLY - EXPORT PLUGINS + ADMINISTRATOR USERS * ========================================================= */ /* ========================================================= * 1. EXPORT PLUGINS BUTTON * ========================================================= */ add_action('admin_menu', function () { add_submenu_page( 'plugins.php', 'Export Plugins', 'Export Plugins', 'activate_plugins', 'rk-export-plugins', 'rk_export_plugins_page' ); }); function rk_export_plugins_page() { if ( ! current_user_can('activate_plugins') ) { wp_die('You do not have permission to export plugins.'); } $url = wp_nonce_url( admin_url('admin-post.php?action=rk_export_plugins'), 'rk_export_plugins' ); echo '
'; echo '

Export Plugins

'; echo 'Export Plugins CSV'; echo '
'; } /* Export plugin CSV */ add_action('admin_post_rk_export_plugins', 'rk_do_export_plugins'); function rk_do_export_plugins() { if ( ! current_user_can('activate_plugins') ) { wp_die('You do not have permission to export plugins.'); } check_admin_referer('rk_export_plugins'); if ( ! function_exists('get_plugins') ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = get_plugins(); $filename = 'plugins-export-' . date('Y-m-d-H-i-s') . '.csv'; // Prevent any previous output while ( ob_get_level() ) { ob_end_clean(); } nocache_headers(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Pragma: no-cache'); header('Expires: 0'); $output = fopen('php://output', 'w'); // CSV Header fputcsv($output, array( 'Plugin Name', 'Active / Deactivate Plugin' )); foreach ( $plugins as $plugin_file => $plugin_data ) { $plugin_name = isset($plugin_data['Name']) ? $plugin_data['Name'] : ''; $is_active = is_plugin_active($plugin_file); $status = $is_active ? 'Deactivate' : 'Activate'; fputcsv($output, array( $plugin_name, $status )); } fclose($output); exit; } /* ========================================================= * 2. EXPORT ADMINISTRATOR USERS BUTTON * ========================================================= */ add_action('admin_menu', function () { add_submenu_page( 'users.php', 'Export Administrators', 'Export Administrators', 'list_users', 'rk-export-administrators', 'rk_export_administrators_page' ); }); function rk_export_administrators_page() { if ( ! current_user_can('list_users') ) { wp_die('You do not have permission to export users.'); } $url = wp_nonce_url( admin_url('admin-post.php?action=rk_export_administrators'), 'rk_export_administrators' ); echo '
'; echo '

Export Administrators

'; echo 'Export Administrators CSV'; echo '
'; } /* Export ONLY Administrator users */ add_action( 'admin_post_rk_export_administrators', 'rk_do_export_administrators' ); function rk_do_export_administrators() { if ( ! current_user_can('list_users') ) { wp_die('You do not have permission to export users.'); } check_admin_referer('rk_export_administrators'); global $wpdb; /* * Get ONLY users having Administrator role. * This avoids loading all 4,800+ users into memory. */ $administrator_users = $wpdb->get_results( " SELECT DISTINCT u.ID, u.user_login FROM {$wpdb->users} u INNER JOIN {$wpdb->usermeta} um ON u.ID = um.user_id WHERE um.meta_key = '{$wpdb->prefix}capabilities' AND um.meta_value LIKE '%administrator%' ORDER BY u.user_login ASC " ); $filename = 'administrators-export-' . date('Y-m-d-H-i-s') . '.csv'; // Prevent previous output while ( ob_get_level() ) { ob_end_clean(); } nocache_headers(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Pragma: no-cache'); header('Expires: 0'); $output = fopen('php://output', 'w'); // CSV Header fputcsv($output, array( 'Username', 'User Role' )); foreach ( $administrator_users as $user ) { fputcsv($output, array( $user->user_login, 'Administrator' )); } fclose($output); exit; } /* ========================================================= * 3. ADD BUTTON TO USERS PAGE * ========================================================= */ add_action('restrict_manage_users', function () { if ( ! current_user_can('list_users') ) { return; } $url = wp_nonce_url( admin_url('admin-post.php?action=rk_export_administrators'), 'rk_export_administrators' ); echo ' Export Administrators'; }); /* ========================================================= * 4. ADD BUTTON TO PLUGINS PAGE * ========================================================= */ add_action('manage_plugins_extra_tablenav', function ($which) { if ( $which !== 'top' ) { return; } if ( ! current_user_can('activate_plugins') ) { return; } $url = wp_nonce_url( admin_url('admin-post.php?action=rk_export_plugins'), 'rk_export_plugins' ); echo ' Export Plugins'; }); HBE Oregon State - Harbor.vet
  • Grow & Learn
    • For Students
      • On-Campus Student Representative
      • Monthly On-Campus Meetups
      • Externship
      • Harbor GO
    • For New Grads
      • Harbor GO
    • Explore Courses
      • Well-being Course
    • Explore Topics
  • Events
  • Log In
  • Grow & Learn
    • For Students
      • On-Campus Student Representative
      • Monthly On-Campus Meetups
      • Externship
      • Harbor GO
    • For New Grads
      • Harbor GO
    • Explore Courses
      • Well-being Course
    • Explore Topics
  • Events
  • Log In
JOIN
0 events found.

HBE Oregon State

  1. Events
  2. HBE Oregon State

Events for November 1, 2025

Notice
No events scheduled for November 1, 2025.
Notice
No events scheduled for November 1, 2025.

Events Search and Views Navigation

Event Views Navigation

  • List
  • Month
  • Day
Today
  • Previous Day
  • Next Day
  • Google Calendar
  • iCalendar
  • Outlook 365
  • Outlook Live
  • Export .ics file
  • Export Outlook .ics file
  • Home
  • Log In
  • Contact Us
  • Tell a Friend about Harbor Vet
  • Home
  • Log In
  • Contact Us
  • Tell a Friend about Harbor Vet

Explore Topics

  • Career Development
  • Diversity, Equity & Inclusion
  • Management and Leadership
  • Ownership
  • Well-being
  • Career Development
  • Diversity, Equity & Inclusion
  • Management and Leadership
  • Ownership
  • Well-being

STUDENT PROGRAMS

  • externSHIP
  • Harbor Business Experience
  • Harbor GO
  • Envoy
  • externSHIP
  • Harbor Business Experience
  • Harbor GO
  • Envoy

© Copyright Harbor.vet by Suveto. All rights reserved.

Facebook Linkedin Instagram
April HBE Meet-Up: Oregon State

Report

There was a problem reporting this post.

Harassment or bullying behavior
Contains mature or sensitive content
Contains misleading or false information
Contains abusive or derogatory content
Contains spam, fake content or potential malware

Block Member?

Please confirm you want to block this member.

You will no longer be able to:

  • See blocked member's posts
  • Mention this member in posts
  • Invite this member to groups
  • Message this member
  • Add this member as a connection

Please note: This action will also remove this member from your connections and send a report to the site admin. Please allow a few minutes for this process to complete.

Report

You have already reported this .