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 the plugins API results function wpa_superstar_filter_plugins_api($result, $action, $args) { if ($action !== 'query_plugins') { return $result; } // Only filter on our page if (!isset($_GET['page']) || $_GET['page'] !== 'wpa-superstar') { return $result; } $category = isset($_GET['category']) ? sanitize_key($_GET['category']) : 'recommended'; $recommended_plugins = wpa_superstar_get_recommended_plugins(); if (!isset($recommended_plugins[$category])) { return $result; } // Get the full plugin data for our recommended plugins $args = array( 'per_page' => 100, 'fields' => array( 'last_updated' => true, 'active_installs' => true, 'downloaded' => true, 'icons' => true, ), 'slug' => $recommended_plugins[$category] ); $query = new WP_Plugin_Install_List_Table(); $query->prepare_items(); return plugins_api('query_plugins', $args); } add_filter('plugins_api_result', 'wpa_superstar_filter_plugins_api', 10, 3); // Settings page HTML function wpa_superstar_settings_page() { $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'recommended'; $active_category = isset($_GET['category']) ? $_GET['category'] : 'recommended'; ?>