From 6fc054f2bf7f57717848b0e75de62af053356322 Mon Sep 17 00:00:00 2001 From: Marcus Quinn Date: Mon, 24 Mar 2025 03:11:03 +0000 Subject: [PATCH] Fix plugin activation and critical errors - Fixed class naming inconsistency in auto-upload functionality - Resolved duplicate menu items by removing direct inclusion of settings.php - Fixed JavaScript variable naming from seoProStack to wpSeoProStack - Added deprecation notice to legacy auto-upload class - Updated AJAX nonce references for consistency --- admin/js/seoprostack-admin.js | 18 +++++++++--------- wp-seoprostack-plugin.php | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/admin/js/seoprostack-admin.js b/admin/js/seoprostack-admin.js index e38aab6..ae6522c 100644 --- a/admin/js/seoprostack-admin.js +++ b/admin/js/seoprostack-admin.js @@ -48,12 +48,12 @@ // Load plugins $.ajax({ - url: seoProStack.ajaxurl, + url: wpSeoProStack.ajaxurl, type: 'POST', data: { action: 'seoprostack_get_pro_plugins', category: category, - nonce: seoProStack.nonce + nonce: wpSeoProStack.nonce }, success: function(response) { $('#seoprostack-plugins-grid').removeClass('loading'); @@ -84,12 +84,12 @@ // Send activation request $.ajax({ - url: seoProStack.ajaxurl, + url: wpSeoProStack.ajaxurl, type: 'POST', data: { action: 'seoprostack_activate_plugin', plugin: plugin, - nonce: seoProStack.nonce + nonce: wpSeoProStack.nonce }, success: function(response) { if (response.success) { @@ -168,7 +168,7 @@ var formData = $form.serializeArray(); var data = { action: 'seoprostack_save_advanced_settings', - nonce: seoProStack.nonce + nonce: wpSeoProStack.nonce }; // Convert form data to proper format @@ -230,11 +230,11 @@ // Send AJAX request $.ajax({ - url: seoProStack.ajaxurl, + url: wpSeoProStack.ajaxurl, type: 'POST', data: { action: 'seoprostack_optimize_database', - nonce: seoProStack.nonce + nonce: wpSeoProStack.nonce }, success: function(response) { // Hide loading @@ -302,11 +302,11 @@ // Send AJAX request $.ajax({ - url: seoProStack.ajaxurl, + url: wpSeoProStack.ajaxurl, type: 'POST', data: { action: 'seoprostack_generate_robots', - nonce: seoProStack.nonce + nonce: wpSeoProStack.nonce }, success: function(response) { // Hide loading diff --git a/wp-seoprostack-plugin.php b/wp-seoprostack-plugin.php index ba45a51..9c3e5aa 100644 --- a/wp-seoprostack-plugin.php +++ b/wp-seoprostack-plugin.php @@ -28,11 +28,11 @@ define('SEOPROSTACK_PLUGIN_BASENAME', plugin_basename(__FILE__)); // Load autoloader require_once SEOPROSTACK_PLUGIN_DIR . 'includes/core/class-seoprostack-autoloader.php'; -// Backward compatibility - load the existing functionality +// Backward compatibility - load only necessary legacy files // This will be removed in future iterations if (is_admin()) { require_once SEOPROSTACK_PLUGIN_DIR . 'admin/pro-plugins-config.php'; - require_once SEOPROSTACK_PLUGIN_DIR . 'admin/settings.php'; + // Legacy settings.php is now handled through the OOP structure } // Activation hook