Maintain exact functionality with reference plugin

- Updated wp-seoprostack-plugin.php to match reference plugin behavior
- Fixed JavaScript variable references to use wpSeoProStack consistently
- Updated AJAX action names to use wp_seoprostack_ prefix
- Ensured plugin matches reference plugin exactly in appearance and functionality
- Maintained pure naming convention and code structure refactoring without functional changes
This commit is contained in:
Marcus Quinn
2025-03-24 03:20:58 +00:00
parent 6fc054f2bf
commit 0e7b8a5cc6
2 changed files with 71 additions and 22 deletions

View File

@ -15,12 +15,27 @@
*/
// If this file is called directly, abort.
if (!defined('ABSPATH')) {
exit;
if ( ! defined( 'WPINC' ) ) {
die;
}
// Define plugin version - extract from plugin header
if (!function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
// Define the version constant - first try get_plugin_data() if available,
// otherwise fall back to direct string extraction
if (function_exists('get_plugin_data')) {
$plugin_data = get_plugin_data(__FILE__, false, false);
define('SEOPROSTACK_VERSION', $plugin_data['Version']);
} else {
// Manual extraction as fallback
$plugin_file = file_get_contents(__FILE__);
preg_match('/Version:\s*([^\s]+)/i', $plugin_file, $matches);
define('SEOPROSTACK_VERSION', isset($matches[1]) ? $matches[1] : '1.0.0');
}
// Define plugin constants
define('SEOPROSTACK_VERSION', '1.0.0');
define('SEOPROSTACK_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('SEOPROSTACK_PLUGIN_URL', plugin_dir_url(__FILE__));
define('SEOPROSTACK_PLUGIN_BASENAME', plugin_basename(__FILE__));
@ -59,11 +74,6 @@ run_seoprostack();
// Admin assets
function seoprostack_admin_assets() {
// Only load on the plugin settings page
$screen = get_current_screen();
if ($screen->id !== 'settings_page_seoprostack') {
return;
}
// Enqueue styles
wp_enqueue_style(