From befa897108a3c7cc747999ac3bc70833b00a805e Mon Sep 17 00:00:00 2001 From: Marcus Quinn Date: Sun, 16 Mar 2025 03:46:17 +0000 Subject: [PATCH] Fix notification positioning, clickable areas, and AJAX nonce issues --- admin/css/wp-allstars-admin.css | 13 +++++++++++-- admin/js/wp-allstars-admin.js | 14 +++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/admin/css/wp-allstars-admin.css b/admin/css/wp-allstars-admin.css index 0891828..39bba5a 100644 --- a/admin/css/wp-allstars-admin.css +++ b/admin/css/wp-allstars-admin.css @@ -199,6 +199,8 @@ input:checked + .wp-toggle-slider:before { /* Expandable Panel Component */ .wp-allstars-toggle-header { cursor: pointer; + position: relative; + z-index: 1; } .wp-allstars-toggle-header::after { @@ -634,14 +636,15 @@ input:checked + .wp-toggle-slider:before { .wp-allstars-toggle-left label, .wp-allstars-setting-row label { position: relative; - padding-right: 80px; + padding-right: 40px; + display: inline-block; } .wp-setting-left label .wp-setting-notification, .wp-allstars-toggle-left label .wp-setting-notification, .wp-allstars-setting-row label .wp-setting-notification { position: absolute; - right: 0; + right: -5px; top: 50%; transform: translateY(-50%); } @@ -662,4 +665,10 @@ input:checked + .wp-toggle-slider:before { display: flex; align-items: center; justify-content: center; +} + +.wp-allstars-toggle-main { + padding-right: 40px; /* Space for chevron */ + position: relative; + z-index: 1; } \ No newline at end of file diff --git a/admin/js/wp-allstars-admin.js b/admin/js/wp-allstars-admin.js index 65c494d..1795bb9 100644 --- a/admin/js/wp-allstars-admin.js +++ b/admin/js/wp-allstars-admin.js @@ -106,10 +106,7 @@ jQuery(document).ready(function($) { var $input = $(this); var option = $input.attr('name'); var value = $input.val(); - var $label = $input.prev('label'); - if (!$label.length) { - $label = $input.closest('.wp-allstars-setting-row').find('label'); - } + var $label = $input.closest('.wp-allstars-setting-row').find('label').first(); updateOption(option, value) .then(function() { @@ -159,13 +156,16 @@ jQuery(document).ready(function($) { // Show loading overlay $('.wpa-loading-overlay').fadeIn(); + // Log the nonce for debugging + console.log('Using nonce:', wpAllstars.nonce); + $.ajax({ url: ajaxurl, type: 'POST', data: { action: 'wp_allstars_get_plugins', category: category || 'minimal', - _ajax_nonce: wpAllstars.nonce + nonce: wpAllstars.nonce }, success: function(response) { if (response.success) { @@ -199,7 +199,7 @@ jQuery(document).ready(function($) { type: 'POST', data: { action: 'wp_allstars_get_theme', - _ajax_nonce: wpAllstars.nonce + nonce: wpAllstars.nonce }, success: function(response) { if (response.success) { @@ -264,7 +264,7 @@ jQuery(document).ready(function($) { data: { action: 'wp_allstars_activate_theme', theme: slug, - _ajax_nonce: wpAllstars.nonce + nonce: wpAllstars.nonce }, success: function(response) { if (response.success) {