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