From 137f7399d5e0683377d5cf2e41db6ed458931510 Mon Sep 17 00:00:00 2001 From: Marcus Quinn Date: Sun, 16 Mar 2025 04:25:50 +0000 Subject: [PATCH] Fix tab navigation and plugin/theme loading issues --- admin/settings.php | 686 +++++++++++++++++++++------------------------ 1 file changed, 312 insertions(+), 374 deletions(-) diff --git a/admin/settings.php b/admin/settings.php index 9343396..b3fdf34 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -199,7 +199,7 @@ function wp_allstars_ajax_get_plugins() { wp_die(-1); } - $category = isset($_GET['category']) ? sanitize_key($_GET['category']) : 'minimal'; + $category = isset($_POST['category']) ? sanitize_key($_POST['category']) : 'minimal'; require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; @@ -446,7 +446,7 @@ function wp_allstars_set_cached_theme($data) { } // Add AJAX endpoint for theme -function wp_allstars_ajax_get_theme() { +function wp_allstars_ajax_get_themes() { // Check nonce with the correct action name if (!check_ajax_referer('wp-allstars-nonce', '_wpnonce', false)) { wp_send_json_error('Invalid security token sent.'); @@ -506,60 +506,6 @@ function wp_allstars_ajax_get_theme() { // Generate custom HTML for the theme ob_start(); ?> -
@@ -573,11 +519,11 @@ function wp_allstars_ajax_get_theme() { exists()): ?> - - @@ -611,7 +557,7 @@ function wp_allstars_ajax_get_theme() { wp_send_json_error('Theme loading error: ' . $e->getMessage()); } } -add_action('wp_ajax_wp_allstars_get_theme', 'wp_allstars_ajax_get_theme'); +add_action('wp_ajax_wp_allstars_get_themes', 'wp_allstars_ajax_get_themes'); // Clear theme cache when themes are updated function wp_allstars_clear_theme_cache() { @@ -695,22 +641,22 @@ function wp_allstars_settings_page() {
@@ -718,7 +664,7 @@ function wp_allstars_settings_page() {
-
+
-

- -

-
-
-
- - -

-
-
- - -

-
- -
- - -

-
- -
- - -

- %filename%, %post_id%, %postname%, %timestamp%, %date%, %year%, %month%, %day% +

+
+

+

+
+
+ + +

+
+
+ + +

+
-
- - -

- %filename%, %post_title%, %post_id%, %postname%, %timestamp% -

+
+ + +

+
+ +
+ + +

+ %filename%, %post_id%, %postname%, %timestamp%, %date%, %year%, %month%, %day% +

+
+ +
+ + +

+ %filename%, %post_title%, %post_id%, %postname%, %timestamp% +

+
-
-
- +
+
+
+ +
+
-
- - -
-
- + -
- -
-

-

- -
- - - - - -
- -
- - - - - - - - -
- -
+
+
-
+ $pro_plugins = wp_allstars_get_pro_plugins_config(); + foreach ($pro_plugins as $plugin) { + ?> +
+

+

+ +
+ + + + + +
+ +
+ + + + + + + + +
+ +
+ +
- + .wpa-pro-plugin .button:hover { + background: #f0f0f1; + border-color: #0071a1; + color: #0071a1; + } + .wpa-pro-plugin .button-primary { + background: #0071a1; + border-color: #0071a1; + color: #fff; + } + .wpa-pro-plugin .button-primary:hover { + background: #005d8c; + border-color: #005d8c; + color: #fff; + } + @media screen and (max-width: 960px) { + .wpa-pro-plugins { + grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); + gap: 20px; + padding: 16px; + } + .wpa-pro-plugin { + padding: 20px; + } + } + @media screen and (max-width: 782px) { + .wpa-pro-plugins { + grid-template-columns: 1fr; + gap: 16px; + padding: 12px; + } + .wpa-pro-plugin { + padding: 16px; + } + .wpa-pro-plugin .button { + width: 100%; + } + } + +
-
-
- -
-
-
-
-
- - /> - -
-