Ecwid Ecommerce Shopping Cart - Version 6.7.4

Version Description

  • Jun 6, 2019 =
  • Fixed the "Random products" sidebar widget layout issues. Some users might notice that the random product widget didn't look good on e-commerce sites with a narrow sidebar. We fixed it so the widget work fine in narrow spaces.
  • Fixed slow loading issue for the site admin. After the latest Ecwid Ecommerce plugin update you might notice the store page loaded a bit longer. That was a bug. It didn't affect how the site loaded for your customers, but it did slow it down for you, the site administrator. We fixed it.
  • Small fixes and improvements.
Download this release

Release Info

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

Code changes from version 6.7.3 to 6.7.4

css/frontend.css CHANGED
@@ -61,6 +61,11 @@ html#ecwid_html body#ecwid_body .ecwid table {
61
  font-weight: 400;
62
  }
63
 
 
 
 
 
 
64
  .ecwid-random-product:not(.loaded) {
65
  min-height: 290px;
66
  }
61
  font-weight: 400;
62
  }
63
 
64
+
65
+ html#ecwid_html body#ecwid_body .ecwid.ecwid-SingleProduct-v2.ecwid-random-product {
66
+ min-width: unset;
67
+ }
68
+
69
  .ecwid-random-product:not(.loaded) {
70
  min-height: 290px;
71
  }
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 Ecommerce
8
- Version: 6.7.3
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
@@ -56,6 +56,7 @@ if ( is_admin() ) {
56
  add_action( 'admin_enqueue_scripts', 'ecwid_common_admin_scripts' );
57
  add_action( 'admin_enqueue_scripts', 'ecwid_register_admin_styles' );
58
  add_action( 'admin_enqueue_scripts', 'ecwid_register_settings_styles' );
 
59
 
60
  add_action( 'wp_ajax_ecwid_hide_vote_message', 'ecwid_hide_vote_message' );
61
  add_action( 'wp_ajax_ecwid_hide_message', 'ecwid_ajax_hide_message' );
@@ -99,7 +100,7 @@ if ( is_admin() ) {
99
  add_filter( 'widget_meta_poweredby', 'ecwid_add_credits' );
100
  add_filter( 'body_class', 'ecwid_body_class' );
101
  add_action( 'redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
102
-
103
  $ecwid_seo_title = '';
104
  }
105
 
@@ -186,7 +187,8 @@ function ecwid_init_integrations()
186
  'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
187
  'bb-plugin/fl-builder.php' => 'beaver-builder',
188
  'elementor/elementor.php' => 'elementor',
189
- 'sitepress-multilingual-cms/sitepress.php' => 'wpml'
 
190
  );
191
 
192
 
@@ -937,6 +939,15 @@ function ecwid_check_api_cache() {
937
  }
938
  }
939
 
 
 
 
 
 
 
 
 
 
940
  function ecwid_admin_check_api_cache()
941
  {
942
  $is_ajax_check_api_cache = isset( $_GET['action'] ) && $_GET['action'] == 'check_api_cache';
@@ -999,6 +1010,9 @@ function ecwid_full_cache_reset()
999
  EcwidPlatform::cache_reset( 'all_categories' );
1000
  EcwidPlatform::cache_reset( 'nav_categories_posts' );
1001
 
 
 
 
1002
  update_option( 'ecwid_last_api_cache_check', time() );
1003
  }
1004
 
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.7.4
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
56
  add_action( 'admin_enqueue_scripts', 'ecwid_common_admin_scripts' );
57
  add_action( 'admin_enqueue_scripts', 'ecwid_register_admin_styles' );
58
  add_action( 'admin_enqueue_scripts', 'ecwid_register_settings_styles' );
59
+ add_action( 'admin_enqueue_scripts', 'ecwid_enqueue_cache_control' );
60
 
61
  add_action( 'wp_ajax_ecwid_hide_vote_message', 'ecwid_hide_vote_message' );
62
  add_action( 'wp_ajax_ecwid_hide_message', 'ecwid_ajax_hide_message' );
100
  add_filter( 'widget_meta_poweredby', 'ecwid_add_credits' );
101
  add_filter( 'body_class', 'ecwid_body_class' );
102
  add_action( 'redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
103
+
104
  $ecwid_seo_title = '';
105
  }
106
 
187
  'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
188
  'bb-plugin/fl-builder.php' => 'beaver-builder',
189
  'elementor/elementor.php' => 'elementor',
190
+ 'sitepress-multilingual-cms/sitepress.php' => 'wpml',
191
+ 'pwa/pwa.php' => 'pwa',
192
  );
193
 
194
 
939
  }
940
  }
941
 
942
+
943
+ function ecwid_enqueue_cache_control() {
944
+ wp_enqueue_script('ecwid-cache-control-js', ECWID_PLUGIN_URL . 'js/cache-control.js', array(), get_option('ecwid_plugin_version'));
945
+
946
+ wp_localize_script( 'ecwid-cache-control-js', 'ecwidCacheControlParams', array(
947
+ 'ajax_url' => admin_url( 'admin-ajax.php' )
948
+ ));
949
+ }
950
+
951
  function ecwid_admin_check_api_cache()
952
  {
953
  $is_ajax_check_api_cache = isset( $_GET['action'] ) && $_GET['action'] == 'check_api_cache';
1010
  EcwidPlatform::cache_reset( 'all_categories' );
1011
  EcwidPlatform::cache_reset( 'nav_categories_posts' );
1012
 
1013
+ $p = new Ecwid_Products();
1014
+ $p->reset_dates();
1015
+
1016
  update_option( 'ecwid_last_api_cache_check', time() );
1017
  }
1018
 
includes/class-ecwid-html-meta.php CHANGED
@@ -43,8 +43,17 @@ abstract class Ecwid_HTML_Meta
43
  return true;
44
  }
45
 
46
- protected function _print_dns_prefetch_control() {
47
- echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
 
 
 
 
 
 
 
 
 
48
  }
49
 
50
  protected function _print_prefetch() {
@@ -53,12 +62,23 @@ abstract class Ecwid_HTML_Meta
53
  return;
54
  }
55
 
 
 
56
  $store_id = get_ecwid_store_id();
57
  $params = ecwid_get_scriptjs_params();
58
 
59
- $this->_print_dns_prefetch_control();
60
  echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?'
61
- . $store_id . $params . '" as="script">' . PHP_EOL;
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  // static only while ecwid_trim_description exists and meta functionality is not moved into this class
@@ -204,18 +224,9 @@ class Ecwid_HTML_Meta_Other extends Ecwid_HTML_Meta {
204
  return;
205
  }
206
 
207
- $this->_print_dns_prefetch_control();
208
-
209
- echo '<link href="https://d201eyh6wia12q.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
210
- echo '<link href="https://d3fi9i0jj23cau.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
211
- echo '<link href="https://dqzrr9k4bjpzk.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
212
- echo '<link href="https://ecwid-static-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
213
- echo '<link href="https://ecwid-images-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
214
- echo '<link href="https://app.ecwid.com" rel="preconnect" crossorigin />' . PHP_EOL;
215
 
216
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
217
- echo '<link href="https://d3j0zfs7paavns.cloudfront.net" rel="preconnect" crossorigin>' . PHP_EOL;
218
-
219
  $css_files = Ecwid_Static_Page::get_css_files();
220
 
221
  if( $css_files && is_array( $css_files ) ) {
43
  return true;
44
  }
45
 
46
+ protected function _get_html_prefetch_control_tags() {
47
+ $html = '';
48
+
49
+ $html .= '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
50
+ $html .= '<link href="https://app.ecwid.com" rel="preconnect" crossorigin />' . PHP_EOL;
51
+ $html .= '<link href="https://ecomm.events" rel="preconnect" crossorigin />' . PHP_EOL;
52
+ $html .= '<link href="https://d1q3axnfhmyveb.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
53
+ $html .= '<link href="https://dqzrr9k4bjpzk.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
54
+ $html .= '<link href="https://d3j0zfs7paavns.cloudfront.net" rel="preconnect" crossorigin>' . PHP_EOL;
55
+
56
+ return $html;
57
  }
58
 
59
  protected function _print_prefetch() {
62
  return;
63
  }
64
 
65
+ echo $this->_get_html_prefetch_control_tags();
66
+
67
  $store_id = get_ecwid_store_id();
68
  $params = ecwid_get_scriptjs_params();
69
 
 
70
  echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?'
71
+ . $store_id . $params . '" as="script" crossorigin>' . PHP_EOL;
72
+
73
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
74
+ $css_files = Ecwid_Static_Page::get_css_files();
75
+
76
+ if( $css_files && is_array( $css_files ) ) {
77
+ foreach ( $css_files as $item ) {
78
+ echo sprintf( '<link rel="preload" href="%s" as="style">', $item ) . PHP_EOL;
79
+ }
80
+ }
81
+ }
82
  }
83
 
84
  // static only while ecwid_trim_description exists and meta functionality is not moved into this class
224
  return;
225
  }
226
 
227
+ echo $this->_get_html_prefetch_control_tags();
 
 
 
 
 
 
 
228
 
229
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
 
 
230
  $css_files = Ecwid_Static_Page::get_css_files();
231
 
232
  if( $css_files && is_array( $css_files ) ) {
includes/class-ecwid-products.php CHANGED
@@ -24,7 +24,7 @@ class Ecwid_Products {
24
  $this->_status = new Ecwid_Products_Sync_Status();
25
  $this->_status->load();
26
 
27
- add_action( 'ecwid_update_store_id', array( $this, 'on_update_store_id' ) );
28
 
29
  if ( ! self::is_enabled() ) {
30
  return;
@@ -159,7 +159,7 @@ class Ecwid_Products {
159
  }
160
 
161
 
162
- public function on_update_store_id() {
163
  $this->_status->reset_dates();
164
  }
165
 
24
  $this->_status = new Ecwid_Products_Sync_Status();
25
  $this->_status->load();
26
 
27
+ add_action( 'ecwid_update_store_id', array( $this, 'reset_dates' ) );
28
 
29
  if ( ! self::is_enabled() ) {
30
  return;
159
  }
160
 
161
 
162
+ public function reset_dates() {
163
  $this->_status->reset_dates();
164
  }
165
 
includes/class-ecwid-static-page.php CHANGED
@@ -7,8 +7,6 @@ class Ecwid_Static_Page {
7
  const OPTION_VALUE_ENABLED = 'Y';
8
  const OPTION_VALUE_DISABLED = 'N';
9
  const OPTION_VALUE_AUTO = '';
10
-
11
- const PARAM_VALID_FROM = 'static_page_valid_from';
12
 
13
  const HANDLE_STATIC_PAGE = 'static-page';
14
  const API_URL = 'https://storefront.ecwid.com/';
@@ -40,7 +38,7 @@ class Ecwid_Static_Page {
40
 
41
  if( $css_files && is_array( $css_files ) ) {
42
  foreach ( $css_files as $index => $item ) {
43
- wp_enqueue_style( 'ecwid-' . self::HANDLE_STATIC_PAGE . '-' . $index, $item );
44
  }
45
  }
46
  }
@@ -54,7 +52,7 @@ class Ecwid_Static_Page {
54
  public static function get_data_for_current_page()
55
  {
56
  if ( current_user_can( Ecwid_Admin::get_capability() ) ) {
57
- EcwidPlatform::force_catalog_cache_reset();
58
  }
59
 
60
  $data = self::_maybe_fetch_data();
@@ -157,7 +155,7 @@ class Ecwid_Static_Page {
157
  if ( $cached_data ) {
158
  return $cached_data;
159
  }
160
-
161
  $fetched_data = null;
162
 
163
  $fetched_data = EcwidPlatform::fetch_url(
@@ -174,6 +172,8 @@ class Ecwid_Static_Page {
174
 
175
  $fetched_data = @json_decode( $fetched_data['data'] );
176
 
 
 
177
  EcwidPlatform::store_in_catalog_cache( $cache_key, $fetched_data );
178
 
179
  return $fetched_data;
7
  const OPTION_VALUE_ENABLED = 'Y';
8
  const OPTION_VALUE_DISABLED = 'N';
9
  const OPTION_VALUE_AUTO = '';
 
 
10
 
11
  const HANDLE_STATIC_PAGE = 'static-page';
12
  const API_URL = 'https://storefront.ecwid.com/';
38
 
39
  if( $css_files && is_array( $css_files ) ) {
40
  foreach ( $css_files as $index => $item ) {
41
+ wp_enqueue_style( 'ecwid-' . self::HANDLE_STATIC_PAGE . '-' . $index, $item, array(), null );
42
  }
43
  }
44
  }
52
  public static function get_data_for_current_page()
53
  {
54
  if ( current_user_can( Ecwid_Admin::get_capability() ) ) {
55
+ add_action( 'wp_enqueue_scripts', 'ecwid_enqueue_cache_control', 100 );
56
  }
57
 
58
  $data = self::_maybe_fetch_data();
155
  if ( $cached_data ) {
156
  return $cached_data;
157
  }
158
+
159
  $fetched_data = null;
160
 
161
  $fetched_data = EcwidPlatform::fetch_url(
172
 
173
  $fetched_data = @json_decode( $fetched_data['data'] );
174
 
175
+ EcwidPlatform::invalidate_catalog_cache_from( substr($fetched_data->lastUpdated, 0, -3) );
176
+
177
  EcwidPlatform::store_in_catalog_cache( $cache_key, $fetched_data );
178
 
179
  return $fetched_data;
includes/importer/task/class-ecwid-importer-task-create-product-variation.php CHANGED
@@ -56,6 +56,10 @@ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task_P
56
  $variation_data['sku'] = $var['sku'];
57
  }
58
 
 
 
 
 
59
  break;
60
  }
61
 
56
  $variation_data['sku'] = $var['sku'];
57
  }
58
 
59
+ if ( !isset( $variation_data['sku']) ) {
60
+ unset( $variation_data['quantity'] );
61
+ }
62
+
63
  break;
64
  }
65
 
includes/integrations/class-ecwid-integration-pwa.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Integration_PWA
4
+ {
5
+ public $cache_prefix = 'ec-store';
6
+
7
+ public function __construct() {
8
+ if( !class_exists( 'WP_Service_Worker_Caching_Routes' ) ) {
9
+ return;
10
+ }
11
+
12
+ $this->_register_routes();
13
+ }
14
+
15
+ protected function _register_routes() {
16
+
17
+ $routes = $this->_get_routes();
18
+
19
+ if( !is_array( $routes ) && empty( $routes ) ) {
20
+ return;
21
+ }
22
+
23
+ foreach ($routes as $route) {
24
+ wp_register_service_worker_caching_route(
25
+ $route['pattern'],
26
+ array(
27
+ 'strategy' => $route['strategy'],
28
+ 'cacheName' => sprintf( '%s: %s', $this->cache_prefix, $route['cache_name'] ),
29
+ 'plugins' => array(
30
+ 'expiration' => $route['expiration']
31
+ )
32
+ )
33
+ );
34
+ }
35
+ }
36
+
37
+ protected function _get_routes() {
38
+ $store_id = get_ecwid_store_id();
39
+
40
+ $stale_while_revalidate = array(
41
+ 'd1q3axnfhmyveb.cloudfront.net',
42
+ 'd1q3axnfhmyveb.cloudfront.net',
43
+ 'd34ikvsdm2rlij.cloudfront.net',
44
+ 'd1q3axnfhmyveb.cloudfront.net',
45
+ 'categories.js\?ownerid=' . $store_id,
46
+ 'd3j0zfs7paavns.cloudfront.net',
47
+ 'data.js\?ownerid=' . $store_id
48
+ );
49
+
50
+ $plugin_dir_name = dirname( ECWID_PLUGIN_BASENAME );
51
+
52
+ $routes = array(
53
+
54
+ array(
55
+ 'pattern' => '.*(?:' . implode( '|', $stale_while_revalidate ) . ').*$',
56
+ 'cache_name' => 'stale-while-revalidate',
57
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
58
+ 'expiration' => array(
59
+ 'maxEntries' => 100,
60
+ 'maxAgeSeconds' => 60 * 60 * 24 * 30
61
+ )
62
+ ),
63
+
64
+ array(
65
+ 'pattern' => '.*(?:png|gif|jpg|svg)$',
66
+ 'cache_name' => 'images-cache',
67
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
68
+ 'expiration' => array(
69
+ 'maxEntries' => 100,
70
+ 'maxAgeSeconds' => 60 * 60 * 24 * 30,
71
+ 'purgeOnQuotaError' => true
72
+ )
73
+ ),
74
+
75
+ array(
76
+ 'pattern' => '.*(?:ttf|woff|woff2)$',
77
+ 'cache_name' => 'fonts-cache',
78
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
79
+ 'expiration' => array(
80
+ 'maxAgeSeconds' => 60 * 60 * 24 * 365
81
+ )
82
+ ),
83
+
84
+ array(
85
+ 'pattern' => '.*\/' . $plugin_dir_name . '\/.*(?:css|js).*$',
86
+ 'cache_name' => 'plugin-cache',
87
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
88
+ 'expiration' => array(
89
+ 'maxAgeSeconds' => 60 * 60 * 24 * 30
90
+ )
91
+ ),
92
+
93
+ array(
94
+ 'pattern' => '.*script.js\?' . $store_id . '.*$',
95
+ 'cache_name' => 'network-first',
96
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_NETWORK_FIRST,
97
+ 'expiration' => array(
98
+ 'maxAgeSeconds' => 60 * 60 * 24 * 30
99
+ )
100
+ ),
101
+
102
+ );
103
+
104
+ return $routes;
105
+ }
106
+
107
+ }
108
+
109
+ $ecwid_integration_pwa = new Ecwid_Integration_PWA();
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -59,6 +59,11 @@ HTML;
59
  $static_html_code = Ecwid_Static_Page::get_html_code();
60
  $code .= '<div id="static-ec-store">' . htmlspecialchars_decode( $static_html_code ) . '</div>';
61
 
 
 
 
 
 
62
  $code .= '<div id="dynamic-ec-store">' . $default_render . '</div>';
63
 
64
 
59
  $static_html_code = Ecwid_Static_Page::get_html_code();
60
  $code .= '<div id="static-ec-store">' . htmlspecialchars_decode( $static_html_code ) . '</div>';
61
 
62
+ $js_code = Ecwid_Static_Page::get_js_code();
63
+ if( !empty( $js_code ) ) {
64
+ $code .= sprintf('<script>%s</script>', $js_code);
65
+ }
66
+
67
  $code .= '<div id="dynamic-ec-store">' . $default_render . '</div>';
68
 
69
 
js/admin.js CHANGED
@@ -1,16 +1,5 @@
1
  jQuery(document).ready(function() {
2
 
3
-
4
- function ecwidCheckApiCache() {
5
- jQuery.getJSON(
6
- 'admin-ajax.php',
7
- {
8
- action: 'check_api_cache',
9
- }
10
- );
11
- }
12
- ecwidCheckApiCache();
13
-
14
  var is_safari = navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf("Safari") > -1;
15
 
16
  wpCookies.set('ecwid_is_safari', is_safari);
1
  jQuery(document).ready(function() {
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  var is_safari = navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf("Safari") > -1;
4
 
5
  wpCookies.set('ecwid_is_safari', is_safari);
js/cache-control.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+
3
+ function ecwidCheckApiCache() {
4
+ jQuery.getJSON(
5
+ ecwidCacheControlParams.ajax_url,
6
+ {
7
+ action: 'check_api_cache',
8
+ }
9
+ );
10
+ }
11
+ ecwidCheckApiCache();
12
+
13
+ })
lib/ecwid_platform.php CHANGED
@@ -15,6 +15,7 @@ class EcwidPlatform {
15
  const CATEGORIES_CACHE_VALID_FROM = 'categories_cache_valid_from';
16
  const PRODUCTS_CACHE_VALID_FROM = 'products_cache_valid_from';
17
  const PROFILE_CACHE_VALID_FROM = 'profile_cache_valid_from';
 
18
 
19
  const OPTION_LOG_CACHE = 'ecwid_log_cache';
20
  const OPTION_ECWID_PLUGIN_DATA = 'ecwid_plugin_data';
@@ -456,7 +457,8 @@ class EcwidPlatform {
456
  $valid_from = max(
457
  EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ),
458
  EcwidPlatform::get( self::PRODUCTS_CACHE_VALID_FROM ),
459
- EcwidPlatform::get( self::PROFILE_CACHE_VALID_FROM )
 
460
  );
461
 
462
  self::cache_log_record(
@@ -467,8 +469,8 @@ class EcwidPlatform {
467
  'valid_from' => $valid_from
468
  )
469
  );
470
-
471
- if ( $result['time'] > $valid_from ) {
472
  return $result['data'];
473
  }
474
 
@@ -522,6 +524,11 @@ class EcwidPlatform {
522
  self::_invalidate_cache_from( self::PROFILE_CACHE_VALID_FROM, $time );
523
  }
524
 
 
 
 
 
 
525
  static public function force_catalog_cache_reset( $time = null )
526
  {
527
  $time = is_null( $time ) ? time() : $time;
15
  const CATEGORIES_CACHE_VALID_FROM = 'categories_cache_valid_from';
16
  const PRODUCTS_CACHE_VALID_FROM = 'products_cache_valid_from';
17
  const PROFILE_CACHE_VALID_FROM = 'profile_cache_valid_from';
18
+ const CATALOG_CACHE_VALID_FROM = 'catalog_valid_from';
19
 
20
  const OPTION_LOG_CACHE = 'ecwid_log_cache';
21
  const OPTION_ECWID_PLUGIN_DATA = 'ecwid_plugin_data';
457
  $valid_from = max(
458
  EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ),
459
  EcwidPlatform::get( self::PRODUCTS_CACHE_VALID_FROM ),
460
+ EcwidPlatform::get( self::PROFILE_CACHE_VALID_FROM ),
461
+ EcwidPlatform::get( self::FORCES_CATALOG_CACHE_RESET_VALID_FROM )
462
  );
463
 
464
  self::cache_log_record(
469
  'valid_from' => $valid_from
470
  )
471
  );
472
+
473
+ if ( EcwidPlatform::get( self::CATALOG_CACHE_VALID_FROM ) > $valid_from ) {
474
  return $result['data'];
475
  }
476
 
524
  self::_invalidate_cache_from( self::PROFILE_CACHE_VALID_FROM, $time );
525
  }
526
 
527
+ static public function invalidate_catalog_cache_from( $time = null )
528
+ {
529
+ self::_invalidate_cache_from( self::CATALOG_CACHE_VALID_FROM, $time );
530
+ }
531
+
532
  static public function force_catalog_cache_reset( $time = null )
533
  {
534
  $time = is_null( $time ) ? time() : $time;
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.2
6
- Stable tag: 6.7.3
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -153,6 +153,11 @@ You can use Ecwid’s built-in import tools to copy your store products from any
153
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
154
 
155
  == Changelog ==
 
 
 
 
 
156
  = 6.7.3 - May 29, 2019 =
157
  - Fixed compatibility with WordPress versions older 5.0
158
  - Fixed a PHP error message ("Can't use function return value in write context ") for PHP versions older 5.5
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.2
6
+ Stable tag: 6.7.4
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
153
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
154
 
155
  == Changelog ==
156
+ = 6.7.4 - Jun 6, 2019 =
157
+ - **Fixed the "Random products" sidebar widget layout issues**. Some users might notice that the random product widget didn't look good on e-commerce sites with a narrow sidebar. We fixed it so the widget work fine in narrow spaces.
158
+ - **Fixed slow loading issue for the site admin**. After the latest Ecwid Ecommerce plugin update you might notice the store page loaded a bit longer. That was a bug. It didn't affect how the site loaded for your customers, but it did slow it down for you, the site administrator. We fixed it.
159
+ - Small fixes and improvements.
160
+
161
  = 6.7.3 - May 29, 2019 =
162
  - Fixed compatibility with WordPress versions older 5.0
163
  - Fixed a PHP error message ("Can't use function return value in write context ") for PHP versions older 5.5