Ecwid Ecommerce Shopping Cart - Version 6.10.29

Version Description

  • Nov 07, 2022 =
  • WordPress 6.1 and Twenty Twenty Three theme compatibility. The new WordPress version with the 2023 theme is released. The Ecwid ecommerce shopping cart plugin is ready for the new release everything works well in your WordPress admin and storefront pages. Feel free to upgrade your site to WordPress 6.1 and try a new theme.
  • Compatibility improvements with XML Sitemaps plugin. If you are using the XML Sitemaps plugin, you may be experiencing an issue where storefront products links are not being added to sitemap. We've fixed it.
  • Improvements for compatibility with the Elementor builder.
  • Minor fixes and improvements.
Download this release

Release Info

Developer Ecwid
Plugin Icon 128x128 Ecwid Ecommerce Shopping Cart
Version 6.10.29
Comparing to
See all releases

Code changes from version 6.10.28 to 6.10.29

css/themes/twentytwentythree.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ #dynamic-ec-store,
2
+ #static-ec-store,
3
+ #ecwid_html .wp-block-post-title,
4
+ #ecwid_body .wp-block-post-title {
5
+ max-width: 1200px;
6
+ }
ecwid-shopping-cart.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?partner=wporg
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Ecommerce
8
- Version: 6.10.28
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
@@ -14,16 +14,15 @@ register_activation_hook( __FILE__, 'ecwid_store_activate' );
14
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
15
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
16
 
17
- define('ECWID_API_AVAILABILITY_CHECK_TIME', 60*60*3);
18
-
19
- define ('ECWID_TRIMMED_DESCRIPTION_LENGTH', 160);
20
 
21
  if ( ! defined( 'ECWID_PLUGIN_DIR' ) ) {
22
  define( 'ECWID_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
23
  }
24
 
25
- if ( !defined( 'ECWID_TEMPLATES_DIR' ) ) {
26
- define ( 'ECWID_TEMPLATES_DIR', ECWID_PLUGIN_DIR . 'templates' );
27
  }
28
 
29
  if ( ! defined( 'ECWID_PLUGIN_BASENAME' ) ) {
@@ -34,13 +33,10 @@ if ( ! defined( 'ECWID_PLUGIN_URL' ) ) {
34
  define( 'ECWID_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
35
  }
36
 
37
- if ( ! defined('ECWID_SHORTCODES_DIR' ) ) {
38
  define( 'ECWID_SHORTCODES_DIR', ECWID_PLUGIN_DIR . 'includes/shortcodes' );
39
  }
40
 
41
- // Older versions of Google XML Sitemaps plugin generate it in admin, newer in site area, so the hook should be assigned in both of them
42
- add_action( 'sm_buildmap', 'ecwid_build_google_xml_sitemap' );
43
-
44
  add_action( 'plugins_loaded', 'ecwid_init_integrations' );
45
  add_filter( 'plugins_loaded', 'ecwid_load_textdomain' );
46
 
@@ -66,7 +62,7 @@ if ( is_admin() ) {
66
  add_action( 'admin_post_ecwid_sync_products', 'ecwid_sync_products' );
67
  add_action( 'admin_post_ec_connect', 'ecwid_admin_post_connect' );
68
  add_action( 'admin_post_ecwid_get_debug', 'ecwid_get_debug_file' );
69
-
70
  add_action( 'admin_head', 'ecwid_ie8_fonts_inclusion' );
71
  add_action( 'get_footer', 'ecwid_admin_get_footer' );
72
  add_action( 'admin_init', 'ecwid_process_oauth_params' );
@@ -75,7 +71,7 @@ if ( is_admin() ) {
75
  add_filter( 'tiny_mce_before_init', 'ecwid_tinymce_init' );
76
  } else {
77
  add_shortcode( 'ecwid_script', 'ecwid_script_shortcode' );
78
-
79
  add_action( 'init', 'ecwid_backward_compatibility' );
80
  add_action( 'init', 'ecwid_check_api_cache' );
81
 
@@ -100,12 +96,12 @@ if ( is_admin() ) {
100
  add_action( 'redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
101
 
102
  $ecwid_seo_title = '';
103
- }
104
 
105
  add_action( 'admin_bar_menu', 'add_ecwid_admin_bar_node', 1000 );
106
 
107
- if ( get_option('ecwid_last_oauth_fail_time') > 0 ) {
108
- add_action( 'plugins_loaded', 'ecwid_test_oauth');
109
  }
110
 
111
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_platform.php';
@@ -130,8 +126,8 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-static-page.php';
130
  if ( is_admin() ) {
131
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-ui-framework.php';
132
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
133
-
134
- if( !Ecwid_Admin::disable_dashboard() ){
135
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-custom-admin-page.php';
136
  }
137
  }
@@ -154,13 +150,13 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-well-known.php';
154
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-storefront-page.php';
155
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-developers-page.php';
156
 
157
- if (version_compare( phpversion(), '5.6', '>=' ) ) {
158
  require_once ECWID_PLUGIN_DIR . 'includes/importer/importer.php';
159
  }
160
 
161
- $version = get_bloginfo('version');
162
 
163
- if (version_compare($version, '4.0') >= 0) {
164
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-customizer.php';
165
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
166
  }
@@ -173,12 +169,12 @@ if ( strpos( $version, '5.5' ) === 0 || version_compare( $version, '5.5' ) >= 0
173
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-sitemap-provider.php';
174
  }
175
 
176
- if( Ecwid_Config::is_cli_running() ) {
177
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-wp-cli.php';
178
  }
179
 
180
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
181
- foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
182
  add_shortcode( $shortcode_name, 'ecwid_shortcode' );
183
  }
184
 
@@ -212,6 +208,7 @@ function ecwid_init_integrations() {
212
  'seo-by-rank-math/rank-math.php' => 'rank-math',
213
  'litespeed-cache/litespeed-cache.php' => 'litespeed-cache',
214
  'sg-cachepress/sg-cachepress.php' => 'sg-optimizer',
 
215
  );
216
 
217
  $old_wordpress = version_compare( get_bloginfo( 'version' ), '5.0', '<' );
@@ -245,14 +242,14 @@ function ecwid_estimate_sync() {
245
 
246
  $result = $p->estimate_sync();
247
 
248
- echo json_encode($result);
249
  }
250
 
251
- if (version_compare($version, '3.6') < 0) {
252
- /**
253
- * A copy of has_shortcode functionality from wordpress 3.6
254
- * http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/shortcodes.php
255
- */
256
 
257
  if (!function_exists('shortcode_exists')) {
258
  function shortcode_exists( $tag ) {
@@ -614,7 +611,6 @@ function ecwid_is_store_closed()
614
  return false;
615
  }
616
 
617
-
618
  function ecwid_backward_compatibility() {
619
 
620
  // Backward compatibility with 1.1.2 and earlier
@@ -630,40 +626,21 @@ function ecwid_backward_compatibility() {
630
  }
631
  }
632
 
633
- function ecwid_build_sitemap($callback)
634
- {
635
-
636
- if ( !Ecwid_Api_V3::is_available() || !ecwid_is_store_page_available() ) return;
637
 
638
  $page_id = Ecwid_Store_Page::get_current_store_page_id();
639
 
640
- if (get_post_status($page_id) == 'publish') {
641
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-sitemap-builder.php';
642
 
643
- $sitemap = new EcwidSitemapBuilder(Ecwid_Store_Page::get_store_url(), $callback);
644
-
645
  $sitemap->generate();
646
  }
647
  }
648
 
649
- function ecwid_build_google_xml_sitemap()
650
- {
651
- return ecwid_build_sitemap('ecwid_google_xml_sitemap_build_sitemap_callback');
652
- }
653
-
654
- function ecwid_google_xml_sitemap_build_sitemap_callback($url, $priority, $frequency)
655
- {
656
- static $generatorObject = null;
657
- if (is_null($generatorObject)) {
658
- $generatorObject = GoogleSitemapGenerator::GetInstance(); //Please note the "&" sign!
659
- }
660
-
661
- if($generatorObject != null) {
662
- $page = new GoogleSitemapGeneratorPage($url, $priority, $frequency);
663
- $generatorObject->AddElement($page);
664
- }
665
- }
666
-
667
  function ecwid_minifier_compatibility()
668
  {
669
  if ( !function_exists( 'get_plugins' ) ) { require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); }
@@ -3114,6 +3091,8 @@ function ecwid_get_shortcode_regex() {
3114
 
3115
  // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
3116
  // Also, see shortcode_unautop() and shortcode.js.
 
 
3117
  return
3118
  '\\[' // Opening bracket
3119
  . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
@@ -3143,6 +3122,7 @@ function ecwid_get_shortcode_regex() {
3143
  . ')?'
3144
  . ')'
3145
  . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]]
 
3146
  }
3147
 
3148
  ?>
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Ecommerce
8
+ Version: 6.10.29
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
14
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
15
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
16
 
17
+ define( 'ECWID_API_AVAILABILITY_CHECK_TIME', 60 * 60 * 3 );
18
+ define( 'ECWID_TRIMMED_DESCRIPTION_LENGTH', 160 );
 
19
 
20
  if ( ! defined( 'ECWID_PLUGIN_DIR' ) ) {
21
  define( 'ECWID_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
22
  }
23
 
24
+ if ( ! defined( 'ECWID_TEMPLATES_DIR' ) ) {
25
+ define( 'ECWID_TEMPLATES_DIR', ECWID_PLUGIN_DIR . 'templates' );
26
  }
27
 
28
  if ( ! defined( 'ECWID_PLUGIN_BASENAME' ) ) {
33
  define( 'ECWID_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
34
  }
35
 
36
+ if ( ! defined( 'ECWID_SHORTCODES_DIR' ) ) {
37
  define( 'ECWID_SHORTCODES_DIR', ECWID_PLUGIN_DIR . 'includes/shortcodes' );
38
  }
39
 
 
 
 
40
  add_action( 'plugins_loaded', 'ecwid_init_integrations' );
41
  add_filter( 'plugins_loaded', 'ecwid_load_textdomain' );
42
 
62
  add_action( 'admin_post_ecwid_sync_products', 'ecwid_sync_products' );
63
  add_action( 'admin_post_ec_connect', 'ecwid_admin_post_connect' );
64
  add_action( 'admin_post_ecwid_get_debug', 'ecwid_get_debug_file' );
65
+
66
  add_action( 'admin_head', 'ecwid_ie8_fonts_inclusion' );
67
  add_action( 'get_footer', 'ecwid_admin_get_footer' );
68
  add_action( 'admin_init', 'ecwid_process_oauth_params' );
71
  add_filter( 'tiny_mce_before_init', 'ecwid_tinymce_init' );
72
  } else {
73
  add_shortcode( 'ecwid_script', 'ecwid_script_shortcode' );
74
+
75
  add_action( 'init', 'ecwid_backward_compatibility' );
76
  add_action( 'init', 'ecwid_check_api_cache' );
77
 
96
  add_action( 'redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
97
 
98
  $ecwid_seo_title = '';
99
+ }//end if
100
 
101
  add_action( 'admin_bar_menu', 'add_ecwid_admin_bar_node', 1000 );
102
 
103
+ if ( get_option( 'ecwid_last_oauth_fail_time' ) > 0 ) {
104
+ add_action( 'plugins_loaded', 'ecwid_test_oauth' );
105
  }
106
 
107
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_platform.php';
126
  if ( is_admin() ) {
127
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-ui-framework.php';
128
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
129
+
130
+ if ( ! Ecwid_Admin::disable_dashboard() ) {
131
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-custom-admin-page.php';
132
  }
133
  }
150
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-storefront-page.php';
151
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-developers-page.php';
152
 
153
+ if ( version_compare( phpversion(), '5.6', '>=' ) ) {
154
  require_once ECWID_PLUGIN_DIR . 'includes/importer/importer.php';
155
  }
156
 
157
+ $version = get_bloginfo( 'version' );
158
 
159
+ if ( version_compare( $version, '4.0' ) >= 0 ) {
160
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-customizer.php';
161
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
162
  }
169
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-sitemap-provider.php';
170
  }
171
 
172
+ if ( Ecwid_Config::is_cli_running() ) {
173
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-wp-cli.php';
174
  }
175
 
176
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
177
+ foreach ( Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name ) {
178
  add_shortcode( $shortcode_name, 'ecwid_shortcode' );
179
  }
180
 
208
  'seo-by-rank-math/rank-math.php' => 'rank-math',
209
  'litespeed-cache/litespeed-cache.php' => 'litespeed-cache',
210
  'sg-cachepress/sg-cachepress.php' => 'sg-optimizer',
211
+ 'google-sitemap-generator/sitemap.php' => 'google-sitemap-generator',
212
  );
213
 
214
  $old_wordpress = version_compare( get_bloginfo( 'version' ), '5.0', '<' );
242
 
243
  $result = $p->estimate_sync();
244
 
245
+ echo json_encode( $result );
246
  }
247
 
248
+ if ( version_compare( $version, '3.6' ) < 0 ) {
249
+ /**
250
+ * A copy of has_shortcode functionality from wordpress 3.6
251
+ * http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/shortcodes.php
252
+ */
253
 
254
  if (!function_exists('shortcode_exists')) {
255
  function shortcode_exists( $tag ) {
611
  return false;
612
  }
613
 
 
614
  function ecwid_backward_compatibility() {
615
 
616
  // Backward compatibility with 1.1.2 and earlier
626
  }
627
  }
628
 
629
+ function ecwid_build_sitemap( $callback ) {
630
+ if ( ! Ecwid_Api_V3::is_available() || ! ecwid_is_store_page_available() ) {
631
+ return;
632
+ }
633
 
634
  $page_id = Ecwid_Store_Page::get_current_store_page_id();
635
 
636
+ if ( get_post_status( $page_id ) === 'publish' ) {
637
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-sitemap-builder.php';
638
 
639
+ $sitemap = new EcwidSitemapBuilder( Ecwid_Store_Page::get_store_url(), $callback );
 
640
  $sitemap->generate();
641
  }
642
  }
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  function ecwid_minifier_compatibility()
645
  {
646
  if ( !function_exists( 'get_plugins' ) ) { require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); }
3091
 
3092
  // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
3093
  // Also, see shortcode_unautop() and shortcode.js.
3094
+
3095
+ // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
3096
  return
3097
  '\\[' // Opening bracket
3098
  . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
3122
  . ')?'
3123
  . ')'
3124
  . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]]
3125
+ // phpcs:enable
3126
  }
3127
 
3128
  ?>
includes/class-ecwid-static-page.php CHANGED
@@ -334,10 +334,6 @@ class Ecwid_Static_Page {
334
  return true;
335
  }
336
 
337
- if ( ! self::is_feature_available() ) {
338
- return false;
339
- }
340
-
341
  if ( get_option( self::OPTION_IS_ENABLED ) == self::OPTION_VALUE_DISABLED ) {
342
  return false;
343
  }
@@ -350,13 +346,7 @@ class Ecwid_Static_Page {
350
  }
351
 
352
  public static function is_feature_available() {
353
- if ( ecwid_is_demo_store() ) {
354
- return true;
355
- }
356
-
357
- $api = new Ecwid_Api_V3();
358
-
359
- return $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
360
  }
361
  }
362
 
334
  return true;
335
  }
336
 
 
 
 
 
337
  if ( get_option( self::OPTION_IS_ENABLED ) == self::OPTION_VALUE_DISABLED ) {
338
  return false;
339
  }
346
  }
347
 
348
  public static function is_feature_available() {
349
+ return true;
 
 
 
 
 
 
350
  }
351
  }
352
 
includes/integrations/class-ecwid-integration-google-sitemap-generator.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Integration_Google_Sitemap_Generator {
4
+ public function __construct() {
5
+ // Older versions of Google XML Sitemaps plugin generate it in admin, newer in site area, so the hook should be assigned in both of them
6
+ add_action( 'sm_buildmap', array( $this, 'build_sitemap' ) );
7
+
8
+ $plugin_data = get_file_data( WP_PLUGIN_DIR . '/google-sitemap-generator/sitemap.php', array( 'version' => 'Version' ), 'plugin' );
9
+ $this->plugin_version = $plugin_data['version'];
10
+ }
11
+
12
+ public function build_sitemap() {
13
+ return ecwid_build_sitemap( array( $this, 'sitemap_callback' ) );
14
+ }
15
+
16
+ //phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
17
+ public function sitemap_callback( $url, $priority, $frequency ) {
18
+
19
+ if ( ! class_exists( 'GoogleSitemapGenerator' ) || ! class_exists( 'GoogleSitemapGeneratorPage' ) ) {
20
+ return false;
21
+ }
22
+
23
+ if ( version_compare( $this->plugin_version, '4.1.2', '>=' ) ) {
24
+ $generator_object = GoogleSitemapGenerator::get_instance();
25
+ } else {
26
+ $generator_object = GoogleSitemapGenerator::GetInstance();
27
+ }
28
+
29
+ if ( $generator_object !== null ) {
30
+ $page = new GoogleSitemapGeneratorPage( $url, $priority, $frequency );
31
+
32
+ if ( version_compare( $this->plugin_version, '4.1.2', '>=' ) ) {
33
+ $generator_object->add_element( $page );
34
+ } else {
35
+ $generator_object->AddElement( $page );
36
+ }
37
+ }
38
+ }
39
+ //phpcs:enable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
40
+ }
41
+
42
+ new Ecwid_Integration_Google_Sitemap_Generator();
includes/shortcodes.php CHANGED
@@ -1,30 +1,30 @@
1
  <?php
2
 
3
- include_once "shortcodes/class-ecwid-shortcode-productbrowser.php";
4
- include_once "shortcodes/class-ecwid-shortcode-minicart.php";
5
- include_once "shortcodes/class-ecwid-shortcode-search.php";
6
- include_once "shortcodes/class-ecwid-shortcode-categories.php";
7
- include_once "shortcodes/class-ecwid-shortcode-product.php";
8
 
9
- add_shortcode('ecwid_productbrowser', 'ecwid_render_shortcode');
10
- add_shortcode('ecwid_minicart', 'ecwid_render_shortcode');
11
- add_shortcode('ecwid_search', 'ecwid_render_shortcode');
12
- add_shortcode('ecwid_categories', 'ecwid_render_shortcode');
13
- add_shortcode('ecwid_product', 'ecwid_render_shortcode');
14
- add_shortcode('ecwid_searchbox', 'ecwid_searchbox_shortcode');
15
- add_shortcode('ec_product', 'ecwid_render_shortcode');
16
 
17
- function ecwid_render_shortcode($params, $content = '', $name = '') {
18
  $shortcode = Ecwid_Shortcode_Base::get_shortcode_object( $name, $params );
19
-
20
  if ( $shortcode ) {
21
  return $shortcode->render( array( 'legacy' => true ) );
22
  }
23
  }
24
 
25
- function ecwid_searchbox_shortcode($params, $content = '', $name = '') {
26
 
27
- $shortcode = new Ecwid_Shortcode_Search($params);
28
 
29
- return $shortcode->render( array( 'legacy' => true ) );
30
- }
1
  <?php
2
 
3
+ require_once 'shortcodes/class-ecwid-shortcode-productbrowser.php';
4
+ require_once 'shortcodes/class-ecwid-shortcode-minicart.php';
5
+ require_once 'shortcodes/class-ecwid-shortcode-search.php';
6
+ require_once 'shortcodes/class-ecwid-shortcode-categories.php';
7
+ require_once 'shortcodes/class-ecwid-shortcode-product.php';
8
 
9
+ add_shortcode( 'ecwid_productbrowser', 'ecwid_render_shortcode' );
10
+ add_shortcode( 'ecwid_minicart', 'ecwid_render_shortcode' );
11
+ add_shortcode( 'ecwid_search', 'ecwid_render_shortcode' );
12
+ add_shortcode( 'ecwid_categories', 'ecwid_render_shortcode' );
13
+ add_shortcode( 'ecwid_product', 'ecwid_render_shortcode' );
14
+ add_shortcode( 'ecwid_searchbox', 'ecwid_searchbox_shortcode' );
15
+ add_shortcode( 'ec_product', 'ecwid_render_shortcode' );
16
 
17
+ function ecwid_render_shortcode( $params, $content = '', $name = '' ) {
18
  $shortcode = Ecwid_Shortcode_Base::get_shortcode_object( $name, $params );
19
+
20
  if ( $shortcode ) {
21
  return $shortcode->render( array( 'legacy' => true ) );
22
  }
23
  }
24
 
25
+ function ecwid_searchbox_shortcode( $params, $content = '', $name = '' ) {
26
 
27
+ $shortcode = new Ecwid_Shortcode_Search( $params );
28
 
29
+ return $shortcode->render( array( 'legacy' => true ) );
30
+ }
includes/shortcodes/class-ecwid-shortcode-base.php CHANGED
@@ -26,13 +26,13 @@ abstract class Ecwid_Shortcode_Base {
26
  if ( ! isset( self::$shortcodes[ $this->get_shortcode_name() ] ) ) {
27
  self::$shortcodes[ $this->get_shortcode_name() ] = array();
28
  }
29
- $this->_index = count( self::$shortcodes[ $this->get_shortcode_name() ] );
 
30
  self::$shortcodes[ $this->get_shortcode_name() ][] = $this;
31
  }
32
 
33
  public static function get_store_shortcode_names() {
34
  return array( 'ecwid', 'ec_store' );
35
-
36
  }
37
 
38
  public static function get_current_store_shortcode_name() {
@@ -44,7 +44,7 @@ abstract class Ecwid_Shortcode_Base {
44
  }
45
 
46
  public static function get_shortcode_object( $name, $params ) {
47
- $names = array( 'productbrowser', 'minicart', 'search', 'categories', 'product' );
48
 
49
  $expected_prefix = 'ecwid_';
50
  if ( Ecwid_Config::is_wl() ) {
26
  if ( ! isset( self::$shortcodes[ $this->get_shortcode_name() ] ) ) {
27
  self::$shortcodes[ $this->get_shortcode_name() ] = array();
28
  }
29
+ $this->_index = count( self::$shortcodes[ $this->get_shortcode_name() ] );
30
+
31
  self::$shortcodes[ $this->get_shortcode_name() ][] = $this;
32
  }
33
 
34
  public static function get_store_shortcode_names() {
35
  return array( 'ecwid', 'ec_store' );
 
36
  }
37
 
38
  public static function get_current_store_shortcode_name() {
44
  }
45
 
46
  public static function get_shortcode_object( $name, $params ) {
47
+ $names = array( 'productbrowser', 'minicart', 'search', 'categories', 'product' );
48
 
49
  $expected_prefix = 'ecwid_';
50
  if ( Ecwid_Config::is_wl() ) {
includes/shortcodes/class-ecwid-shortcode-minicart.php CHANGED
@@ -8,30 +8,35 @@ class Ecwid_Shortcode_Minicart extends Ecwid_Shortcode_Base {
8
 
9
  $params = shortcode_atts(
10
  array(
11
- 'layout' => NULL,
12
- 'is_ecwid_shortcode' => FALSE,
13
- ), $shortcode_attributes
 
14
  );
15
 
16
  $layout = $params['layout'];
17
- if ( ! in_array( $layout, array(
18
- '',
19
- 'attachToCategories',
20
- 'floating',
21
- 'Mini',
22
- 'MiniAttachToProductBrowser'
23
- ), true )
 
 
 
 
24
  ) {
25
  $layout = 'MiniAttachToProductBrowser';
26
  }
27
 
28
  $this->_params = array(
29
- 'layout' => $layout
30
  );
31
 
32
  if ( $params['is_ecwid_shortcode'] ) {
33
  // it is a part of the ecwid shortcode, we need to show it anyways
34
- $ecwid_enable_minicart = $ecwid_show_categories = TRUE;
35
  } else {
36
  // it is a ecwid_minicart widget that works based on appearance settings
37
  $ecwid_enable_minicart = get_option( 'ecwid_enable_minicart' );
@@ -53,11 +58,11 @@ class Ecwid_Shortcode_Minicart extends Ecwid_Shortcode_Base {
53
 
54
  $default_render = parent::render();
55
 
56
- if ( !isset($this->_params['layout']) || $this->_params['layout'] != 'MiniAttachToProductBrowser' ) {
57
  return $default_render;
58
  }
59
 
60
- $has_minicart = (strpos($default_render, 'xMinicart') !== false);
61
  if ( $has_minicart && Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_feature_available() ) {
62
  $default_render .= '<style>#static-ec-store { padding-top: 40px; }</style>';
63
  }
@@ -65,11 +70,11 @@ class Ecwid_Shortcode_Minicart extends Ecwid_Shortcode_Base {
65
  return $default_render;
66
  }
67
 
68
- public function build_params_string($params = null) {
69
- if (!is_null($params) && array_key_exists('id', $params) && isset($params['layout']) && $params['layout'] == 'MiniAttachToProductBrowser') {
70
- unset($params['id']);
71
  }
72
 
73
- return parent::build_params_string($params);
74
  }
75
- }
8
 
9
  $params = shortcode_atts(
10
  array(
11
+ 'layout' => null,
12
+ 'is_ecwid_shortcode' => false,
13
+ ),
14
+ $shortcode_attributes
15
  );
16
 
17
  $layout = $params['layout'];
18
+ if ( ! in_array(
19
+ $layout,
20
+ array(
21
+ '',
22
+ 'attachToCategories',
23
+ 'floating',
24
+ 'Mini',
25
+ 'MiniAttachToProductBrowser',
26
+ ),
27
+ true
28
+ )
29
  ) {
30
  $layout = 'MiniAttachToProductBrowser';
31
  }
32
 
33
  $this->_params = array(
34
+ 'layout' => $layout,
35
  );
36
 
37
  if ( $params['is_ecwid_shortcode'] ) {
38
  // it is a part of the ecwid shortcode, we need to show it anyways
39
+ $ecwid_enable_minicart = $ecwid_show_categories = true;
40
  } else {
41
  // it is a ecwid_minicart widget that works based on appearance settings
42
  $ecwid_enable_minicart = get_option( 'ecwid_enable_minicart' );
58
 
59
  $default_render = parent::render();
60
 
61
+ if ( ! isset( $this->_params['layout'] ) || $this->_params['layout'] != 'MiniAttachToProductBrowser' ) {
62
  return $default_render;
63
  }
64
 
65
+ $has_minicart = ( strpos( $default_render, 'xMinicart' ) !== false );
66
  if ( $has_minicart && Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_feature_available() ) {
67
  $default_render .= '<style>#static-ec-store { padding-top: 40px; }</style>';
68
  }
70
  return $default_render;
71
  }
72
 
73
+ public function build_params_string( $params = null ) {
74
+ if ( ! is_null( $params ) && array_key_exists( 'id', $params ) && isset( $params['layout'] ) && $params['layout'] == 'MiniAttachToProductBrowser' ) {
75
+ unset( $params['id'] );
76
  }
77
 
78
+ return parent::build_params_string( $params );
79
  }
80
+ }
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -76,7 +76,7 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
76
 
77
  $js_code = Ecwid_Static_Page::get_js_code();
78
  if ( ! empty( $js_code ) ) {
79
- $code .= sprintf( '<script data-cfasync="false" data-no-optimize="1" type="text/javascript">%s</script>', $js_code ) . PHP_EOL;
80
  }
81
 
82
  return $code;
@@ -281,4 +281,39 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
281
 
282
  return ob_get_clean();
283
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
 
 
76
 
77
  $js_code = Ecwid_Static_Page::get_js_code();
78
  if ( ! empty( $js_code ) ) {
79
+ $code .= sprintf( '<script id="ec-static-inline-js" data-cfasync="false" data-no-optimize="1" type="text/javascript">%s</script>', $js_code ) . PHP_EOL;
80
  }
81
 
82
  return $code;
281
 
282
  return ob_get_clean();
283
  }
284
+
285
+ public static function init_static_js_repair() {
286
+
287
+ if ( is_admin() || wp_doing_ajax() || ! Ecwid_Store_Page::is_store_page() ) {
288
+ return;
289
+ }
290
+
291
+ ob_start();
292
+ add_action( 'shutdown', 'Ecwid_Shortcode_ProductBrowser::is_needed_static_js_repair', 0 );
293
+ }
294
+
295
+ public static function is_needed_static_js_repair() {
296
+ $output = ob_get_clean();
297
+
298
+ $pattern = '/<script id="ec-static-inline-js"(.*?)>(.*?)<\/script>/is';
299
+
300
+ $is_found_static_js = preg_match( $pattern, $output, $m );
301
+
302
+ if ( $is_found_static_js ) {
303
+ preg_match( $pattern, $output, $matches );
304
+
305
+ if ( ! empty( $matches[2] ) ) {
306
+ $static_js = $matches[2];
307
+
308
+ if ( strpos( $static_js, '&#038;' ) !== false ) {
309
+ $static_js = str_replace( '&#038;', '&', $static_js );
310
+ $output = preg_replace( $pattern, "<script id=\"ec-static-inline-js\"$1>$static_js</script>", $output, 1 );
311
+ }
312
+ }
313
+ }
314
+
315
+ echo $output; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
316
+ }
317
  }
318
+
319
+ add_action( 'template_redirect', 'Ecwid_Shortcode_ProductBrowser::init_static_js_repair' );
includes/themes.php CHANGED
@@ -79,6 +79,7 @@ function ecwid_apply_theme( $theme_name = null ) {
79
  'newstore' => array( 'css', 'title' ),
80
  'twentytwentyone' => array( 'css-no-parent', 'title' ),
81
  'twentytwentytwo' => array( 'css-no-parent', 'title' ),
 
82
  );
83
  $generic_themes = apply_filters( 'ecwid_generic_themes', $generic_themes );
84
 
79
  'newstore' => array( 'css', 'title' ),
80
  'twentytwentyone' => array( 'css-no-parent', 'title' ),
81
  'twentytwentytwo' => array( 'css-no-parent', 'title' ),
82
+ 'twentytwentythree' => array( 'css-no-parent', 'title' ),
83
  );
84
  $generic_themes = apply_filters( 'ecwid_generic_themes', $generic_themes );
85
 
includes/themes/class-ecwid-theme-base.php CHANGED
@@ -3,40 +3,40 @@
3
  class Ecwid_Theme_Base {
4
 
5
  const PROP_USE_JS_API_FOR_CATS_NAV_MENU = 'js-api-for-cats-nav-menu';
6
- const PROP_AJAX_DEFER_RENDERING = 'ajax-defer-rendering';
7
-
8
  const ACTION_APPLY_THEME = 'ecwid-apply-theme';
9
-
10
  const OPTION_LEGACY_CUSTOM_SCROLLER = 'ec_store_custom_scroller';
11
-
12
  public $has_advanced_layout = false;
13
 
14
  protected $adjust_pb_scroll = false;
15
 
16
  protected $name;
17
 
18
- protected $scroll_indent = 100;
19
  protected $scroll_indent_admin_bar = 32;
20
 
21
- protected $has_js = false;
22
- protected $has_css = false;
23
  protected $css_parent = false;
24
 
25
- public $historyjs_html4mode = false;
26
  protected $use_js_api_for_cats_nav_menu = false;
27
 
28
  public static $instance = null;
29
 
30
- public function __construct()
31
- {
32
- }
33
 
34
- public static function create($name, $props) {
35
 
36
- $theme = new Ecwid_Theme_Base();
37
  $theme->name = $name;
38
 
39
- if (is_admin()) return;
 
 
40
 
41
  if ( array_key_exists( 'scroll', $props ) ) {
42
  $theme->create_scroller( $props );
@@ -54,14 +54,14 @@ class Ecwid_Theme_Base {
54
  $theme->add_css( '' );
55
  }
56
 
57
- if (in_array( 'historyjs_html4mode', $props, true ) ) {
58
  $theme->historyjs_html4mode = true;
59
  }
60
 
61
- if (in_array( self::PROP_USE_JS_API_FOR_CATS_NAV_MENU, $props, true ) ) {
62
  add_filter( Ecwid_Nav_Menus::FILTER_USE_JS_API_FOR_CATS_MENU, array( $theme, 'filter_use_js_api_for_cats_menu' ) );
63
  }
64
-
65
  if ( in_array( self::PROP_AJAX_DEFER_RENDERING, $props, true ) ) {
66
  add_filter( Ecwid_Ajax_Defer_Renderer::FILTER_ENABLED, '__return_true' );
67
  }
@@ -70,7 +70,7 @@ class Ecwid_Theme_Base {
70
 
71
  $store_page_params = Ecwid_Store_Page::get_store_page_params();
72
 
73
- if( @$store_page_params['product_details_show_product_name'] ) {
74
  add_filter( 'option_' . Ecwid_Store_Page::OPTION_REPLACE_TITLE, '__return_false' );
75
  }
76
  }
@@ -81,28 +81,28 @@ class Ecwid_Theme_Base {
81
  public function filter_use_js_api_for_cats_menu( $value ) {
82
  return Ecwid_Nav_Menus::OPTVAL_USE_JS_API_FOR_CATS_MENU_TRUE;
83
  }
84
-
85
  protected function add_js() {
86
  wp_enqueue_script(
87
  'ecwid-theme-js',
88
  ECWID_PLUGIN_URL . 'js/themes/' . $this->name . '.js',
89
  array( 'jquery' ),
90
- get_option('ecwid_plugin_version')
 
91
  );
92
  }
93
 
94
  public function create_scroller( $props ) {
95
  $this->scroll_indent = $props['scroll'];
96
 
97
- if( is_admin_bar_showing() ) {
98
- $this->scroll_indent += $this->scroll_indent_admin_bar;
99
  }
100
 
101
  add_filter( 'ecwid_inline_js_config', array( $this, 'ecwid_inline_js_config_hook' ) );
102
  }
103
 
104
- public function ecwid_inline_js_config_hook( $js )
105
- {
106
  $js .= 'window.ec.config.scroll_indent = ' . $this->scroll_indent . ';';
107
  return $js;
108
  }
@@ -110,20 +110,20 @@ class Ecwid_Theme_Base {
110
  protected function add_css( $parent = null ) {
111
 
112
  $name = strtolower( $this->name );
113
- if (is_null($parent)) {
114
  $parent = array( $name . '-style' );
115
- } else if (empty($parent)) {
116
  $parent = array();
117
  } else {
118
  $parent = array( $parent );
119
  }
120
-
121
  wp_enqueue_style(
122
  'ecwid-theme-css',
123
  ECWID_PLUGIN_URL . 'css/themes/' . $name . '.css',
124
  $parent,
125
- get_option('ecwid_plugin_version')
126
  );
127
  }
128
 
129
- }
3
  class Ecwid_Theme_Base {
4
 
5
  const PROP_USE_JS_API_FOR_CATS_NAV_MENU = 'js-api-for-cats-nav-menu';
6
+ const PROP_AJAX_DEFER_RENDERING = 'ajax-defer-rendering';
7
+
8
  const ACTION_APPLY_THEME = 'ecwid-apply-theme';
9
+
10
  const OPTION_LEGACY_CUSTOM_SCROLLER = 'ec_store_custom_scroller';
11
+
12
  public $has_advanced_layout = false;
13
 
14
  protected $adjust_pb_scroll = false;
15
 
16
  protected $name;
17
 
18
+ protected $scroll_indent = 100;
19
  protected $scroll_indent_admin_bar = 32;
20
 
21
+ protected $has_js = false;
22
+ protected $has_css = false;
23
  protected $css_parent = false;
24
 
25
+ public $historyjs_html4mode = false;
26
  protected $use_js_api_for_cats_nav_menu = false;
27
 
28
  public static $instance = null;
29
 
30
+ public function __construct() { }
 
 
31
 
32
+ public static function create( $name, $props ) {
33
 
34
+ $theme = new Ecwid_Theme_Base();
35
  $theme->name = $name;
36
 
37
+ if ( is_admin() ) {
38
+ return;
39
+ }
40
 
41
  if ( array_key_exists( 'scroll', $props ) ) {
42
  $theme->create_scroller( $props );
54
  $theme->add_css( '' );
55
  }
56
 
57
+ if ( in_array( 'historyjs_html4mode', $props, true ) ) {
58
  $theme->historyjs_html4mode = true;
59
  }
60
 
61
+ if ( in_array( self::PROP_USE_JS_API_FOR_CATS_NAV_MENU, $props, true ) ) {
62
  add_filter( Ecwid_Nav_Menus::FILTER_USE_JS_API_FOR_CATS_MENU, array( $theme, 'filter_use_js_api_for_cats_menu' ) );
63
  }
64
+
65
  if ( in_array( self::PROP_AJAX_DEFER_RENDERING, $props, true ) ) {
66
  add_filter( Ecwid_Ajax_Defer_Renderer::FILTER_ENABLED, '__return_true' );
67
  }
70
 
71
  $store_page_params = Ecwid_Store_Page::get_store_page_params();
72
 
73
+ if ( @$store_page_params['product_details_show_product_name'] ) {
74
  add_filter( 'option_' . Ecwid_Store_Page::OPTION_REPLACE_TITLE, '__return_false' );
75
  }
76
  }
81
  public function filter_use_js_api_for_cats_menu( $value ) {
82
  return Ecwid_Nav_Menus::OPTVAL_USE_JS_API_FOR_CATS_MENU_TRUE;
83
  }
84
+
85
  protected function add_js() {
86
  wp_enqueue_script(
87
  'ecwid-theme-js',
88
  ECWID_PLUGIN_URL . 'js/themes/' . $this->name . '.js',
89
  array( 'jquery' ),
90
+ get_option( 'ecwid_plugin_version' ),
91
+ false
92
  );
93
  }
94
 
95
  public function create_scroller( $props ) {
96
  $this->scroll_indent = $props['scroll'];
97
 
98
+ if ( is_admin_bar_showing() ) {
99
+ $this->scroll_indent += $this->scroll_indent_admin_bar;
100
  }
101
 
102
  add_filter( 'ecwid_inline_js_config', array( $this, 'ecwid_inline_js_config_hook' ) );
103
  }
104
 
105
+ public function ecwid_inline_js_config_hook( $js ) {
 
106
  $js .= 'window.ec.config.scroll_indent = ' . $this->scroll_indent . ';';
107
  return $js;
108
  }
110
  protected function add_css( $parent = null ) {
111
 
112
  $name = strtolower( $this->name );
113
+ if ( is_null( $parent ) ) {
114
  $parent = array( $name . '-style' );
115
+ } elseif ( empty( $parent ) ) {
116
  $parent = array();
117
  } else {
118
  $parent = array( $parent );
119
  }
120
+
121
  wp_enqueue_style(
122
  'ecwid-theme-css',
123
  ECWID_PLUGIN_URL . 'css/themes/' . $name . '.css',
124
  $parent,
125
+ get_option( 'ecwid_plugin_version' )
126
  );
127
  }
128
 
129
+ }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Ecwid Ecommerce Shopping Cart ===
2
  Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, shopping cart, online store
4
  Requires at least: 4.4
5
- Tested up to: 6.0
6
- Stable tag: 6.10.28
7
 
8
  Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -152,9 +152,15 @@ You can use Ecwid’s built-in import tools to copy your store products from any
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
155
  = 6.10.28 - Sep 01, 2022 =
156
  - Improvements in the plugin code to comply with the WordPress plugin marketplace recommendations.
157
- - Improvements for compatibility with Divi builder.
158
  - Minor fixes and improvements.
159
 
160
  = 6.10.27 - Aug 18, 2022 =
1
+ === Ecwid Ecommerce Shopping Cart ===
2
  Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, shopping cart, online store
4
  Requires at least: 4.4
5
+ Tested up to: 6.1
6
+ Stable tag: 6.10.29
7
 
8
  Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
152
 
153
  == Changelog ==
154
 
155
+ = 6.10.29 - Nov 07, 2022 =
156
+ - **WordPress 6.1 and Twenty Twenty Three theme compatibility.** The new WordPress version with the 2023 theme is released. The Ecwid ecommerce shopping cart plugin is ready for the new release — everything works well in your WordPress admin and storefront pages. Feel free to upgrade your site to WordPress 6.1 and try a new theme.
157
+ - Compatibility improvements with XML Sitemaps plugin. If you are using the XML Sitemaps plugin, you may be experiencing an issue where storefront products links are not being added to sitemap. We've fixed it.
158
+ - Improvements for compatibility with the Elementor builder.
159
+ - Minor fixes and improvements.
160
+
161
  = 6.10.28 - Sep 01, 2022 =
162
  - Improvements in the plugin code to comply with the WordPress plugin marketplace recommendations.
163
+ - Improvements ecommerce widgets for Divi builder.
164
  - Minor fixes and improvements.
165
 
166
  = 6.10.27 - Aug 18, 2022 =
templates/admin/developers.php CHANGED
@@ -473,7 +473,7 @@
473
  </div>
474
  </div>
475
  <div class="cta-block__cta">
476
- <a href="https://ecwid-community.herokuapp.com/?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span>Join Community</span> </a>
477
  </div>
478
  </div>
479
  </div>
473
  </div>
474
  </div>
475
  <div class="cta-block__cta">
476
+ <a href="https://join.slack.com/t/lightspeed-ecom-comm/shared_invite/zt-1hvv9uar5-BtF5AQGJHqd~T7fR2~Boyw" target="_blank" type="button" class="btn btn-default btn-medium"> <span>Join Community</span> </a>
477
  </div>
478
  </div>
479
  </div>