| @@ -107,16 +107,17 @@ | ||
| 107 | 107 | add_action('admin_init', function () { |
| 108 | 108 | if(class_exists('ShopEngine_Pro')) { |
| 109 | 109 | new Updater(); |
| 110 | 110 | } |
| 111 | + new \ShopEngine\Compatibility\Migrations\Direct_Checkout; | |
| 111 | 112 | }); |
| 112 | 113 | |
| 113 | 114 | |
| 114 | 115 | add_action('wp_loaded', function () { |
| 115 | - | |
| 116 | + //phpcs:ignore WordPress.Security.NonceVerification.Recommended --It's a fronted user part, not possible to verify nonce here | |
| 116 | 117 | if(isset($_REQUEST['preview']) && $_REQUEST['preview'] == 'true' && !empty($_REQUEST['preview_id'])) { |
| 117 | 118 | |
| 118 | - $pid = (int)$_REQUEST['preview_id']; | |
| 119 | + $pid = (int)$_REQUEST['preview_id']; //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here | |
| 119 | 120 | |
| 120 | 121 | $po = get_post($pid); |
| 121 | 122 | |
| 122 | 123 | if($po->post_type === Template_Cpt::TYPE) { |
| @@ -258,9 +259,9 @@ | ||
| 258 | 259 | $cookie_name = "shopengine_recent_viewed_product"; |
| 259 | 260 | |
| 260 | 261 | if(isset($_COOKIE[$cookie_name])) { |
| 261 | 262 | |
| 262 | - $cookie_ids = $_COOKIE[$cookie_name]; | |
| 263 | + $cookie_ids = sanitize_text_field(wp_unslash($_COOKIE[$cookie_name])); | |
| 263 | 264 | $product_ids = explode(',', $cookie_ids); |
| 264 | 265 | |
| 265 | 266 | if(!is_array($product_ids)) { |
| 266 | 267 | $product_ids = [$product_ids]; |
| @@ -348,12 +349,8 @@ | ||
| 348 | 349 | |
| 349 | 350 | |
| 350 | 351 | public function missing_woocommerce() { |
| 351 | 352 | |
| 352 | - if(isset($_GET['activate'])) { | |
| 353 | - unset($_GET['activate']); | |
| 354 | - } | |
| 355 | - | |
| 356 | 353 | if(file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) { |
| 357 | 354 | |
| 358 | 355 | $btn['label'] = esc_html__('Activate WooCommerce', 'shopengine'); |
| 359 | 356 | $btn['url'] = wp_nonce_url('plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=all&paged=1', 'activate-plugin_woocommerce/woocommerce.php'); |
| @@ -376,12 +373,8 @@ | ||
| 376 | 373 | } |
| 377 | 374 | |
| 378 | 375 | |
| 379 | 376 | public function missing_elementor() { |
| 380 | - | |
| 381 | - if(isset($_GET['activate'])) { | |
| 382 | - unset($_GET['activate']); | |
| 383 | - } | |
| 384 | 377 | |
| 385 | 378 | if(file_exists(WP_PLUGIN_DIR . '/elementor/elementor.php')) { |
| 386 | 379 | |
| 387 | 380 | $btn['label'] = esc_html__('Activate Elementor', 'shopengine'); |