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