Ecwid Ecommerce Shopping Cart - Version 5.1.1

Version Description

  • Fixed the Strict code standards notices appearing on some sites with Ecwid plugin enabled. The messages didnt affect the product catalog and checkout, but looked confusing for the site visitors. We fixed that. The notices should disappear now.
  • Minor improvement for the SEO friendly clean URLs function.
Download this release

Release Info

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

Code changes from version 5.1 to 5.1.1

ecwid-shopping-cart.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?source=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 Team
8
- Version: 5.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -587,11 +587,8 @@ function ecwid_check_version()
587
 
588
  do_action( 'ecwid_on_plugin_update' );
589
 
590
- Ecwid_Store_Page::add_store_page(
591
- array(
592
- get_option('ecwid_store_page_id'), get_option('ecwid_store_page_id_auto')
593
- )
594
- );
595
 
596
  if (Ecwid_Store_Page::get_current_store_page_id()) {
597
  delete_option('ecwid_store_page_id_auto');
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 Team
8
+ Version: 5.1.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
587
 
588
  do_action( 'ecwid_on_plugin_update' );
589
 
590
+ Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id') );
591
+ Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id_auto') );
 
 
 
592
 
593
  if (Ecwid_Store_Page::get_current_store_page_id()) {
594
  delete_option('ecwid_store_page_id_auto');
includes/class-ecwid-seo-links.php CHANGED
@@ -154,25 +154,34 @@ JS;
154
 
155
  $pages = Ecwid_Store_Page::get_store_pages_array();
156
 
157
- foreach ( $pages as $page_id ) {
158
- $link = get_page_uri( $page_id );
159
- $rules['^' . $link . '/.*'] = 'index.php?page_id=' . $page_id;
160
- }
 
 
 
 
 
161
 
162
- if (
163
- is_plugin_active( 'polylang/polylang.php' )
164
- && function_exists( 'pll_get_post_language' )
165
- && class_exists( 'PLL_Model' )
166
- && method_exists( 'PLL_Model', 'get_links_model' )
167
- ) {
168
- $options = get_option( 'polylang' );
169
- $model = new PLL_Model( $options );
170
- $links_model = $model->get_links_model();
171
- if ( $links_model instanceof PLL_Links_Directory ) {
172
- foreach ( $pages as $page_id ) {
173
- $link = get_page_uri( $page_id );
174
- $language = pll_get_post_language( $page_id );
175
- $rules['^' . $language . '/' . $link . '/.*'] = 'index.php?page_id=' . $page_id;
 
 
 
 
176
  }
177
  }
178
  }
154
 
155
  $pages = Ecwid_Store_Page::get_store_pages_array();
156
 
157
+ if ( is_array( $pages ) ) {
158
+
159
+ foreach ($pages as $page_id) {
160
+ $patterns = $this->get_seo_links_patterns();
161
+ $link = get_page_uri($page_id);
162
+ foreach ($patterns as $pattern) {
163
+ $rules['^' . $link . '/' . $pattern . '.*'] = 'index.php?page_id=' . $page_id;
164
+ }
165
+ }
166
 
167
+ if (
168
+ is_plugin_active('polylang/polylang.php')
169
+ && function_exists('pll_get_post_language')
170
+ && class_exists('PLL_Model')
171
+ && method_exists('PLL_Model', 'get_links_model')
172
+ ) {
173
+ $options = get_option('polylang');
174
+ $model = new PLL_Model($options);
175
+ $links_model = $model->get_links_model();
176
+ if ($links_model instanceof PLL_Links_Directory) {
177
+ $patterns = $this->get_seo_links_patterns();
178
+ foreach ($pages as $page_id) {
179
+ $link = get_page_uri($page_id);
180
+ $language = pll_get_post_language($page_id);
181
+ foreach ($patterns as $pattern) {
182
+ $rules['^' . $language . '/' . $link . '/' . $pattern . '.*'] = 'index.php?page_id=' . $page_id;
183
+ }
184
+ }
185
  }
186
  }
187
  }
includes/class-ecwid-store-page.php CHANGED
@@ -140,7 +140,7 @@ class Ecwid_Store_Page {
140
 
141
  $pages[] = $page_id;
142
 
143
- if ( count( $pages ) == 1 || ! get_option( self::OPTION_MAIN_STORE_PAGE_ID ) ) {
144
  update_option( self::OPTION_MAIN_STORE_PAGE_ID, $page_id );
145
  }
146
 
@@ -171,7 +171,7 @@ class Ecwid_Store_Page {
171
  }
172
  }
173
 
174
- public function get_store_pages_array() {
175
 
176
  if ( self::$_store_pages ) {
177
  return self::$_store_pages;
@@ -270,4 +270,4 @@ class Ecwid_Store_Page {
270
 
271
  add_action( 'init', array( 'Ecwid_Store_Page', 'flush_rewrites' ) );
272
  add_action( 'shutdown', array( 'Ecwid_Store_Page', 'on_frontend_rendered' ) );
273
- add_action( 'save_post', array( 'Ecwid_Store_Page', 'on_save_post' ) );
140
 
141
  $pages[] = $page_id;
142
 
143
+ if ( count( $pages ) == 1 || !get_option( self::OPTION_MAIN_STORE_PAGE_ID ) ) {
144
  update_option( self::OPTION_MAIN_STORE_PAGE_ID, $page_id );
145
  }
146
 
171
  }
172
  }
173
 
174
+ public static function get_store_pages_array() {
175
 
176
  if ( self::$_store_pages ) {
177
  return self::$_store_pages;
270
 
271
  add_action( 'init', array( 'Ecwid_Store_Page', 'flush_rewrites' ) );
272
  add_action( 'shutdown', array( 'Ecwid_Store_Page', 'on_frontend_rendered' ) );
273
+ add_action( 'save_post', array( 'Ecwid_Store_Page', 'on_save_post' ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.7
6
- Stable tag: 5.1
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -149,6 +149,10 @@ You can use Ecwid’s built-in import tools to copy your store products from any
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
 
 
 
 
152
  = 5.1 =
153
  - **Improved SEO friendly clean URLs tool.** Previously, if you had your store installed on different pages of your site (e.g. different store categories on different site pages), the SEO URLs worked on the main store/catalog page only. Now it should work fine on all pages you add your store to. Please make sure you use the “Add store” editor button when adding your store to the site pages.
154
  - **The new categories menu widget is now enabled for every site.** We released the new categories widget in the version 3.4 — it is mobile friendly and looks great with any wordpress ecommerce theme. We made it possible to turn on/off the new widget temporarily to make sure every site would have time to try it before it’s enabled for everyone. Now it’s enabled. If you have enabled it previously, nothing will change for you — your categories widget is already updated. If you have the old categories widget displayed on your site, this update will replace it with the new one. Please let us know if you have any trouble with the new widget.
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.7
6
+ Stable tag: 5.1.1
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
152
+ = 5.1.1 =
153
+ - **Fixed the “Strict code standards” notices** appearing on some sites with Ecwid plugin enabled. The messages didn’t affect the product catalog and checkout, but looked confusing for the site visitors. We fixed that. The notices should disappear now.
154
+ - Minor improvement for the SEO friendly clean URLs function.
155
+
156
  = 5.1 =
157
  - **Improved SEO friendly clean URLs tool.** Previously, if you had your store installed on different pages of your site (e.g. different store categories on different site pages), the SEO URLs worked on the main store/catalog page only. Now it should work fine on all pages you add your store to. Please make sure you use the “Add store” editor button when adding your store to the site pages.
158
  - **The new categories menu widget is now enabled for every site.** We released the new categories widget in the version 3.4 — it is mobile friendly and looks great with any wordpress ecommerce theme. We made it possible to turn on/off the new widget temporarily to make sure every site would have time to try it before it’s enabled for everyone. Now it’s enabled. If you have enabled it previously, nothing will change for you — your categories widget is already updated. If you have the old categories widget displayed on your site, this update will replace it with the new one. Please let us know if you have any trouble with the new widget.