Ecwid Ecommerce Shopping Cart - Version 6.2.1

Version Description

  • Aug 8, 2018 =

  • New Main storefront page selector in the plugin advanced settings. If you have your storefront added to several pages on your site, you can now choose the main storefront page in the plugin settings (Ecwid Advanced). This will define where the store navigation menus and sidebar widgets should be linked to. If you have a single online store page (which is totally OK), this new option wont be displayed.

  • New warning messages for the sites with outdated TLS. Ecwid is a PCI DSS level 1 certified ecommerce provider, which is a gold security standard for e-commerce solutions. Put it simply, when you use Ecwid, you have a bank level of online payments security in your online store. One of the requirements to make sure Ecwid merchants can securely process payments on their site is to use up-to-date TLS software on the server where your site is hosted. If your store dashboard doesnt load in your Wordpress admin backend or you see a warning message saying that the Ecwid plugin cannot connect to the Ecwid API, thats most likely caused by outdated TLS on your hosting. We recommend contacting your hosting in such case. If everything works fine and no warning message appears, that means no action is required from your side.

  • Minor improvements in the store dashboard in the WordPress admin backend. We improved the scroll behavior on the store admin dashboard pages and fixed a couple minor issues in the Ecwid menu items in the WordPress admin backend.

  • Fixed an issue with store popup appearing on protected pages before the password is entered. Some online sellers add their store catalog on protected pages on their ecommerce site to restrict access to it for some particular group of customers (e.g. wholesale membership). There was an issue with store catalog appearing in a popup on such pages we fixed that.

  • Fixed an issue in the Add store button in the WordPress page editor. There was a bug that made the store widgets appear at the top of the page when you use the Add store button in the classic Wordpress editor. We fixed it, it should work fine now.

  • Minor fixes and improvements.

Download this release

Release Info

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

Code changes from version 6.2 to 6.2.1

css/admin.css CHANGED
@@ -20,6 +20,11 @@
20
  background-image: url(../images/icon-sidebar-active.png);
21
  }
22
 
 
 
 
 
 
23
  .ecwid-settings h2 {
24
  background:url(../images/icon-title.png) no-repeat 0% 50%;
25
  padding-left: 43px;
20
  background-image: url(../images/icon-sidebar-active.png);
21
  }
22
 
23
+
24
+ .toplevel_page_ec-store #wpcontent .ecwid-message {
25
+ margin-left: 20px;
26
+ }
27
+
28
  .ecwid-settings h2 {
29
  background:url(../images/icon-title.png) no-repeat 0% 50%;
30
  padding-left: 43px;
css/legacy-connect.css ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .general-settings {
2
+ font-size: 14px;
3
+ max-width: 750px;
4
+ padding-bottom: 15px;
5
+ }
6
+
7
+ .general-settings .greeting-box {
8
+ height: 141px;
9
+ padding-bottom: 12px;
10
+ }
11
+
12
+ .general-settings .greeting-box .image-container {
13
+ padding-right: 20px;
14
+ }
15
+
16
+ .general-settings .greeting-box > div {
17
+ display: table-cell;
18
+ vertical-align: middle;
19
+ }
20
+
21
+ .general-settings .greeting-box .main-message {
22
+ font-size: 22px;
23
+ font-weight: bold;
24
+ line-height: 22px;
25
+ }
26
+
27
+ .general-settings .greeting-box .secondary-message {
28
+ font-size: 17px;
29
+ padding-top: 13px;
30
+ line-height: 23px;
31
+ }
32
+
33
+ .general-settings ol {
34
+ margin-top: 30px;
35
+ padding-left: 10px;
36
+ list-style-position: inside;
37
+ }
38
+
39
+ .general-settings ol li {
40
+ font-size: 20px;
41
+ margin-bottom: 34px;
42
+ font-weight: bold;
43
+ padding-top: 10px;
44
+ }
45
+
46
+ .general-settings ol li * {
47
+ color: #333333;
48
+ font-size:14px;
49
+ font-weight: normal;
50
+ }
51
+
52
+ .general-settings ol li h4 {
53
+ font-size: 20px;
54
+ font-weight: bold;
55
+ margin: 0px 0px 12px;
56
+ display: inline-block;
57
+ }
58
+
59
+ .general-settings .ecwid-account-buttons .pure-button {
60
+ margin: 5px 17px 5px 0px;
61
+ }
62
+
63
+ .general-settings .ecwid-account-buttons {
64
+ padding: 20px 0px 10px;
65
+ margin-bottom: -5px;
66
+ }
67
+
68
+ .general-settings p.note {
69
+ font-weight: bold;
70
+ }
71
+
72
+ .ecwid-settings .note {
73
+ font-size: 11px;
74
+ color: #A0A0A0;
75
+ display: inline-block;
76
+ line-height: 16px;
77
+ }
78
+
79
+
80
+ .general-settings input[type=text] {
81
+ height: 34px;
82
+ font-size: 14px;
83
+ }
84
+
85
+ .general-settings .find-store-id-in-cp {
86
+ line-height: 18px;
87
+ margin-bottom: 15px;
88
+ }
89
+
90
+ .general-settings .find-store-id-in-cp em {
91
+ color: #246fba;
92
+ font-style: normal;
93
+ }
94
+
95
+ .general-settings #ecwid_store_id {
96
+ position: relative;
97
+ top: 2px;
98
+ width: 153px;
99
+ }
100
+
101
+ .pure-button {
102
+ display: inline-block;
103
+ line-height: 32px;
104
+ text-decoration: none;
105
+ }
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: 6.2
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
@@ -102,6 +102,9 @@ if (get_option('ecwid_last_oauth_fail_time') > 0) {
102
  }
103
  $ecwid_script_rendered = false; // controls single script.js on page
104
 
 
 
 
105
  require_once ECWID_PLUGIN_DIR . 'includes/themes.php';
106
  require_once ECWID_PLUGIN_DIR . 'includes/oembed.php';
107
  require_once ECWID_PLUGIN_DIR . 'includes/widgets.php';
@@ -114,6 +117,7 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-oauth.php';
114
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
115
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-config.php';
116
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin.php';
 
117
 
118
  if ( is_admin() ) {
119
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
@@ -124,8 +128,6 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-ajax-defer-renderer.php';
124
 
125
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-store-page.php';
126
 
127
- require_once ECWID_PLUGIN_DIR . 'lib/ecwid_platform.php';
128
- require_once ECWID_PLUGIN_DIR . 'lib/ecwid_api_v3.php';
129
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_product.php';
130
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_category.php';
131
 
@@ -318,8 +320,6 @@ function ecwid_add_deactivation_popup()
318
  }
319
 
320
  function ecwid_enqueue_frontend() {
321
-
322
-
323
  global $ecwid_current_theme;
324
 
325
  if ( $ecwid_current_theme && $ecwid_current_theme->historyjs_html4mode || get_option('ecwid_historyjs_html4mode') ) {
@@ -525,7 +525,7 @@ function ecwid_backward_compatibility() {
525
  function ecwid_build_sitemap($callback)
526
  {
527
 
528
- if ( !ecwid_is_paid_account() || !ecwid_is_store_page_available() ) return;
529
 
530
  $page_id = Ecwid_Store_Page::get_current_store_page_id();
531
 
@@ -678,6 +678,7 @@ function ecwid_check_version()
678
  delete_option('ecwid_store_page_id_auto');
679
  }
680
 
 
681
  flush_rewrite_rules();
682
  }
683
 
@@ -951,7 +952,7 @@ TEXT;
951
  "id" => "ecwid-faq",
952
  "title" => __("Read FAQ", 'ecwid-shopping-cart'),
953
  "parent" => "ecwid-main",
954
- 'href' => __('https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-', 'ecwid-shopping-cart'),
955
  'meta' => array(
956
  'target' => '_blank'
957
  )
@@ -973,6 +974,11 @@ function ecwid_content_has_productbrowser( $content ) {
973
 
974
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
975
 
 
 
 
 
 
976
  if ($result) {
977
  return $result;
978
  }
@@ -994,7 +1000,6 @@ function ecwid_content_has_productbrowser( $content ) {
994
  }
995
 
996
  }
997
-
998
 
999
  return $result;
1000
  }
@@ -1449,8 +1454,13 @@ function ecwid_get_scriptjs_params( $force_lang = null ) {
1449
  $params .= '&data_rpw=1';
1450
  }
1451
 
1452
- if (!Ecwid_Api_V3::get_token()) {
1453
- $params .= '&data_no_apiv3=1';
 
 
 
 
 
1454
  }
1455
 
1456
  require_once ECWID_PLUGIN_DIR . '/includes/importer/importer.php';
@@ -1986,17 +1996,20 @@ function ecwid_register_admin_styles($hook_suffix) {
1986
 
1987
  wp_enqueue_style('ecwid-admin-css', ECWID_PLUGIN_URL . 'css/admin.css', array(), get_option('ecwid_plugin_version'));
1988
  wp_enqueue_style('ecwid-fonts-css', ECWID_PLUGIN_URL . 'css/fonts.css', array(), get_option('ecwid_plugin_version'));
1989
-
1990
  if (isset($_GET['page']) && strpos($_GET['page'], 'ec-store') === 0) {
1991
 
1992
- if ( ecwid_is_demo_store( get_option('ecwid_store_id') ) ) {
 
1993
  // Open dashboard for the first time, ecwid store id is set to demo => need landing styles/scripts
1994
  wp_enqueue_script('ecwid-landing-js', ECWID_PLUGIN_URL . 'js/landing.js', array(), get_option('ecwid_plugin_version'));
1995
  wp_localize_script('ecwid-landing-js', 'ecwidParams', array(
1996
  'registerLink' => ecwid_get_register_link(),
1997
  'isWL' => Ecwid_Config::is_wl()
1998
- ));
 
1999
  if (ecwid_use_old_landing()) {
 
2000
  wp_enqueue_style('ecwid-landing-css', ECWID_PLUGIN_URL . 'css/landing_old.css', array(), get_option('ecwid_plugin_version'), 'all');
2001
  } else {
2002
  wp_enqueue_style('ecwid-landing-css', ECWID_PLUGIN_URL . 'css/landing.css', array(), get_option('ecwid_plugin_version'), 'all');
@@ -2066,19 +2079,24 @@ function ecwid_settings_api_init() {
2066
  if ($_POST['settings_section'] == 'advanced' && !@$_POST['ecwid_is_sso_enabled']) {
2067
  update_option('ecwid_sso_secret_key', '');
2068
  }
 
 
 
 
2069
  }
2070
 
2071
- if (isset($_POST['ecwid_store_id'])) {
2072
  update_option('ecwid_is_api_enabled', 'off');
2073
  update_option('ecwid_api_check_time', 0);
2074
  update_option('ecwid_last_oauth_fail_time', 0);
 
2075
  }
2076
 
2077
 
2078
  }
2079
 
2080
  function ecwid_common_admin_scripts() {
2081
-
2082
  ecwid_get_demo_store_id();
2083
  wp_enqueue_script('ecwid-admin-js', ECWID_PLUGIN_URL . 'js/admin.js', array(), get_option('ecwid_plugin_version'));
2084
  wp_enqueue_script('ecwid-modernizr-js', ECWID_PLUGIN_URL . 'js/modernizr.js', array(), get_option('ecwid_plugin_version'));
@@ -2103,7 +2121,7 @@ function ecwid_common_admin_scripts() {
2103
  function ecwid_is_legacy_appearance_used() {
2104
  $api = new Ecwid_Api_V3();
2105
 
2106
- return !$api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
2107
  }
2108
 
2109
  function ecwid_get_register_link()
@@ -2206,35 +2224,28 @@ function ecwid_create_store() {
2206
  }
2207
 
2208
  function ecwid_general_settings_do_page() {
 
 
2209
  $store_id = get_option( 'ecwid_store_id' );
2210
 
2211
  $connection_error = isset( $_GET['connection_error'] );
2212
 
2213
- if ( ecwid_is_demo_store() && !Ecwid_Config::overrides_token() ) {
2214
  $no_oauth = @$_GET['oauth'] == 'no';
2215
 
2216
  $there_was_oauth_error = isset( $connection_error ) && $no_oauth;
2217
- $customer_returned_from_creating_store_at_ecwid =
2218
- EcwidPlatform::cache_get( 'user_was_redirected_to_ecwid_site_to_create_account' );
2219
 
2220
  $no_reg_wl = Ecwid_Config::is_no_reg_wl();
2221
-
2222
- if ( $there_was_oauth_error || $customer_returned_from_creating_store_at_ecwid || $no_reg_wl) {
2223
- EcwidPlatform::cache_reset( 'user_was_redirected_to_ecwid_site_to_create_account' );
2224
- require_once ECWID_PLUGIN_DIR . 'templates/connect.php';
2225
- } else {
2226
- $register = ! $connection_error && ! isset( $_GET['connect'] ) && ! @$_COOKIE['ecwid_create_store_clicked'];
2227
 
2228
- $api = new Ecwid_Api_V3();
2229
- global $current_user;
2230
 
2231
- if ( ecwid_use_old_landing() ) {
2232
- require_once( ECWID_PLUGIN_DIR . '/templates/landing_old.php' );
2233
- } else if ($api->does_store_exist($current_user->user_email)) {
2234
- require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
2235
- } else {
2236
- require_once( ECWID_PLUGIN_DIR . '/templates/landing.php' );
2237
- }
2238
  }
2239
  } else {
2240
  global $ecwid_oauth;
@@ -2289,9 +2300,9 @@ function ecwid_get_admin_sso_url( $time, $page = '' ) {
2289
  }
2290
 
2291
  $lang = ecwid_get_current_user_locale();
2292
-
2293
  return sprintf(
2294
- 'https://' . Ecwid_Config::get_cpanel_domain() . '/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&place=%s&lang=%s',
2295
  get_ecwid_store_id(),
2296
  Ecwid_Api_V3::get_token(),
2297
  $time,
@@ -2301,7 +2312,6 @@ function ecwid_get_admin_sso_url( $time, $page = '' ) {
2301
  );
2302
  }
2303
 
2304
-
2305
  function ecwid_get_iframe_src($time, $page)
2306
  {
2307
  $url = ecwid_get_admin_sso_url($time, $page);
@@ -2388,7 +2398,7 @@ function ecwid_admin_do_page( $page ) {
2388
  $result = $request->do_request();
2389
  }
2390
 
2391
- if (empty($result['code']) && empty($result['data'])) {
2392
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
2393
  } else if ($result['code'] != 200) {
2394
  if (ecwid_test_oauth(true)) {
@@ -2403,16 +2413,22 @@ function ecwid_admin_do_page( $page ) {
2403
 
2404
 
2405
  function ecwid_admin_products_do_page() {
2406
- ecwid_admin_do_page('products');
 
 
2407
  }
2408
 
2409
  function ecwid_admin_orders_do_page() {
2410
- ecwid_admin_do_page('orders');
 
 
2411
  }
2412
 
2413
 
2414
  function ecwid_admin_mobile_do_page() {
2415
- ecwid_admin_do_page('mobile');
 
 
2416
  }
2417
 
2418
  function ecwid_help_do_page() {
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: 6.2.1
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
102
  }
103
  $ecwid_script_rendered = false; // controls single script.js on page
104
 
105
+ require_once ECWID_PLUGIN_DIR . 'lib/ecwid_platform.php';
106
+ require_once ECWID_PLUGIN_DIR . 'lib/ecwid_api_v3.php';
107
+
108
  require_once ECWID_PLUGIN_DIR . 'includes/themes.php';
109
  require_once ECWID_PLUGIN_DIR . 'includes/oembed.php';
110
  require_once ECWID_PLUGIN_DIR . 'includes/widgets.php';
117
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
118
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-config.php';
119
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin.php';
120
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-main-page.php';
121
 
122
  if ( is_admin() ) {
123
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
128
 
129
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-store-page.php';
130
 
 
 
131
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_product.php';
132
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_category.php';
133
 
320
  }
321
 
322
  function ecwid_enqueue_frontend() {
 
 
323
  global $ecwid_current_theme;
324
 
325
  if ( $ecwid_current_theme && $ecwid_current_theme->historyjs_html4mode || get_option('ecwid_historyjs_html4mode') ) {
525
  function ecwid_build_sitemap($callback)
526
  {
527
 
528
+ if ( !Ecwid_Api_V3::is_available() || !ecwid_is_paid_account() || !ecwid_is_store_page_available() ) return;
529
 
530
  $page_id = Ecwid_Store_Page::get_current_store_page_id();
531
 
678
  delete_option('ecwid_store_page_id_auto');
679
  }
680
 
681
+ Ecwid_Api_V3::reset_api_status();
682
  flush_rewrite_rules();
683
  }
684
 
952
  "id" => "ecwid-faq",
953
  "title" => __("Read FAQ", 'ecwid-shopping-cart'),
954
  "parent" => "ecwid-main",
955
+ 'href' => __('https://support.ecwid.com/hc/en-us/articles/360000635709-Customizing-design-of-your-Ecwid-store-on-a-Wordpress-site', 'ecwid-shopping-cart'),
956
  'meta' => array(
957
  'target' => '_blank'
958
  )
974
 
975
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
976
 
977
+
978
+ if ( class_exists( 'Ecwid_Integration_Gutenberg' ) && strpos( $content, Ecwid_Integration_Gutenberg::STORE_BLOCK ) !== false ) {
979
+ return true;
980
+ }
981
+
982
  if ($result) {
983
  return $result;
984
  }
1000
  }
1001
 
1002
  }
 
1003
 
1004
  return $result;
1005
  }
1454
  $params .= '&data_rpw=1';
1455
  }
1456
 
1457
+ if ( Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_TLS ) {
1458
+ $params .= '&data_api_disabled_tls=1';
1459
+ }
1460
+
1461
+
1462
+ if ( Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_OTHER ) {
1463
+ $params .= '&data_api_disabled=1';
1464
  }
1465
 
1466
  require_once ECWID_PLUGIN_DIR . '/includes/importer/importer.php';
1996
 
1997
  wp_enqueue_style('ecwid-admin-css', ECWID_PLUGIN_URL . 'css/admin.css', array(), get_option('ecwid_plugin_version'));
1998
  wp_enqueue_style('ecwid-fonts-css', ECWID_PLUGIN_URL . 'css/fonts.css', array(), get_option('ecwid_plugin_version'));
1999
+
2000
  if (isset($_GET['page']) && strpos($_GET['page'], 'ec-store') === 0) {
2001
 
2002
+ if ( ecwid_is_demo_store( get_option('ecwid_store_id' ) ) ) {
2003
+
2004
  // Open dashboard for the first time, ecwid store id is set to demo => need landing styles/scripts
2005
  wp_enqueue_script('ecwid-landing-js', ECWID_PLUGIN_URL . 'js/landing.js', array(), get_option('ecwid_plugin_version'));
2006
  wp_localize_script('ecwid-landing-js', 'ecwidParams', array(
2007
  'registerLink' => ecwid_get_register_link(),
2008
  'isWL' => Ecwid_Config::is_wl()
2009
+ )
2010
+ );
2011
  if (ecwid_use_old_landing()) {
2012
+
2013
  wp_enqueue_style('ecwid-landing-css', ECWID_PLUGIN_URL . 'css/landing_old.css', array(), get_option('ecwid_plugin_version'), 'all');
2014
  } else {
2015
  wp_enqueue_style('ecwid-landing-css', ECWID_PLUGIN_URL . 'css/landing.css', array(), get_option('ecwid_plugin_version'), 'all');
2079
  if ($_POST['settings_section'] == 'advanced' && !@$_POST['ecwid_is_sso_enabled']) {
2080
  update_option('ecwid_sso_secret_key', '');
2081
  }
2082
+
2083
+ if ($_POST['settings_section'] == 'advanced' && $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] && in_array( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID], Ecwid_Store_Page::get_store_pages_array() ) ) {
2084
+ Ecwid_Store_Page::update_main_store_page_id( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] );
2085
+ }
2086
  }
2087
 
2088
+ if ( isset( $_POST['ecwid_store_id'] ) ) {
2089
  update_option('ecwid_is_api_enabled', 'off');
2090
  update_option('ecwid_api_check_time', 0);
2091
  update_option('ecwid_last_oauth_fail_time', 0);
2092
+ update_option( 'ecwid_connected_via_legacy_page_time', time() );
2093
  }
2094
 
2095
 
2096
  }
2097
 
2098
  function ecwid_common_admin_scripts() {
2099
+
2100
  ecwid_get_demo_store_id();
2101
  wp_enqueue_script('ecwid-admin-js', ECWID_PLUGIN_URL . 'js/admin.js', array(), get_option('ecwid_plugin_version'));
2102
  wp_enqueue_script('ecwid-modernizr-js', ECWID_PLUGIN_URL . 'js/modernizr.js', array(), get_option('ecwid_plugin_version'));
2121
  function ecwid_is_legacy_appearance_used() {
2122
  $api = new Ecwid_Api_V3();
2123
 
2124
+ return Ecwid_Api_V3::get_token() && !$api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
2125
  }
2126
 
2127
  function ecwid_get_register_link()
2224
  }
2225
 
2226
  function ecwid_general_settings_do_page() {
2227
+
2228
+ return;
2229
  $store_id = get_option( 'ecwid_store_id' );
2230
 
2231
  $connection_error = isset( $_GET['connection_error'] );
2232
 
2233
+ if ( ecwid_is_demo_store() && !Ecwid_Config::overrides_token() ) {
2234
  $no_oauth = @$_GET['oauth'] == 'no';
2235
 
2236
  $there_was_oauth_error = isset( $connection_error ) && $no_oauth;
 
 
2237
 
2238
  $no_reg_wl = Ecwid_Config::is_no_reg_wl();
 
 
 
 
 
 
2239
 
2240
+ global $current_user;
2241
+ $api = new Ecwid_Api_V3();
2242
 
2243
+ if ( $there_was_oauth_error || $no_reg_wl || $api->does_store_exist( $current_user->user_email ) ) {
2244
+ require_once ECWID_PLUGIN_DIR . 'templates/connect.php';
2245
+ } else {
2246
+ $register = ! $connection_error && ! isset( $_GET['connect'] );
2247
+
2248
+ require_once( ECWID_PLUGIN_DIR . '/templates/landing.php' );
 
2249
  }
2250
  } else {
2251
  global $ecwid_oauth;
2300
  }
2301
 
2302
  $lang = ecwid_get_current_user_locale();
2303
+
2304
  return sprintf(
2305
+ 'https://' . Ecwid_Config::get_api_domain() . '/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&place=%s&lang=%s',
2306
  get_ecwid_store_id(),
2307
  Ecwid_Api_V3::get_token(),
2308
  $time,
2312
  );
2313
  }
2314
 
 
2315
  function ecwid_get_iframe_src($time, $page)
2316
  {
2317
  $url = ecwid_get_admin_sso_url($time, $page);
2398
  $result = $request->do_request();
2399
  }
2400
 
2401
+ if (empty($result['code']) && empty($result['data']) ) {
2402
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
2403
  } else if ($result['code'] != 200) {
2404
  if (ecwid_test_oauth(true)) {
2413
 
2414
 
2415
  function ecwid_admin_products_do_page() {
2416
+ Ecwid_Admin_Main_Page::do_integrated_admin_page(
2417
+ Ecwid_Admin_Main_Page::PAGE_PRODUCTS
2418
+ );
2419
  }
2420
 
2421
  function ecwid_admin_orders_do_page() {
2422
+ Ecwid_Admin_Main_Page::do_integrated_admin_page(
2423
+ Ecwid_Admin_Main_Page::PAGE_ORDERS
2424
+ );
2425
  }
2426
 
2427
 
2428
  function ecwid_admin_mobile_do_page() {
2429
+ Ecwid_Admin_Main_Page::do_integrated_admin_page(
2430
+ Ecwid_Admin_Main_Page::PAGE_MOBILE
2431
+ );
2432
  }
2433
 
2434
  function ecwid_help_do_page() {
includes/class-ecwid-admin-main-page.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ define( 'ECWID_ADMIN_TEMPLATES_DIR', ECWID_PLUGIN_DIR . '/templates/admin' );
4
+
5
+ class Ecwid_Admin_Main_Page
6
+ {
7
+ const PAGE_DASHBOARD = 'dashboard';
8
+ const PAGE_PRODUCTS = 'products';
9
+ const PAGE_ORDERS = 'orders';
10
+ const PAGE_MOBILE = 'mobile';
11
+
12
+ public function do_page()
13
+ {
14
+ if ( $this->_is_forced_reconnect() ) {
15
+ ecwid_update_store_id(0);
16
+
17
+ wp_redirect( 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG );
18
+ }
19
+
20
+ $is_demo = ecwid_is_demo_store();
21
+ $is_api_connection_ok = !Ecwid_Api_V3::connection_fails();
22
+
23
+ if ( $is_demo && $is_api_connection_ok ) {
24
+
25
+ if (
26
+ $this->_is_whitelabel_mode_with_no_registration()
27
+ || $this->_is_oauth_error()
28
+ || $this->_is_current_user_email_registered_at_ecwid()
29
+ ) {
30
+
31
+ $this->_do_simple_connect_page();
32
+ return;
33
+
34
+ } else {
35
+
36
+ $this->_do_fancy_connect_page();
37
+ return;
38
+ }
39
+ }
40
+
41
+
42
+ if ( $is_demo && !$is_api_connection_ok ) {
43
+
44
+ $this->_do_legacy_connect_page();
45
+ return;
46
+ }
47
+
48
+ if ( !$is_demo ) {
49
+
50
+ if ( $this->_is_connect_error() ) {
51
+
52
+ $this->_do_simple_reconnect_page();
53
+ return;
54
+
55
+ } else if (
56
+ !$is_api_connection_ok
57
+ || Ecwid_Admin::disable_dashboard()
58
+ ) {
59
+ $this->_do_simple_dashboard_page();
60
+ return;
61
+
62
+ } else {
63
+
64
+ $this->_do_integrated_admin_page();
65
+ return;
66
+ }
67
+ }
68
+ }
69
+
70
+ public static function uses_integrated_admin()
71
+ {
72
+ $page = new Ecwid_Admin_Main_Page();
73
+
74
+ return
75
+ !ecwid_is_demo_store()
76
+ && !$page->_is_connect_error()
77
+ && !Ecwid_Api_V3::connection_fails()
78
+ && !Ecwid_Admin::disable_dashboard();
79
+ }
80
+
81
+ public static function do_integrated_admin_page( $page = self::PAGE_DASHBOARD )
82
+ {
83
+ $this_obj = new Ecwid_Admin_Main_Page();
84
+ $this_obj->_do_integrated_admin_page( $page );
85
+ }
86
+
87
+ public function _do_integrated_admin_page( $page = self::PAGE_DASHBOARD )
88
+ {
89
+ if (isset($_GET['show_timeout']) && $_GET['show_timeout'] == '1') {
90
+ require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
91
+ die();
92
+ }
93
+
94
+ if (Ecwid_Api_V3::get_token() == false) {
95
+ require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
96
+ die();
97
+ }
98
+
99
+ global $ecwid_oauth;
100
+
101
+ if (isset($_GET['ec-page']) && $_GET['ec-page']) {
102
+ $page = $_GET['ec-page'];
103
+ }
104
+
105
+ if (isset($_GET['ec-store-page']) && $_GET['ec-store-page']) {
106
+ $page = $_GET['ec-store-page'];
107
+ }
108
+
109
+ if ($page == ecwid_get_admin_iframe_upgrade_page()) {
110
+ update_option('ecwid_api_check_time', time() - ECWID_API_AVAILABILITY_CHECK_TIME + 10 * 60);
111
+ }
112
+
113
+ if ($page == 'dashboard') {
114
+ $show_reconnect = true;
115
+ }
116
+
117
+ $time = time() - get_option('ecwid_time_correction', 0);
118
+
119
+ $iframe_src = ecwid_get_iframe_src($time, $page);
120
+
121
+ $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
122
+
123
+ if (!$request) {
124
+ echo Ecwid_Message_Manager::show_message('no_oauth');
125
+ return;
126
+ }
127
+
128
+ $result = $request->do_request();
129
+
130
+ if ( @$result['code'] == 403 && (
131
+ strpos($result['data'], 'Token too old') !== false
132
+ || strpos($result['data'], 'window.top.location = \'https://my.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?') !== false
133
+ )
134
+ ) {
135
+
136
+ if (isset($result['headers']['date'])) {
137
+ $time = strtotime($result['headers']['date']);
138
+
139
+ $iframe_src = ecwid_get_iframe_src($time, $page);
140
+
141
+ $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
142
+ if (!$request) {
143
+ echo Ecwid_Message_Manager::show_message('no_oauth');
144
+ return;
145
+ }
146
+ $result = $request->do_request();
147
+
148
+ if ($result['code'] == 200) {
149
+ update_option('ecwid_time_correction', time() - $time);
150
+ }
151
+ }
152
+
153
+ $iframe_src = ecwid_get_iframe_src($time, $page);
154
+
155
+ $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
156
+ $result = $request->do_request();
157
+ }
158
+
159
+ if (empty($result['code']) && empty($result['data']) ) {
160
+ require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
161
+ } else if ($result['code'] != 200) {
162
+ if (ecwid_test_oauth(true)) {
163
+ require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
164
+ } else {
165
+ require_once ECWID_PLUGIN_DIR . 'templates/dashboard.php';
166
+ }
167
+ } else {
168
+ require_once ECWID_PLUGIN_DIR . 'templates/ecwid-admin.php';
169
+ }
170
+ }
171
+
172
+ protected function _do_simple_dashboard_page()
173
+ {
174
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/simple-dashboard.php';
175
+ }
176
+
177
+ protected function _do_simple_connect_page()
178
+ {
179
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/simple-connect.tpl.php';
180
+ }
181
+
182
+ protected function _do_simple_reconnect_page()
183
+ {
184
+
185
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/simple-reconnect.tpl.php';
186
+ }
187
+
188
+ protected function _do_fancy_connect_page()
189
+ {
190
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/landing.tpl.php';
191
+ }
192
+
193
+ protected function _do_legacy_connect_page()
194
+ {
195
+ wp_enqueue_style('legacy-connect', ECWID_PLUGIN_URL . '/css/legacy-connect.css');
196
+
197
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/legacy-connect.tpl.php';
198
+ }
199
+
200
+ protected function _is_whitelabel_mode_with_no_registration()
201
+ {
202
+ return Ecwid_Config::is_no_reg_wl();
203
+ }
204
+
205
+ protected function _is_oauth_error()
206
+ {
207
+ $connection_error = isset( $_GET['connection_error'] );
208
+ $no_oauth = @$_GET['oauth'] == 'no';
209
+
210
+ return isset( $connection_error ) && $no_oauth;
211
+ }
212
+
213
+ protected function _is_current_user_email_registered_at_ecwid()
214
+ {
215
+ $api = new Ecwid_Api_V3();
216
+ $current_user = wp_get_current_user();
217
+
218
+ return $api->does_store_exist( $current_user->user_email );
219
+ }
220
+
221
+ protected function _is_forced_reconnect()
222
+ {
223
+ return isset( $_GET['reconnect'] );
224
+ }
225
+
226
+ protected function _is_connect_error()
227
+ {
228
+ return isset( $_GET['connection_error'] );
229
+ }
230
+ }
231
+
232
+ $_ecwid_admin_main_page = new Ecwid_Admin_Main_Page();
includes/class-ecwid-admin.php CHANGED
@@ -37,12 +37,14 @@ class Ecwid_Admin {
37
  {
38
  $is_newbie = ecwid_is_demo_store();
39
 
 
 
40
  add_menu_page(
41
  sprintf(__('%s shopping cart settings', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
42
  sprintf(__('%s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
43
  'manage_options',
44
  self::ADMIN_SLUG,
45
- 'ecwid_general_settings_do_page',
46
  '',
47
  '2.562347345'
48
  );
@@ -64,9 +66,9 @@ class Ecwid_Admin {
64
  }
65
 
66
  global $ecwid_oauth;
67
- if (!$is_newbie && $ecwid_oauth->has_scope('allow_sso') && !self::disable_dashboard() ) {
68
 
69
- if ( !self::are_auto_menus_enabled() ){
70
  add_submenu_page(
71
  self::ADMIN_SLUG,
72
  __('Sales', 'ecwid-shopping-cart'),
@@ -121,7 +123,7 @@ class Ecwid_Admin {
121
  }
122
  }
123
 
124
- if (!$is_newbie || (isset($_GET['page']) && $_GET['page'] == 'ecwid-advanced')) {
125
  add_submenu_page(
126
  self::ADMIN_SLUG,
127
  __('Advanced settings', 'ecwid-shopping-cart'),
@@ -256,7 +258,7 @@ class Ecwid_Admin {
256
  $menu_item['title'] = stripslashes($item['title']);
257
 
258
  if ( @$item['type'] != 'separator' ) {
259
- $slug = $this->_slugify_ecwid_cp_hash( $item['path'], $item['title'], $slugs );
260
  $menu_item['url'] = 'admin.php?page=' . $slug;
261
  $menu_item['slug'] = $slug;
262
  $menu_item['hash'] = $item['path'];
@@ -267,7 +269,7 @@ class Ecwid_Admin {
267
 
268
  if ( @$item['items'] ) foreach ( $item['items'] as $item2 ) {
269
 
270
- $slug2 = $this->_slugify_ecwid_cp_hash( $item2['path'], $item2['title'], $slugs );
271
  $slugs[] = $slug2;
272
  $item2['url'] = 'admin.php?page=' . $slug2;
273
  $item2['slug'] = $slug2;
@@ -283,18 +285,15 @@ class Ecwid_Admin {
283
  return $result;
284
  }
285
 
286
- protected function _slugify_ecwid_cp_hash( $hash, $title, $slugs ) {
287
 
288
  if ( strpos( $hash, ':' ) === false && !in_array( self::ADMIN_SLUG . '-admin-' . $hash, $slugs ) ) {
289
  $slug = $hash;
290
  } else {
291
  $match = array();
292
 
293
- if ( function_exists( 'mb_strtolower' ) ) {
294
- $slug = mb_strtolower( $title );
295
- } else {
296
- $slug = strtolower( $title );
297
- }
298
  $result = preg_match_all( '#[\p{L}0-9\-_]+#u', $slug, $match );
299
 
300
  if ( $result && count( @$match[0] ) > 0 ) {
@@ -375,6 +374,7 @@ class Ecwid_Admin {
375
  }
376
 
377
  static public function disable_dashboard() {
 
378
  if ( !isset( $_GET['reconnect'] ) ) {
379
  if ( get_option( 'ecwid_disable_dashboard' ) == 'on' ) {
380
  return true;
@@ -382,6 +382,8 @@ class Ecwid_Admin {
382
  return true;
383
  }
384
  }
 
 
385
  }
386
  }
387
 
37
  {
38
  $is_newbie = ecwid_is_demo_store();
39
 
40
+ $page = new Ecwid_Admin_Main_Page();
41
+
42
  add_menu_page(
43
  sprintf(__('%s shopping cart settings', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
44
  sprintf(__('%s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
45
  'manage_options',
46
  self::ADMIN_SLUG,
47
+ array( $page, 'do_page' ),
48
  '',
49
  '2.562347345'
50
  );
66
  }
67
 
68
  global $ecwid_oauth;
69
+ if (!$is_newbie && $ecwid_oauth->has_scope('allow_sso') && Ecwid_Api_V3::is_available() ) {
70
 
71
+ if ( !self::are_auto_menus_enabled() ) {
72
  add_submenu_page(
73
  self::ADMIN_SLUG,
74
  __('Sales', 'ecwid-shopping-cart'),
123
  }
124
  }
125
 
126
+ if ( Ecwid_Api_V3::is_available() && !$is_newbie || (isset($_GET['page']) && $_GET['page'] == 'ecwid-advanced')) {
127
  add_submenu_page(
128
  self::ADMIN_SLUG,
129
  __('Advanced settings', 'ecwid-shopping-cart'),
258
  $menu_item['title'] = stripslashes($item['title']);
259
 
260
  if ( @$item['type'] != 'separator' ) {
261
+ $slug = $this->_slugify_ecwid_cp_hash( $item['path'], $slugs );
262
  $menu_item['url'] = 'admin.php?page=' . $slug;
263
  $menu_item['slug'] = $slug;
264
  $menu_item['hash'] = $item['path'];
269
 
270
  if ( @$item['items'] ) foreach ( $item['items'] as $item2 ) {
271
 
272
+ $slug2 = $this->_slugify_ecwid_cp_hash( $item2['path'], $slugs );
273
  $slugs[] = $slug2;
274
  $item2['url'] = 'admin.php?page=' . $slug2;
275
  $item2['slug'] = $slug2;
285
  return $result;
286
  }
287
 
288
+ protected function _slugify_ecwid_cp_hash( $hash, $slugs ) {
289
 
290
  if ( strpos( $hash, ':' ) === false && !in_array( self::ADMIN_SLUG . '-admin-' . $hash, $slugs ) ) {
291
  $slug = $hash;
292
  } else {
293
  $match = array();
294
 
295
+ $slug = $hash;
296
+
 
 
 
297
  $result = preg_match_all( '#[\p{L}0-9\-_]+#u', $slug, $match );
298
 
299
  if ( $result && count( @$match[0] ) > 0 ) {
374
  }
375
 
376
  static public function disable_dashboard() {
377
+
378
  if ( !isset( $_GET['reconnect'] ) ) {
379
  if ( get_option( 'ecwid_disable_dashboard' ) == 'on' ) {
380
  return true;
382
  return true;
383
  }
384
  }
385
+
386
+ return false;
387
  }
388
  }
389
 
includes/class-ecwid-config.php CHANGED
@@ -64,6 +64,7 @@ class Ecwid_Config {
64
  }
65
 
66
  public static function get_oauth_appsecret() {
 
67
  return EcwidPlatform::get( self::OAUTH_APPSECRET, Ecwid_Api_V3::CLIENT_SECRET );
68
  }
69
 
64
  }
65
 
66
  public static function get_oauth_appsecret() {
67
+
68
  return EcwidPlatform::get( self::OAUTH_APPSECRET, Ecwid_Api_V3::CLIENT_SECRET );
69
  }
70
 
includes/class-ecwid-floating-minicart.php CHANGED
@@ -27,6 +27,8 @@ if ( version_compare( get_bloginfo('version'), '4.0' ) >= 0 ) {
27
 
28
  public function display()
29
  {
 
 
30
  $display = get_option(self::OPTION_WIDGET_DISPLAY);
31
 
32
  if (!array_key_exists($display, self::get_display_options())) {
27
 
28
  public function display()
29
  {
30
+ if ( post_password_required() ) return;
31
+
32
  $display = get_option(self::OPTION_WIDGET_DISPLAY);
33
 
34
  if (!array_key_exists($display, self::get_display_options())) {
includes/class-ecwid-integration-aiosp.php CHANGED
@@ -7,6 +7,10 @@ class Ecwid_Integration_All_In_One_SEO_Pack
7
 
8
  public function __construct()
9
  {
 
 
 
 
10
  add_action( 'wp', array( $this, 'disable_seo_if_needed' ) );
11
 
12
  add_filter( 'aiosp_sitemap_extra', array( $this, 'aiosp_hook_sitemap_extra' ) );
7
 
8
  public function __construct()
9
  {
10
+ if ( !Ecwid_Api_V3::is_available() ) {
11
+ return;
12
+ }
13
+
14
  add_action( 'wp', array( $this, 'disable_seo_if_needed' ) );
15
 
16
  add_filter( 'aiosp_sitemap_extra', array( $this, 'aiosp_hook_sitemap_extra' ) );
includes/class-ecwid-integration-wpseo.php CHANGED
@@ -9,10 +9,14 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
9
 
10
  public function __construct()
11
  {
 
 
 
 
12
  add_action( 'wp', array( $this, 'disable_seo_on_escaped_fragment' ) );
13
  add_action( 'template_redirect', array( $this, 'disable_rewrite_titles' ) );
14
 
15
- if (ecwid_is_paid_account() && ecwid_is_store_page_available()) {
16
  add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
17
  add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
18
  if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
9
 
10
  public function __construct()
11
  {
12
+ if ( !Ecwid_Api_V3::is_available() ) {
13
+ return;
14
+ }
15
+
16
  add_action( 'wp', array( $this, 'disable_seo_on_escaped_fragment' ) );
17
  add_action( 'template_redirect', array( $this, 'disable_rewrite_titles' ) );
18
 
19
+ if ( ecwid_is_paid_account() && ecwid_is_store_page_available()) {
20
  add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
21
  add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
22
  if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
includes/class-ecwid-message-manager.php CHANGED
@@ -5,10 +5,12 @@ class Ecwid_Message_Manager
5
  protected $messages = array();
6
 
7
  const MSG_WOO_IMPORT_ONBOARDING = 'connected_woo';
8
-
9
  protected function __construct()
10
  {
11
  $this->init_messages();
 
 
12
  }
13
 
14
  public static function show_messages()
@@ -244,6 +246,26 @@ TXT
244
  'primary_url' => admin_url( 'admin-post.php?action=ec_connect&reconnect' ),
245
  'hideable' => true
246
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  );
248
 
249
  if ( class_exists( 'Ecwid_Import_Page' ) ) {
@@ -331,6 +353,20 @@ TXT
331
  }
332
 
333
  return $result;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
335
  }
336
 
5
  protected $messages = array();
6
 
7
  const MSG_WOO_IMPORT_ONBOARDING = 'connected_woo';
8
+
9
  protected function __construct()
10
  {
11
  $this->init_messages();
12
+
13
+ add_action( 'ecwid_connected_via_legacy_page', array( $this, 'on_connected_via_legacy_page' ) );
14
  }
15
 
16
  public static function show_messages()
246
  'primary_url' => admin_url( 'admin-post.php?action=ec_connect&reconnect' ),
247
  'hideable' => true
248
  ),
249
+
250
+ 'api_failed_tls' => array(
251
+ 'title' => __( 'Warning: some of your online store features are disabled.', 'ecwid-shopping-cart' ),
252
+ 'message' => sprintf( __( 'This Wordpress site doesn\'t seem to be able to connect to the Ecwid servers. Your store is working and your products can be purchased from your site. But some features are disabled including SEO, product sidebar widgets, advanced site menu and store navigation. This is caused by your server misconfiguration — it is using deprecated tools (TLS 1.0) to communicate with the %1$s APIs. This can be fixed by your hosting provider by updating server software to the latest version.'
253
+ , 'ecwid-shopping-cart' ),
254
+ Ecwid_Config::get_brand()
255
+ ),
256
+ 'type' => 'warning',
257
+ 'hideable' => false
258
+ ),
259
+
260
+ 'api_failed_other' => array(
261
+ 'title' => __( 'Warning: some of your online store features are disabled.', 'ecwid-shopping-cart' ),
262
+ 'message' => sprintf( __( 'This Wordpress site doesn\'t seem to be able to connect to the %1$s servers. Your store is working and your products can be purchased from your site, but some features are disabled, including SEO, product sidebar widgets, advanced site menu and store navigation. This is likely caused by your server misconfiguration and can be fixed by your hosting provider. Here is a more techy description of the problem, which you can send to your hosting provider: "The Wordpress function wp_remote_post() failed to connect a remote server because of some error. Seems like HTTP POST requests are disabled on this server".'
263
+ , 'ecwid-shopping-cart' ),
264
+ Ecwid_Config::get_brand()
265
+ ),
266
+ 'type' => 'warning',
267
+ 'hideable' => false
268
+ )
269
  );
270
 
271
  if ( class_exists( 'Ecwid_Import_Page' ) ) {
353
  }
354
 
355
  return $result;
356
+
357
+ case 'api_failed_tls':
358
+ return
359
+ !ecwid_is_demo_store()
360
+ && get_current_screen()->parent_base == Ecwid_Admin::ADMIN_SLUG
361
+ && Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_TLS
362
+ && time() - get_option( 'ecwid_connected_via_legacy_page_time' ) > 15 * MINUTE_IN_SECONDS;
363
+
364
+ case 'api_failed_other':
365
+ return
366
+ !ecwid_is_demo_store()
367
+ && get_current_screen()->parent_base == Ecwid_Admin::ADMIN_SLUG
368
+ && Ecwid_Api_V3::get_api_status() == Ecwid_Api_V3::API_STATUS_ERROR_OTHER
369
+ && time() - get_option( 'ecwid_connected_via_legacy_page_time' ) > 15 * MINUTE_IN_SECONDS;
370
  }
371
  }
372
 
includes/class-ecwid-oauth.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
 
3
- include ECWID_PLUGIN_DIR . "lib/phpseclib/AES.php";
4
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_api_v3.php';
5
 
6
  class Ecwid_OAuth {
@@ -72,7 +71,7 @@ class Ecwid_OAuth {
72
 
73
  $scope = $this->_get_scope();
74
 
75
- if (!in_array('create_customers', $scope)) {
76
  $scope[] = 'create_customers';
77
  }
78
 
@@ -123,8 +122,6 @@ class Ecwid_OAuth {
123
  || !isset( $result->access_token )
124
  || ( $result->token_type != 'Bearer' )
125
  ) {
126
- ecwid_log_error(var_export($return, true));
127
-
128
  return $this->trigger_auth_error($reconnect ? 'reconnect' : 'default');
129
  }
130
 
@@ -135,13 +132,10 @@ class Ecwid_OAuth {
135
  update_option( 'ecwid_public_token', $result->public_token );
136
  update_option( self::OPTION_JUST_CONNECTED, true );
137
  EcwidPlatform::cache_reset( 'all_categories' );
138
- $this->api->save_token($result->access_token);
139
 
 
140
 
141
- // Reset "Create store cookie" set previously to display the landing page
142
- //in "Connect" mode rather than "Create" mode
143
- setcookie('ecwid_create_store_clicked', null, strtotime('-1 day'), ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
144
-
145
  if ( isset( $this->state->return_url ) && !empty( $this->state->return_url ) ) {
146
  wp_redirect( admin_url( $this->state->return_url ) );
147
  } else {
@@ -293,20 +287,12 @@ class Ecwid_OAuth {
293
  $this->state->reason = '';
294
  $this->state->mode = self::MODE_CONNECT;
295
  }
296
-
297
- if (isset($_COOKIE['ecwid_create_store_clicked'])) {
298
- $this->state->create_store_clicked = $_COOKIE['ecwid_create_store_clicked'];
299
- }
300
  }
301
 
302
  public function get_state() {
303
  return $this->state;
304
  }
305
 
306
- public function was_create_store_clicked() {
307
- return $this->state->create_store_clicked;
308
- }
309
-
310
  protected function _save_state() {
311
  setcookie('ecwid_oauth_state', json_encode($this->state), strtotime('+1 day'), ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
312
  }
1
  <?php
2
 
 
3
  require_once ECWID_PLUGIN_DIR . 'lib/ecwid_api_v3.php';
4
 
5
  class Ecwid_OAuth {
71
 
72
  $scope = $this->_get_scope();
73
 
74
+ if (!in_array( 'create_customers', $scope ) ) {
75
  $scope[] = 'create_customers';
76
  }
77
 
122
  || !isset( $result->access_token )
123
  || ( $result->token_type != 'Bearer' )
124
  ) {
 
 
125
  return $this->trigger_auth_error($reconnect ? 'reconnect' : 'default');
126
  }
127
 
132
  update_option( 'ecwid_public_token', $result->public_token );
133
  update_option( self::OPTION_JUST_CONNECTED, true );
134
  EcwidPlatform::cache_reset( 'all_categories' );
135
+ Ecwid_Api_V3::reset_api_status();
136
 
137
+ $this->api->save_token($result->access_token);
138
 
 
 
 
 
139
  if ( isset( $this->state->return_url ) && !empty( $this->state->return_url ) ) {
140
  wp_redirect( admin_url( $this->state->return_url ) );
141
  } else {
287
  $this->state->reason = '';
288
  $this->state->mode = self::MODE_CONNECT;
289
  }
 
 
 
 
290
  }
291
 
292
  public function get_state() {
293
  return $this->state;
294
  }
295
 
 
 
 
 
296
  protected function _save_state() {
297
  setcookie('ecwid_oauth_state', json_encode($this->state), strtotime('+1 day'), ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
298
  }
includes/class-ecwid-product-popup.php CHANGED
@@ -7,6 +7,9 @@ class Ecwid_Product_Popup {
7
  if ( version_compare( $version, '3.9' ) < 0 ) {
8
  return;
9
  }
 
 
 
10
 
11
  add_action( 'init', array( $this, 'init' ) );
12
  add_action( 'current_screen', array( $this, 'init_current_screen' ) );
7
  if ( version_compare( $version, '3.9' ) < 0 ) {
8
  return;
9
  }
10
+ if ( !Ecwid_Api_V3::is_available() ) {
11
+ return;
12
+ }
13
 
14
  add_action( 'init', array( $this, 'init' ) );
15
  add_action( 'current_screen', array( $this, 'init_current_screen' ) );
includes/class-ecwid-seo-links.php CHANGED
@@ -200,8 +200,7 @@ class Ecwid_Seo_Links {
200
 
201
  public function add_js_config() {
202
 
203
- global $wp_query;
204
- $page_id = $wp_query->get( 'page_id' );
205
 
206
  $has_store = Ecwid_Store_Page::is_store_page( $page_id );
207
 
@@ -256,12 +255,17 @@ JS;
256
 
257
  foreach ( $all_base_urls as $page_id => $links ) {
258
  $patterns = $this->get_seo_links_patterns();
 
 
 
 
259
 
260
- if ( !in_array( get_post( $page_id )->post_type, array( 'page', 'post' ) ) ) continue;
261
-
262
  foreach ( $links as $link ) {
263
  foreach ( $patterns as $pattern ) {
264
- add_rewrite_rule( '^' . $link . '/' . $pattern . '.*', 'index.php?page_id=' . $page_id, 'top' );
 
265
  }
266
  }
267
  }
@@ -305,6 +309,20 @@ JS;
305
  }
306
  }
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  $are_the_same = array_diff( $flattened, $flattened_saved );
309
 
310
  return empty( $are_the_same ) && $saved_home == $this->is_store_on_home_page();
@@ -323,7 +341,7 @@ JS;
323
  if ( !isset( $base_urls[$page_id] ) ) {
324
  $base_urls[$page_id] = array();
325
  }
326
- $base_urls[$page_id][] = urldecode( get_page_uri( $page_id ) );
327
  }
328
 
329
  if (
@@ -335,7 +353,7 @@ JS;
335
  if ( PLL()->options['force_lang'] == 1 ) {
336
  $patterns = $this->get_seo_links_patterns();
337
  foreach ( $pages as $page_id ) {
338
- $link = urldecode( get_page_uri( $page_id ) );
339
  $language = pll_get_post_language( $page_id );
340
 
341
  if ( !isset( $base_urls[$page_id] ) ) {
@@ -351,6 +369,14 @@ JS;
351
  return $base_urls;
352
  }
353
 
 
 
 
 
 
 
 
 
354
 
355
 
356
  public static function is_enabled() {
200
 
201
  public function add_js_config() {
202
 
203
+ $page_id = get_queried_object_id();
 
204
 
205
  $has_store = Ecwid_Store_Page::is_store_page( $page_id );
206
 
255
 
256
  foreach ( $all_base_urls as $page_id => $links ) {
257
  $patterns = $this->get_seo_links_patterns();
258
+
259
+ $post = get_post( $page_id );
260
+ if ( ! $post ) continue;
261
+ if ( !in_array( $post->post_type, array( 'page', 'post' ) ) ) continue;
262
 
263
+ $param_name = $post->post_type == 'page' ? 'page_id' : 'p';
264
+
265
  foreach ( $links as $link ) {
266
  foreach ( $patterns as $pattern ) {
267
+ $link = trim( $link, '/' );
268
+ add_rewrite_rule( '^' . $link . '/' . $pattern . '.*', 'index.php?' . $param_name . '=' . $page_id, 'top' );
269
  }
270
  }
271
  }
309
  }
310
  }
311
 
312
+ $rules = get_option( 'rewrite_rules' );
313
+ foreach ( $flattened as $link ) {
314
+ $link = trim( $link, '/' );
315
+
316
+ $patterns = $this->get_seo_links_patterns();
317
+ $pattern = $patterns[0];
318
+
319
+ $rules_pattern = '^' . $link . '/' . $pattern . '.*';
320
+
321
+ if ( !array_key_exists( $rules_pattern, $rules ) ) {
322
+ return false;
323
+ }
324
+ }
325
+
326
  $are_the_same = array_diff( $flattened, $flattened_saved );
327
 
328
  return empty( $are_the_same ) && $saved_home == $this->is_store_on_home_page();
341
  if ( !isset( $base_urls[$page_id] ) ) {
342
  $base_urls[$page_id] = array();
343
  }
344
+ $base_urls[$page_id][] = urldecode( $this->_get_relative_permalink( $page_id ) );
345
  }
346
 
347
  if (
353
  if ( PLL()->options['force_lang'] == 1 ) {
354
  $patterns = $this->get_seo_links_patterns();
355
  foreach ( $pages as $page_id ) {
356
+ $link = urldecode( $this->_get_relative_permalink( $page_id ) );
357
  $language = pll_get_post_language( $page_id );
358
 
359
  if ( !isset( $base_urls[$page_id] ) ) {
369
  return $base_urls;
370
  }
371
 
372
+ protected function _get_relative_permalink( $item_id ) {
373
+ $permalink = get_permalink( $item_id );
374
+
375
+ $home_url = home_url();
376
+
377
+ return substr( $permalink, strlen( $home_url ) );
378
+ }
379
+
380
 
381
 
382
  public static function is_enabled() {
includes/class-ecwid-store-page.php CHANGED
@@ -191,7 +191,7 @@ class Ecwid_Store_Page {
191
  self::_set_store_pages( $pages );
192
  self::schedule_flush_rewrites();
193
  }
194
-
195
  public static function reset_store_page( $page_id ) {
196
 
197
  $pages = self::get_store_pages_array();
@@ -288,6 +288,13 @@ class Ecwid_Store_Page {
288
  return $result;
289
  }
290
 
 
 
 
 
 
 
 
291
  public static function on_save_post( $post_id ) {
292
 
293
  if ( wp_is_post_revision( $post_id ) )
191
  self::_set_store_pages( $pages );
192
  self::schedule_flush_rewrites();
193
  }
194
+
195
  public static function reset_store_page( $page_id ) {
196
 
197
  $pages = self::get_store_pages_array();
288
  return $result;
289
  }
290
 
291
+ public static function update_main_store_page_id( $new_id ) {
292
+
293
+ if ( self::post_content_has_productbrowser( $new_id ) ) {
294
+ update_option( self::OPTION_MAIN_STORE_PAGE_ID, $new_id );
295
+ }
296
+ }
297
+
298
  public static function on_save_post( $post_id ) {
299
 
300
  if ( wp_is_post_revision( $post_id ) )
includes/shortcodes/class-ecwid-shortcode-product.php CHANGED
@@ -45,15 +45,15 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
45
  $attributes['version'] = 1;
46
  }
47
 
48
- $this->params = $attributes;
49
  }
50
 
51
  public function render_placeholder() {
52
  $widget_parts = array();
53
 
54
- if ($this->params['version'] == 1) {
55
  $widget_parts = $this->_get_widget_parts_v1();
56
- } else if ($this->params['version'] == 2) {
57
  $widget_parts = $this->_get_widget_parts_v2();
58
  }
59
 
@@ -61,13 +61,13 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
61
 
62
  $result = $widget_parts['opening_div'];
63
 
64
- $items = preg_split('![^0-9^a-z^A-Z^\-^_]!', $this->params['display']);
65
 
66
- $product = Ecwid_Product::get_without_loading( $this->params['id'], (object)array('name' => '') );
67
 
68
  if (is_array($items) && count($items) > 0) foreach ($items as $item) {
69
  if (array_key_exists($item, $display_items)) {
70
- if ($this->params['link'] == 'yes' && in_array($item, array('title', 'picture'))) {
71
  $product_link = $product->link;
72
  $result .= '<a href="' . esc_url($product_link) . '">' . $display_items[$item] . '</a>';
73
  } else {
@@ -86,7 +86,7 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
86
  }
87
 
88
  public function get_ecwid_widget_function_name() {
89
- return $this->params['version'] == 1 ? 'xSingleProduct' : 'xProduct';
90
  }
91
 
92
  protected function _get_widget_parts_v1() {
@@ -103,7 +103,7 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
103
  ),
104
  'opening_div' => sprintf('<div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-%d" '
105
  . 'itemscope itemtype="http://schema.org/Product" '
106
- . 'data-single-product-id="%d" id="%s">', $this->params['id'], $this->params['id'], $this->get_html_id())
107
  );
108
  }
109
 
@@ -114,21 +114,21 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
114
  'ecwid',
115
  'ecwid-SingleProduct-v2',
116
  'ecwid-Product',
117
- 'ecwid-Product-' . $this->params['id']
118
  );
119
 
120
- if ($this->params['show_border'] != 0) { // defaults to 1
121
  $bordered_class = '';
122
  $main_div_classes[] = 'ecwid-SingleProduct-v2-bordered';
123
  }
124
 
125
- if ($this->params['center_align'] == 1) { // defaults to 0
126
  $main_div_classes[] = 'ecwid-SingleProduct-v2-centered';
127
  }
128
 
129
  $main_div_class = implode( ' ', $main_div_classes );
130
 
131
- if ($this->params['show_price_on_button'] == 0) { // defaults to 1
132
  $price_location_attributes = '';
133
  }
134
 
@@ -147,7 +147,7 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
147
  ),
148
  'opening_div' => sprintf('<div class="' . $main_div_class . '" '
149
  . 'itemscope itemtype="http://schema.org/Product" data-single-product-id="%d" id="%s">',
150
- $this->params['id'],
151
  $this->get_html_id()
152
  )
153
  );
45
  $attributes['version'] = 1;
46
  }
47
 
48
+ $this->_params = $attributes;
49
  }
50
 
51
  public function render_placeholder() {
52
  $widget_parts = array();
53
 
54
+ if ($this->_params['version'] == 1) {
55
  $widget_parts = $this->_get_widget_parts_v1();
56
+ } else if ($this->_params['version'] == 2) {
57
  $widget_parts = $this->_get_widget_parts_v2();
58
  }
59
 
61
 
62
  $result = $widget_parts['opening_div'];
63
 
64
+ $items = preg_split('![^0-9^a-z^A-Z^\-^_]!', $this->_params['display']);
65
 
66
+ $product = Ecwid_Product::get_without_loading( $this->_params['id'], (object)array('name' => '') );
67
 
68
  if (is_array($items) && count($items) > 0) foreach ($items as $item) {
69
  if (array_key_exists($item, $display_items)) {
70
+ if ($this->_params['link'] == 'yes' && in_array($item, array('title', 'picture'))) {
71
  $product_link = $product->link;
72
  $result .= '<a href="' . esc_url($product_link) . '">' . $display_items[$item] . '</a>';
73
  } else {
86
  }
87
 
88
  public function get_ecwid_widget_function_name() {
89
+ return $this->_params['version'] == 1 ? 'xSingleProduct' : 'xProduct';
90
  }
91
 
92
  protected function _get_widget_parts_v1() {
103
  ),
104
  'opening_div' => sprintf('<div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-%d" '
105
  . 'itemscope itemtype="http://schema.org/Product" '
106
+ . 'data-single-product-id="%d" id="%s">', $this->_params['id'], $this->_params['id'], $this->get_html_id())
107
  );
108
  }
109
 
114
  'ecwid',
115
  'ecwid-SingleProduct-v2',
116
  'ecwid-Product',
117
+ 'ecwid-Product-' . $this->_params['id']
118
  );
119
 
120
+ if ($this->_params['show_border'] != 0) { // defaults to 1
121
  $bordered_class = '';
122
  $main_div_classes[] = 'ecwid-SingleProduct-v2-bordered';
123
  }
124
 
125
+ if ($this->_params['center_align'] == 1) { // defaults to 0
126
  $main_div_classes[] = 'ecwid-SingleProduct-v2-centered';
127
  }
128
 
129
  $main_div_class = implode( ' ', $main_div_classes );
130
 
131
+ if ($this->_params['show_price_on_button'] == 0) { // defaults to 1
132
  $price_location_attributes = '';
133
  }
134
 
147
  ),
148
  'opening_div' => sprintf('<div class="' . $main_div_class . '" '
149
  . 'itemscope itemtype="http://schema.org/Product" data-single-product-id="%d" id="%s">',
150
+ $this->_params['id'],
151
  $this->get_html_id()
152
  )
153
  );
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -38,18 +38,22 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
38
  $plain_content = '';
39
 
40
  $html_catalog_params = false;
41
- if ( ecwid_should_display_escaped_fragment_catalog() ) {
42
- $html_catalog_params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
43
- } elseif ( Ecwid_Seo_Links::is_enabled() && Ecwid_Store_Page::is_store_page() ) {
44
- $html_catalog_params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
45
- }
46
-
47
- $html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
48
 
49
- if ( $html_catalog_params !== false && get_option( 'ecwid_print_html_catalog', 'Y' ) ) {
50
- $plain_content = $this->_build_html_catalog( $store_id, $html_catalog_params );
51
- }
 
 
 
 
52
 
 
 
 
 
 
 
 
53
  $classname = $this->_get_html_class_name();
54
  $result = <<<HTML
55
  <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$html_catalog_params[default_category_id]">
38
  $plain_content = '';
39
 
40
  $html_catalog_params = false;
 
 
 
 
 
 
 
41
 
42
+ if ( !Ecwid_Api_V3::is_available() ) {
43
+
44
+ if (ecwid_should_display_escaped_fragment_catalog()) {
45
+ $html_catalog_params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
46
+ } elseif (Ecwid_Seo_Links::is_enabled() && Ecwid_Store_Page::is_store_page()) {
47
+ $html_catalog_params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
48
+ }
49
 
50
+ $html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
51
+
52
+ if ($html_catalog_params !== false && get_option('ecwid_print_html_catalog', 'Y')) {
53
+ $plain_content = $this->_build_html_catalog($store_id, $html_catalog_params);
54
+ }
55
+ }
56
+
57
  $classname = $this->_get_html_class_name();
58
  $result = <<<HTML
59
  <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$html_catalog_params[default_category_id]">
includes/widgets.php CHANGED
@@ -48,12 +48,15 @@ function ecwid_sidebar_widgets_init() {
48
  }
49
 
50
  register_widget('Ecwid_Widget_Store_Link');
51
- register_widget('Ecwid_Widget_Recently_Viewed');
52
- register_widget('Ecwid_Widget_Latest_Products');
53
-
54
- register_widget('Ecwid_Widget_Vertical_Categories_List');
55
- register_widget('Ecwid_Widget_Random_Product');
56
-
 
 
 
57
  if (ecwid_migrations_is_original_plugin_version_older_than('4.3')) {
58
  register_widget('Ecwid_Widget_VCategories');
59
  }
48
  }
49
 
50
  register_widget('Ecwid_Widget_Store_Link');
51
+
52
+ if ( Ecwid_Api_V3::is_available() ) {
53
+ register_widget('Ecwid_Widget_Recently_Viewed');
54
+ register_widget('Ecwid_Widget_Latest_Products');
55
+
56
+ register_widget('Ecwid_Widget_Vertical_Categories_List');
57
+ register_widget('Ecwid_Widget_Random_Product');
58
+ }
59
+
60
  if (ecwid_migrations_is_original_plugin_version_older_than('4.3')) {
61
  register_widget('Ecwid_Widget_VCategories');
62
  }
includes/widgets/class-ecwid-widget-nsf-minicart.php CHANGED
@@ -49,9 +49,9 @@ class Ecwid_Widget_NSF_Minicart extends WP_Widget {
49
 
50
  $new_instance = wp_parse_args( (array) $new_instance, array(
51
  self::FIELD_TITLE => '',
52
- self::FIELD_LAYOUT => 'BIG_ICON_DETAILS_SUBTOTAL',
53
  self::FIELD_ICON => 'BAG',
54
- self::FIELD_FIXED_SHAPE => '',
55
  ) );
56
 
57
  $new_instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
49
 
50
  $new_instance = wp_parse_args( (array) $new_instance, array(
51
  self::FIELD_TITLE => '',
52
+ self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
53
  self::FIELD_ICON => 'BAG',
54
+ self::FIELD_FIXED_SHAPE => 'RECT',
55
  ) );
56
 
57
  $new_instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
js/landing.js CHANGED
@@ -1,9 +1,3 @@
1
- switch_to_connect = function() {
2
- jQuery('.ecwid-landing').removeClass('register').addClass('connect');
3
- jQuery('.ecwid-thank-step-one').addClass('active');
4
- wpCookies.set('ecwid_create_store_clicked', 1);
5
- }
6
-
7
  hide_on_loading = '.create-store-button, .create-store-have-account-question';
8
  invisible_on_loading = '.create-store-have-account-link';
9
  show_on_loading = '.create-store-loading, .create-store-loading-note';
 
 
 
 
 
 
1
  hide_on_loading = '.create-store-button, .create-store-have-account-question';
2
  invisible_on_loading = '.create-store-have-account-link';
3
  show_on_loading = '.create-store-loading, .create-store-loading-note';
js/store-editor-page.js CHANGED
@@ -282,6 +282,9 @@ jQuery(document).ready(function() {
282
  } else {
283
 
284
  if (tinymce.activeEditor && !tinymce.activeEditor.isHidden()) {
 
 
 
285
  tinymce.activeEditor.execCommand('mceInsertContent', false, stringToInsert);
286
  tinymce.activeEditor.execCommand('mceSetContent', false, tinymce.activeEditor.getBody().innerHTML);
287
  } else {
@@ -359,6 +362,8 @@ ecwid_open_store_popup = function() {
359
  if (tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden()) {
360
  tinyMCE.activeEditor.save();
361
 
 
 
362
  var content = jQuery(tinyMCE.activeEditor.getBody())
363
  .find('.ecwid-store-editor')
364
  .attr('data-ecwid-shortcode');
282
  } else {
283
 
284
  if (tinymce.activeEditor && !tinymce.activeEditor.isHidden()) {
285
+ if ($popup.data('range')) {
286
+ tinymce.activeEditor.selection.setRng($popup.data('range'));
287
+ }
288
  tinymce.activeEditor.execCommand('mceInsertContent', false, stringToInsert);
289
  tinymce.activeEditor.execCommand('mceSetContent', false, tinymce.activeEditor.getBody().innerHTML);
290
  } else {
362
  if (tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden()) {
363
  tinyMCE.activeEditor.save();
364
 
365
+ $popup.data('range', tinyMCE.activeEditor.selection.getRng());
366
+
367
  var content = jQuery(tinyMCE.activeEditor.getBody())
368
  .find('.ecwid-store-editor')
369
  .attr('data-ecwid-shortcode');
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -36,7 +36,7 @@ msgstr "Посмотреть FAQ"
36
 
37
  #: ecwid-shopping-cart.php:881
38
  msgid ""
39
- "https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-"
40
  msgstr "https://support.ecwid.com/hc/ru/articles/207101259-Wordpress-ORG"
41
 
42
  #: ecwid-shopping-cart.php:890
@@ -1692,7 +1692,11 @@ msgstr "Витрина магазина"
1692
  msgid "Displays storefront: product listing and checkout"
1693
  msgstr "Показывает витрину магазина, корзину и оформление заказа"
1694
 
 
 
1695
 
 
 
1696
 
1697
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1698
  #. Plugin URI of the plugin/theme
36
 
37
  #: ecwid-shopping-cart.php:881
38
  msgid ""
39
+ "https://support.ecwid.com/hc/en-us/articles/360000635709-Customizing-design-of-your-Ecwid-store-on-a-Wordpress-site"
40
  msgstr "https://support.ecwid.com/hc/ru/articles/207101259-Wordpress-ORG"
41
 
42
  #: ecwid-shopping-cart.php:890
1692
  msgid "Displays storefront: product listing and checkout"
1693
  msgstr "Показывает витрину магазина, корзину и оформление заказа"
1694
 
1695
+ msgid "Main storefront page"
1696
+ msgstr "Главная страница магазина"
1697
 
1698
+ msgid "You have your storefront added to several pages on your site. You can choose the main storefront page here — the store navigation menus and sidebar widgets will open it."
1699
+ msgstr "Вы добавили витрину магазина на несколько страниц сайта. С помощью этой настройки вы можете выбрать, какую из страниц считать главной витриной — на неё будут ссылаться пункты меню и сайдбар-виджеты."
1700
 
1701
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1702
  #. Plugin URI of the plugin/theme
lib/ecwid_api_v3.php CHANGED
@@ -11,12 +11,30 @@ class Ecwid_Api_V3
11
 
12
  const PROFILE_CACHE_NAME = 'apiv3_store_profile';
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
15
 
16
  public $store_id = null;
17
 
18
  protected static $profile = null;
19
-
20
  public function __construct() {
21
 
22
  $this->store_id = EcwidPlatform::get_store_id();
@@ -25,26 +43,96 @@ class Ecwid_Api_V3
25
 
26
  $this->_categories_api_url = $this->_api_url . $this->store_id . '/categories';
27
  $this->_products_api_url = $this->_api_url . $this->store_id . '/products';
 
 
28
  }
29
 
30
  public static function is_available()
31
  {
32
- $token = self::_load_token();
33
 
34
- if ( $token && $token != get_option( self::TOKEN_OPTION_NAME ) ) {
35
- return true;
36
  }
 
 
 
 
 
 
 
 
 
 
37
 
38
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  public static function save_token($token)
42
  {
43
- EcwidPlatform::init_crypt(true);
44
 
45
- $value = base64_encode(EcwidPlatform::encrypt($token));
46
 
47
- update_option(self::TOKEN_OPTION_NAME, $value);
 
48
  }
49
 
50
 
@@ -373,7 +461,7 @@ class Ecwid_Api_V3
373
  $url = $this->_api_url . $this->store_id . '/latest-stats';
374
 
375
  $params = array(
376
- 'token' => $this->get_token()
377
  );
378
 
379
  $url = $this->build_request_url($url, $params);
@@ -397,13 +485,19 @@ class Ecwid_Api_V3
397
  $url = $this->_api_url . $this->store_id . '/profile';
398
 
399
  $params = array(
400
- 'token' => $this->get_token()
401
  );
402
 
403
  $url = $this->build_request_url($url, $params);
404
  $result = EcwidPlatform::fetch_url($url);
405
 
406
- if (@$result['code'] != '200' || empty($result['data'])) {
 
 
 
 
 
 
407
  return false;
408
  }
409
 
11
 
12
  const PROFILE_CACHE_NAME = 'apiv3_store_profile';
13
 
14
+ const OPTION_API_STATUS = 'ecwid_api_status';
15
+ const API_STATUS_OK = 'ok';
16
+ const API_STATUS_UNDEFINED = null;
17
+ const API_STATUS_ERROR_TLS = 'fail_old_tls';
18
+ const API_STATUS_ERROR_OTHER = 'fail_other';
19
+ const API_STATUS_ERROR_TOKEN = 'fail_token';
20
+
21
+ public static function get_api_status_list()
22
+ {
23
+ return array(
24
+ self::API_STATUS_UNDEFINED,
25
+ self::API_STATUS_OK,
26
+ self::API_STATUS_ERROR_TOKEN,
27
+ self::API_STATUS_ERROR_TLS,
28
+ self::API_STATUS_ERROR_OTHER
29
+ );
30
+ }
31
+
32
  const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
33
 
34
  public $store_id = null;
35
 
36
  protected static $profile = null;
37
+
38
  public function __construct() {
39
 
40
  $this->store_id = EcwidPlatform::get_store_id();
43
 
44
  $this->_categories_api_url = $this->_api_url . $this->store_id . '/categories';
45
  $this->_products_api_url = $this->_api_url . $this->store_id . '/products';
46
+
47
+ add_option( self::OPTION_API_STATUS, self::API_STATUS_UNDEFINED );
48
  }
49
 
50
  public static function is_available()
51
  {
52
+ $status = self::get_api_status();
53
 
54
+ if ( $status == self::API_STATUS_UNDEFINED ) {
55
+ return self::check_api_status();
56
  }
57
+
58
+ return $status == self::API_STATUS_OK;
59
+ }
60
+
61
+ public static function connection_fails()
62
+ {
63
+ $status = self::get_api_status();
64
+
65
+ return in_array( $status, array( self::API_STATUS_ERROR_OTHER, self::API_STATUS_ERROR_TLS ) );
66
+ }
67
 
68
+ public static function reset_api_status()
69
+ {
70
+ update_option( self::OPTION_API_STATUS, self::API_STATUS_UNDEFINED );
71
+ }
72
+
73
+ public static function set_api_status( $new_status )
74
+ {
75
+ if ( in_array( $new_status, self::get_api_status_list() ) ) {
76
+ update_option( self::OPTION_API_STATUS, $new_status );
77
+ }
78
+
79
+ return $new_status == self::API_STATUS_OK;
80
+ }
81
+
82
+ public static function get_api_status()
83
+ {
84
+ return get_option( self::OPTION_API_STATUS );
85
+ }
86
+
87
+
88
+ public static function check_api_status()
89
+ {
90
+ $api = new Ecwid_Api_V3();
91
+
92
+ $token = self::_load_token();
93
+ if ( !$token ) {
94
+ return self::set_api_status( self::API_STATUS_ERROR_TOKEN );
95
+ }
96
+
97
+ $profile = $api->get_store_profile();
98
+
99
+
100
+ if ( $profile ) {
101
+ return self::set_api_status( self::API_STATUS_OK );
102
+ } else {
103
+ $transports = stream_get_transports();
104
+
105
+ $tls_fails = true;
106
+
107
+ foreach ( $transports as $transport ) {
108
+ $matches = array();
109
+
110
+ $is_tls = preg_match( '!tlsv(.*)!', $transport, $matches );
111
+
112
+ if ( $is_tls ) {
113
+ if ( version_compare( $matches[1], '1.1', '>=' ) ) {
114
+ $tls_fails = false;
115
+ break;
116
+ }
117
+ }
118
+ }
119
+
120
+ if ( $tls_fails ) {
121
+ return self::set_api_status( self::API_STATUS_ERROR_TLS );
122
+ } else {
123
+ return self::set_api_status( self::API_STATUS_ERROR_OTHER );
124
+ }
125
+ }
126
  }
127
 
128
  public static function save_token($token)
129
  {
130
+ EcwidPlatform::init_crypt( true );
131
 
132
+ $value = base64_encode( EcwidPlatform::encrypt( $token ) );
133
 
134
+ update_option( self::TOKEN_OPTION_NAME, $value );
135
+ self::reset_api_status();
136
  }
137
 
138
 
461
  $url = $this->_api_url . $this->store_id . '/latest-stats';
462
 
463
  $params = array(
464
+ 'token' => self::get_token()
465
  );
466
 
467
  $url = $this->build_request_url($url, $params);
485
  $url = $this->_api_url . $this->store_id . '/profile';
486
 
487
  $params = array(
488
+ 'token' => self::get_token()
489
  );
490
 
491
  $url = $this->build_request_url($url, $params);
492
  $result = EcwidPlatform::fetch_url($url);
493
 
494
+ if ( @$result['code'] == '403' ) {
495
+ self::set_api_status( self::API_STATUS_ERROR_TOKEN );
496
+ return false;
497
+ }
498
+
499
+ if ( self::get_api_status() == self::API_STATUS_OK && ( @$result['code'] != '200' || empty($result['data'] ) ) ) {
500
+ self::set_api_status( self::API_STATUS_UNDEFINED );
501
  return false;
502
  }
503
 
lib/ecwid_platform.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
  require_once 'ecwid_requests.php';
 
4
 
5
  class EcwidPlatform {
6
 
1
  <?php
2
 
3
  require_once 'ecwid_requests.php';
4
+ require_once ECWID_PLUGIN_DIR . 'lib/phpseclib/AES.php';
5
 
6
  class EcwidPlatform {
7
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.9
6
- Stable tag: 6.2
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -144,13 +144,22 @@ You can add the store categories menu to your site menu to help your customers e
144
 
145
  = How do I migrate my shop from Shopify or Woocommerce? =
146
 
147
- You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://help.ecwid.com/customer/portal/articles/1169671).
148
 
149
 
150
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
151
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
152
 
153
  == Changelog ==
 
 
 
 
 
 
 
 
 
154
  = 6.2 - Jun 25, 2018 =
155
  - **New! Revamped floating cart icon.** We added a new floating cart widget that allows to display a cart icon along with items count and subtotal in the corner of the screen. This way, it's always visible and your customers can click it to check their cart contents and proceed with checkout. The new floating shopping cart icon looks better and provides a lot of layout customization options. You can enable it in the Customizer menu under "Ecwid" section in your WordPress admin backend: (Appearance → Customize → Ecwid).
156
  - **Fixed a "Call to undefined function mb_strtolower" error message that appeared on some hosts.** If you saw such an error message, this should be fixed now.
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.9
6
+ Stable tag: 6.2.1
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
144
 
145
  = How do I migrate my shop from Shopify or Woocommerce? =
146
 
147
+ You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://support.ecwid.com/hc/en-us/articles/360000049040-Migrating-to-Ecwid-from-WooCommerce).
148
 
149
 
150
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
151
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
152
 
153
  == Changelog ==
154
+ = 6.2.1 - Aug 8, 2018 =
155
+
156
+ - **New “Main storefront page” selector in the plugin advanced settings.** If you have your storefront added to several pages on your site, you can now choose the main storefront page in the plugin settings (Ecwid → Advanced). This will define where the store navigation menus and sidebar widgets should be linked to. If you have a single online store page (which is totally OK), this new option won’t be displayed.
157
+ - **New warning messages for the sites with outdated TLS.** Ecwid is a PCI DSS level 1 certified ecommerce provider, which is a gold security standard for e-commerce solutions. Put it simply, when you use Ecwid, you have a bank level of online payments security in your online store. One of the requirements to make sure Ecwid merchants can securely process payments on their site is to use up-to-date TLS software on the server where your site is hosted. If your store dashboard doesn’t load in your Wordpress admin backend or you see a warning message saying that the Ecwid plugin cannot connect to the Ecwid API, that’s most likely caused by outdated TLS on your hosting. We recommend contacting your hosting in such case. If everything works fine and no warning message appears, that means no action is required from your side.
158
+ - **Minor improvements in the store dashboard in the WordPress admin backend.** We improved the scroll behavior on the store admin dashboard pages and fixed a couple minor issues in the Ecwid menu items in the WordPress admin backend.
159
+ - **Fixed an issue with store popup appearing on protected pages before the password is entered.** Some online sellers add their store catalog on protected pages on their ecommerce site to restrict access to it for some particular group of customers (e.g. wholesale membership). There was an issue with store catalog appearing in a popup on such pages — we fixed that.
160
+ - **Fixed an issue in the “Add store” button in the WordPress page editor.** There was a bug that made the store widgets appear at the top of the page when you use the “Add store” button in the classic Wordpress editor. We fixed it, it should work fine now.
161
+ - Minor fixes and improvements.
162
+
163
  = 6.2 - Jun 25, 2018 =
164
  - **New! Revamped floating cart icon.** We added a new floating cart widget that allows to display a cart icon along with items count and subtotal in the corner of the screen. This way, it's always visible and your customers can click it to check their cart contents and proceed with checkout. The new floating shopping cart icon looks better and provides a lot of layout customization options. You can enable it in the Customizer menu under "Ecwid" section in your WordPress admin backend: (Appearance → Customize → Ecwid).
165
  - **Fixed a "Call to undefined function mb_strtolower" error message that appeared on some hosts.** If you saw such an error message, this should be fixed now.
templates/admin-footer.php CHANGED
@@ -1,5 +1,7 @@
1
  <div class="ecwid-admin-footer">
2
- <?php if ( !Ecwid_Config::is_wl() ): ?>
 
 
3
  <div class="ecwid-admin-footer-block ecwid-app-badges-block">
4
  <h4 class="ecwid-admin-footer-title"><?php _e('Manage Store on iPhone, iPad or Android', 'ecwid-shopping-cart'); ?></h4>
5
  <div class="ecwid-admin-footer-text">
@@ -9,13 +11,17 @@
9
  </a>
10
  </div>
11
  </div>
 
 
12
  <div class="ecwid-admin-footer-block">
13
  <h4 class="ecwid-admin-footer-title"><?php _e('Questions?', 'ecwid-shopping-cart'); ?></h4>
14
  <div class="ecwid-admin-footer-text">
15
  <?php _e('<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart'); ?>
16
  </div>
17
  </div>
 
18
  <?php endif; ?>
 
19
  <?php if (@$show_reconnect && Ecwid_Config::should_show_reconnect_in_footer()): ?>
20
  <div class="ecwid-admin-footer-block">
21
  <h4 class="ecwid-admin-footer-title"><?php printf( __('Want to connect another %s store?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
1
  <div class="ecwid-admin-footer">
2
+ <?php if ( !Ecwid_Config::is_wl()): ?>
3
+
4
+ <?php if ( Ecwid_Admin_Main_Page::uses_integrated_admin() ): ?>
5
  <div class="ecwid-admin-footer-block ecwid-app-badges-block">
6
  <h4 class="ecwid-admin-footer-title"><?php _e('Manage Store on iPhone, iPad or Android', 'ecwid-shopping-cart'); ?></h4>
7
  <div class="ecwid-admin-footer-text">
11
  </a>
12
  </div>
13
  </div>
14
+ <?php endif; ?>
15
+
16
  <div class="ecwid-admin-footer-block">
17
  <h4 class="ecwid-admin-footer-title"><?php _e('Questions?', 'ecwid-shopping-cart'); ?></h4>
18
  <div class="ecwid-admin-footer-text">
19
  <?php _e('<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart'); ?>
20
  </div>
21
  </div>
22
+
23
  <?php endif; ?>
24
+
25
  <?php if (@$show_reconnect && Ecwid_Config::should_show_reconnect_in_footer()): ?>
26
  <div class="ecwid-admin-footer-block">
27
  <h4 class="ecwid-admin-footer-title"><?php printf( __('Want to connect another %s store?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
templates/admin/landing.tpl.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $connection_error = isset( $_GET['connection_error'] );
4
+ $register = !$connection_error && ! isset( $_GET['connect'] );
5
+
6
+ ?>
7
+
8
+ <script type='text/javascript'>//<![CDATA[
9
+ document.body.className += ' ecwid-no-padding';
10
+ //]]>
11
+ </script>
12
+ <div class="ecwid-landing <?php echo $register ? 'register' : 'connect'; echo $connection_error ? ' conn-error': ''; ?>">
13
+ <div class="ecwid-thank">
14
+ <h1>
15
+ <?php printf( __( 'Welcome to %s!', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
16
+ <span><?php printf( __( 'Thank you for choosing %s to build your online store. The first step to sell successfully online is to set up your store! Let’s get started and add a store to your website in a few simple steps.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
17
+ </h1>
18
+
19
+ <div class="ecwid-button">
20
+
21
+ <button class="create-store-button btn btn-primary btn-large">
22
+ <?php _e( 'Create Store', 'ecwid-shopping-cart' ); ?>
23
+ </button>
24
+ <button class="create-store-loading btn btn-primary btn-large btn-loading">
25
+ <div class="loader">
26
+ <div class="ecwid-spinner spin-right">
27
+ <svg width="60px" height="60px" viewBox="0 0 60 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
28
+ <path class="loader-outer" d="M30,60 C46.5685425,60 60,46.5685425 60,30 C60,13.4314575 46.5685425,0 30,0 C13.4314575,0 0,13.4314575 0,30 C0,46.5685425 13.4314575,60 30,60 L30,60 Z"></path>
29
+ <path class="loader-background" d="M30,56 C44.3594035,56 56,44.3594035 56,30 C56,15.6405965 44.3594035,4 30,4 C15.6405965,4 4,15.6405965 4,30 C4,44.3594035 15.6405965,56 30,56 L30,56 Z" fill="#FFFFFF"></path>
30
+ <path class="loader-inner" d="M12.0224719,32.0224719 C10.9078652,32.0224719 10,31.1146067 10,30 C10,18.9707865 18.9707865,10 30,10 C31.1146067,10 32.0224719,10.9078652 32.0224719,12.0224719 C32.0224719,13.1370787 31.1146067,14.0449438 30,14.0449438 C21.2,14.0449438 14.0449438,21.2 14.0449438,30 C14.0449438,31.1146067 13.1370787,32.0224719 12.0224719,32.0224719 L12.0224719,32.0224719 Z M30,50 C28.8853933,50 27.9775281,49.0921348 27.9775281,47.9775281 C27.9775281,46.8629213 28.8853933,45.9550562 30,45.9550562 C38.8,45.9550562 45.9550562,38.8 45.9550562,30 C45.9550562,28.8853933 46.8629213,27.9775281 47.9775281,27.9775281 C49.0921348,27.9775281 50,28.8853933 50,30 C50,41.0292135 41.0292135,50 30,50 L30,50 Z" fill="#231F20"></path>
31
+ </svg>
32
+ </div>
33
+ </div>
34
+ </button>
35
+
36
+ <button class="create-store-success btn btn-large btn-success btn-icon">
37
+ <i class="icon-check"></i>
38
+ <?php _e('Store is created', 'ecwid-shopping-cart'); ?>
39
+ </button>
40
+
41
+ <div class="create-store-loading-note ecwid-button-description">
42
+ <?php _e('Creating store', 'ecwid-shopping-cart'); ?>
43
+ </div>
44
+
45
+ <div class="create-store-success-note ecwid-button-description">
46
+ <?php _e('Preparing your store dashboard', 'ecwid-shopping-cart'); ?>
47
+ </div>
48
+
49
+ <div class="button-description-mobile">
50
+ <?php _e('Free registration, No credit card required', 'ecwid-shopping-cart'); ?>
51
+ </div>
52
+ <div class="button-description-mobile on-error ecwid-connection-error">
53
+ <?php printf( __( 'Connection error: please click the button again and give permissions for this plugin<br /> to show your %s store on this site.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
54
+ </div>
55
+ <div class="create-store-have-account ecwid-button-description">
56
+ <span class="create-store-have-account-question"><?php printf( __( 'Already have %s account?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
57
+ <a class="create-store-have-account-link" href="admin-post.php?action=ec_connect"><?php _e('Connect your store to this site', 'ecwid-shopping-cart'); ?></a>
58
+ </div>
59
+ <div class="button-description-mobile">
60
+ <?php printf( __( 'You will be asked to log in to your %s Control Panel<br />and give permissions to show your store on this site', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
61
+ </div>
62
+ <div class="button-description-mobile">
63
+ <h3><?php _e('Get ready to sell online', 'ecwid-shopping-cart'); ?></h3>
64
+ </div>
65
+ </div>
66
+ <div class="ecwid-thank-background">
67
+ <div class="ecwid-thank-background-tablet"><img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/tablet-iphone.png"></div>
68
+ </div>
69
+ </div>
70
+ <div class="ecwid-description">
71
+ <div class="ecwid-description-inner">
72
+ <div class="ecwid-description-image"><img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/ecwid-description-image.jpg"></div>
73
+ <div class="ecwid-description-text">
74
+ <h2><?php _e( 'Sell Everywhere', 'ecwid-shopping-cart'); ?></h2>
75
+ <p><?php _e('Start selling on your WordPress site. Then mirror your shop on your Facebook page, blog and marketplaces like Google Shopping, Yahoo and Shopping.com.', 'ecwid-shopping-cart'); ?></p>
76
+ <p><?php printf( __( 'Use %s\'s mobile-POS to swipe credit cards and sell on the go. Your orders and inventory are always synchronized with your online store.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></p>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ <div class="ecwid-features">
81
+ <div class="ecwid-features-inner">
82
+ <h2><?php _e('Features', 'ecwid-shopping-cart'); ?></h2>
83
+ <div class="ecwid-features-top">
84
+ <div class="ecwid-features-top-item">
85
+ <div class="ecwid-features-top-item-image">
86
+ <img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/wordpress.svg">
87
+ </div>
88
+ <div class="ecwid-features-top-item-text">
89
+ <h3><?php _e('Compatible with your theme', 'ecwid-shopping-cart'); ?></h3>
90
+ <p><?php printf( __( '%s is compatible with your<br>“%s” WordPress theme<br>out of the box.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand(), ecwid_get_theme_name() ); ?></p>
91
+ </div>
92
+ </div>
93
+ <div class="ecwid-features-top-item">
94
+ <div class="ecwid-features-top-item-image">
95
+ <img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/gift.svg" class="gift">
96
+ </div>
97
+ <div class="ecwid-features-top-item-text">
98
+ <h3><?php _e('Free and always up to date', 'ecwid-shopping-cart'); ?></h3>
99
+ <p><?php _e('Free plan always available with tons of features<br>at no additional cost. Updates are seamless, automatic<br>and free of charge.', 'ecwid-shopping-cart'); ?></p>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ <div class="ecwid-features-bottom">
104
+ <div class="ecwid-features-bottom-item">
105
+ <div class="ecwid-features-bottom-item-image">
106
+ <img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/responsive-grow.svg">
107
+ </div>
108
+ <div class="ecwid-features-bottom-item-text">
109
+ <h3><?php _e('Responsive design', 'ecwid-shopping-cart'); ?></h3>
110
+ <p><?php _e('Your store looks perfect<br />on all devices', 'ecwid-shopping-cart'); ?></p>
111
+ </div>
112
+ </div>
113
+ <div class="ecwid-features-bottom-item">
114
+ <div class="ecwid-features-bottom-item-image">
115
+ <img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/secure-pci.svg" class="secure">
116
+ </div>
117
+ <div class="ecwid-features-bottom-item-text">
118
+ <h3><?php _e('PCI DSS Certified', 'ecwid-shopping-cart'); ?></h3>
119
+ <p><?php _e('Secure checkout with over 40<br />payment options', 'ecwid-shopping-cart'); ?></p>
120
+ </div>
121
+ </div>
122
+ <div class="ecwid-features-bottom-item">
123
+ <div class="ecwid-features-bottom-item-image">
124
+ <img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/global.svg">
125
+ </div>
126
+ <div class="ecwid-features-bottom-item-text">
127
+ <h3><?php _e('Global Reach', 'ecwid-shopping-cart'); ?></h3>
128
+ <p><?php _e('Over 1 million merchants in 175 countries', 'ecwid-shopping-cart'); ?></p>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ <div class="ecwid-start">
135
+ <h2><?php _e('Start selling <br>on your WordPress <nobr>site for free</nobr>', 'ecwid-shopping-cart'); ?>
136
+ </h2>
137
+ <div class="ecwid-button">
138
+ <button class="create-store-button btn btn-primary btn-large">
139
+ <?php _e( 'Create Store', 'ecwid-shopping-cart'); ?>
140
+ </button>
141
+ <button class="create-store-loading btn btn-primary btn-large btn-loading">
142
+ <div class="loader">
143
+ <div class="ecwid-spinner spin-right">
144
+ <svg width="60px" height="60px" viewBox="0 0 60 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
145
+ <path class="loader-outer" d="M30,60 C46.5685425,60 60,46.5685425 60,30 C60,13.4314575 46.5685425,0 30,0 C13.4314575,0 0,13.4314575 0,30 C0,46.5685425 13.4314575,60 30,60 L30,60 Z"></path>
146
+ <path class="loader-background" d="M30,56 C44.3594035,56 56,44.3594035 56,30 C56,15.6405965 44.3594035,4 30,4 C15.6405965,4 4,15.6405965 4,30 C4,44.3594035 15.6405965,56 30,56 L30,56 Z" fill="#FFFFFF"></path>
147
+ <path class="loader-inner" d="M12.0224719,32.0224719 C10.9078652,32.0224719 10,31.1146067 10,30 C10,18.9707865 18.9707865,10 30,10 C31.1146067,10 32.0224719,10.9078652 32.0224719,12.0224719 C32.0224719,13.1370787 31.1146067,14.0449438 30,14.0449438 C21.2,14.0449438 14.0449438,21.2 14.0449438,30 C14.0449438,31.1146067 13.1370787,32.0224719 12.0224719,32.0224719 L12.0224719,32.0224719 Z M30,50 C28.8853933,50 27.9775281,49.0921348 27.9775281,47.9775281 C27.9775281,46.8629213 28.8853933,45.9550562 30,45.9550562 C38.8,45.9550562 45.9550562,38.8 45.9550562,30 C45.9550562,28.8853933 46.8629213,27.9775281 47.9775281,27.9775281 C49.0921348,27.9775281 50,28.8853933 50,30 C50,41.0292135 41.0292135,50 30,50 L30,50 Z" fill="#231F20"></path>
148
+ </svg>
149
+ </div>
150
+ </div>
151
+ </button>
152
+
153
+ <button class="create-store-success btn btn-large btn-success btn-icon">
154
+ <i class="icon-check"></i>
155
+ <?php _e('Store is created', 'ecwid-shopping-cart'); ?>
156
+ </button>
157
+
158
+ <div class="create-store-loading-note ecwid-button-description">
159
+ <?php _e('Creating store', 'ecwid-shopping-cart'); ?>
160
+ </div>
161
+
162
+ <div class="create-store-success-note ecwid-button-description">
163
+ <?php _e('Preparing your store dashboard', 'ecwid-shopping-cart'); ?>
164
+ </div>
165
+
166
+ <div class="ecwid-button-description">
167
+ <?php printf( __( 'Already have %s account?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
168
+ <a href="admin-post.php?action=ec_connect"><?php _e('Connect your store to this site', 'ecwid-shopping-cart'); ?></a>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ </div>
templates/admin/legacy-connect.tpl.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap ecwid-admin">
2
+
3
+ <div class="box">
4
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
5
+
6
+ <form method="POST" action="options.php" class="pure-form ecwid-settings general-settings">
7
+ <?php settings_fields('ecwid_options_page'); ?>
8
+ <fieldset>
9
+
10
+ <input type="hidden" name="settings_section" value="general" />
11
+
12
+ <div class="greeting-box">
13
+
14
+ <div class="image-container">
15
+ <img class="greeting-image" src="<?php echo( esc_attr ( ECWID_PLUGIN_URL ) ); ?>/images/store_inprogress.png" width="142" />
16
+ </div>
17
+
18
+ <div class="messages-container">
19
+ <div class="main-message">
20
+
21
+ <?php printf( __('Thank you for choosing %s to build your online store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
22
+ </div>
23
+ <div class="secondary-message">
24
+ <?php _e('The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps.', 'ecwid-shopping-cart'); ?>
25
+ </div>
26
+ </div>
27
+
28
+ </div>
29
+ <hr />
30
+
31
+ <ol>
32
+ <li>
33
+ <h4><?php printf( __('Register at %s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
34
+ <div>
35
+ <?php printf( __('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() ); ?>
36
+ </div>
37
+ <div class="ecwid-account-buttons">
38
+ <a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?partner=wporg#register">
39
+ <?php _e('Create new account', 'ecwid-shopping-cart'); ?>
40
+ </a>
41
+ <a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?partner=wporg">
42
+ <?php _e('I already have an account, sign in', 'ecwid-shopping-cart'); ?>
43
+ </a>
44
+ </div>
45
+ <div class="note">
46
+ <?php _e('You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
47
+ </div>
48
+ </li>
49
+ <li>
50
+ <h4><?php _e('Find your Store ID', 'ecwid-shopping-cart'); ?></h4>
51
+ <div>
52
+ <?php printf( __('Store ID is a unique identifier of any %1$s store, it consists of several digits. You can find it on the "Dashboard" page of %1$s control panel. Also the Store ID will be sent in the Welcome email after the registration.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
53
+ </div>
54
+ </li>
55
+ <li>
56
+ <h4>
57
+ <?php _e('Enter your Store ID', 'ecwid-shopping-cart'); ?>
58
+ </h4>
59
+ <div><label for="ecwid_store_id"><?php _e('Enter your Store ID here:', 'ecwid-shopping-cart'); ?></label></div>
60
+ <div class="pure-control-group store-id">
61
+ <input
62
+ id="ecwid_store_id"
63
+ name="ecwid_store_id"
64
+ type="text"
65
+ placeholder="<?php _e('Store ID', 'ecwid-shopping-cart'); ?>"
66
+ value="<?php if ( !ecwid_is_demo_store() ) echo esc_attr( get_ecwid_store_id() ); ?>"
67
+ />
68
+ <button type="submit" class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>"><?php printf( __('Save and connect your %s store to the site', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></button>
69
+ </div>
70
+
71
+ </li>
72
+ </ol>
73
+ </fieldset>
74
+ </form>
75
+ </div>
76
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
77
+ </div>
templates/admin/simple-connect.tpl.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $no_oauth = @$_GET['oauth'] == 'no';
3
+ $connection_error = isset( $_GET['connection_error'] );
4
+ ?>
5
+
6
+ <div class="wrap ecwid-admin ecwid-connect<?php if ($no_oauth): ?> no-oauth<?php else: ?> with-oauth<?php endif; ?>">
7
+ <div class="box">
8
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
9
+
10
+ <div class="greeting-image">
11
+ <img src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/store_inprogress.png" width="142" />
12
+ </div>
13
+
14
+ <div class="greeting-message mobile-br">
15
+ <?php _e( 'Connect your store<br /> to this WordPress site', 'ecwid-shopping-cart' ); ?>
16
+ </div>
17
+
18
+ <div class="connect-store-id no-oauth">
19
+ <input type="text" id="ecwid-store-id" placeholder="<?php _e('Enter your Store ID', 'ecwid-shopping-cart'); ?>" />
20
+ </div>
21
+ <div class="connect-button">
22
+ <a href="admin-post.php?action=ec_connect" class="with-oauth"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
23
+ <a id="ecwid-connect-no-oauth" href="admin-post.php?action=ec_connect" class="no-oauth" style="white-space: nowrap; width:auto"><?php _e( 'Save and connect', 'ecwid-shopping-cart' ); ?></a>
24
+ </div>
25
+
26
+ <?php if (!$connection_error): ?>
27
+
28
+ <div class="note initial with-oauth">
29
+ <?php printf( __( 'To display your store on this site, you need to allow WordPress to access your %1$s products. Please press connect to provide permission.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
30
+ </div>
31
+
32
+ <?php else: ?>
33
+
34
+ <div class="note auth-error">
35
+ <span>
36
+ <?php _e( 'Connection error - after clicking button you need to login and accept permissions to use our plugin. Please, try again.', 'ecwid-shopping-cart' ); ?>
37
+ </span>
38
+ </div>
39
+ <?php endif; ?>
40
+
41
+ <?php if ($no_oauth): ?>
42
+ <h4 class="no-oauth where-to-find-store-id" style="text-align: center"><?php _e('Where to find your Store ID:', 'ecwid-shopping-cart'); ?></h4>
43
+ <div class="note no-oauth">
44
+ <?php printf( __( 'Store ID is a unique identifier of your %1$s account. You can find it in your %1$s control panel: open the <a %2$s>Dashboard page</a> and find the "<b>Store ID: NNNNNNN</b>" text, where <b>NNNNNNN</b> is your Store&nbsp;ID.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand(), 'href="https://' . Ecwid_Config::get_cpanel_domain() . '/cp/CP.html?source=wporg#dashboard" target="_blank"' ); ?>
45
+ </div>
46
+ <?php endif; ?>
47
+
48
+ <?php if ( !Ecwid_Config::is_no_reg_wl() ): ?>
49
+ <div class="create-account-link">
50
+ <a target="_blank" href="<?php echo esc_attr(ecwid_get_register_link()); ?>">
51
+ <?php printf( __( "Don't have an %s account? Create one now.", 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
52
+ </a>
53
+ </div>
54
+ <?php endif; ?>
55
+ </div>
56
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
57
+ </div>
templates/admin/simple-dashboard.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap ecwid-admin ecwid-dashboard">
2
+ <div class="box">
3
+ <div class="head">
4
+ <?php ecwid_embed_svg( 'ecwid-logo-blue' );?>
5
+ <h3>
6
+ <?php printf( __( '%s Shopping Cart', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
7
+ </h3>
8
+ <div class="store-id drop-down">
9
+ <span>
10
+ <?php _e( 'Store ID', 'ecwid-shopping-cart' ); ?> : <?php echo get_ecwid_store_id(); ?>
11
+ </span>
12
+ <ul>
13
+ <li>
14
+ <a href="admin.php?page=ec-store&reconnect"><?php _e( 'Disconnect store', 'ecwid-shopping-cart' ); ?></a>
15
+ </li>
16
+ </ul>
17
+ </div>
18
+ </div>
19
+ <div class="body">
20
+ <div class="greeting-image">
21
+ <img src="<?php echo( esc_attr( ECWID_PLUGIN_URL )); ?>/images/store_ready.png" width="142" />
22
+ </div>
23
+
24
+ <div class="greeting">
25
+ <?php if (@$_GET['settings-updated']): ?>
26
+ <div class="greeting-title">
27
+ <?php _e('Congratulations!', 'ecwid-shopping-cart'); ?>
28
+ </div>
29
+ <div class="greeting-message mobile-br">
30
+ <?php printf( __( 'Your %s store is now connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
31
+ </div>
32
+ <?php else: ?>
33
+
34
+ <div class="greeting-title">
35
+ <?php _e('Greetings!', 'ecwid-shopping-cart'); ?>
36
+ </div>
37
+ <div class="greeting-message mobile-br">
38
+ <?php printf( __( 'Your %s store is connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
39
+ </div>
40
+ <?php endif; ?>
41
+
42
+ <ul class="greeting-links">
43
+ <li>
44
+ <a target="_blank" href="<?php echo Ecwid_Store_Page::get_store_url(); ?>"><?php _e('Visit storefront', 'ecwid-shopping-cart'); ?></a>
45
+ </li>
46
+ <li>
47
+ <a target="_blank"
48
+ <?php if ( Ecwid_Api_V3::is_available() && ecwid_get_admin_sso_url(time(), '') ): ?>
49
+ href="admin-post.php?action=ecwid-do-sso"
50
+ <?php else: ?>
51
+ href="//<?php echo Ecwid_Config::get_cpanel_domain(); ?>/cp?source=wporg"
52
+ <?php endif; ?>
53
+
54
+ ><?php _e('Open control panel', 'ecwid-shopping-cart'); ?></a>
55
+ </li>
56
+ </ul>
57
+
58
+
59
+
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
65
+ </div>
templates/admin/simple-reconnect.tpl.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $connection_error = isset( $_GET['connection_error'] );
4
+ global $ecwid_oauth;
5
+
6
+ ?>
7
+ <div class="wrap ecwid-admin ecwid-connect ecwid-reconnect">
8
+ <div class="box">
9
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
10
+
11
+ <div class="greeting-image">
12
+ <img src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/store_inprogress.png" width="142" />
13
+ </div>
14
+
15
+ <div class="greeting-message mobile-br">
16
+ <?php _e( 'Connect your store<br /> to this WordPress site', 'ecwid-shopping-cart' ); ?>
17
+ </div>
18
+
19
+ <?php if ($ecwid_oauth->get_reconnect_message()): ?>
20
+ <div class="note reconnect-message">
21
+ <?php echo $ecwid_oauth->get_reconnect_message(); ?>
22
+ </div>
23
+ <?php endif; ?>
24
+
25
+ <div class="connect-button">
26
+ <a href="admin-post.php?action=ec_connect&reconnect"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
27
+ </div>
28
+
29
+ <?php if ($connection_error && $ecwid_oauth->get_error() == 'cancelled'): ?>
30
+
31
+
32
+ <div class="note auth-error">
33
+ <span>
34
+ <?php _e( 'Connection error - after clicking button you need to login and accept permissions to use our plugin. Please, try again.', 'ecwid-shopping-cart' ); ?>
35
+ </span>
36
+ </div>
37
+
38
+ <?php elseif ($connection_error && $ecwid_oauth->get_error() == 'other'): ?>
39
+
40
+ <div class="note auth-error">
41
+ <span>
42
+ <?php printf( __( 'Looks like your site does not support remote POST requests that are required for %s API to work. Please, contact your hosting provider to enable cURL.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
43
+ </span>
44
+ </div>
45
+
46
+ <?php else: ?>
47
+
48
+ <div class="note">
49
+ <?php printf( __( 'To sell using %1$s, you must allow WordPress to access the %1$s plugin. The connect button will direct you to your %1$s account where you can provide permission.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
50
+ </div>
51
+ <?php endif; ?>
52
+ </div>
53
+ <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
54
+ </div>
templates/advanced-settings.php CHANGED
@@ -120,9 +120,36 @@
120
  </div>
121
  </div>
122
  <?php endif; ?>
123
-
124
  <hr />
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  <div class="pure-control-group checkbox">
127
  <div class="label">
128
  <label for="<?php echo Ecwid_Products::OPTION_ENABLED; ?>">
@@ -147,7 +174,7 @@
147
  </div>
148
  </div>
149
  </div>
150
-
151
  <?php ecwid_sync_do_page(); ?>
152
 
153
  <div class="note grayed-links">
120
  </div>
121
  </div>
122
  <?php endif; ?>
 
123
  <hr />
124
 
125
+ <?php if ( count ( Ecwid_Store_Page::get_store_pages_array() ) > 1 ): ?>
126
+ <div class="pure-control-group">
127
+ <div class="label">
128
+ <label for="<?php echo Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID; ?>">
129
+ <?php _e('Main storefront page', 'ecwid-shopping-cart'); ?>
130
+ </label>
131
+ <select id="<?php echo Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID; ?>" name="<?php echo Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID; ?>">
132
+ <?php foreach ( Ecwid_Store_Page::get_store_pages_array() as $id ): ?>
133
+ <option
134
+ value="<?php echo $id; ?>"
135
+ <?php if ( $id == Ecwid_Store_Page::get_current_store_page_id() ): ?>
136
+ selected="selected"
137
+ <?php endif; ?>
138
+ ><?php esc_html_e( get_post( $id )->post_title ); ?></option>
139
+ <?php endforeach; ?>
140
+ </select>
141
+
142
+
143
+ <div class="note">
144
+ <?php _e( 'You have your storefront added to several pages on your site. You can choose the main storefront page here — the store navigation menus and sidebar widgets will open it.', 'ecwid-shopping-cart' ); ?>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <hr />
149
+
150
+ <?php endif; ?>
151
+
152
+
153
  <div class="pure-control-group checkbox">
154
  <div class="label">
155
  <label for="<?php echo Ecwid_Products::OPTION_ENABLED; ?>">
174
  </div>
175
  </div>
176
  </div>
177
+
178
  <?php ecwid_sync_do_page(); ?>
179
 
180
  <div class="note grayed-links">
templates/ecwid-admin.php CHANGED
@@ -85,7 +85,7 @@
85
  </script>
86
 
87
 
88
- <iframe seamless id="ecwid-frame" frameborder="0" width="100%" height="700" scrolling="yes"></iframe>
89
 
90
  <script type="text/javascript">
91
  jQuery(document).ready(function() {
85
  </script>
86
 
87
 
88
+ <iframe seamless id="ecwid-frame" frameborder="0" width="100%" height="700" scrolling="no"></iframe>
89
 
90
  <script type="text/javascript">
91
  jQuery(document).ready(function() {