array( 'advanced-custom-fields', 'admin-menu-editor', 'antispam-bee', 'burst-statistics', 'freesoul-deactivate-plugins', 'plugin-toggle', 'pretty-links', 'seo-by-rank-math', 'turnstile' ), 'advanced' => array( 'fluent-crm', 'fluentform', 'fluent-smtp', 'fluent-support' ), 'ecommerce' => array( 'woocommerce', 'client-booking' ), 'lms' => array( // Add LMS plugins when needed ) ); } // Filter plugins API to show only our recommended plugins function wpa_superstar_plugins_api_result($res, $action, $args) { if ($action !== 'query_plugins') { return $res; } if (!empty($_GET['page']) && $_GET['page'] === 'wpa-superstar') { $category = isset($_GET['category']) ? sanitize_key($_GET['category']) : 'minimal'; $recommended_plugins = wpa_superstar_get_recommended_plugins(); if (isset($recommended_plugins[$category])) { // Get plugin data for our recommended plugins $args = (object) array( 'per_page' => 100, 'fields' => array( 'last_updated' => true, 'active_installs' => true, 'downloaded' => true, 'icons' => true, ), 'locale' => get_user_locale(), 'slugs' => $recommended_plugins[$category] ); $query = plugins_api('query_plugins', $args); if (!is_wp_error($query)) { return $query; } } } return $res; } add_filter('plugins_api_result', 'wpa_superstar_plugins_api_result', 10, 3); // Settings page HTML function wpa_superstar_settings_page() { global $tabs; $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'recommended'; $active_category = isset($_GET['category']) ? $_GET['category'] : 'minimal'; // Ensure required files are loaded if ($active_tab === 'recommended') { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; wp_enqueue_script('plugin-install'); wp_enqueue_script('updates'); add_thickbox(); } ?>