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
This commit is contained in:
Marcus Quinn
2025-03-24 03:06:21 +00:00
parent f2929bb43a
commit 7f4ea3ec0c
3 changed files with 14 additions and 5 deletions

View File

@ -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);

View File

@ -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
*/

View File

@ -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');