Version Description
- Feb 12, 2019 =
- SEO improvement for the H1 tags on the product and category pages. Ecwid puts product and categories ecommerce data in the page content in a SEO-friendly microdata format so that search engines can index your store well. On the other hand, Wordpress pages have their own data, specifically <h1> tags, which stay on product pages and visible to Google when it is indexing your site. So, in addition to a product title like My cool product, Google may see your store page title on the same page like Shop. We improved it the product pages will now have more prominent and clear <h1> tags containing product title only. This should improve indexation and the way your products look in the search results in Google.
- Minor fixes and improvements.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 6.4.10 |
Comparing to | |
See all releases |
Code changes from version 6.4.8 to 6.4.10
- ecwid-shopping-cart.php +90 -10
- includes/class-ecwid-help-page.php +14 -1
- includes/class-ecwid-html-meta.php +3 -3
- includes/class-ecwid-products.php +6 -7
- includes/class-ecwid-seo-links.php +9 -3
- includes/class-ecwid-static-home-page.php +1 -1
- includes/faq_entries.php +11 -1
- includes/integrations/class-ecwid-integration-gutenberg.php +42 -20
- includes/themes/class-ecwid-theme-base.php +11 -6
- js/frontend.js +26 -0
- js/store-editor-page.js +11 -7
- languages/ecwid-shopping-cart-ru_RU.mo +0 -0
- languages/ecwid-shopping-cart-ru_RU.po +10 -1
- lib/ecwid_api_v3.php +5 -5
- lib/ecwid_platform.php +17 -19
- readme.txt +10 -1
- templates/sync.php +2 -2
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.4.
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
@@ -64,6 +64,7 @@ if ( is_admin() ){
|
|
64 |
add_action('wp_ajax_ecwid_sync_products', 'ecwid_sync_products');
|
65 |
add_action('admin_head', 'ecwid_ie8_fonts_inclusion');
|
66 |
add_action('init', 'ecwid_apply_theme', 0);
|
|
|
67 |
add_action('get_footer', 'ecwid_admin_get_footer');
|
68 |
add_action('admin_post_ec_connect', 'ecwid_admin_post_connect');
|
69 |
add_filter('tiny_mce_before_init', 'ecwid_tinymce_init');
|
@@ -93,6 +94,7 @@ if ( is_admin() ){
|
|
93 |
add_filter('body_class', 'ecwid_body_class');
|
94 |
add_action('redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
|
95 |
add_action('init', 'ecwid_check_api_cache');
|
|
|
96 |
$ecwid_seo_title = '';
|
97 |
}
|
98 |
add_action('admin_bar_menu', 'add_ecwid_admin_bar_node', 1000);
|
@@ -134,7 +136,9 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-nav-menus.php';
|
|
134 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-seo-links.php';
|
135 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-html-meta.php';
|
136 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-wp-dashboard-feed.php';
|
137 |
-
|
|
|
|
|
138 |
|
139 |
$version = get_bloginfo('version');
|
140 |
if (version_compare($version, '4.0') >= 0) {
|
@@ -164,6 +168,7 @@ function ecwid_init_integrations()
|
|
164 |
'above-the-fold-optimization/abovethefold.php' => 'above-the-fold',
|
165 |
'js_composer/js_composer.php' => 'wpbakery-composer',
|
166 |
'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
|
|
|
167 |
'elementor/elementor.php' => 'elementor'
|
168 |
|
169 |
);
|
@@ -288,6 +293,13 @@ function ecwid_ie8_fonts_inclusion()
|
|
288 |
HTML;
|
289 |
|
290 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
add_action('wp_ajax_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
|
293 |
add_action('wp_ajax_nopriv_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
|
@@ -682,9 +694,15 @@ function ecwid_check_version()
|
|
682 |
// Since 6.4.x
|
683 |
add_option( EcwidPlatform::OPTION_LOG_CACHE );
|
684 |
|
685 |
-
// Since 6.
|
686 |
add_option( 'ecwid_hide_canonical', false );
|
687 |
|
|
|
|
|
|
|
|
|
|
|
|
|
688 |
do_action( 'ecwid_on_plugin_update' );
|
689 |
|
690 |
Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id') );
|
@@ -1417,6 +1435,48 @@ function _ecwid_get_seo_title()
|
|
1417 |
return "";
|
1418 |
}
|
1419 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1420 |
add_filter('oembed_endpoint_url', 'ecwid_oembed_url', 10, 3);
|
1421 |
|
1422 |
function ecwid_oembed_url( $url, $permalink, $format ) {
|
@@ -1515,15 +1575,33 @@ function ecwid_get_scriptjs_params( $force_lang = null ) {
|
|
1515 |
if ( Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_OTHER ) {
|
1516 |
$params .= '&data_api_disabled=1';
|
1517 |
}
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
|
|
1522 |
}
|
1523 |
-
|
1524 |
if ( Ecwid_Static_Home_Page::is_enabled() ) {
|
1525 |
$params .= '&data_static_home=1';
|
1526 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1527 |
|
1528 |
return $params;
|
1529 |
}
|
@@ -2173,6 +2251,8 @@ function ecwid_settings_api_init() {
|
|
2173 |
}
|
2174 |
|
2175 |
if ( isset( $_POST['ecwid_store_id'] ) ) {
|
|
|
|
|
2176 |
update_option('ecwid_is_api_enabled', 'off');
|
2177 |
update_option('ecwid_api_check_time', 0);
|
2178 |
update_option('ecwid_last_oauth_fail_time', 0);
|
@@ -2393,7 +2473,7 @@ function ecwid_get_admin_sso_url( $time, $page = '' ) {
|
|
2393 |
Ecwid_Api_V3::get_token(),
|
2394 |
$time,
|
2395 |
hash( 'sha256', get_ecwid_store_id() . Ecwid_Api_V3::get_token() . $time . Ecwid_Config::get_oauth_appsecret() ),
|
2396 |
-
$page,
|
2397 |
substr( $lang, 0, 2 )
|
2398 |
);
|
2399 |
}
|
@@ -2703,7 +2783,7 @@ function ecwid_advanced_settings_do_page() {
|
|
2703 |
}
|
2704 |
|
2705 |
$reconnect_link = get_reconnect_link();
|
2706 |
-
|
2707 |
require_once ECWID_PLUGIN_DIR . 'templates/advanced-settings.php';
|
2708 |
}
|
2709 |
|
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.4.10
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
64 |
add_action('wp_ajax_ecwid_sync_products', 'ecwid_sync_products');
|
65 |
add_action('admin_head', 'ecwid_ie8_fonts_inclusion');
|
66 |
add_action('init', 'ecwid_apply_theme', 0);
|
67 |
+
add_action('init', 'ecwid_maybe_remove_emoji');
|
68 |
add_action('get_footer', 'ecwid_admin_get_footer');
|
69 |
add_action('admin_post_ec_connect', 'ecwid_admin_post_connect');
|
70 |
add_filter('tiny_mce_before_init', 'ecwid_tinymce_init');
|
94 |
add_filter('body_class', 'ecwid_body_class');
|
95 |
add_action('redirect_canonical', 'ecwid_redirect_canonical', 10, 2 );
|
96 |
add_action('init', 'ecwid_check_api_cache');
|
97 |
+
add_filter( 'the_title', 'ecwid_page_title' );
|
98 |
$ecwid_seo_title = '';
|
99 |
}
|
100 |
add_action('admin_bar_menu', 'add_ecwid_admin_bar_node', 1000);
|
136 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-seo-links.php';
|
137 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-html-meta.php';
|
138 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-wp-dashboard-feed.php';
|
139 |
+
if (version_compare( phpversion(), '5.6', '>=' ) ) {
|
140 |
+
require_once ECWID_PLUGIN_DIR . 'includes/importer/importer.php';
|
141 |
+
}
|
142 |
|
143 |
$version = get_bloginfo('version');
|
144 |
if (version_compare($version, '4.0') >= 0) {
|
168 |
'above-the-fold-optimization/abovethefold.php' => 'above-the-fold',
|
169 |
'js_composer/js_composer.php' => 'wpbakery-composer',
|
170 |
'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
|
171 |
+
'bb-plugin/fl-builder.php' => 'beaver-builder',
|
172 |
'elementor/elementor.php' => 'elementor'
|
173 |
|
174 |
);
|
293 |
HTML;
|
294 |
|
295 |
}
|
296 |
+
add_action( 'wp_head', 'ecwid_maybe_remove_emoji', 0 );
|
297 |
+
function ecwid_maybe_remove_emoji() {
|
298 |
+
|
299 |
+
if ( Ecwid_Store_page::is_store_page() && get_option( 'ecwid_remove_emoji' ) == 'Y' && strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false ) {
|
300 |
+
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
301 |
+
}
|
302 |
+
}
|
303 |
|
304 |
add_action('wp_ajax_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
|
305 |
add_action('wp_ajax_nopriv_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
|
694 |
// Since 6.4.x
|
695 |
add_option( EcwidPlatform::OPTION_LOG_CACHE );
|
696 |
|
697 |
+
// Since 6.4.8
|
698 |
add_option( 'ecwid_hide_canonical', false );
|
699 |
|
700 |
+
// Since 6.4.9
|
701 |
+
add_option( Ecwid_Theme_Base::OPTION_LEGACY_CUSTOM_SCROLLER, false );
|
702 |
+
|
703 |
+
// Since 6.4.9+
|
704 |
+
add_option( 'ecwid_remove_emoji', 'Y' );
|
705 |
+
|
706 |
do_action( 'ecwid_on_plugin_update' );
|
707 |
|
708 |
Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id') );
|
1435 |
return "";
|
1436 |
}
|
1437 |
|
1438 |
+
function ecwid_page_title( $title ) {
|
1439 |
+
|
1440 |
+
if ( ! Ecwid_Store_Page::is_store_page() ) return $title;
|
1441 |
+
|
1442 |
+
$sep = ecwid_get_title_separator();
|
1443 |
+
$title_placeholder = '@title@';
|
1444 |
+
$format = "$title_placeholder";
|
1445 |
+
$title_pattern = sprintf(
|
1446 |
+
'<span id="ecwid-main-page-title" data-original-title="%s" data-title-placeholder="%s" data-format="%s">%%s</span>',
|
1447 |
+
$title,
|
1448 |
+
$title_placeholder,
|
1449 |
+
$format
|
1450 |
+
);
|
1451 |
+
|
1452 |
+
$params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
|
1453 |
+
|
1454 |
+
if ( !@$params['mode'] ) {
|
1455 |
+
return sprintf( $title_pattern, $title );
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
$ecwid_title = null;
|
1459 |
+
|
1460 |
+
if ( $params['mode'] == 'product' ) {
|
1461 |
+
$p = Ecwid_Product::get_by_id( $params['id'] );
|
1462 |
+
$ecwid_title = isset( $p->seoTitle ) ? $p->seoTitle : $p->name;
|
1463 |
+
} else if ( $params['mode'] == 'category' ) {
|
1464 |
+
$c = Ecwid_Category::get_by_id( $params['id'] );
|
1465 |
+
$ecwid_title = $c->name;
|
1466 |
+
}
|
1467 |
+
|
1468 |
+
if ( !empty( $ecwid_title ) ) {
|
1469 |
+
|
1470 |
+
|
1471 |
+
return sprintf(
|
1472 |
+
$title_pattern,
|
1473 |
+
esc_html( str_replace( $title_placeholder, $ecwid_title, $format ) )
|
1474 |
+
);
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
return $title;
|
1478 |
+
}
|
1479 |
+
|
1480 |
add_filter('oembed_endpoint_url', 'ecwid_oembed_url', 10, 3);
|
1481 |
|
1482 |
function ecwid_oembed_url( $url, $permalink, $format ) {
|
1575 |
if ( Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_OTHER ) {
|
1576 |
$params .= '&data_api_disabled=1';
|
1577 |
}
|
1578 |
+
if (version_compare( phpversion(), '5.6', '>=' ) ) {
|
1579 |
+
require_once ECWID_PLUGIN_DIR . '/includes/importer/importer.php';
|
1580 |
+
if ( class_exists( 'Ecwid_Importer' ) && get_option( Ecwid_Importer::OPTION_WOO_CATALOG_IMPORTED ) ) {
|
1581 |
+
$params .= '&data_imported=1';
|
1582 |
+
}
|
1583 |
}
|
1584 |
+
|
1585 |
if ( Ecwid_Static_Home_Page::is_enabled() ) {
|
1586 |
$params .= '&data_static_home=1';
|
1587 |
}
|
1588 |
+
|
1589 |
+
if ( class_exists( 'Ecwid_Integration_Gutenberg') ) {
|
1590 |
+
|
1591 |
+
$all_blocks = Ecwid_Integration_Gutenberg::get_block_names();
|
1592 |
+
$page_blocks = Ecwid_Integration_Gutenberg::get_blocks_on_page();
|
1593 |
+
|
1594 |
+
$mask = "";
|
1595 |
+
foreach ( $all_blocks as $name ) {
|
1596 |
+
if ( array_key_exists( $name, $page_blocks ) ) {
|
1597 |
+
$mask .= '1';
|
1598 |
+
} else {
|
1599 |
+
$mask .= '0';
|
1600 |
+
}
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
$params .= '&data_g=' . $mask;
|
1604 |
+
}
|
1605 |
|
1606 |
return $params;
|
1607 |
}
|
2251 |
}
|
2252 |
|
2253 |
if ( isset( $_POST['ecwid_store_id'] ) ) {
|
2254 |
+
|
2255 |
+
ecwid_update_store_id( $_POST['ecwid_store_id'] );
|
2256 |
update_option('ecwid_is_api_enabled', 'off');
|
2257 |
update_option('ecwid_api_check_time', 0);
|
2258 |
update_option('ecwid_last_oauth_fail_time', 0);
|
2473 |
Ecwid_Api_V3::get_token(),
|
2474 |
$time,
|
2475 |
hash( 'sha256', get_ecwid_store_id() . Ecwid_Api_V3::get_token() . $time . Ecwid_Config::get_oauth_appsecret() ),
|
2476 |
+
urlencode( $page ),
|
2477 |
substr( $lang, 0, 2 )
|
2478 |
);
|
2479 |
}
|
2783 |
}
|
2784 |
|
2785 |
$reconnect_link = get_reconnect_link();
|
2786 |
+
|
2787 |
require_once ECWID_PLUGIN_DIR . 'templates/advanced-settings.php';
|
2788 |
}
|
2789 |
|
includes/class-ecwid-help-page.php
CHANGED
@@ -66,6 +66,17 @@ class Ecwid_Help_Page {
|
|
66 |
|
67 |
$max = 8;
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
$result = array();
|
70 |
foreach ( $faqs as $idx => $faq ) {
|
71 |
if ( isset($faq['priority']) && $faq['priority'] == 'newbie_with_woo' ) {
|
@@ -79,7 +90,7 @@ class Ecwid_Help_Page {
|
|
79 |
}
|
80 |
$faqs = array_values($faqs);
|
81 |
|
82 |
-
while (count($result) < $max) {
|
83 |
$rand = rand(0, count($faqs) - 1);
|
84 |
$result[] = $faqs[$rand];
|
85 |
|
@@ -87,6 +98,8 @@ class Ecwid_Help_Page {
|
|
87 |
$faqs = array_values($faqs);
|
88 |
}
|
89 |
|
|
|
|
|
90 |
$faqs = $result;
|
91 |
|
92 |
$result = array();
|
66 |
|
67 |
$max = 8;
|
68 |
|
69 |
+
$guaranteed_3 = null;
|
70 |
+
|
71 |
+
foreach ( $faqs as $idx => $faq ) {
|
72 |
+
if ( isset( $faq['priority'] ) && $faq['priority'] == 'guaranteed_3' ) {
|
73 |
+
$guaranteed_3 = array();
|
74 |
+
$guaranteed_3[] = $faq;
|
75 |
+
unset( $faqs[$idx] );
|
76 |
+
break;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
$result = array();
|
81 |
foreach ( $faqs as $idx => $faq ) {
|
82 |
if ( isset($faq['priority']) && $faq['priority'] == 'newbie_with_woo' ) {
|
90 |
}
|
91 |
$faqs = array_values($faqs);
|
92 |
|
93 |
+
while ( count($result) < $max + ( $guaranteed_3 ? 1 : 0 ) ) {
|
94 |
$rand = rand(0, count($faqs) - 1);
|
95 |
$result[] = $faqs[$rand];
|
96 |
|
98 |
$faqs = array_values($faqs);
|
99 |
}
|
100 |
|
101 |
+
array_splice( $result, 2, 0, $guaranteed_3 );
|
102 |
+
|
103 |
$faqs = $result;
|
104 |
|
105 |
$result = array();
|
includes/class-ecwid-html-meta.php
CHANGED
@@ -63,9 +63,9 @@ abstract class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
|
|
63 |
|
64 |
protected function __construct($id)
|
65 |
{
|
66 |
-
parent::__construct();
|
67 |
-
|
68 |
$this->id = $id;
|
|
|
|
|
69 |
}
|
70 |
|
71 |
public function wp_head()
|
@@ -87,7 +87,7 @@ abstract class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
|
|
87 |
);
|
88 |
|
89 |
$og_tags = apply_filters( 'ecwid_og_tags', $og_tags );
|
90 |
-
|
91 |
if (!empty($og_tags)) {
|
92 |
foreach ($og_tags as $tag => $value) {
|
93 |
if (!$value) continue;
|
63 |
|
64 |
protected function __construct($id)
|
65 |
{
|
|
|
|
|
66 |
$this->id = $id;
|
67 |
+
|
68 |
+
parent::__construct();
|
69 |
}
|
70 |
|
71 |
public function wp_head()
|
87 |
);
|
88 |
|
89 |
$og_tags = apply_filters( 'ecwid_og_tags', $og_tags );
|
90 |
+
|
91 |
if (!empty($og_tags)) {
|
92 |
foreach ($og_tags as $tag => $value) {
|
93 |
if (!$value) continue;
|
includes/class-ecwid-products.php
CHANGED
@@ -311,12 +311,12 @@ class Ecwid_Products {
|
|
311 |
$result['last_update'] = $this->_status->get_last_sync_time();
|
312 |
|
313 |
if ($updated->total > 0) {
|
314 |
-
$result['updated_from'] = $updated->items[0]->updated;
|
315 |
$result['last_updated'] = Ecwid_Api_V3::format_time($this->_status->last_deleted_product_time);
|
316 |
}
|
317 |
|
318 |
if ($deleted->total > 0) {
|
319 |
-
$result['deleted_from'] = $deleted->items[0]->date;
|
320 |
$result['last_deleted'] = Ecwid_Api_V3::format_time($this->_status->last_deleted_product_time);
|
321 |
}
|
322 |
|
@@ -404,7 +404,7 @@ class Ecwid_Products {
|
|
404 |
$offset = $settings['offset'];
|
405 |
}
|
406 |
|
407 |
-
if ($settings && $settings['from']) {
|
408 |
$updated_from = $settings['from'];
|
409 |
} else {
|
410 |
$updated_from = $this->_status->get_updated_from();
|
@@ -442,7 +442,7 @@ class Ecwid_Products {
|
|
442 |
$over = TRUE;
|
443 |
return false;
|
444 |
}
|
445 |
-
|
446 |
foreach ( $products->items as $product ) {
|
447 |
$this->_process_product( $product );
|
448 |
}
|
@@ -541,13 +541,12 @@ class Ecwid_Products {
|
|
541 |
$offset = $settings['offset'];
|
542 |
}
|
543 |
|
544 |
-
if ($settings && $settings['from']) {
|
545 |
$deleted_from = $settings['from'];
|
546 |
} else {
|
547 |
-
$deleted_from = $this->_status->
|
548 |
}
|
549 |
|
550 |
-
$deleted_from = $this->_status->get_deleted_from();
|
551 |
while ( ! $over ) {
|
552 |
|
553 |
$this->_status_event(array(
|
311 |
$result['last_update'] = $this->_status->get_last_sync_time();
|
312 |
|
313 |
if ($updated->total > 0) {
|
314 |
+
$result['updated_from'] = $updated->items[0]->updated - 1;
|
315 |
$result['last_updated'] = Ecwid_Api_V3::format_time($this->_status->last_deleted_product_time);
|
316 |
}
|
317 |
|
318 |
if ($deleted->total > 0) {
|
319 |
+
$result['deleted_from'] = $deleted->items[0]->date - 1;
|
320 |
$result['last_deleted'] = Ecwid_Api_V3::format_time($this->_status->last_deleted_product_time);
|
321 |
}
|
322 |
|
404 |
$offset = $settings['offset'];
|
405 |
}
|
406 |
|
407 |
+
if ( $settings && isset( $settings['from'] ) ) {
|
408 |
$updated_from = $settings['from'];
|
409 |
} else {
|
410 |
$updated_from = $this->_status->get_updated_from();
|
442 |
$over = TRUE;
|
443 |
return false;
|
444 |
}
|
445 |
+
|
446 |
foreach ( $products->items as $product ) {
|
447 |
$this->_process_product( $product );
|
448 |
}
|
541 |
$offset = $settings['offset'];
|
542 |
}
|
543 |
|
544 |
+
if ($settings && isset( $settings['from'] ) ) {
|
545 |
$deleted_from = $settings['from'];
|
546 |
} else {
|
547 |
+
$deleted_from = $this->_status->get_deleted_from();
|
548 |
}
|
549 |
|
|
|
550 |
while ( ! $over ) {
|
551 |
|
552 |
$this->_status_event(array(
|
includes/class-ecwid-seo-links.php
CHANGED
@@ -210,7 +210,7 @@ class Ecwid_Seo_Links {
|
|
210 |
}
|
211 |
}
|
212 |
|
213 |
-
if ( self::is_404_seo_link() ) {
|
214 |
return $config;
|
215 |
}
|
216 |
|
@@ -326,9 +326,15 @@ JS;
|
|
326 |
$param_name = $post->post_type == 'page' ? 'page_id' : 'p';
|
327 |
|
328 |
foreach ( $links as $link ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
foreach ( $patterns as $pattern ) {
|
330 |
-
|
331 |
-
add_rewrite_rule(
|
332 |
}
|
333 |
}
|
334 |
}
|
210 |
}
|
211 |
}
|
212 |
|
213 |
+
if ( Ecwid_Api_V3::is_available() && self::is_404_seo_link() ) {
|
214 |
return $config;
|
215 |
}
|
216 |
|
326 |
$param_name = $post->post_type == 'page' ? 'page_id' : 'p';
|
327 |
|
328 |
foreach ( $links as $link ) {
|
329 |
+
$link = trim( $link, '/' );
|
330 |
+
|
331 |
+
if (strpos($link, 'index.php') !== 0) {
|
332 |
+
$link = '^' . preg_quote( $link );
|
333 |
+
}
|
334 |
+
|
335 |
foreach ( $patterns as $pattern ) {
|
336 |
+
|
337 |
+
add_rewrite_rule( $link . '/' . $pattern . '.*', 'index.php?' . $param_name . '=' . $page_id, 'top' );
|
338 |
}
|
339 |
}
|
340 |
}
|
includes/class-ecwid-static-home-page.php
CHANGED
@@ -199,7 +199,7 @@ class Ecwid_Static_Home_Page {
|
|
199 |
return false;
|
200 |
}
|
201 |
|
202 |
-
if ( get_ecwid_store_id() > 15182050 && get_ecwid_store_id() % 2 == 0
|
203 |
return true;
|
204 |
}
|
205 |
|
199 |
return false;
|
200 |
}
|
201 |
|
202 |
+
if ( 0 && get_ecwid_store_id() > 15182050 && get_ecwid_store_id() % 2 == 0 ) {
|
203 |
return true;
|
204 |
}
|
205 |
|
includes/faq_entries.php
CHANGED
@@ -44,7 +44,7 @@ $faqs = array(
|
|
44 |
)
|
45 |
),
|
46 |
array(
|
47 |
-
'title' => __( 'How do I add store categories to the site menu
|
48 |
'body' => __(
|
49 |
'You can add the store categories menu to your site menu to help your customers easily navigate your site. Just open "Appearance > Menus" in your WordPress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site.'
|
50 |
, 'ecwid-shopping-cart'
|
@@ -69,5 +69,15 @@ $faqs = array(
|
|
69 |
'You can display your store on the site main page. Adjust the "Reading" settings of your site as described in our <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#displaystoreonhomepage">Help Center.</a>'
|
70 |
, 'ecwid-shopping-cart'
|
71 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
)
|
73 |
);
|
44 |
)
|
45 |
),
|
46 |
array(
|
47 |
+
'title' => __( 'How do I add store categories to the site menu?', 'ecwid-shopping-cart' ),
|
48 |
'body' => __(
|
49 |
'You can add the store categories menu to your site menu to help your customers easily navigate your site. Just open "Appearance > Menus" in your WordPress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site.'
|
50 |
, 'ecwid-shopping-cart'
|
69 |
'You can display your store on the site main page. Adjust the "Reading" settings of your site as described in our <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#displaystoreonhomepage">Help Center.</a>'
|
70 |
, 'ecwid-shopping-cart'
|
71 |
)
|
72 |
+
),
|
73 |
+
array(
|
74 |
+
'title' => __( 'Is there a WordPress theme for Ecwid?', 'ecwid-shopping-cart' ),
|
75 |
+
'body' => sprintf(
|
76 |
+
__(
|
77 |
+
'Ecwid is compatible with any WordPress theme. Be it a free theme from WordPress.org catalog, a premium theme by a third-party vendor or a custom-made theme, your Ecwid store will work good with it. If you want a premium theme, we recommend <a href="%s">TemplateMonster themes</a>'
|
78 |
+
, 'ecwid-shopping-cart'
|
79 |
+
), admin_url( 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '&ec-store-page=apps%3Aview%3Dapp%26name%3Dtemplatemonster-themes' )
|
80 |
+
),
|
81 |
+
'priority' => 'guaranteed_3'
|
82 |
)
|
83 |
);
|
includes/integrations/class-ecwid-integration-gutenberg.php
CHANGED
@@ -47,9 +47,7 @@ class Ecwid_Integration_Gutenberg {
|
|
47 |
)
|
48 |
);
|
49 |
}
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
public function on_save_post( $post, $request, $creating ) {
|
54 |
if (strpos( $post->post_content, '<!-- wp:' . self::STORE_BLOCK ) !== false ) {
|
55 |
Ecwid_Store_Page::add_store_page( $post->ID );
|
@@ -126,14 +124,8 @@ class Ecwid_Integration_Gutenberg {
|
|
126 |
|
127 |
protected function _get_products_data() {
|
128 |
|
129 |
-
$
|
130 |
-
|
131 |
-
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
132 |
-
$blocks = gutenberg_parse_blocks( $post->post_content );
|
133 |
-
} else {
|
134 |
-
$blocks = parse_blocks( $post->post_content );
|
135 |
-
}
|
136 |
-
|
137 |
$productIds = array();
|
138 |
foreach ( $blocks as $block ) {
|
139 |
if ( $block['blockName'] == self::PRODUCT_BLOCK ) {
|
@@ -196,7 +188,7 @@ class Ecwid_Integration_Gutenberg {
|
|
196 |
$params['display'] = '';
|
197 |
$display_string = '';
|
198 |
foreach ( $display as $name ) {
|
199 |
-
if (@$params['show_' . $name]) {
|
200 |
$params['display'] .= ' ' . $name;
|
201 |
}
|
202 |
}
|
@@ -326,7 +318,43 @@ JS;
|
|
326 |
|
327 |
return $result;
|
328 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
protected function _get_version_for_assets( $asset_file_path )
|
331 |
{
|
332 |
if ( $_SERVER['HTTP_HOST'] == 'localhost' ) {
|
@@ -417,13 +445,7 @@ JS;
|
|
417 |
|
418 |
public static function get_store_block_data_from_current_page() {
|
419 |
|
420 |
-
$
|
421 |
-
|
422 |
-
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
423 |
-
$blocks = gutenberg_parse_blocks( $post->post_content );
|
424 |
-
} else {
|
425 |
-
$blocks = parse_blocks( $post->post_content );
|
426 |
-
}
|
427 |
|
428 |
$store_block = null;
|
429 |
foreach ( $blocks as $block ) {
|
@@ -469,4 +491,4 @@ JS;
|
|
469 |
}
|
470 |
}
|
471 |
|
472 |
-
$ecwid_gutenberg = new Ecwid_Integration_Gutenberg();
|
47 |
)
|
48 |
);
|
49 |
}
|
50 |
+
|
|
|
|
|
51 |
public function on_save_post( $post, $request, $creating ) {
|
52 |
if (strpos( $post->post_content, '<!-- wp:' . self::STORE_BLOCK ) !== false ) {
|
53 |
Ecwid_Store_Page::add_store_page( $post->ID );
|
124 |
|
125 |
protected function _get_products_data() {
|
126 |
|
127 |
+
$blocks = self::get_blocks_on_page();
|
128 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
$productIds = array();
|
130 |
foreach ( $blocks as $block ) {
|
131 |
if ( $block['blockName'] == self::PRODUCT_BLOCK ) {
|
188 |
$params['display'] = '';
|
189 |
$display_string = '';
|
190 |
foreach ( $display as $name ) {
|
191 |
+
if ( @$params['show_' . $name] ) {
|
192 |
$params['display'] .= ' ' . $name;
|
193 |
}
|
194 |
}
|
318 |
|
319 |
return $result;
|
320 |
}
|
321 |
+
|
322 |
+
public static function get_block_names() {
|
323 |
+
return array(
|
324 |
+
self::STORE_BLOCK,
|
325 |
+
self::PRODUCT_BLOCK
|
326 |
+
);
|
327 |
+
}
|
328 |
|
329 |
+
/**
|
330 |
+
* @param $post
|
331 |
+
*
|
332 |
+
* @return array
|
333 |
+
*/
|
334 |
+
public static function get_blocks_on_page() {
|
335 |
+
$post = get_post();
|
336 |
+
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
337 |
+
$blocks = gutenberg_parse_blocks( $post->post_content );
|
338 |
+
} else {
|
339 |
+
$blocks = parse_blocks( $post->post_content );
|
340 |
+
}
|
341 |
+
|
342 |
+
if ( empty( $blocks ) ) {
|
343 |
+
return array();
|
344 |
+
}
|
345 |
+
|
346 |
+
$result = array();
|
347 |
+
|
348 |
+
$ecwid_blocks = self::get_block_names();
|
349 |
+
foreach ( $blocks as $block ) {
|
350 |
+
if ( in_array( $block['blockName'], $ecwid_blocks ) ) {
|
351 |
+
$result[$block['blockName']] = $block;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
return $result;
|
356 |
+
}
|
357 |
+
|
358 |
protected function _get_version_for_assets( $asset_file_path )
|
359 |
{
|
360 |
if ( $_SERVER['HTTP_HOST'] == 'localhost' ) {
|
445 |
|
446 |
public static function get_store_block_data_from_current_page() {
|
447 |
|
448 |
+
$blocks = self::get_blocks_on_page();
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
|
450 |
$store_block = null;
|
451 |
foreach ( $blocks as $block ) {
|
491 |
}
|
492 |
}
|
493 |
|
494 |
+
$ecwid_gutenberg = new Ecwid_Integration_Gutenberg();
|
includes/themes/class-ecwid-theme-base.php
CHANGED
@@ -7,6 +7,8 @@ class Ecwid_Theme_Base {
|
|
7 |
|
8 |
const ACTION_APPLY_THEME = 'ecwid-apply-theme';
|
9 |
|
|
|
|
|
10 |
public $has_advanced_layout = false;
|
11 |
|
12 |
protected $adjust_pb_scroll = false;
|
@@ -78,12 +80,15 @@ class Ecwid_Theme_Base {
|
|
78 |
}
|
79 |
|
80 |
protected function create_scroller() {
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
protected function add_css( $parent = null ) {
|
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;
|
80 |
}
|
81 |
|
82 |
protected function create_scroller() {
|
83 |
+
|
84 |
+
if ( get_option( self::OPTION_LEGACY_CUSTOM_SCROLLER, false ) ) {
|
85 |
+
wp_enqueue_script(
|
86 |
+
'ecwid-scroller',
|
87 |
+
ECWID_PLUGIN_URL . 'js/create_scroller.js' ,
|
88 |
+
array( 'jquery' ),
|
89 |
+
get_option('ecwid_plugin_version')
|
90 |
+
);
|
91 |
+
}
|
92 |
}
|
93 |
|
94 |
protected function add_css( $parent = null ) {
|
js/frontend.js
CHANGED
@@ -37,4 +37,30 @@ jQuery(document).ready(function() {
|
|
37 |
};
|
38 |
|
39 |
ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
});
|
37 |
};
|
38 |
|
39 |
ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
|
40 |
+
|
41 |
+
|
42 |
+
if ( jQuery('#ecwid-main-page-title').length > 0 ) {
|
43 |
+
Ecwid.OnPageLoaded.add(function(page) {
|
44 |
+
var isCategory = page.type == 'CATEGORY';
|
45 |
+
var isProduct = page.type == 'PRODUCT';
|
46 |
+
|
47 |
+
if ( !isCategory && !isProduct ) return;
|
48 |
+
|
49 |
+
var el = jQuery('#ecwid-main-page-title');
|
50 |
+
var format = el.attr('data-format');
|
51 |
+
var titlePlaceholder = el.attr('data-title-placeholder');
|
52 |
+
|
53 |
+
var newTitle = jQuery('title').html();
|
54 |
+
if ( !newTitle ) {
|
55 |
+
newTitle = "";
|
56 |
+
}
|
57 |
+
if ( isCategory && page.categoryId == 0 || newTitle.length == 0 ) {
|
58 |
+
var title = el.attr('data-original-title');
|
59 |
+
} else {
|
60 |
+
var title = format.replace( titlePlaceholder, jQuery('title').html() );
|
61 |
+
}
|
62 |
+
|
63 |
+
el.html( title );
|
64 |
+
});
|
65 |
+
}
|
66 |
});
|
js/store-editor-page.js
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
var createGutenbergedShortcodeString;
|
2 |
|
|
|
|
|
|
|
|
|
3 |
jQuery(document).ready(function() {
|
4 |
$popup = jQuery('#ecwid-store-popup-content');
|
5 |
|
@@ -106,14 +110,14 @@ jQuery(document).ready(function() {
|
|
106 |
'minicart_layout': 'MiniAttachToProductBrowser'
|
107 |
}
|
108 |
}
|
109 |
-
|
110 |
/*
|
111 |
* Tests whether there is a valid store shortcode
|
112 |
*/
|
113 |
checkEcwid = function() {
|
114 |
|
115 |
var hasEcwid = false;
|
116 |
-
if (
|
117 |
content = tinyMCE.activeEditor.getBody();
|
118 |
|
119 |
hasEcwid = jQuery(content).find('.ecwid-store-editor').length > 0;
|
@@ -126,7 +130,7 @@ jQuery(document).ready(function() {
|
|
126 |
} else {
|
127 |
jQuery('.wp-media-buttons').removeClass('has-ecwid');
|
128 |
}
|
129 |
-
if (
|
130 |
var body = tinymce.activeEditor.dom.doc.body;
|
131 |
var button = tinymce.activeEditor.dom.select('#ecwid-edit-store-button');
|
132 |
|
@@ -276,12 +280,12 @@ jQuery(document).ready(function() {
|
|
276 |
jQuery('#content').val(
|
277 |
jQuery('#content').val().replace(stringToReplace, stringToInsert)
|
278 |
);
|
279 |
-
if (
|
280 |
jQuery(tinymce.activeEditor.getBody()).find('.ecwid-store-editor').attr('data-ecwid-shortcode', shortcode.shortcode.string());
|
281 |
}
|
282 |
} else {
|
283 |
|
284 |
-
if (
|
285 |
if ($popup.data('range')) {
|
286 |
tinymce.activeEditor.selection.setRng($popup.data('range'));
|
287 |
}
|
@@ -365,7 +369,7 @@ ecwid_open_store_popup = function() {
|
|
365 |
|
366 |
var shortcode;
|
367 |
|
368 |
-
if (
|
369 |
tinyMCE.activeEditor.save();
|
370 |
|
371 |
$popup.data('range', tinyMCE.activeEditor.selection.getRng());
|
@@ -405,7 +409,7 @@ ecwid_open_store_popup = function() {
|
|
405 |
|
406 |
updatePreview();
|
407 |
|
408 |
-
if (
|
409 |
tinyMCE.activeEditor.execCommand('SelectAll');
|
410 |
tinyMCE.activeEditor.selection.collapse(true);
|
411 |
}
|
1 |
var createGutenbergedShortcodeString;
|
2 |
|
3 |
+
function ecwidIsTinyMCEActive() {
|
4 |
+
return typeof tinyMCE != 'undefined' && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
|
5 |
+
}
|
6 |
+
|
7 |
jQuery(document).ready(function() {
|
8 |
$popup = jQuery('#ecwid-store-popup-content');
|
9 |
|
110 |
'minicart_layout': 'MiniAttachToProductBrowser'
|
111 |
}
|
112 |
}
|
113 |
+
|
114 |
/*
|
115 |
* Tests whether there is a valid store shortcode
|
116 |
*/
|
117 |
checkEcwid = function() {
|
118 |
|
119 |
var hasEcwid = false;
|
120 |
+
if (ecwidIsTinyMCEActive()) {
|
121 |
content = tinyMCE.activeEditor.getBody();
|
122 |
|
123 |
hasEcwid = jQuery(content).find('.ecwid-store-editor').length > 0;
|
130 |
} else {
|
131 |
jQuery('.wp-media-buttons').removeClass('has-ecwid');
|
132 |
}
|
133 |
+
if (ecwidIsTinyMCEActive()) {
|
134 |
var body = tinymce.activeEditor.dom.doc.body;
|
135 |
var button = tinymce.activeEditor.dom.select('#ecwid-edit-store-button');
|
136 |
|
280 |
jQuery('#content').val(
|
281 |
jQuery('#content').val().replace(stringToReplace, stringToInsert)
|
282 |
);
|
283 |
+
if (ecwidIsTinyMCEActive()) {
|
284 |
jQuery(tinymce.activeEditor.getBody()).find('.ecwid-store-editor').attr('data-ecwid-shortcode', shortcode.shortcode.string());
|
285 |
}
|
286 |
} else {
|
287 |
|
288 |
+
if (ecwidIsTinyMCEActive()) {
|
289 |
if ($popup.data('range')) {
|
290 |
tinymce.activeEditor.selection.setRng($popup.data('range'));
|
291 |
}
|
369 |
|
370 |
var shortcode;
|
371 |
|
372 |
+
if (ecwidIsTinyMCEActive()) {
|
373 |
tinyMCE.activeEditor.save();
|
374 |
|
375 |
$popup.data('range', tinyMCE.activeEditor.selection.getRng());
|
409 |
|
410 |
updatePreview();
|
411 |
|
412 |
+
if (ecwidIsTinyMCEActive()) {
|
413 |
tinyMCE.activeEditor.execCommand('SelectAll');
|
414 |
tinyMCE.activeEditor.selection.collapse(true);
|
415 |
}
|
languages/ecwid-shopping-cart-ru_RU.mo
CHANGED
Binary file
|
languages/ecwid-shopping-cart-ru_RU.po
CHANGED
@@ -411,7 +411,7 @@ msgstr ""
|
|
411 |
"target=\"_blank\" href=\"%s\">Подробнее о расценках.</a>"
|
412 |
|
413 |
#: includes/faq_entries.php:45
|
414 |
-
msgid "How do I add store categories to the site menu
|
415 |
msgstr "Как добавить категории в меню сайта?"
|
416 |
|
417 |
#: includes/faq_entries.php:46
|
@@ -481,6 +481,15 @@ msgstr ""
|
|
481 |
"Перейдите на страницу <a href=\"options-reading.php\">«Настройки > Чтение»</"
|
482 |
"a> и выберите «Магазин\t» в выпадающем списке главной страницы."
|
483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
#: includes/oembed.php:68 includes/oembed.php:97 templates/help.php:96
|
485 |
msgid "See more"
|
486 |
msgstr "Посмотреть все"
|
411 |
"target=\"_blank\" href=\"%s\">Подробнее о расценках.</a>"
|
412 |
|
413 |
#: includes/faq_entries.php:45
|
414 |
+
msgid "How do I add store categories to the site menu?"
|
415 |
msgstr "Как добавить категории в меню сайта?"
|
416 |
|
417 |
#: includes/faq_entries.php:46
|
481 |
"Перейдите на страницу <a href=\"options-reading.php\">«Настройки > Чтение»</"
|
482 |
"a> и выберите «Магазин\t» в выпадающем списке главной страницы."
|
483 |
|
484 |
+
msgid "Is there a WordPress theme for Ecwid?"
|
485 |
+
msgstr "Существуют ли темы для Эквида?"
|
486 |
+
|
487 |
+
#: includes/faq_entries.php:66
|
488 |
+
msgid "Ecwid is compatible with any WordPress theme. Be it a free theme from WordPress.org catalog, a premium theme by a third-party vendor or a custom-made theme, your Ecwid store will work good with it. If you want a premium theme, we recommend <a href=\"%s\">TemplateMonster themes</a>"
|
489 |
+
msgstr ""
|
490 |
+
"Эквид совместим с любой темой, будь то бесплатная тема из каталога WordPress.org, платная тема или заказная разработка. Ваш магазин должен работать хорошо в любом случае. Если вы ищете хорошие премиум-темы, мы рекомендуем <a href=\"%s\">TemplateMonster</a>"
|
491 |
+
|
492 |
+
|
493 |
#: includes/oembed.php:68 includes/oembed.php:97 templates/help.php:96
|
494 |
msgid "See more"
|
495 |
msgstr "Посмотреть все"
|
lib/ecwid_api_v3.php
CHANGED
@@ -93,6 +93,11 @@ class Ecwid_Api_V3
|
|
93 |
{
|
94 |
$api = new Ecwid_Api_V3();
|
95 |
|
|
|
|
|
|
|
|
|
|
|
96 |
$profile = $api->get_store_profile();
|
97 |
|
98 |
if ( $profile ) {
|
@@ -119,11 +124,6 @@ class Ecwid_Api_V3
|
|
119 |
if (-$tls_fails ) {
|
120 |
return self::set_api_status( self::API_STATUS_ERROR_TLS );
|
121 |
}
|
122 |
-
|
123 |
-
$token = self::_load_token();
|
124 |
-
if ( !$token ) {
|
125 |
-
return self::set_api_status( self::API_STATUS_ERROR_TOKEN );
|
126 |
-
}
|
127 |
|
128 |
return self::set_api_status( self::API_STATUS_ERROR_OTHER );
|
129 |
}
|
93 |
{
|
94 |
$api = new Ecwid_Api_V3();
|
95 |
|
96 |
+
$token = self::_load_token();
|
97 |
+
if ( !$token ) {
|
98 |
+
return self::set_api_status( self::API_STATUS_ERROR_TOKEN );
|
99 |
+
}
|
100 |
+
|
101 |
$profile = $api->get_store_profile();
|
102 |
|
103 |
if ( $profile ) {
|
124 |
if (-$tls_fails ) {
|
125 |
return self::set_api_status( self::API_STATUS_ERROR_TLS );
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
return self::set_api_status( self::API_STATUS_ERROR_OTHER );
|
129 |
}
|
lib/ecwid_platform.php
CHANGED
@@ -387,7 +387,7 @@ class EcwidPlatform {
|
|
387 |
'valid_from' => EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM )
|
388 |
)
|
389 |
);
|
390 |
-
|
391 |
if ( $result['time'] > EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ) ) {
|
392 |
return $result['data'];
|
393 |
}
|
@@ -463,38 +463,36 @@ class EcwidPlatform {
|
|
463 |
return $type . '_' . md5($url);
|
464 |
}
|
465 |
|
466 |
-
static
|
467 |
-
|
468 |
-
|
469 |
-
EcwidPlatform::
|
|
|
|
|
|
|
470 |
self::cache_log_record(
|
471 |
-
'
|
472 |
array(
|
473 |
'time' => $time
|
474 |
)
|
475 |
);
|
476 |
-
|
|
|
|
|
|
|
|
|
477 |
}
|
478 |
|
479 |
static public function invalidate_categories_cache_from( $time = null )
|
480 |
{
|
481 |
-
|
482 |
-
EcwidPlatform::set( self::CATEGORIES_CACHE_VALID_FROM, $time );
|
483 |
-
self::cache_log_record(
|
484 |
-
'invalidate_categories_cache',
|
485 |
-
array(
|
486 |
-
'time' => $time
|
487 |
-
)
|
488 |
-
);
|
489 |
}
|
490 |
|
491 |
static public function invalidate_profile_cache_from( $time = null )
|
492 |
{
|
493 |
-
|
494 |
-
EcwidPlatform::set( self::PROFILE_CACHE_VALID_FROM, $time );
|
495 |
}
|
496 |
-
|
497 |
-
|
498 |
static public function force_catalog_cache_reset( $time = null )
|
499 |
{
|
500 |
$time = is_null( $time ) ? time() : $time;
|
387 |
'valid_from' => EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM )
|
388 |
)
|
389 |
);
|
390 |
+
|
391 |
if ( $result['time'] > EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ) ) {
|
392 |
return $result['data'];
|
393 |
}
|
463 |
return $type . '_' . md5($url);
|
464 |
}
|
465 |
|
466 |
+
static protected function _invalidate_cache_from( $name, $time ) {
|
467 |
+
$time = is_null( $time ) ? time() : $time;
|
468 |
+
|
469 |
+
$old = EcwidPlatform::get( $name );
|
470 |
+
if ( $old > $time) return;
|
471 |
+
|
472 |
+
EcwidPlatform::set( $name, $time );
|
473 |
self::cache_log_record(
|
474 |
+
'invalidate_cache_' . $name,
|
475 |
array(
|
476 |
'time' => $time
|
477 |
)
|
478 |
);
|
479 |
+
}
|
480 |
+
|
481 |
+
static public function invalidate_products_cache_from( $time = null )
|
482 |
+
{
|
483 |
+
self::_invalidate_cache_from( self::PRODUCTS_CACHE_VALID_FROM, $time );
|
484 |
}
|
485 |
|
486 |
static public function invalidate_categories_cache_from( $time = null )
|
487 |
{
|
488 |
+
self::_invalidate_cache_from( self::CATEGORIES_CACHE_VALID_FROM, $time );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
}
|
490 |
|
491 |
static public function invalidate_profile_cache_from( $time = null )
|
492 |
{
|
493 |
+
self::_invalidate_cache_from( self::PROFILE_CACHE_VALID_FROM, $time );
|
|
|
494 |
}
|
495 |
+
|
|
|
496 |
static public function force_catalog_cache_reset( $time = null )
|
497 |
{
|
498 |
$time = is_null( $time ) ? time() : $time;
|
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.7
|
5 |
Tested up to: 5.0
|
6 |
-
Stable tag: 6.4.
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
@@ -150,6 +150,15 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
150 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
151 |
|
152 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
= 6.4.8 - Dec 26, 2018 =
|
154 |
- **Improved settings interface for the "Product" block in Gutenberg (the new WordPress page editor)**. You can add a single product to any of your pages or posts using the Ecwid ecommerce "Product" block and fine-tune its layout in the block settings on the right side in the editor.
|
155 |
- **Resolved a minor layout issue caused by the Embed Any Document plugin.** The Embed Any Document plugin adds a breaking CSS code to the Wordpress admin backend which caused some of the Ecwid plugin admin pages display incorreclty. We fixed that, the plugins are now compatible.
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.0
|
6 |
+
Stable tag: 6.4.9
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
150 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
151 |
|
152 |
== Changelog ==
|
153 |
+
= 6.4.10 - Feb 12, 2019 =
|
154 |
+
- **SEO improvement for the H1 tags on the product and category pages**. Ecwid puts product and categories ecommerce data in the page content in a SEO-friendly ‘microdata’ format so that search engines can index your store well. On the other hand, Wordpress pages have their own data, specifically <h1> tags, which stay on product pages and visible to Google when it is indexing your site. So, in addition to a product title like “My cool product”, Google may see your store page title on the same page like “Shop”. We improved it — the product pages will now have more prominent and clear <h1> tags containing product title only. This should improve indexation and the way your products look in the search results in Google.
|
155 |
+
- Minor fixes and improvements.
|
156 |
+
|
157 |
+
= 6.4.9 - Feb 7, 2019 =
|
158 |
+
- **Fixes for the Open Graph image tag (og:image tag).** When you share a page from your ecommerce site on Facebook or in a messenger, you should see the product title, description and image in the sharing preview snippet.
|
159 |
+
- **Improvements for the product listing auto-scroll function.** In some Wordpress themes, the site header might overlap product pages when you navigate from page to page in your online store. We improved it to make the product and category pages appear better to your customers.
|
160 |
+
- Various minor fixes and improvements.
|
161 |
+
|
162 |
= 6.4.8 - Dec 26, 2018 =
|
163 |
- **Improved settings interface for the "Product" block in Gutenberg (the new WordPress page editor)**. You can add a single product to any of your pages or posts using the Ecwid ecommerce "Product" block and fine-tune its layout in the block settings on the right side in the editor.
|
164 |
- **Resolved a minor layout issue caused by the Embed Any Document plugin.** The Embed Any Document plugin adds a breaking CSS code to the Wordpress admin backend which caused some of the Ecwid plugin admin pages display incorreclty. We fixed that, the plugins are now compatible.
|
templates/sync.php
CHANGED
@@ -47,7 +47,7 @@ function process_no_sse_sync(data) {
|
|
47 |
if (processed_updates > 0) {
|
48 |
mode = 'updated';
|
49 |
}
|
50 |
-
offset = data.offset + data.limit;
|
51 |
}
|
52 |
if (mode == 'updated') {
|
53 |
jQuery('#current_item').text('Updating products...');
|
@@ -69,7 +69,7 @@ function increment_progress_counter(increment = 1) {
|
|
69 |
return;
|
70 |
}
|
71 |
|
72 |
-
name = 'count_updated';
|
73 |
|
74 |
var css = '#' + name;
|
75 |
var current = jQuery(css).data('count');
|
47 |
if (processed_updates > 0) {
|
48 |
mode = 'updated';
|
49 |
}
|
50 |
+
offset = parseInt(data.offset) + parseInt(data.limit);
|
51 |
}
|
52 |
if (mode == 'updated') {
|
53 |
jQuery('#current_item').text('Updating products...');
|
69 |
return;
|
70 |
}
|
71 |
|
72 |
+
var name = 'count_updated';
|
73 |
|
74 |
var css = '#' + name;
|
75 |
var current = jQuery(css).data('count');
|