Skip to content

Commit 2639a72

Browse files
authored
Merge pull request #333 from Ecwid/dev
Dev
2 parents faea216 + f6b6860 commit 2639a72

10 files changed

Lines changed: 66 additions & 16 deletions

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
== Changelog ==
2+
= 7.0.1 - Apr 8, 2025 =
3+
- **WordPress 6.8 compatibility.** The new WordPress version will be released soon. 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.8.
4+
- Added support for URLs without ID feature in the sitemap and store menus.
5+
- Fixed an issue where storefront URLs were missing a slash in certain cases when the URLs without ID feature was enabled.
6+
27
= 7.0 - Mar 26, 2025 =
38
- **New clean and SEO-friendly URLs for your product and category pages—no more random numbers!** We’ve introduced a new format for product and category page links. Now, you can remove those auto-generated numbers, making them cleaner and better for SEO. For example, instead of `/shoes-c123`, your URL slug can simply be `/shoes`! To activate this feature, go to "WordPress admin → Ecwid → Storefront", scroll down, and enable "Set URL slugs without IDs for products and categories". If you’re on a Business or Unlimited plan, you can also customize product and category slugs however you like for a more personalized and SEO-friendly URL.
49

ecwid-shopping-cart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/*
33
Plugin Name: Ecwid by Lightspeed Ecommerce Shopping Cart
44
Plugin URI: http://www.ecwid.com?partner=wporg
5-
Description: Ecwid by Lightspeed 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.
5+
Description: Ecwid by Lightspeed is a full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
66
Text Domain: ecwid-shopping-cart
77
Author: Ecwid Ecommerce
8-
Version: 7.0
8+
Version: 7.0.1
99
Author URI: https://ecwid.to/ecwid-site
1010
License: GPLv2 or later
1111
*/

includes/class-ecwid-html-meta.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ public function wp_head_last() {
123123
protected function _print_description() {
124124
$description_html = false;
125125

126-
if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
126+
if( Ecwid_Seo_Links::is_slugs_without_ids_enabled() ) {
127+
$slug = Ecwid_Static_Page::get_current_storefront_page_slug();
128+
$noindex_pages = Ecwid_Seo_Links::get_noindex_pages();
129+
130+
$is_internal_catalog_page = ! empty( $slug ) && ! in_array( $slug, $noindex_pages );
131+
} else {
132+
$is_internal_catalog_page = Ecwid_Seo_Links::is_product_browser_url();
133+
}
134+
135+
if ( ecwid_is_applicable_escaped_fragment() || $is_internal_catalog_page ) {
127136
$description_html = Ecwid_Static_Page::get_meta_description_html();
128137
} elseif ( Ecwid_Store_Page::is_store_page() ) {
129138
$set_metadesc = false;

includes/class-ecwid-sitemap-builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function generate( $page_num ) {
2929
$categories = $api->get_categories(
3030
array(
3131
'offset' => $offset,
32-
'limit' => $limit,
32+
'limit' => $limit
3333
)
3434
);
3535

includes/class-ecwid-static-page.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected static function maybe_fetch_data() {
142142
}
143143
}
144144

145-
if ( ! ecwid_is_demo_store() ) {
145+
if ( self::is_need_use_new_endpoint() ) {
146146
$query_params['baseUrl'] = get_permalink();
147147

148148
$query_params['getStaticContent'] = 'true';
@@ -253,6 +253,7 @@ protected static function process_page_status( $data, $cache_key = null ) {
253253

254254
if( $data->status === 'NONCANONICAL' ) {
255255
$permalink = get_permalink();
256+
$permalink = trailingslashit( $permalink );
256257
wp_redirect( $permalink . $data->canonicalSlug, 301 );
257258
exit;
258259
}
@@ -270,7 +271,7 @@ protected static function process_page_status( $data, $cache_key = null ) {
270271

271272
protected static function get_static_snapshot( $endpoint_params, $query_params, $dynamic_css = '' ) {
272273

273-
if ( ! ecwid_is_demo_store() ) {
274+
if ( self::is_need_use_new_endpoint() ) {
274275
$api = new Ecwid_Api_V3();
275276
$data = $api->get_storefront_widget_page( $query_params );
276277

@@ -335,6 +336,16 @@ protected static function get_static_snapshot( $endpoint_params, $query_params,
335336
return null;
336337
}
337338

339+
protected static function is_need_use_new_endpoint() {
340+
$is_token_valid = Ecwid_Api_V3::get_api_status() === Ecwid_Api_V3::API_STATUS_OK;
341+
342+
if ( ! ecwid_is_demo_store() && Ecwid_Seo_Links::is_slugs_without_ids_enabled() && $is_token_valid ) {
343+
return true;
344+
}
345+
346+
return false;
347+
}
348+
338349
protected static function get_cache_key( $query_params, $endpoint_params ) {
339350
return serialize( array_merge( $query_params, $endpoint_params ) );
340351
}
@@ -471,6 +482,10 @@ public static function is_enabled_static_home_page() {
471482
return false;
472483
}
473484

485+
if ( isset( $store_page_params['show_root_categories'] ) && $store_page_params['show_root_categories'] === false ) {
486+
return false;
487+
}
488+
474489
if ( array_key_exists( 'ec-enable-static-page', $_GET ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
475490
return true;
476491
}

js/admin-menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ function ecwidApplyIframeAdminMenu($link, menu) {
7979
}
8080

8181
if (jQuery(this).hasClass('current')) {
82-
if (slug != 'ec-store-admin-products') {
83-
return false;
84-
}
82+
// if (slug != 'ec-store-admin-products') {
83+
return false;
84+
// }
8585
}
8686

8787
if (ecwid_params.is_demo_store) {

lib/ecwid_api_v3.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function get_categories( $input_params ) {
168168
$params['parent'] = $input_params['parent'];
169169
}
170170

171-
$passthru = array( 'offset', 'limit', 'parent', 'baseUrl', 'cleanUrls', 'hidden_categories', 'responseFields' );
171+
$passthru = array( 'offset', 'limit', 'parent', 'baseUrl', 'cleanUrls', 'hidden_categories', 'responseFields', 'slugsWithoutIds', 'slugsWithoutIds' );
172172
foreach ( $passthru as $name ) {
173173
if ( array_key_exists( $name, $input_params ) ) {
174174
$params[ $name ] = $input_params[ $name ];
@@ -183,6 +183,10 @@ public function get_categories( $input_params ) {
183183
$params['cleanUrls'] = 'true';
184184
}
185185

186+
if ( Ecwid_Seo_Links::is_slugs_without_ids_enabled() ) {
187+
$params['slugsWithoutIds'] = 'true';
188+
}
189+
186190
$options = $this->build_request_headers();
187191

188192
$url = $this->build_request_url(
@@ -261,6 +265,10 @@ public function get_category( $category_id ) {
261265
$params['cleanUrls'] = 'true';
262266
}
263267

268+
if ( Ecwid_Seo_Links::is_slugs_without_ids_enabled() ) {
269+
$params['slugsWithoutIds'] = 'true';
270+
}
271+
264272
$options = $this->build_request_headers();
265273

266274
$url = $this->build_request_url(
@@ -319,6 +327,10 @@ public function get_product( $product_id ) {
319327
$params['cleanUrls'] = 'false';
320328
}
321329

330+
if ( Ecwid_Seo_Links::is_slugs_without_ids_enabled() ) {
331+
$params['slugsWithoutIds'] = 'true';
332+
}
333+
322334
$options = $this->build_request_headers();
323335

324336
$url = $this->build_request_url(
@@ -350,7 +362,7 @@ public function get_product( $product_id ) {
350362
public function search_products( $input_params ) {
351363
$params = array();
352364

353-
$passthru = array( 'updatedFrom', 'offset', 'limit', 'sortBy', 'keyword', 'baseUrl', 'cleanUrls', 'category', 'productId' );
365+
$passthru = array( 'updatedFrom', 'offset', 'limit', 'sortBy', 'keyword', 'baseUrl', 'cleanUrls', 'category', 'productId', 'slugsWithoutIds' );
354366
foreach ( $passthru as $name ) {
355367
if ( array_key_exists( $name, $input_params ) ) {
356368
$params[ $name ] = (string) $input_params[ $name ];
@@ -365,6 +377,10 @@ public function search_products( $input_params ) {
365377
$params['cleanUrls'] = 'true';
366378
}
367379

380+
if ( Ecwid_Seo_Links::is_slugs_without_ids_enabled() ) {
381+
$params['slugsWithoutIds'] = 'true';
382+
}
383+
368384
$params['enabled'] = 'true';
369385

370386
if ( EcwidPlatform::get( 'hide_out_of_stock' ) ) {
@@ -450,7 +466,7 @@ public function get_deleted_products( $input_params ) {
450466
public function get_products( $input_params ) {
451467
$params = array();
452468

453-
$passthru = array( 'updatedFrom', 'offset', 'limit', 'sortBy', 'keyword', 'createdFrom', 'createdTo', 'sku', 'enabled', 'responseFields' );
469+
$passthru = array( 'updatedFrom', 'offset', 'limit', 'sortBy', 'keyword', 'createdFrom', 'createdTo', 'sku', 'enabled', 'responseFields', 'slugsWithoutIds' );
454470

455471
foreach ( $passthru as $name ) {
456472
if ( array_key_exists( $name, $input_params ) ) {

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Tags: ecommerce, e-commerce, storefront, shopping cart, online store
44
License: GPLv2 or later
55
License URI: https://www.gnu.org/licenses/gpl-2.0.html
66
Requires at least: 4.4
7-
Tested up to: 6.7
8-
Stable tag: 7.0
7+
Tested up to: 6.8
8+
Stable tag: 7.0.1
99

1010
Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support.
1111

@@ -153,6 +153,11 @@ You can use Ecwid’s built-in import tools to copy your store products from any
153153
* [Ecwid Help Center](http://help.ecwid.com "Ecwid Help")
154154

155155
== Changelog ==
156+
= 7.0.1 - Apr 8, 2025 =
157+
- **WordPress 6.8 compatibility.** The new WordPress version will be released soon. 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.8.
158+
- Added support for URLs without ID feature in the sitemap and store menus.
159+
- Fixed an issue where storefront URLs were missing a slash in certain cases when the URLs without ID feature was enabled.
160+
156161
= 7.0 - Mar 26, 2025 =
157162
- **New clean and SEO-friendly URLs for your product and category pages—no more random numbers!** We’ve introduced a new format for product and category page links. Now, you can remove those auto-generated numbers, making them cleaner and better for SEO. For example, instead of `/shoes-c123`, your URL slug can simply be `/shoes`! To activate this feature, go to "WordPress admin → Ecwid → Storefront", scroll down, and enable "Set URL slugs without IDs for products and categories". If you’re on a Business or Unlimited plan, you can also customize product and category slugs however you like for a more personalized and SEO-friendly URL.
158163

templates/admin/legacy-connect.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<li>
3333
<h4><?php echo esc_html( sprintf( __( 'Register at %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h4>
3434
<div>
35-
<?php echo esc_html( sprintf( __( 'Create a new %s account which you will use to manage your store and inventory. The registration is free.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
35+
<?php echo esc_html( sprintf( __( 'Create a new %s account which you will use to manage your store and inventory.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
3636
</div>
3737
<div class="ecwid-account-buttons">
3838

templates/admin/welcome-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
} else {
4444
echo wp_kses_post(
4545
sprintf(
46-
__( 'To add your store to your website, put your %1$s Store ID in the field below. If you don\'t have an %1$s account yet, create one for free on the <a %2$s>%1$s website</a>.', 'ecwid-shopping-cart' ),
46+
__( 'To add your store to your website, put your %1$s Store ID in the field below. If you don\'t have an %1$s account yet, create one on the <a %2$s>%1$s website</a>.', 'ecwid-shopping-cart' ),
4747
Ecwid_Config::get_brand(),
4848
'href="' . esc_attr( ecwid_get_register_link() ) . '" target="_blank"'
4949
)

0 commit comments

Comments
 (0)