| @@ -26,8 +26,9 @@ | ||
| 26 | 26 | public function __construct() |
| 27 | 27 | { |
| 28 | 28 | |
| 29 | 29 | // Embed the Script on our Plugin's Option Page Only |
| 30 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check of the current admin page slug for asset routing, no form data processed. | |
| 30 | 31 | if (isset($_GET['page']) && ($_GET['page'] == 'ultimate_post_kit_options')) { |
| 31 | 32 | add_action('admin_enqueue_scripts', [$this, 'enqueue_styles']); |
| 32 | 33 | } |
| 33 | 34 | add_action('admin_init', [$this, 'enqueue_admin_script']); |
| @@ -45,9 +46,8 @@ | ||
| 45 | 46 | |
| 46 | 47 | public function admin_notice_styles(){ |
| 47 | 48 | $direction_suffix = is_rtl() ? '.rtl' : ''; |
| 48 | 49 | wp_enqueue_style('upk-admin-biggopti', BDTUPK_ADMIN_ASSETS_URL . 'css/upk-admin-biggopti' . $direction_suffix . '.css', [], BDTUPK_VER); |
| 49 | - wp_enqueue_style('bdt-admin-api-biggopti', BDTUPK_ADMIN_ASSETS_URL . 'css/upk-admin-api-biggopti' . $direction_suffix . '.css', [], BDTUPK_VER); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | function install_and_activate() |
| @@ -74,9 +74,9 @@ | ||
| 74 | 74 | |
| 75 | 75 | wp_enqueue_style('bdt-uikit', BDTUPK_ADMIN_ASSETS_URL . 'css/bdt-uikit' . $direction_suffix . '.css', [], '3.17.0'); |
| 76 | 76 | wp_enqueue_style('upk-font', BDTUPK_ASSETS_URL . 'css/upk-font' . $direction_suffix . '.css', [], BDTUPK_VER); |
| 77 | 77 | |
| 78 | - wp_enqueue_script('bdt-uikit', BDTUPK_ADMIN_ASSETS_URL . 'js/bdt-uikit.min.js', ['jquery'], '3.17.0'); | |
| 78 | + wp_enqueue_script('bdt-uikit', BDTUPK_ADMIN_ASSETS_URL . 'js/bdt-uikit.min.js', ['jquery'], '3.17.0', true); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * Row meta |
| @@ -185,11 +185,9 @@ | ||
| 185 | 185 | wp_enqueue_script('jquery'); |
| 186 | 186 | wp_enqueue_script('jquery-form'); |
| 187 | 187 | wp_enqueue_script('upk-biggopti', BDTUPK_ADMIN_ASSETS_URL . 'js/upk-biggopti.min.js', ['jquery'], BDTUPK_VER, true); |
| 188 | 188 | |
| 189 | - wp_enqueue_script('upk-admin-api-biggopti', BDTUPK_ADMIN_ASSETS_URL . 'js/upk-admin-api-biggopti.min.js', ['jquery'], BDTUPK_VER, true); | |
| 190 | - | |
| 191 | - $dismissals = get_option('bdt_biggopti_dismissals', []); | |
| 189 | + $dismissals = get_option('bdtupk_biggopti_dismissals', []); | |
| 192 | 190 | $dismissed_display_ids = []; |
| 193 | 191 | $prefix = 'bdt-admin-biggopti-api-biggopti-'; |
| 194 | 192 | foreach (array_keys($dismissals) as $key) { |
| 195 | 193 | if (strpos($key, $prefix) === 0) { |
| @@ -199,8 +197,9 @@ | ||
| 199 | 197 | } |
| 200 | 198 | } |
| 201 | 199 | |
| 202 | 200 | $current_sector = ''; |
| 201 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check of the current admin page slug for display routing, no form data processed. | |
| 203 | 202 | if ( isset( $_GET['page'] ) && $_GET['page'] === 'ultimate_post_kit_options' ) { |
| 204 | 203 | $current_sector = 'plugin_dashboard'; |
| 205 | 204 | } |
| 206 | 205 | $script_config = [ |
| @@ -211,12 +210,12 @@ | ||
| 211 | 210 | 'dismissedDisplayIds' => $dismissed_display_ids, |
| 212 | 211 | 'currentSector' => $current_sector, |
| 213 | 212 | ]; |
| 214 | 213 | wp_localize_script('upk-biggopti', 'UltimatePostKitBiggoptiConfig', $script_config); |
| 215 | - wp_localize_script('upk-admin-api-biggopti', 'UltimatePostKitAdminApiBiggoptiConfig', $script_config); | |
| 216 | 214 | |
| 215 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check of the current admin page slug for asset routing, no form data processed. | |
| 217 | 216 | if (isset($_GET['page']) && ($_GET['page'] == 'ultimate_post_kit_options')) { |
| 218 | - wp_enqueue_script('chart', BDTUPK_ADMIN_ASSETS_URL . 'js/chart.min.js', ['jquery'], '3.9.1', true); | |
| 217 | + wp_enqueue_script('chart', BDTUPK_ADMIN_ASSETS_URL . 'js/chart.min.js', ['jquery'], '4.5.1', true); | |
| 219 | 218 | wp_enqueue_script('upk-admin', BDTUPK_ADMIN_ASSETS_URL . 'js/upk-admin.min.js', ['jquery', 'chart'], BDTUPK_VER, true); |
| 220 | 219 | }else{ |
| 221 | 220 | wp_enqueue_script('upk-admin', BDTUPK_ADMIN_ASSETS_URL . 'js/upk-admin.min.js', ['jquery'], BDTUPK_VER, true); |
| 222 | 221 | } |