PluginProbe
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 4.7.4
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v4.7.4
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 All 85 releases
← All changes | plugin.php +181 -44 2.5.14.7.4 View file →
@@ -1,11 +1,15 @@
1 1 <?php
2 2
3 3 namespace ShopEngine;
4 4
5 +defined('ABSPATH') || exit;
6 +
5 7 use ShopEngine\Compatibility\Conflicts\Manifest as Conflict_Manifest;
6 8 use ShopEngine\Core\Builders\Base;
9 +use ShopEngine\Compatibility\Migrations\LangMigration;
7 10 use ShopEngine\Core\Query_Modifier;
11 +use ShopEngine\Core\Wc_Customizer\Register_Settings;
8 12 use ShopEngine\Core\Template_Cpt;
9 13 use ShopEngine\Libs\License\License_Route;
10 14 use ShopEngine\Libs\Rating\Rating;
11 15 use ShopEngine\Libs\Updater\Init as Updater;
@@ -11,9 +15,8 @@
11 15 use ShopEngine\Libs\Updater\Init as Updater;
12 16 use ShopEngine\Modules\Manifest as Module_Manifest;
13 17 use ShopEngine\Widgets\Manifest;
14 18
15 -defined('ABSPATH') || exit;
16 19
17 20 /**
18 21 * Plugin final Class.
19 22 * Handles dynamically loading classes only when needed. Check Elementor Plugin, Woocomerce Plugin Loaded or Install.
@@ -30,11 +33,15 @@
30 33 */
31 34 public function __construct() {
32 35 // load autoload method
33 36 Autoloader::run();
37 + add_action( 'wp_ajax_shopengine_admin_action', [\ShopEngine\Utils\Util::class, 'shopengine_admin_action'] );
34 38 }
35 39
36 -
40 + public function utils_url()
41 + {
42 + return $this->plugin_url() . 'utils/';
43 + }
37 44 /**
38 45 * Public function init.
39 46 * call function for all
40 47 *
@@ -43,8 +50,11 @@
43 50 public function init() {
44 51
45 52 $error = false;
46 53
54 + // init notice class
55 + \Oxaim\Libs\Notice::init();
56 +
47 57 // check woocommerce plugin
48 58 if(!did_action('woocommerce_loaded')) {
49 59 add_action('admin_notices', [$this, 'missing_woocommerce']);
50 60
@@ -86,14 +96,23 @@
86 96 array_unshift($links, $custom_link);
87 97 endforeach;
88 98
89 99 if (!is_plugin_active('shopengine-pro/shopengine-pro.php')) {
90 - $links[] = '<a title="' . $pro . '" href="https://wpmet.com/plugin/shopengine/pricing/" style="color:#FCB214;font-weight:700" target="_blank">' . esc_html__('Go Pro', 'shopengine') . '</a>';
100 + $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>';
91 101 }
92 102 return $links;
93 103 });
94 104
105 + /**
106 + * EmailKit Global Class initialization
107 + *
108 + */
109 + if( !class_exists('EmailKit') && !did_action('edit_with_emailkit_loaded') && class_exists('\Wpmet\Libs\Emailkit') && \ShopEngine\Utils\Util::get_settings( 'shopengine_user_consent_for_banner', 'true' ) == 'true' ) {
95 110
111 + new \Wpmet\Libs\Emailkit();
112 + }
113 +
114 +
96 115 /**
97 116 * Routes initialization
98 117 *
99 118 */
@@ -106,45 +125,23 @@
106 125 add_action('admin_init', function () {
107 126 if(class_exists('ShopEngine_Pro')) {
108 127 new Updater();
109 128 }
129 + new \ShopEngine\Compatibility\Migrations\Direct_Checkout;
110 130 });
111 131
112 132
113 133 add_action('wp_loaded', function () {
114 -
115 - if(isset($_REQUEST['preview']) && $_REQUEST['preview'] == 'true' && !empty($_REQUEST['preview_id'])) {
116 -
117 - $pid = (int)$_REQUEST['preview_id'];
118 -
119 - $po = get_post($pid);
120 -
121 - if($po->post_type === Template_Cpt::TYPE) {
122 -
123 - $template = \ShopEngine\Core\Builders\Templates::get_registered_template_data($pid);
124 -
125 - if(empty($template) || !isset($template['url'])) {
126 - return;
127 - }
128 -
129 - $param = [
130 - 'shopengine_template_id' => $pid,
131 - 'preview_nonce' => wp_create_nonce('template_preview_' . $pid),
132 - 'change_template' => '1',
133 - ];
134 -
135 - $url = \ShopEngine\Utils\Helper::add_to_url($template['url'], $param);
136 -
137 - wp_safe_redirect($url);
138 - exit;
139 - }
140 - }
134 + /**
135 + * migrate data
136 + */
137 + LangMigration::instance()->init();
141 138 });
142 139
143 140 // avoid themes for loading woocommerce functions
144 - $avoid_themes = ['avada', 'avada child'];
141 + $avoid_themes = ['avada', 'woodmart', 'Avada', 'Woodmart'];
145 142
146 - if(!in_array(strtolower(wp_get_theme()), $avoid_themes)) {
143 + if( !in_array(get_template(), $avoid_themes) ) {
147 144 /**
148 145 * Ensuring woocommerce functions are loaded before theme is modifying those
149 146 *
150 147 */
@@ -171,21 +168,142 @@
171 168 add_theme_support('wc-product-gallery-lightbox');
172 169 add_theme_support('wc-product-gallery-slider');
173 170 }
174 171
172 +
173 + $filter_string = ''; // elementskit,metform-pro
174 + $filter_string .= ((!in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',elementskit');
175 + $filter_string .= (!class_exists('\MetForm\Plugin') ? '' : ',metform');
176 + $filter_string .= (!class_exists('\MetForm_Pro\Plugin') ? '' : ',metform-pro');
177 +
175 178 #Registering new post-type & etc
176 179 Base::instance()->init();
180 +
177 181
178 182 Rating::instance('shopengine')
179 183 ->set_plugin( 'ShopEngine', 'https://wpmet.com/wordpress.org/rating/shopengine' )
180 184 ->set_plugin_logo( 'https://ps.w.org/shopengine/assets/icon-256x256.gif?rev=2505061', 'width:150px !important' )
181 - ->set_priority( 10 )
185 + ->set_priority( 11 )
182 186 ->set_first_appear_day( 7 )
183 187 ->set_condition( true )
184 188 ->call();
189 +
190 + if ( is_admin() && \ShopEngine\Utils\Util::get_settings( 'shopengine_user_consent_for_banner', 'true' ) == 'true' ) {
185 191
192 + /**
193 + * Show WPMET stories widget in dashboard
194 + */
195 +
196 + \Wpmet\Libs\Stories::instance('shopengine')
197 +
198 + ->set_filter($filter_string)
199 + ->set_plugin('ShopEngine', 'https://wpmet.com/plugin/shopengine/')
200 + ->set_api_url('https://api.wpmet.com/public/stories/')
201 + ->call();
202 +
203 + // banner
204 + \Wpmet\Libs\Banner::instance('shopengine')
205 + ->set_filter(ltrim($filter_string, ','))
206 + ->set_api_url('https://api.wpmet.com/public/jhanda')
207 + ->set_plugin_screens('edit-shopengine-template')
208 + ->set_plugin_screens('edit-shopengine-template')
209 + ->call();
210 + }
211 +
212 + $apps_img_path = \ShopEngine::plugin_url() . 'assets/images/apps-page/';
213 + /**
214 + * Show our plugins menu for others wpmet plugins
215 + */
216 + \ShopEngine\Wpmet\Libs\Plugins::instance()->init('shopengine')
217 + ->set_parent_menu_slug('shopengine-settings')
218 + ->set_submenu_name('Our Plugins')
219 + ->set_section_title('Get More out of Your WooCommerce Website!')
220 + ->set_section_description('Install other plugins from us and take your WooCommerce site to the next level for absolutely free!')
221 + ->set_items_per_row(4)
222 + ->set_plugins(
223 + [
224 + 'elementskit-lite/elementskit-lite.php' => [
225 + 'name' => esc_html__('ElementsKit', 'shopengine'),
226 + 'url' => 'https://wordpress.org/plugins/elementskit-lite/',
227 + 'icon' => $apps_img_path. 'elementskit.gif',
228 + 'desc' => esc_html__('All-in-one Elementor addon trusted by 1 Million+ users, makes your website builder process easier with ultimate freedom.', 'shopengine'),
229 + 'docs' => 'https://wpmet.com/doc/elementskit/',
230 + ],
231 + 'getgenie/getgenie.php' => [
232 + 'name' => esc_html__('GetGenie', 'shopengine'),
233 + 'url' => 'https://wordpress.org/plugins/getgenie/',
234 + 'icon' => $apps_img_path.'getgenie.gif',
235 + 'desc' => esc_html__('Your personal AI assistant for content and SEO. Write content that ranks on Google with NLP keywords and SERP analysis data.', 'shopengine'),
236 + 'docs' => 'https://getgenie.ai/docs/',
237 + ],
238 + 'gutenkit-blocks-addon/gutenkit-blocks-addon.php' => [
239 + 'name' => esc_html__('GutenKit', 'shopengine'),
240 + 'url' => 'https://wordpress.org/plugins/gutenkit-blocks-addon/',
241 + 'icon' => $apps_img_path. 'guten-kit.png',
242 + 'desc' => esc_html__('Gutenberg blocks, patterns, and templates that extend the page-building experience using the WordPress block editor.', 'shopengine'),
243 + 'docs' => 'https://wpmet.com/doc/gutenkit/',
244 + ],
245 + 'metform/metform.php' => [
246 + 'name' => esc_html__('MetForm', 'shopengine'),
247 + 'url' => 'https://wordpress.org/plugins/metform/',
248 + 'icon' => $apps_img_path. 'metform.png',
249 + 'desc' => esc_html__('Drag & drop form builder for Elementor to create contact forms, multi-step forms, and more — smoother, faster, and better!', 'shopengine'),
250 + 'docs' => 'https://wpmet.com/doc/metform/',
251 + ],
252 + 'emailkit/EmailKit.php' => [
253 + 'name' => esc_html__('EmailKit', 'shopengine'),
254 + 'url' => 'https://wordpress.org/plugins/emailkit/',
255 + 'icon' => $apps_img_path . 'emailkit.png',
256 + 'desc' => esc_html__('Advanced email customizer for WooCommerce and WordPress. Build, customize, and send emails from WordPress to boost your sales!', 'shopengine'),
257 + 'docs' => 'https://wpmet.com/doc/emailkit/',
258 + ],
259 + 'wp-social/wp-social.php' => [
260 + 'name' => esc_html__('WP Social', 'shopengine'),
261 + 'url' => 'https://wordpress.org/plugins/wp-social/',
262 + 'icon' => $apps_img_path . 'wp-social.png',
263 + 'desc' => esc_html__('Add social share, login, and engagement counter — unified solution for all social media with tons of different styles for your website.', 'shopengine'),
264 + 'docs' => 'https://wpmet.com/doc/wp-social/',
265 + ],
266 + 'wp-ultimate-review/wp-ultimate-review.php' => [
267 + 'name' => esc_html__('WP Ultimate Review', 'shopengine'),
268 + 'url' => 'https://wordpress.org/plugins/wp-ultimate-review/',
269 + 'icon' => $apps_img_path . 'ultimate-review.png',
270 + 'desc' => esc_html__('Collect and showcase reviews on your website to build brand credibility and social proof with the easiest solution.','shopengine'),
271 + 'docs' => 'https://wpmet.com/doc/wp-ultimate-review/',
272 + ],
273 + 'wp-fundraising-donation/wp-fundraising.php' => [
274 + 'name' => esc_html__('FundEngine', 'shopengine'),
275 + 'url' => 'https://wordpress.org/plugins/wp-fundraising-donation/',
276 + 'icon' => $apps_img_path . 'fundengine.png',
277 + 'desc' => esc_html__('Create fundraising, crowdfunding, and donation websites with PayPal and Stripe payment gateway integration.', 'shopengine'),
278 + 'docs' => 'https://wpmet.com/doc/fundengine/',
279 + ],
280 + 'blocks-for-shopengine/shopengine-gutenberg-addon.php' => [
281 + 'name' => esc_html__('Blocks for ShopEngine', 'shopengine'),
282 + 'url' => 'https://wordpress.org/plugins/blocks-for-shopengine/',
283 + 'icon' => $apps_img_path. 'shopengine.gif',
284 + 'desc' => esc_html__('All in one WooCommerce solution for Gutenberg! Build your WooCommerce pages in a block editor with full customization.', 'shopengine'),
285 + 'docs' => 'https://wpmet.com/doc/shopengine/shopengine-gutenberg/',
286 + ],
287 + 'genie-image-ai/genie-image-ai.php' => [
288 + 'name' => esc_html__('Genie Image', 'shopengine'),
289 + 'url' => 'https://wordpress.org/plugins/genie-image-ai/',
290 + 'icon' => $apps_img_path . 'genie-image.png',
291 + 'desc' => esc_html__('AI-powered text-to-image generator for WordPress with OpenAI’s DALL-E 2 technology to generate high-quality images in one click.
292 + ', 'shopengine'),
293 + 'docs' => 'https://getgenie.ai/docs/',
294 + ],
295 + ]
296 + )
297 + ->call();
298 +
299 +
300 +
301 + \ShopEngine\Core\MultiLanguage\Language::instance()->init();
302 +
186 303 \ShopEngine\Core\Settings\Base::instance()->init();
187 304
305 +
188 306 new Libs\Select_Api\Base();
189 307
190 308 (new Module_Manifest())->init();
191 309
@@ -200,9 +318,9 @@
200 318 add_action('get_header', [$this, 'shopengine_track_product_views']);
201 319
202 320 // database migrations
203 321 // (new \ShopEngine\Compatibility\Migrations\Migration())->init();
204 - (new \ShopEngine\Compatibility\Migrations\Temp_Migration())->init();
322 + // (new \ShopEngine\Compatibility\Migrations\Temp_Migration())->init();
205 323
206 324
207 325 // call service providers
208 326
@@ -216,11 +334,12 @@
216 334 }
217 335
218 336 }
219 337
338 + add_filter('script_loader_tag', [$this, 'filter_load_type'], 99, 3);
220 339
221 -
222 - add_filter('script_loader_tag', [$this, 'filter_load_type'], 99, 3);
340 + //it will register an option in customizer for woocommerce products catelog. It's related with our Arcive Products widget.
341 + Register_Settings::instance()->init();
223 342 }
224 343
225 344
226 345 // add async and defer attributes to enqueued scripts
@@ -252,9 +371,9 @@
252 371 $cookie_name = "shopengine_recent_viewed_product";
253 372
254 373 if(isset($_COOKIE[$cookie_name])) {
255 374
256 - $cookie_ids = $_COOKIE[$cookie_name];
375 + $cookie_ids = sanitize_text_field(wp_unslash($_COOKIE[$cookie_name]));
257 376 $product_ids = explode(',', $cookie_ids);
258 377
259 378 if(!is_array($product_ids)) {
260 379 $product_ids = [$product_ids];
@@ -342,11 +461,11 @@
342 461
343 462
344 463 public function missing_woocommerce() {
345 464
346 - if(isset($_GET['activate'])) {
347 - unset($_GET['activate']);
348 - }
465 + if(!current_user_can('manage_options')) {
466 + return;
467 + }
349 468
350 469 if(file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) {
351 470
352 471 $btn['label'] = esc_html__('Activate WooCommerce', 'shopengine');
@@ -362,8 +481,9 @@
362 481 [
363 482 'id' => 'missing-woo',
364 483 'type' => 'error',
365 484 'dismissible' => true,
485 + 'is_required' => true,
366 486 'btn' => $btn,
367 487 'message' => sprintf(esc_html__('ShopEngine requires woocommerce Plugin, which is currently NOT RUNNING.', 'shopengine'), '4.1.0'),
368 488 ]
369 489 );
@@ -371,11 +491,11 @@
371 491
372 492
373 493 public function missing_elementor() {
374 494
375 - if(isset($_GET['activate'])) {
376 - unset($_GET['activate']);
377 - }
495 + if(!current_user_can('manage_options')) {
496 + return;
497 + }
378 498
379 499 if(file_exists(WP_PLUGIN_DIR . '/elementor/elementor.php')) {
380 500
381 501 $btn['label'] = esc_html__('Activate Elementor', 'shopengine');
@@ -386,15 +506,28 @@
386 506 $btn['label'] = esc_html__('Install Elementor', 'shopengine');
387 507 $btn['url'] = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=elementor'), 'install-plugin_elementor');
388 508 }
389 509
510 + if(file_exists(WP_PLUGIN_DIR . '/blocks-for-shopengine/shopengine-gutenberg-addon.php')) {
511 +
512 + $btn2['label'] = esc_html__('Activate Blocks for ShopEngine', 'shopengine');
513 + $btn2['url'] = wp_nonce_url('plugins.php?action=activate&plugin=blocks-for-shopengine/shopengine-gutenberg-addon.php&plugin_status=all&paged=1', 'activate-plugin_blocks-for-shopengine/shopengine-gutenberg-addon.php');
514 +
515 + } else {
516 +
517 + $btn2['label'] = esc_html__('Install Blocks for ShopEngine', 'shopengine');
518 + $btn2['url'] = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=blocks-for-shopengine'), 'install-plugin_blocks-for-shopengine');
519 + }
520 +
390 521 Utils\Notice::push(
391 522 [
392 523 'id' => 'missing-elementor',
393 524 'type' => 'error',
525 + 'is_required' => true,
394 526 'dismissible' => true,
395 527 'btn' => $btn,
396 - 'message' => sprintf(esc_html__('ShopEngine requires Elementor version %1$s+, which is currently NOT RUNNING.', 'shopengine'), '3.0.0'),
528 + 'btn2' => $btn2,
529 + 'message' => esc_html__('To use ShopEngine, install Elementor (For the Elementor Builder) OR Blocks for ShopEngine (For Gutenberg Builder).', 'shopengine'),
397 530 ]
398 531 );
399 532 }
400 533
@@ -399,8 +532,12 @@
399 532 }
400 533
401 534
402 535 public function failed_elementor_version() {
536 +
537 + if(!current_user_can('manage_options')) {
538 + return;
539 + }
403 540
404 541 $btn['label'] = esc_html__('Update Elementor', 'shopengine');
405 542 $btn['url'] = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=elementor'), 'upgrade-plugin_elementor');
406 543