Ecwid Ecommerce Shopping Cart - Version 6.10.12

Version Description

  • Apr 14, 2021 =
  • Improvements for compatibility of the shopping cart category menu with WPML plugin. Some ecommerce sites had an issue with category names in multilingual mode when enabling the WPML plugin. We've fixed that.
  • Improvements for the single product blocks added via the Ecwid shopping cart plugin. We enhanced the SEO structured product data for Gutenberg blocks to make them meet the latest Google recommendations.
  • Minor fixes and improvements.

See full changelog

Download this release

Release Info

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

Code changes from version 6.10.11 to 6.10.12

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.11
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
@@ -168,6 +168,10 @@ if ( strpos( $version, '5.5' ) === 0 || version_compare( $version, '5.5' ) >= 0
168
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-sitemap-provider.php';
169
  }
170
 
 
 
 
 
171
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
172
  foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
173
  add_shortcode( $shortcode_name, 'ecwid_shortcode' );
@@ -1686,9 +1690,11 @@ function ecwid_plugin_activation_redirect( $plugin ) {
1686
  && isset($_POST['checked'])
1687
  && count($_POST['checked']) > 1;
1688
 
 
 
1689
  $is_newbie = ecwid_is_demo_store();
1690
 
1691
- if( !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
1692
  exit( wp_safe_redirect( Ecwid_Admin::get_dashboard_url() ) );
1693
  }
1694
  }
@@ -2080,7 +2086,6 @@ function ecwid_settings_api_init() {
2080
  if ( isset( $_POST['ecwid_store_id'] ) ) {
2081
 
2082
  ecwid_update_store_id( $_POST['ecwid_store_id'] );
2083
- update_option('ecwid_api_check_retry_after', 0);
2084
  update_option('ecwid_last_oauth_fail_time', 0);
2085
  update_option('ecwid_connected_via_legacy_page_time', time());
2086
  }
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.12
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
168
  require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-sitemap-provider.php';
169
  }
170
 
171
+ if( Ecwid_Config::is_cli_running() ) {
172
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ec-store-wp-cli.php';
173
+ }
174
+
175
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
176
  foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
177
  add_shortcode( $shortcode_name, 'ecwid_shortcode' );
1690
  && isset($_POST['checked'])
1691
  && count($_POST['checked']) > 1;
1692
 
1693
+ $is_cli_running = Ecwid_Config::is_cli_running();
1694
+
1695
  $is_newbie = ecwid_is_demo_store();
1696
 
1697
+ if( !$is_cli_running && !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
1698
  exit( wp_safe_redirect( Ecwid_Admin::get_dashboard_url() ) );
1699
  }
1700
  }
2086
  if ( isset( $_POST['ecwid_store_id'] ) ) {
2087
 
2088
  ecwid_update_store_id( $_POST['ecwid_store_id'] );
 
2089
  update_option('ecwid_last_oauth_fail_time', 0);
2090
  update_option('ecwid_connected_via_legacy_page_time', time());
2091
  }
includes/class-ec-store-wp-cli.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ec_Store_WP_CLI extends WP_CLI_Command {
3
+
4
+ public static $command = 'ec-store';
5
+
6
+ /**
7
+ * Setting WL configuration. If you need more information, please contact your manager.
8
+ * ## OPTIONS
9
+ *
10
+ * [--wl_mode]
11
+ * : Is whitelable mode enabled — true or false
12
+ *
13
+ * [--brand]
14
+ * : Brand name
15
+ *
16
+ * [--contact_us_url]
17
+ * : Link to contacts page in admin pages footer
18
+ *
19
+ * [--channel_id]
20
+ * : Chanel ID. Used for creating a registration link
21
+ *
22
+ * [--oauth_authorize_url]
23
+ * : Authorization link
24
+ *
25
+ * [--oauth_token_url]
26
+ * : Link for getting OAuth token
27
+ *
28
+ * [--registration_url]
29
+ * : Link for user registration
30
+ *
31
+ * [--oauth_appid]
32
+ * : Application ID
33
+ *
34
+ * [--oauth_appsecret]
35
+ * : Application secret key
36
+ *
37
+ * [--oauth_token]
38
+ * : Store token. Not working without Store ID
39
+ *
40
+ * [--store_id]
41
+ * : Store ID. Not working without token
42
+ *
43
+ * [--scriptjs_domain]
44
+ * : Domain for script.js
45
+ *
46
+ * [--api_domain]
47
+ * : API domain
48
+ *
49
+ * [--cp_domain]
50
+ * : Control panel domain
51
+ *
52
+ * [--demo_store_id]
53
+ * : Demo store ID
54
+ *
55
+ */
56
+ function config( $args, $assoc_args ) {
57
+
58
+ $config = $assoc_args;
59
+
60
+ Ecwid_Config::load_from_cli( $config );
61
+
62
+ WP_CLI::line( 'Configuration saved!' );
63
+ }
64
+
65
+ }
66
+
67
+ WP_CLI::add_command( Ec_Store_WP_CLI::$command, 'Ec_Store_WP_CLI' );
includes/class-ecwid-config.php CHANGED
@@ -112,6 +112,26 @@ class Ecwid_Config {
112
 
113
  self::_apply_config( $result );
114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  public static function enqueue_styles() {
117
  if ( !self::is_wl() ) {
112
 
113
  self::_apply_config( $result );
114
  }
115
+
116
+ public static function is_cli_running() {
117
+ return defined( 'WP_CLI' ) && WP_CLI;
118
+ }
119
+
120
+ public static function load_from_cli( $config ) {
121
+
122
+ if ( !$config ) {
123
+ return;
124
+ }
125
+
126
+ $common_config = self::_get_common_config();
127
+ $token_config_name = $common_config[self::TOKEN];
128
+
129
+ if( isset( $config[$token_config_name] ) ) {
130
+ Ecwid_Api_V3::save_token( $config[$token_config_name] );
131
+ }
132
+
133
+ self::_apply_config( $config );
134
+ }
135
 
136
  public static function enqueue_styles() {
137
  if ( !self::is_wl() ) {
includes/class-ecwid-nav-menus.php CHANGED
@@ -242,6 +242,11 @@ class Ecwid_Nav_Menus {
242
  $post->object_id = 0;
243
  $post->ecwid_page_type = 'category';
244
  $post->ecwid_category_id = $category->id;
 
 
 
 
 
245
 
246
  $posts[] = $post;
247
  }
@@ -250,6 +255,8 @@ class Ecwid_Nav_Menus {
250
  }
251
  }
252
 
 
 
253
  foreach ( $posts as $post ) {
254
  $counter++;
255
  $post->menu_item_parent = $item->ID;
242
  $post->object_id = 0;
243
  $post->ecwid_page_type = 'category';
244
  $post->ecwid_category_id = $category->id;
245
+
246
+ $post->ecwid_name_translated = array();
247
+ if( isset($category->nameTranslated) ) {
248
+ $post->ecwid_name_translated = $category->nameTranslated;
249
+ }
250
 
251
  $posts[] = $post;
252
  }
255
  }
256
  }
257
 
258
+ $posts = apply_filters( 'ecwid_nav_categories_posts', $posts );
259
+
260
  foreach ( $posts as $post ) {
261
  $counter++;
262
  $post->menu_item_parent = $item->ID;
includes/importer/class-ecwid-importer.php CHANGED
@@ -267,6 +267,13 @@ class Ecwid_Importer
267
  return false;
268
  }
269
 
 
 
 
 
 
 
 
270
  public static function is_localhost() {
271
 
272
  if( get_option( self::OPTIONS_SEPARATE_IMAGE_LOADING, false ) ) {
267
  return false;
268
  }
269
 
270
+ public function send_import_mark_to_log() {
271
+ $api = new Ecwid_Api_V3();
272
+ $params = array( 'wp_import_woo' => get_ecwid_store_id() );
273
+
274
+ return $api->get_store_update_stats( $params );
275
+ }
276
+
277
  public static function is_localhost() {
278
 
279
  if( get_option( self::OPTIONS_SEPARATE_IMAGE_LOADING, false ) ) {
includes/importer/task/class-ecwid-importer-task-main.php CHANGED
@@ -6,6 +6,8 @@ class Ecwid_Importer_Task_Main extends Ecwid_Importer_Task {
6
 
7
  public function execute( Ecwid_Importer $importer, array $data ) {
8
 
 
 
9
  if ( $importer->get_setting( Ecwid_Importer::SETTING_DELETE_DEMO ) && Ecwid_Importer::count_ecwid_demo_products() ) {
10
  $importer->append_task(
11
  Ecwid_Importer_Task_Delete_Products::build( Ecwid_Importer::get_ecwid_demo_products() )
6
 
7
  public function execute( Ecwid_Importer $importer, array $data ) {
8
 
9
+ $importer->send_import_mark_to_log();
10
+
11
  if ( $importer->get_setting( Ecwid_Importer::SETTING_DELETE_DEMO ) && Ecwid_Importer::count_ecwid_demo_products() ) {
12
  $importer->append_task(
13
  Ecwid_Importer_Task_Delete_Products::build( Ecwid_Importer::get_ecwid_demo_products() )
includes/integrations/class-ecwid-integration-wpml.php CHANGED
@@ -15,6 +15,22 @@ class Ecwid_Integration_WPML
15
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
16
  add_filter( 'wpml_hreflangs', array( $this, 'filter_hreflangs' ), 10, 1 );
17
  add_filter( 'wpml_hreflangs_html', array( $this, 'filter_hreflangs_html'), 10, 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
 
20
  public function mod_rewrite_rules( $link, $page_id ) {
15
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
16
  add_filter( 'wpml_hreflangs', array( $this, 'filter_hreflangs' ), 10, 1 );
17
  add_filter( 'wpml_hreflangs_html', array( $this, 'filter_hreflangs_html'), 10, 1 );
18
+
19
+ add_filter( 'ecwid_nav_categories_posts', array( $this, 'filter_ecwid_menu_items'), 10, 1 );
20
+ }
21
+
22
+ public function filter_ecwid_menu_items($posts) {
23
+
24
+ $lang = apply_filters( 'wpml_current_language', null );
25
+
26
+ foreach ($posts as $key => $post) {
27
+
28
+ if( !empty($post->ecwid_name_translated->{$lang}) ) {
29
+ $posts[$key]->title = $post->ecwid_name_translated->{$lang};
30
+ }
31
+ }
32
+
33
+ return $posts;
34
  }
35
 
36
  public function mod_rewrite_rules( $link, $page_id ) {
includes/shortcodes/class-ecwid-shortcode-product.php CHANGED
@@ -62,9 +62,18 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
62
  $items = preg_split('![^0-9^a-z^A-Z^\-^_]!', $this->_params['display']);
63
 
64
  $product = Ecwid_Product::get_without_loading( $this->_params['id'], (object)array('name' => '') );
65
-
66
  if (is_array($items) && count($items) > 0) foreach ($items as $item) {
67
  if (array_key_exists($item, $display_items)) {
 
 
 
 
 
 
 
 
 
68
  if ($this->_params['link'] == 'yes' && in_array($item, array('title', 'picture'))) {
69
  $product_link = $product->link;
70
  $result .= '<a href="' . esc_url($product_link) . '">' . $display_items[$item] . '</a>';
@@ -91,7 +100,7 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
91
  return array(
92
  'display_items' => array(
93
  'picture' => '<div itemprop="picture"></div>',
94
- 'title' => '<div class="ecwid-title" itemprop="title"></div>',
95
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
96
  . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"></div>'
97
  . '</div>',
@@ -133,9 +142,9 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
133
  return array(
134
  'display_items' => array(
135
  'picture' => '<div itemprop="picture"></div>',
136
- 'title' => '<div class="ecwid-title" itemprop="title"></div>',
137
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
138
- . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"' . $price_location_attributes . '>'
139
  . '<div itemprop="priceCurrency"></div>'
140
  . '</div>'
141
  . '</div>',
62
  $items = preg_split('![^0-9^a-z^A-Z^\-^_]!', $this->_params['display']);
63
 
64
  $product = Ecwid_Product::get_without_loading( $this->_params['id'], (object)array('name' => '') );
65
+
66
  if (is_array($items) && count($items) > 0) foreach ($items as $item) {
67
  if (array_key_exists($item, $display_items)) {
68
+
69
+ if( $item == 'title' ) {
70
+ $display_items[$item] = str_replace('$name', $product->name, $display_items[$item]);
71
+ }
72
+
73
+ if( $item == 'price' ) {
74
+ $display_items[$item] = str_replace('$price', $product->price, $display_items[$item]);
75
+ }
76
+
77
  if ($this->_params['link'] == 'yes' && in_array($item, array('title', 'picture'))) {
78
  $product_link = $product->link;
79
  $result .= '<a href="' . esc_url($product_link) . '">' . $display_items[$item] . '</a>';
100
  return array(
101
  'display_items' => array(
102
  'picture' => '<div itemprop="picture"></div>',
103
+ 'title' => '<div class="ecwid-title" 222 itemprop="title"></div>',
104
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
105
  . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"></div>'
106
  . '</div>',
142
  return array(
143
  'display_items' => array(
144
  'picture' => '<div itemprop="picture"></div>',
145
+ 'title' => '<div class="ecwid-title" itemprop="name" content="$name"></div>',
146
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
147
+ . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"' . $price_location_attributes . ' content="$price">'
148
  . '<div itemprop="priceCurrency"></div>'
149
  . '</div>'
150
  . '</div>',
lib/ecwid_api_v3.php CHANGED
@@ -478,6 +478,11 @@ class Ecwid_Api_V3
478
  $query['partner'] = Ecwid_Config::get_channel_id();
479
  }
480
 
 
 
 
 
 
481
  foreach ($query as $key => $value) {
482
  $query[$key] = urlencode($value);
483
  }
@@ -508,7 +513,7 @@ class Ecwid_Api_V3
508
  return @$result['code'] == 200;
509
  }
510
 
511
- public function get_store_update_stats() {
512
 
513
  static $stats = null;
514
 
@@ -520,6 +525,10 @@ class Ecwid_Api_V3
520
  'token' => self::get_token()
521
  );
522
 
 
 
 
 
523
  $url = $this->build_request_url($url, $params);
524
  $result = EcwidPlatform::fetch_url($url);
525
 
478
  $query['partner'] = Ecwid_Config::get_channel_id();
479
  }
480
 
481
+ $is_default_wl_domain = strpos($url, 'shopsettings.com') !== false;
482
+ if( !isset($query['partner']) && Ecwid_Config::is_wl() && $is_default_wl_domain ) {
483
+ $query['partner'] = Ecwid_Config::get_channel_id();
484
+ }
485
+
486
  foreach ($query as $key => $value) {
487
  $query[$key] = urlencode($value);
488
  }
513
  return @$result['code'] == 200;
514
  }
515
 
516
+ public function get_store_update_stats( $additional_params = false ) {
517
 
518
  static $stats = null;
519
 
525
  'token' => self::get_token()
526
  );
527
 
528
+ if( is_array($additional_params) ) {
529
+ $params = array_merge( $additional_params, $params );
530
+ }
531
+
532
  $url = $this->build_request_url($url, $params);
533
  $result = EcwidPlatform::fetch_url($url);
534
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.7
6
- Stable tag: 6.10.11
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -111,7 +111,8 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
111
  4.
112
  5.
113
  6.
114
- 7.
 
115
 
116
  == Frequently Asked Questions ==
117
 
@@ -156,9 +157,9 @@ You can use Ecwid’s built-in import tools to copy your store products from any
156
 
157
  == Changelog ==
158
 
159
- = 6.10.11 - Mar 24, 2021 =
160
- - Improved compatibility with Oxygen Builder plugin. We noticed that the Ecwid plugin affected some settings on the Oxygen Builder editor page. We fixed it, now it works fine.
161
- - Improvements for the single product widgets added via the Ecwid shopping cart plugin. We enhanced the SEO structured product data for sidebar widgets to make them meet the latest Google recommendations.
162
  - Minor fixes and improvements.
163
 
164
  [See full changelog](https://raw.githubusercontent.com/Ecwid/ecwid-wordpress-plugin/master/CHANGELOG.txt)
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.7
6
+ Stable tag: 6.10.12
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
111
  4.
112
  5.
113
  6.
114
+ 7.
115
+ 8.
116
 
117
  == Frequently Asked Questions ==
118
 
157
 
158
  == Changelog ==
159
 
160
+ = 6.10.12 - Apr 14, 2021 =
161
+ - Improvements for compatibility of the shopping cart category menu with WPML plugin. Some ecommerce sites had an issue with category names in multilingual mode when enabling the WPML plugin. We've fixed that.
162
+ - Improvements for the single product blocks added via the Ecwid shopping cart plugin. We enhanced the SEO structured product data for Gutenberg blocks to make them meet the latest Google recommendations.
163
  - Minor fixes and improvements.
164
 
165
  [See full changelog](https://raw.githubusercontent.com/Ecwid/ecwid-wordpress-plugin/master/CHANGELOG.txt)