$plugin) { // Skip the SEO Pro Stack plugin if (strpos($path, 'wp-seoprostack-plugin') !== false) { continue; } $is_active = in_array($path, $active_plugins); $plugin_slug = explode('/', $path)[0]; $plugin_list[] = array( 'name' => $plugin['Name'], 'slug' => $plugin_slug, 'version' => $plugin['Version'], 'active' => $is_active, 'path' => $path ); } // Sort plugins alphabetically usort($plugin_list, function ($a, $b) { return strcasecmp($a['name'], $b['name']); }); wp_send_json_success($plugin_list); } }