Fix notification position, set default values, and fix AJAX nonce issues

This commit is contained in:
Marcus Quinn
2025-03-16 04:08:10 +00:00
parent 330cacb0be
commit 2773c49bb0
3 changed files with 23 additions and 26 deletions

View File

@ -655,7 +655,7 @@ input:checked + .wp-toggle-slider:before {
.wp-allstars-setting-row label .wp-setting-notification { .wp-allstars-setting-row label .wp-setting-notification {
position: absolute; position: absolute;
right: -60px; right: -60px;
top: 0; top: -2px;
transform: translateY(0); transform: translateY(0);
line-height: 1.4; line-height: 1.4;
} }

View File

@ -161,11 +161,11 @@ jQuery(document).ready(function($) {
$.ajax({ $.ajax({
url: ajaxurl, url: ajaxurl,
type: 'POST', type: 'GET',
data: { data: {
action: 'wp_allstars_get_plugins', action: 'wp_allstars_get_plugins',
category: category || 'minimal', category: category || 'minimal',
security: wpAllstars.nonce _ajax_nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
@ -196,10 +196,10 @@ jQuery(document).ready(function($) {
$.ajax({ $.ajax({
url: ajaxurl, url: ajaxurl,
type: 'POST', type: 'GET',
data: { data: {
action: 'wp_allstars_get_theme', action: 'wp_allstars_get_theme',
security: wpAllstars.nonce _ajax_nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
@ -264,7 +264,7 @@ jQuery(document).ready(function($) {
data: { data: {
action: 'wp_allstars_activate_theme', action: 'wp_allstars_activate_theme',
theme: slug, theme: slug,
security: wpAllstars.nonce _ajax_nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {

View File

@ -681,25 +681,22 @@ function wp_allstars_settings_page() {
</div> </div>
<div class="wp-allstars-toggle-settings"> <div class="wp-allstars-toggle-settings">
<div class="wp-allstars-setting-row"> <div class="wp-allstars-setting-row">
<label for="wp_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label> <label for="wp_allstars_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label>
<input type="number" <input type="number"
id="wp_max_width" id="wp_allstars_max_width"
name="wp_max_width" name="wp_allstars_max_width"
value="<?php echo esc_attr(get_option('wp_allstars_max_width', 1920)); ?>" value="<?php echo esc_attr(get_option('wp_allstars_max_width', 2560)); ?>"
min="0"
/> />
<p class="description"><?php esc_html_e('Maximum width of uploaded images (px). Leave empty for no limit.', 'wp-allstars'); ?></p> <p class="description"><?php esc_html_e('Maximum width for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div> </div>
<div class="wp-allstars-setting-row"> <div class="wp-allstars-setting-row">
<label for="wp_max_height"><?php esc_html_e('Max Height', 'wp-allstars'); ?></label> <label for="wp_allstars_max_height"><?php esc_html_e('Max Height', 'wp-allstars'); ?></label>
<input type="number" <input type="number"
id="wp_max_height" id="wp_allstars_max_height"
name="wp_max_height" name="wp_allstars_max_height"
value="<?php echo esc_attr(get_option('wp_allstars_max_height', 1080)); ?>" value="<?php echo esc_attr(get_option('wp_allstars_max_height', 2560)); ?>"
min="0"
/> />
<p class="description"><?php esc_html_e('Maximum height of uploaded images (px). Leave empty for no limit.', 'wp-allstars'); ?></p> <p class="description"><?php esc_html_e('Maximum height for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div> </div>
<div class="wp-allstars-setting-row"> <div class="wp-allstars-setting-row">