| @@ -3,9 +3,8 @@ | ||
| 3 | 3 | namespace ShopEngine; |
| 4 | 4 | |
| 5 | 5 | use ShopEngine\Compatibility\Conflicts\Manifest as Conflict_Manifest; |
| 6 | 6 | use ShopEngine\Core\Builders\Base; |
| 7 | -use ShopEngine\Compatibility\Migrations\LangMigration; | |
| 8 | 7 | use ShopEngine\Core\Query_Modifier; |
| 9 | 8 | use ShopEngine\Core\Template_Cpt; |
| 10 | 9 | use ShopEngine\Libs\License\License_Route; |
| 11 | 10 | use ShopEngine\Libs\Rating\Rating; |
| @@ -75,14 +74,12 @@ | ||
| 75 | 74 | |
| 76 | 75 | if($error) { |
| 77 | 76 | return; |
| 78 | 77 | } |
| 79 | - | |
| 78 | + | |
| 80 | 79 | add_filter("plugin_action_links_shopengine/shopengine.php", function ($links) { |
| 81 | - $free = esc_html__("Go To Shopengine","shopengine"); | |
| 82 | - $pro = esc_html__("Go To ShopenginePro","shopengine"); | |
| 83 | 80 | |
| 84 | - $custom_links[] = '<a title="' . $free . '" href="'.admin_url('edit.php?post_type=shopengine-template#getting-started').'" target="_blank">' . esc_html__('Settings', 'shopengine') . '</a>'; | |
| 81 | + $custom_links[] = '<a href="'.admin_url('edit.php?post_type=shopengine-template#getting-started').'" target="_blank">' . esc_html__('Settings', 'shopengine') . '</a>'; | |
| 85 | 82 | |
| 86 | 83 | foreach ($custom_links as $custom_link): |
| 87 | 84 | array_unshift($links, $custom_link); |
| 88 | 85 | endforeach; |
| @@ -87,9 +84,9 @@ | ||
| 87 | 84 | array_unshift($links, $custom_link); |
| 88 | 85 | endforeach; |
| 89 | 86 | |
| 90 | 87 | if (!is_plugin_active('shopengine-pro/shopengine-pro.php')) { |
| 91 | - $links[] = '<a title="' . $pro . '" href="https://wpmet.com/plugin/shopengine/pricing/" style="color:#FCB214;font-weight:700" target="_blank" rel="noopener">' . esc_html__('Go Pro', 'shopengine') . '</a>'; | |
| 88 | + $links[] = '<a href="https://wpmet.com/plugin/shopengine/pricing/" style="color:#FCB214;font-weight:700" target="_blank">' . esc_html__('Go Pro', 'shopengine') . '</a>'; | |
| 92 | 89 | } |
| 93 | 90 | return $links; |
| 94 | 91 | }); |
| 95 | 92 | |
| @@ -107,17 +104,16 @@ | ||
| 107 | 104 | add_action('admin_init', function () { |
| 108 | 105 | if(class_exists('ShopEngine_Pro')) { |
| 109 | 106 | new Updater(); |
| 110 | 107 | } |
| 111 | - new \ShopEngine\Compatibility\Migrations\Direct_Checkout; | |
| 112 | 108 | }); |
| 113 | 109 | |
| 114 | 110 | |
| 115 | 111 | add_action('wp_loaded', function () { |
| 116 | - //phpcs:ignore WordPress.Security.NonceVerification.Recommended --It's a fronted user part, not possible to verify nonce here | |
| 112 | + | |
| 117 | 113 | if(isset($_REQUEST['preview']) && $_REQUEST['preview'] == 'true' && !empty($_REQUEST['preview_id'])) { |
| 118 | 114 | |
| 119 | - $pid = (int)$_REQUEST['preview_id']; //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here | |
| 115 | + $pid = (int)$_REQUEST['preview_id']; | |
| 120 | 116 | |
| 121 | 117 | $po = get_post($pid); |
| 122 | 118 | |
| 123 | 119 | if($po->post_type === Template_Cpt::TYPE) { |
| @@ -139,13 +135,8 @@ | ||
| 139 | 135 | wp_safe_redirect($url); |
| 140 | 136 | exit; |
| 141 | 137 | } |
| 142 | 138 | } |
| 143 | - | |
| 144 | - /** | |
| 145 | - * migrate data | |
| 146 | - */ | |
| 147 | - LangMigration::instance()->init(); | |
| 148 | 139 | }); |
| 149 | 140 | |
| 150 | 141 | // avoid themes for loading woocommerce functions |
| 151 | 142 | $avoid_themes = ['avada', 'avada child']; |
| @@ -189,10 +180,8 @@ | ||
| 189 | 180 | ->set_first_appear_day( 7 ) |
| 190 | 181 | ->set_condition( true ) |
| 191 | 182 | ->call(); |
| 192 | 183 | |
| 193 | - \ShopEngine\Core\MultiLanguage\Language::instance()->init(); | |
| 194 | - | |
| 195 | 184 | \ShopEngine\Core\Settings\Base::instance()->init(); |
| 196 | 185 | |
| 197 | 186 | new Libs\Select_Api\Base(); |
| 198 | 187 | |
| @@ -209,9 +198,9 @@ | ||
| 209 | 198 | add_action('get_header', [$this, 'shopengine_track_product_views']); |
| 210 | 199 | |
| 211 | 200 | // database migrations |
| 212 | 201 | // (new \ShopEngine\Compatibility\Migrations\Migration())->init(); |
| 213 | - // (new \ShopEngine\Compatibility\Migrations\Temp_Migration())->init(); | |
| 202 | + (new \ShopEngine\Compatibility\Migrations\Temp_Migration())->init(); | |
| 214 | 203 | |
| 215 | 204 | |
| 216 | 205 | // call service providers |
| 217 | 206 | |
| @@ -225,8 +214,10 @@ | ||
| 225 | 214 | } |
| 226 | 215 | |
| 227 | 216 | } |
| 228 | 217 | |
| 218 | + | |
| 219 | + | |
| 229 | 220 | add_filter('script_loader_tag', [$this, 'filter_load_type'], 99, 3); |
| 230 | 221 | } |
| 231 | 222 | |
| 232 | 223 | |
| @@ -259,9 +250,9 @@ | ||
| 259 | 250 | $cookie_name = "shopengine_recent_viewed_product"; |
| 260 | 251 | |
| 261 | 252 | if(isset($_COOKIE[$cookie_name])) { |
| 262 | 253 | |
| 263 | - $cookie_ids = sanitize_text_field(wp_unslash($_COOKIE[$cookie_name])); | |
| 254 | + $cookie_ids = $_COOKIE[$cookie_name]; | |
| 264 | 255 | $product_ids = explode(',', $cookie_ids); |
| 265 | 256 | |
| 266 | 257 | if(!is_array($product_ids)) { |
| 267 | 258 | $product_ids = [$product_ids]; |
| @@ -297,10 +288,12 @@ | ||
| 297 | 288 | * Include public function |
| 298 | 289 | * |
| 299 | 290 | * @since 1.0.0 |
| 300 | 291 | */ |
| 301 | - public function js_css_public() { | |
| 302 | - wp_register_style('shopengine-public', \ShopEngine::plugin_url() . 'assets/css/shopengine-public.css', false, \ShopEngine::version()); | |
| 292 | + public function js_css_public() { | |
| 293 | + wp_enqueue_style('shopengine-icon', \ShopEngine::plugin_url() . 'assets/css/shopengine-icon.css', false, \ShopEngine::version()); | |
| 294 | + wp_enqueue_style('shopengine-simple-scrollbar-css', \ShopEngine::plugin_url() . 'assets/css/simple-scrollbar.css', false, \ShopEngine::version()); | |
| 295 | + wp_enqueue_style('shopengine-public-css', \ShopEngine::plugin_url() . 'assets/css/public-style.css', false, \ShopEngine::version()); | |
| 303 | 296 | |
| 304 | 297 | // Modal Stylesheet |
| 305 | 298 | wp_register_style('shopengine-modal-styles', \ShopEngine::plugin_url() . 'assets/css/shopengine-modal.css', false, \ShopEngine::version()); |
| 306 | 299 | |
| @@ -349,8 +342,12 @@ | ||
| 349 | 342 | |
| 350 | 343 | |
| 351 | 344 | public function missing_woocommerce() { |
| 352 | 345 | |
| 346 | + if(isset($_GET['activate'])) { | |
| 347 | + unset($_GET['activate']); | |
| 348 | + } | |
| 349 | + | |
| 353 | 350 | if(file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) { |
| 354 | 351 | |
| 355 | 352 | $btn['label'] = esc_html__('Activate WooCommerce', 'shopengine'); |
| 356 | 353 | $btn['url'] = wp_nonce_url('plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=all&paged=1', 'activate-plugin_woocommerce/woocommerce.php'); |
| @@ -373,8 +370,12 @@ | ||
| 373 | 370 | } |
| 374 | 371 | |
| 375 | 372 | |
| 376 | 373 | public function missing_elementor() { |
| 374 | + | |
| 375 | + if(isset($_GET['activate'])) { | |
| 376 | + unset($_GET['activate']); | |
| 377 | + } | |
| 377 | 378 | |
| 378 | 379 | if(file_exists(WP_PLUGIN_DIR . '/elementor/elementor.php')) { |
| 379 | 380 | |
| 380 | 381 | $btn['label'] = esc_html__('Activate Elementor', 'shopengine'); |