Ecwid Ecommerce Shopping Cart - Version 2.3.1

Version Description

  • Automatic generation of the rel="canonical" links for SEO. Canonical links are aimed to specify the preferred (canonical) URL of the web page for search engines to prevent possible duplicate content issues. Ecwid plugin now generates such links automatically for product and categories pages in your store to provide search crawlers with well-structured content and help them better index your store.
  • Improved compatibility with CloudFlare Rocket Loader. The merchants who use CloudFlare Rocket Loader extensions on their sites might previously experience issues with loading of their Ecwid stores. We've further improved the plugin code to prevent such issues in the future. Now Ecwid plugin should perfectly work with CloudFlare extensions.
  • Several minor fixes and enhancements
Download this release

Release Info

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

Code changes from version 2.3 to 2.3.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: 2.3
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -45,13 +45,14 @@ if ( is_admin() ){
45
  add_action('init', 'ecwid_backward_compatibility');
46
  add_action('send_headers', 'ecwid_503_on_store_closed');
47
  add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
48
- add_action('wp_loaded', 'ecwid_seo_ultimate_compatibility', 0);
49
  add_action('wp_title', 'ecwid_seo_compatibility_init', 0);
50
  add_filter('wp_title', 'ecwid_seo_title', 20);
51
  add_action('plugins_loaded', 'ecwid_minifier_compatibility', 0);
52
  add_action('wp_head', 'ecwid_meta_description', 0);
53
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
54
  add_action('wp_head', 'ecwid_meta');
 
55
  add_action('wp_head', 'ecwid_seo_compatibility_restore', 1000);
56
  add_filter( 'widget_meta_poweredby', 'ecwid_add_credits');
57
  add_filter('the_content', 'ecwid_content_started', 0);
@@ -63,6 +64,22 @@ $ecwid_script_rendered = false; // controls single script.js on page
63
 
64
  $version = get_bloginfo('version');
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  if (version_compare($version, '3.6') < 0) {
67
  /**
68
  * A copy of has_shortcode functionality from wordpress 3.6
@@ -269,7 +286,7 @@ function ecwid_seo_ultimate_compatibility()
269
  {
270
  global $seo_ultimate;
271
 
272
- if ($seo_ultimate) {
273
  remove_action('template_redirect', array($seo_ultimate->modules['titles'], 'before_header'), 0);
274
  remove_action('wp_head', array($seo_ultimate->modules['titles'], 'after_header'), 1000);
275
  remove_action('su_head', array($seo_ultimate->modules['meta-descriptions'], 'head_tag_output'));
@@ -413,6 +430,18 @@ function ecwid_meta() {
413
  }
414
  }
415
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  function ecwid_meta_description() {
417
 
418
  $allowed = ecwid_is_api_enabled() && isset($_GET['_escaped_fragment_']);
@@ -550,10 +579,10 @@ function ecwid_content_started($content)
550
 
551
  function ecwid_wrap_shortcode_content($content)
552
  {
553
- return "<!-- Ecwid shopping cart plugin v 2.3 -->"
554
  . ecwid_get_scriptjs_code()
555
  . "<div>$content</div>"
556
- . "<!-- END Ecwid Shopping Cart v 2.3 -->";
557
  }
558
 
559
  function ecwid_get_scriptjs_code($force_lang = null) {
@@ -562,7 +591,7 @@ function ecwid_get_scriptjs_code($force_lang = null) {
562
  if (!$ecwid_script_rendered) {
563
  $store_id = get_ecwid_store_id();
564
  $force_lang_str = !is_null($force_lang) ? "&lang=$force_lang" : '';
565
- $s = '<script type="text/javascript" data-cfasync="false" src="//' . APP_ECWID_COM . '/script.js?' . $store_id . $force_lang_str . '"></script>';
566
  $s = $s . ecwid_sso();
567
  $ecwid_script_rendered = true;
568
 
@@ -716,7 +745,8 @@ function ecwid_productbrowser_shortcode($shortcode_params) {
716
  }
717
 
718
  $s = <<<EOT
719
- <script type="text/javascript"> xProductBrowser("categoriesPerRow=$ecwid_pb_categoriesperrow","views=grid($ecwid_pb_productspercolumn_grid,$ecwid_pb_productsperrow_grid) list($ecwid_pb_productsperpage_list) table($ecwid_pb_productsperpage_table)","categoryView=$ecwid_pb_defaultview","searchView=$ecwid_pb_searchview","style="$ecwid_default_category_str);</script>
 
720
  {$plain_content}
721
  EOT;
722
  return ecwid_wrap_shortcode_content($s);
@@ -1062,18 +1092,6 @@ class EcwidBadgeWidget extends WP_Widget {
1062
  'height' => '20',
1063
  'alt' => __('Ecwid shopping cart widget', 'ecwid-shopping-cart')
1064
  ),
1065
- 'ecwid-shopping-cart-2' => array (
1066
- 'name' => 'ecwid-shopping-cart-3',
1067
- 'width' => '165',
1068
- 'height' => '56',
1069
- 'alt' => __('Ecwid shopping cart', 'ecwid-shopping-cart')
1070
- ),
1071
- 'ecwid-ecommerce-widgets-2' => array (
1072
- 'name' => 'ecwid-ecommerce-widgets-3',
1073
- 'width' => '165',
1074
- 'height' => '58',
1075
- 'alt' => __('Ecwid e-commerce widgets', 'ecwid-shopping-cart')
1076
- ),
1077
  'ecwid-ecommerce-solution-2' => array (
1078
  'name' => 'ecwid-ecommerce-solution-2',
1079
  'width' => '165',
@@ -1098,6 +1116,18 @@ class EcwidBadgeWidget extends WP_Widget {
1098
  'height' => '58',
1099
  'alt' => __('Ecwid e-commerce widgets', 'ecwid-shopping-cart')
1100
  ),
 
 
 
 
 
 
 
 
 
 
 
 
1101
  'ecwid-ecommerce-solution-3' => array (
1102
  'name' => 'ecwid-ecommerce-solution-3',
1103
  'width' => '165',
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: 2.3.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
45
  add_action('init', 'ecwid_backward_compatibility');
46
  add_action('send_headers', 'ecwid_503_on_store_closed');
47
  add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
48
+ add_action('wp', 'ecwid_seo_ultimate_compatibility', 0);
49
  add_action('wp_title', 'ecwid_seo_compatibility_init', 0);
50
  add_filter('wp_title', 'ecwid_seo_title', 20);
51
  add_action('plugins_loaded', 'ecwid_minifier_compatibility', 0);
52
  add_action('wp_head', 'ecwid_meta_description', 0);
53
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
54
  add_action('wp_head', 'ecwid_meta');
55
+ add_action('wp_head', 'ecwid_canonical');
56
  add_action('wp_head', 'ecwid_seo_compatibility_restore', 1000);
57
  add_filter( 'widget_meta_poweredby', 'ecwid_add_credits');
58
  add_filter('the_content', 'ecwid_content_started', 0);
64
 
65
  $version = get_bloginfo('version');
66
 
67
+ function ecwid_add_breadcrumbs_navxt($trail)
68
+ {
69
+ $breadcrumb = new bcn_breadcrumb('Ecwid', '', '', 'http://ecwid.com');
70
+ $trail->add($breadcrumb);
71
+ }
72
+
73
+ function ecwid_add_breadcrumb_links_wpseo($links)
74
+ {
75
+ return array_merge((array)$links, array(
76
+ array(
77
+ 'text' => 'ecwid.com',
78
+ 'url' => 'http://ecwid.com'
79
+ )
80
+ ));
81
+ }
82
+
83
  if (version_compare($version, '3.6') < 0) {
84
  /**
85
  * A copy of has_shortcode functionality from wordpress 3.6
286
  {
287
  global $seo_ultimate;
288
 
289
+ if ($seo_ultimate && ecwid_page_has_productbrowser()) {
290
  remove_action('template_redirect', array($seo_ultimate->modules['titles'], 'before_header'), 0);
291
  remove_action('wp_head', array($seo_ultimate->modules['titles'], 'after_header'), 1000);
292
  remove_action('su_head', array($seo_ultimate->modules['meta-descriptions'], 'head_tag_output'));
430
  }
431
  }
432
 
433
+ function ecwid_canonical() {
434
+ $allowed = ecwid_is_api_enabled() && isset($_GET['_escaped_fragment_']);
435
+ if (!$allowed) return;
436
+
437
+ $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
438
+ if (!$params) return;
439
+
440
+ if (!in_array($params['mode'], array('category', 'product')) || !isset($params['id'])) return;
441
+
442
+ echo '<link rel="canonical" href="' . get_permalink() . '#!/~/' . $params['mode'] . '/id=' . $params['id'] . '" />' . PHP_EOL;
443
+ }
444
+
445
  function ecwid_meta_description() {
446
 
447
  $allowed = ecwid_is_api_enabled() && isset($_GET['_escaped_fragment_']);
579
 
580
  function ecwid_wrap_shortcode_content($content)
581
  {
582
+ return "<!-- Ecwid shopping cart plugin v 2.3.1 -->"
583
  . ecwid_get_scriptjs_code()
584
  . "<div>$content</div>"
585
+ . "<!-- END Ecwid Shopping Cart v 2.3.1 -->";
586
  }
587
 
588
  function ecwid_get_scriptjs_code($force_lang = null) {
591
  if (!$ecwid_script_rendered) {
592
  $store_id = get_ecwid_store_id();
593
  $force_lang_str = !is_null($force_lang) ? "&lang=$force_lang" : '';
594
+ $s = '<script data-cfasync="false" type="text/javascript" src="//' . APP_ECWID_COM . '/script.js?' . $store_id . '&data_platform=wporg' . $force_lang_str . '"></script>';
595
  $s = $s . ecwid_sso();
596
  $ecwid_script_rendered = true;
597
 
745
  }
746
 
747
  $s = <<<EOT
748
+ <div id="ecwid-store-$store_id"></div>
749
+ <script type="text/javascript"> xProductBrowser("categoriesPerRow=$ecwid_pb_categoriesperrow","views=grid($ecwid_pb_productspercolumn_grid,$ecwid_pb_productsperrow_grid) list($ecwid_pb_productsperpage_list) table($ecwid_pb_productsperpage_table)","categoryView=$ecwid_pb_defaultview","searchView=$ecwid_pb_searchview","style="$ecwid_default_category_str, "id=ecwid-store-$store_id");</script>
750
  {$plain_content}
751
  EOT;
752
  return ecwid_wrap_shortcode_content($s);
1092
  'height' => '20',
1093
  'alt' => __('Ecwid shopping cart widget', 'ecwid-shopping-cart')
1094
  ),
 
 
 
 
 
 
 
 
 
 
 
 
1095
  'ecwid-ecommerce-solution-2' => array (
1096
  'name' => 'ecwid-ecommerce-solution-2',
1097
  'width' => '165',
1116
  'height' => '58',
1117
  'alt' => __('Ecwid e-commerce widgets', 'ecwid-shopping-cart')
1118
  ),
1119
+ 'ecwid-shopping-cart-3' => array (
1120
+ 'name' => 'ecwid-shopping-cart-3',
1121
+ 'width' => '165',
1122
+ 'height' => '56',
1123
+ 'alt' => __('Ecwid shopping cart', 'ecwid-shopping-cart')
1124
+ ),
1125
+ 'ecwid-ecommerce-widgets-3' => array (
1126
+ 'name' => 'ecwid-ecommerce-widgets-3',
1127
+ 'width' => '165',
1128
+ 'height' => '58',
1129
+ 'alt' => __('Ecwid e-commerce widgets', 'ecwid-shopping-cart')
1130
+ ),
1131
  'ecwid-ecommerce-solution-3' => array (
1132
  'name' => 'ecwid-ecommerce-solution-3',
1133
  'width' => '165',
lib/EcwidCatalog.php CHANGED
@@ -181,11 +181,12 @@ class EcwidCatalog
181
  {
182
  foreach ($categories as $category)
183
  {
184
- $category_url = $this->build_url($category["url"]);
 
185
  $category_name = $category["name"];
186
  $return .= sprintf(
187
  '<div class="ecwid_catalog_category_name"><a href="%s">%s</a></div>' . PHP_EOL,
188
- esc_attr($category_url . '&offset=0&sort=nameAsc'),
189
  esc_html($category_name)
190
  );
191
  }
@@ -195,7 +196,7 @@ class EcwidCatalog
195
  {
196
  foreach ($products as $product)
197
  {
198
- $product_url = $this->store_base_url . "#!/~/product/category=" . $id . "&id=" . $product["id"];
199
  $this->build_url($product["url"]);
200
  $product_name = $product["name"];
201
  $product_price = $product["price"] . "&nbsp;" . $profile["currency"];
181
  {
182
  foreach ($categories as $category)
183
  {
184
+ $category_url = $this->build_url($this->store_base_url . "#!/~/category/id=" . $category["id"]);
185
+
186
  $category_name = $category["name"];
187
  $return .= sprintf(
188
  '<div class="ecwid_catalog_category_name"><a href="%s">%s</a></div>' . PHP_EOL,
189
+ esc_attr($category_url),
190
  esc_html($category_name)
191
  );
192
  }
196
  {
197
  foreach ($products as $product)
198
  {
199
+ $product_url = $this->store_base_url . "#!/~/product/id=" . $product["id"];
200
  $this->build_url($product["url"]);
201
  $product_name = $product["name"];
202
  $product_price = $product["price"] . "&nbsp;" . $profile["currency"];
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid Team
3
  Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
4
  Requires at least: 2.8
5
  Tested up to: 3.8
6
- Stable tag: 2.3
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
@@ -78,6 +78,11 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
78
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
79
 
80
  == Changelog ==
 
 
 
 
 
81
  = 2.3 =
82
  - Added compatibility with Google XML Sitemaps plugin. Now you can submit your store items links along with the other site pages to search engines. To use this feature, please install the "Google XML Sitemaps" plugin (http://wordpress.org/plugins/google-sitemap-generator/), generate a sitemap (it will include your products and categories links) and submit it to the search engines to help them better crawl and categorize your site.
83
 
3
  Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
4
  Requires at least: 2.8
5
  Tested up to: 3.8
6
+ Stable tag: 2.3.1
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
78
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
79
 
80
  == Changelog ==
81
+ = 2.3.1 =
82
+ - Automatic generation of the rel="canonical" links for SEO. Canonical links are aimed to specify the preferred (canonical) URL of the web page for search engines to prevent possible duplicate content issues. Ecwid plugin now generates such links automatically for product and categories pages in your store to provide search crawlers with well-structured content and help them better index your store.
83
+ - Improved compatibility with CloudFlare Rocket Loader. The merchants who use CloudFlare Rocket Loader extensions on their sites might previously experience issues with loading of their Ecwid stores. We've further improved the plugin code to prevent such issues in the future. Now Ecwid plugin should perfectly work with CloudFlare extensions.
84
+ - Several minor fixes and enhancements
85
+
86
  = 2.3 =
87
  - Added compatibility with Google XML Sitemaps plugin. Now you can submit your store items links along with the other site pages to search engines. To use this feature, please install the "Google XML Sitemaps" plugin (http://wordpress.org/plugins/google-sitemap-generator/), generate a sitemap (it will include your products and categories links) and submit it to the search engines to help them better crawl and categorize your site.
88
 
templates/general-settings-initial.php CHANGED
@@ -41,7 +41,7 @@
41
  </a>
42
  </div>
43
  <div class="note">
44
- <?php _e('You will be able to sign up through your exising Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
45
  </div>
46
  </li>
47
  <li>
41
  </a>
42
  </div>
43
  <div class="note">
44
+ <?php _e('You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
45
  </div>
46
  </li>
47
  <li>