From 7f4ea3ec0c1729ee93a755d2826bdc1434896146 Mon Sep 17 00:00:00 2001 From: Marcus Quinn Date: Mon, 24 Mar 2025 03:06:21 +0000 Subject: [PATCH] Fix fatal error: Address naming inconsistencies from WP Allstars to SEO Pro Stack refactoring - Resolved class naming conflicts in auto-upload functionality - Fixed menu slug from 'wp-allstars' to 'seoprostack' - Corrected AJAX nonce references for consistency - Updated JavaScript variable name to 'wpSeoProStack' - Added deprecation notice to legacy auto-upload class --- admin/settings.php | 4 ++-- includes/class-seoprostack-auto-upload.php | 13 +++++++++++-- wp-seoprostack-plugin.php | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/admin/settings.php b/admin/settings.php index 31c79a4..d632c0e 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -9,7 +9,7 @@ function wp_seoprostack_admin_menu() { 'SEO Pro Stack Settings', 'SEO Pro Stack', 'manage_options', - 'wp-allstars', + 'seoprostack', 'wp_seoprostack_settings_page' ); } @@ -31,7 +31,7 @@ add_action('admin_init', 'wp_seoprostack_register_settings'); // AJAX handler for settings function wp_seoprostack_update_option() { - check_ajax_referer('wp-seoprostack-nonce', 'nonce'); + check_ajax_referer('seoprostack-nonce', 'nonce'); $option = sanitize_text_field($_POST['option']); $value = intval($_POST['value']); update_option($option, $value); diff --git a/includes/class-seoprostack-auto-upload.php b/includes/class-seoprostack-auto-upload.php index ee9df56..7835dca 100644 --- a/includes/class-seoprostack-auto-upload.php +++ b/includes/class-seoprostack-auto-upload.php @@ -2,10 +2,19 @@ /** * Auto Upload Images functionality * - * @package WP_Allstars + * @package SEO_Pro_Stack + * @deprecated 1.0.0 Use the class in includes/features/auto-upload/class-seoprostack-auto-upload.php instead */ -class WP_Allstars_Auto_Upload { +// If this file is called directly, abort. +if (!defined('ABSPATH')) { + exit; +} + +/** + * @deprecated 1.0.0 Use SEOProStack_Auto_Upload instead + */ +class SEOProStack_Auto_Upload_Legacy { /** * Initialize the class */ diff --git a/wp-seoprostack-plugin.php b/wp-seoprostack-plugin.php index 78cd754..ba45a51 100644 --- a/wp-seoprostack-plugin.php +++ b/wp-seoprostack-plugin.php @@ -91,6 +91,6 @@ function seoprostack_admin_assets() { 'nonce' => wp_create_nonce('seoprostack-nonce'), 'updateNonce' => wp_create_nonce('updates') ); - wp_localize_script('seoprostack-admin', 'seoProStack', $ajax_data); + wp_localize_script('seoprostack-admin', 'wpSeoProStack', $ajax_data); } add_action('admin_enqueue_scripts', 'seoprostack_admin_assets'); \ No newline at end of file