Fix plugin display issues in the Plugin Manager class
This commit is contained in:
@ -62,7 +62,7 @@ class WP_Allstars_Plugin_Manager {
|
|||||||
*/
|
*/
|
||||||
public static function ajax_get_plugins() {
|
public static function ajax_get_plugins() {
|
||||||
// Check nonce with the correct action name
|
// Check nonce with the correct action name
|
||||||
if (!check_ajax_referer('wp-allstars-nonce', '_wpnonce', false)) {
|
if (!check_ajax_referer('wp-allstars-nonce', false, false)) {
|
||||||
wp_send_json_error('Invalid security token sent.');
|
wp_send_json_error('Invalid security token sent.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -220,9 +220,17 @@ class WP_Allstars_Plugin_Manager {
|
|||||||
|
|
||||||
// Add PRO button if available
|
// Add PRO button if available
|
||||||
self::add_pro_button($plugin);
|
self::add_pro_button($plugin);
|
||||||
|
|
||||||
|
// Add "More Details" link
|
||||||
|
echo '<li><a class="thickbox open-plugin-details-modal" href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin->slug . '&TB_iframe=true&width=600&height=550')) . '" aria-label="' . esc_attr(sprintf(__('More information about %s'), $plugin->name)) . '">' . __('More Details') . '</a></li>';
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if (!empty($plugin->icons) && !empty($plugin->icons['1x'])): ?>
|
||||||
|
<div class="plugin-icon">
|
||||||
|
<img src="<?php echo esc_url($plugin->icons['1x']); ?>" alt="">
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="desc column-description">
|
<div class="desc column-description">
|
||||||
<p><?php echo esc_html($plugin->short_description); ?></p>
|
<p><?php echo esc_html($plugin->short_description); ?></p>
|
||||||
<p class="authors">
|
<p class="authors">
|
||||||
@ -338,6 +346,3 @@ class WP_Allstars_Plugin_Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the class
|
|
||||||
WP_Allstars_Plugin_Manager::init();
|
|
||||||
|
@ -45,8 +45,7 @@ require_once dirname(__FILE__) . '/data/recommended-plugins.php';
|
|||||||
require_once dirname(__FILE__) . '/includes/class-plugin-manager.php';
|
require_once dirname(__FILE__) . '/includes/class-plugin-manager.php';
|
||||||
|
|
||||||
// Initialize the Plugin Manager
|
// Initialize the Plugin Manager
|
||||||
global $wp_allstars_plugin_manager;
|
WP_Allstars_Plugin_Manager::init();
|
||||||
$wp_allstars_plugin_manager = new WP_Allstars_Plugin_Manager();
|
|
||||||
|
|
||||||
|
|
||||||
// Remove the old plugins API filter since we're handling everything in the AJAX endpoint
|
// Remove the old plugins API filter since we're handling everything in the AJAX endpoint
|
||||||
@ -259,8 +258,7 @@ function wp_allstars_settings_page() {
|
|||||||
|
|
||||||
// Clear cache and load required files
|
// Clear cache and load required files
|
||||||
if ($active_tab === 'recommended') {
|
if ($active_tab === 'recommended') {
|
||||||
global $wp_allstars_plugin_manager;
|
WP_Allstars_Plugin_Manager::clear_plugin_cache();
|
||||||
$wp_allstars_plugin_manager->clear_plugin_cache();
|
|
||||||
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
||||||
wp_enqueue_script('plugin-install');
|
wp_enqueue_script('plugin-install');
|
||||||
wp_enqueue_script('updates');
|
wp_enqueue_script('updates');
|
||||||
|
Reference in New Issue
Block a user