Ecwid Ecommerce Shopping Cart - Version 5.7.2

Version Description

  • Dec 20, 1017 =
  • Fixed a couple of bugs on the Ecwid dashboard page. The store control panel might not appear in the Wordpress backend for some users (especially it was likely to happen in Safari browser). We fixed it. So if you experienced that issue in your Wordpress admin backend, this update should fix it for you.
  • Added fixes and layout improvements to make Ecwid e-commerce plugin compatible with Abubize Business and Evolve Plus Wordpress themes. If you use one of those themes, you might notice layout issues on your store page caused by the theme styles overriding Ecwid styles. We fixed that. If you find any trouble in how Ecwid works with your theme, please let us know.
  • Fixed an issue in the way Ecwid shortcode is rendered in the Wordpress page editor. You might notice the Wordpress editor froze when you changed the "widgets" part of the Ecwid shortcode in the editor. For example, if you put a shortcode with categories widget only (without product browser). We fixed it now you can adjust the shortcode as you wish. Note this problem only affected the Wordpress editor neither your store nor your control panel were affected. So, if you don't customize the shortcode content, you can just ignore this, everything is working fine for you.
  • Several minor fixes and improvements. Ecwid is constantly updated with new cool ecommerce features. To see more updates and learn something new about selling online, see our blog.
Download this release

Release Info

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

Code changes from version 5.7.1 to 5.7.2

css/themes/businesso.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .ecwid td {
2
+ border: 0 !important;
3
+ }
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: 5.7.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -13,7 +13,6 @@ register_activation_hook( __FILE__, 'ecwid_store_activate' );
13
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
14
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
15
 
16
- define("ECWID_DEMO_STORE_ID", 1003);
17
  define('ECWID_API_AVAILABILITY_CHECK_TIME', 60*60*3);
18
 
19
  define ('ECWID_TRIMMED_DESCRIPTION_LENGTH', 160);
@@ -1563,7 +1562,7 @@ function ecwid_store_activate() {
1563
  EOT;
1564
  add_option("ecwid_store_page_id", '', '', 'yes');
1565
 
1566
- add_option("ecwid_store_id", ECWID_DEMO_STORE_ID, '', 'yes');
1567
 
1568
  add_option("ecwid_enable_minicart", 'Y', '', 'yes');
1569
  add_option("ecwid_show_categories", '', '', 'yes');
@@ -1748,6 +1747,94 @@ function ecwid_abs_intval($value) {
1748
  return null;
1749
  }
1750
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1751
  function ecwid_sync_do_page() {
1752
 
1753
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
@@ -1805,7 +1892,7 @@ function ecwid_register_admin_styles($hook_suffix) {
1805
 
1806
  if (isset($_GET['page']) && strpos($_GET['page'], 'ec-store') === 0) {
1807
 
1808
- if (get_option('ecwid_store_id') == ECWID_DEMO_STORE_ID) {
1809
  // Open dashboard for the first time, ecwid store id is set to demo => need landing styles/scripts
1810
  wp_enqueue_script('ecwid-landing-js', ECWID_PLUGIN_URL . 'js/landing.js', array(), get_option('ecwid_plugin_version'));
1811
  wp_localize_script('ecwid-landing-js', 'ecwidParams', array(
@@ -1838,7 +1925,7 @@ function ecwid_register_settings_styles($hook_suffix) {
1838
 
1839
  function ecwid_plugin_actions($links) {
1840
  $settings_link = "<a href='" . Ecwid_Admin::get_dashboard_url() . "'>"
1841
- . (get_ecwid_store_id() == ECWID_DEMO_STORE_ID ? __('Setup', 'ecwid-shopping-cart') : __('Settings') )
1842
  . "</a>";
1843
  array_unshift( $links, $settings_link );
1844
 
@@ -1980,12 +2067,11 @@ function ecwid_create_store() {
1980
  }
1981
 
1982
  function ecwid_general_settings_do_page() {
1983
-
1984
  $store_id = get_option( 'ecwid_store_id' );
1985
 
1986
  $connection_error = isset( $_GET['connection_error'] );
1987
 
1988
- if ( $store_id == ECWID_DEMO_STORE_ID && !Ecwid_Config::overrides_token() ) {
1989
  $no_oauth = @$_GET['oauth'] == 'no';
1990
 
1991
  $there_was_oauth_error = isset( $connection_error ) && $no_oauth;
@@ -1994,8 +2080,6 @@ function ecwid_general_settings_do_page() {
1994
 
1995
  $no_reg_wl = Ecwid_Config::is_no_reg_wl();
1996
 
1997
- global $ecwid_oauth;
1998
-
1999
  if ( $there_was_oauth_error || $customer_returned_from_creating_store_at_ecwid || $no_reg_wl) {
2000
  EcwidPlatform::cache_reset( 'user_was_redirected_to_ecwid_site_to_create_account' );
2001
  require_once ECWID_PLUGIN_DIR . 'templates/connect.php';
@@ -2015,8 +2099,8 @@ function ecwid_general_settings_do_page() {
2015
  }
2016
  } else {
2017
  global $ecwid_oauth;
2018
-
2019
- if ( get_option( 'ecwid_disable_dashboard' ) && !isset( $_GET['reconnect'] ) ) {
2020
  require_once ECWID_PLUGIN_DIR . 'templates/dashboard.php';
2021
  } else if ( !$ecwid_oauth->has_scope( 'allow_sso' ) && !isset($_GET['reconnect']) ) {
2022
  if ( ecwid_test_oauth(true) ) {
@@ -2044,7 +2128,26 @@ function ecwid_general_settings_do_page() {
2044
  }
2045
  }
2046
 
2047
- function ecwid_get_iframe_src($time, $page) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2048
 
2049
  if (function_exists('get_user_locale')) {
2050
  $lang = get_user_locale();
@@ -2053,7 +2156,7 @@ function ecwid_get_iframe_src($time, $page) {
2053
  }
2054
 
2055
  return sprintf(
2056
- 'https://' . Ecwid_Config::get_cpanel_domain() . '/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&place=%s&inline&lang=%s&min-height=700',
2057
  get_ecwid_store_id(),
2058
  Ecwid_Api_V3::get_token(),
2059
  $time,
@@ -2063,6 +2166,11 @@ function ecwid_get_iframe_src($time, $page) {
2063
  );
2064
  }
2065
 
 
 
 
 
 
2066
  function ecwid_admin_do_page( $page ) {
2067
 
2068
  if (isset($_GET['show_timeout']) && $_GET['show_timeout'] == '1') {
@@ -2086,16 +2194,20 @@ function ecwid_admin_do_page( $page ) {
2086
  $time = time() - get_option('ecwid_time_correction', 0);
2087
 
2088
  $iframe_src = ecwid_get_iframe_src($time, $page);
2089
-
2090
  $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
2091
  if (!$request) {
2092
  echo Ecwid_Message_Manager::show_message('no_oauth');
2093
  return;
2094
  }
2095
-
2096
  $result = $request->do_request();
2097
-
2098
- if ($result['code'] == 403 && strpos($result['data'], 'Token too old') !== false ) {
 
 
 
 
2099
 
2100
  if (isset($result['headers']['date'])) {
2101
  $time = strtotime($result['headers']['date']);
@@ -2171,7 +2283,7 @@ function ecwid_process_oauth_params() {
2171
  }
2172
 
2173
  global $ecwid_oauth;
2174
- $is_connect = get_ecwid_store_id() != ECWID_DEMO_STORE_ID && !isset($_GET['connection_error']);
2175
 
2176
  $is_reconnect = isset($_GET['reconnect']) && !isset($_GET['connection_error']);
2177
 
@@ -2353,7 +2465,7 @@ function get_ecwid_store_id() {
2353
 
2354
  $store_id = get_option('ecwid_store_id');
2355
  if (empty($store_id)) {
2356
- $store_id = ECWID_DEMO_STORE_ID;
2357
  }
2358
 
2359
  return $store_id;
@@ -2700,6 +2812,15 @@ JS;
2700
 
2701
  var ecwid_sso_profile='$ecwid_sso_profile';
2702
  $sign_in_out_urls
 
 
 
 
 
 
 
 
 
2703
  </script>
2704
  HTML;
2705
  }
@@ -2780,7 +2901,7 @@ function ecwid_is_paid_account()
2780
  'PREMIUM', $profile->account->availableFeatures
2781
  );
2782
  }
2783
- return ecwid_is_apiv1_enabled() && get_ecwid_store_id() != ECWID_DEMO_STORE_ID;
2784
  }
2785
 
2786
  function ecwid_is_apiv1_enabled()
@@ -2789,7 +2910,7 @@ function ecwid_is_apiv1_enabled()
2789
  $ecwid_api_check_time = get_option('ecwid_api_check_time');
2790
  $now = time();
2791
 
2792
- if ( $now > ($ecwid_api_check_time + ECWID_API_AVAILABILITY_CHECK_TIME) && get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
2793
  $ecwid = ecwid_new_product_api();
2794
 
2795
  $ecwid_is_api_enabled = ($ecwid->is_api_enabled() ? 'on' : 'off');
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: 5.7.2
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
13
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
14
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
15
 
 
16
  define('ECWID_API_AVAILABILITY_CHECK_TIME', 60*60*3);
17
 
18
  define ('ECWID_TRIMMED_DESCRIPTION_LENGTH', 160);
1562
  EOT;
1563
  add_option("ecwid_store_page_id", '', '', 'yes');
1564
 
1565
+ add_option("ecwid_store_id", Ecwid_Config::get_demo_store_id(), '', 'yes');
1566
 
1567
  add_option("ecwid_enable_minicart", 'Y', '', 'yes');
1568
  add_option("ecwid_show_categories", '', '', 'yes');
1747
  return null;
1748
  }
1749
 
1750
+ function ecwid_get_update_params_options() {
1751
+ $options = array(
1752
+ 'ecwid_store_id' => array(
1753
+ 'type' => 'string'
1754
+ ),
1755
+ 'ecwid_ajax_defer_rendering' => array(
1756
+ 'values' => array(
1757
+ 'on',
1758
+ 'off',
1759
+ 'auto'
1760
+ )
1761
+ ),
1762
+ 'ecwid_disable_dashboard' => array(
1763
+ 'values' => array(
1764
+ 'on',
1765
+ 'off',
1766
+ ''
1767
+ )
1768
+ ),
1769
+ 'ecwid_disable_pb_url' => array(
1770
+ 'type' => 'bool'
1771
+ ),
1772
+ Ecwid_Widget_Floating_Shopping_Cart::OPTION_DISPLAY_POSITION => array(
1773
+ 'values' => array(
1774
+ '',
1775
+ 'topright',
1776
+ 'bottomright'
1777
+ )
1778
+ ),
1779
+ Ecwid_Widget_Floating_Shopping_Cart::OPTION_MOVE_INTO_BODY => array(
1780
+ 'type' => 'bool',
1781
+ ),
1782
+ 'ecwid_historyjs_html4mode' => array(
1783
+ 'type' => 'bool'
1784
+ ),
1785
+ 'ecwid_plugin_migration_since_version' => array(
1786
+ 'type' => 'string'
1787
+ ),
1788
+ 'ecwid_seo_links_enabled' => array(
1789
+ 'type' => 'bool'
1790
+ ),
1791
+ 'force_scriptjs_render' => array(
1792
+ 'type' => 'bool'
1793
+ )
1794
+ );
1795
+
1796
+ return $options;
1797
+ }
1798
+
1799
+ function ecwid_get_update_params_action() {
1800
+ return 'ecwid-update-params';
1801
+ }
1802
+
1803
+ function ecwid_params_do_page() {
1804
+
1805
+ include ECWID_PLUGIN_DIR . 'templates/admin-params.php';
1806
+ }
1807
+
1808
+ add_action('admin_post_' . ecwid_get_update_params_action(), 'ecwid_update_plugin_params');
1809
+ function ecwid_update_plugin_params()
1810
+ {
1811
+ if ( !current_user_can('administrator') ) {
1812
+ header('403 Access Denied');
1813
+
1814
+ die();
1815
+ }
1816
+
1817
+ if ( !wp_verify_nonce(@$_POST['nonce'], 'ecwid-update-params' ) ) {
1818
+ header('403 Access Denied');
1819
+
1820
+ die();
1821
+ }
1822
+
1823
+ $options = ecwid_get_update_params_options();
1824
+
1825
+ $options4update = array();
1826
+
1827
+ foreach ( $options as $key => $option ) {
1828
+ $options4update[$key] = @$_POST['option'][$key];
1829
+ }
1830
+
1831
+ foreach ($options4update as $name => $value) {
1832
+ update_option($name, $value);
1833
+ }
1834
+
1835
+ wp_redirect('admin.php?page=ec-params');
1836
+ }
1837
+
1838
  function ecwid_sync_do_page() {
1839
 
1840
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
1892
 
1893
  if (isset($_GET['page']) && strpos($_GET['page'], 'ec-store') === 0) {
1894
 
1895
+ if (get_option('ecwid_store_id') == Ecwid_Config::get_demo_store_id()) {
1896
  // Open dashboard for the first time, ecwid store id is set to demo => need landing styles/scripts
1897
  wp_enqueue_script('ecwid-landing-js', ECWID_PLUGIN_URL . 'js/landing.js', array(), get_option('ecwid_plugin_version'));
1898
  wp_localize_script('ecwid-landing-js', 'ecwidParams', array(
1925
 
1926
  function ecwid_plugin_actions($links) {
1927
  $settings_link = "<a href='" . Ecwid_Admin::get_dashboard_url() . "'>"
1928
+ . (get_ecwid_store_id() == Ecwid_Config::get_demo_store_id() ? __('Setup', 'ecwid-shopping-cart') : __('Settings') )
1929
  . "</a>";
1930
  array_unshift( $links, $settings_link );
1931
 
2067
  }
2068
 
2069
  function ecwid_general_settings_do_page() {
 
2070
  $store_id = get_option( 'ecwid_store_id' );
2071
 
2072
  $connection_error = isset( $_GET['connection_error'] );
2073
 
2074
+ if ( $store_id == Ecwid_Config::get_demo_store_id() && !Ecwid_Config::overrides_token() ) {
2075
  $no_oauth = @$_GET['oauth'] == 'no';
2076
 
2077
  $there_was_oauth_error = isset( $connection_error ) && $no_oauth;
2080
 
2081
  $no_reg_wl = Ecwid_Config::is_no_reg_wl();
2082
 
 
 
2083
  if ( $there_was_oauth_error || $customer_returned_from_creating_store_at_ecwid || $no_reg_wl) {
2084
  EcwidPlatform::cache_reset( 'user_was_redirected_to_ecwid_site_to_create_account' );
2085
  require_once ECWID_PLUGIN_DIR . 'templates/connect.php';
2099
  }
2100
  } else {
2101
  global $ecwid_oauth;
2102
+
2103
+ if ( Ecwid_Admin::disable_dashboard() ) {
2104
  require_once ECWID_PLUGIN_DIR . 'templates/dashboard.php';
2105
  } else if ( !$ecwid_oauth->has_scope( 'allow_sso' ) && !isset($_GET['reconnect']) ) {
2106
  if ( ecwid_test_oauth(true) ) {
2128
  }
2129
  }
2130
 
2131
+
2132
+ add_action('admin_post_ecwid-do-sso', 'ecwid_do_sso_redirect');
2133
+ function ecwid_do_sso_redirect() {
2134
+
2135
+ if ( !current_user_can('manage_options') ) {
2136
+ die();
2137
+ }
2138
+
2139
+ $url = ecwid_get_admin_sso_url( time() );
2140
+
2141
+ wp_redirect( $url );
2142
+ }
2143
+
2144
+ function ecwid_get_admin_sso_url( $time, $page = '' ) {
2145
+
2146
+ $oauth = new Ecwid_Oauth();
2147
+
2148
+ if ( !Ecwid_Api_V3::get_token() || !$oauth->has_scope( 'allow_sso' ) ) {
2149
+ return false;
2150
+ }
2151
 
2152
  if (function_exists('get_user_locale')) {
2153
  $lang = get_user_locale();
2156
  }
2157
 
2158
  return sprintf(
2159
+ 'https://' . Ecwid_Config::get_cpanel_domain() . '/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&place=%s&lang=%s',
2160
  get_ecwid_store_id(),
2161
  Ecwid_Api_V3::get_token(),
2162
  $time,
2166
  );
2167
  }
2168
 
2169
+
2170
+ function ecwid_get_iframe_src($time, $page) {
2171
+ return ecwid_get_admin_sso_url($time, $page) . '&inline&&min-height=700';
2172
+ }
2173
+
2174
  function ecwid_admin_do_page( $page ) {
2175
 
2176
  if (isset($_GET['show_timeout']) && $_GET['show_timeout'] == '1') {
2194
  $time = time() - get_option('ecwid_time_correction', 0);
2195
 
2196
  $iframe_src = ecwid_get_iframe_src($time, $page);
2197
+
2198
  $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
2199
  if (!$request) {
2200
  echo Ecwid_Message_Manager::show_message('no_oauth');
2201
  return;
2202
  }
2203
+
2204
  $result = $request->do_request();
2205
+
2206
+ if ($result['code'] == 403 && (
2207
+ strpos($result['data'], 'Token too old') !== false
2208
+ || strpos($result['data'], 'window.top.location = \'https://my.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?') !== false
2209
+ )
2210
+ ) {
2211
 
2212
  if (isset($result['headers']['date'])) {
2213
  $time = strtotime($result['headers']['date']);
2283
  }
2284
 
2285
  global $ecwid_oauth;
2286
+ $is_connect = get_ecwid_store_id() != Ecwid_Config::get_demo_store_id() && !isset($_GET['connection_error']);
2287
 
2288
  $is_reconnect = isset($_GET['reconnect']) && !isset($_GET['connection_error']);
2289
 
2465
 
2466
  $store_id = get_option('ecwid_store_id');
2467
  if (empty($store_id)) {
2468
+ $store_id = Ecwid_Config::get_demo_store_id();
2469
  }
2470
 
2471
  return $store_id;
2812
 
2813
  var ecwid_sso_profile='$ecwid_sso_profile';
2814
  $sign_in_out_urls
2815
+
2816
+ jQuery(document).ready(function() {
2817
+ Ecwid.OnPageLoad.add(function(page) {
2818
+ if (page.type == 'SIGN_IN' && ecwid_sso_profile == '') {
2819
+ location.href = '$signin_url';
2820
+ }
2821
+ })
2822
+ }
2823
+ );
2824
  </script>
2825
  HTML;
2826
  }
2901
  'PREMIUM', $profile->account->availableFeatures
2902
  );
2903
  }
2904
+ return ecwid_is_apiv1_enabled() && get_ecwid_store_id() != Ecwid_Config::get_demo_store_id();
2905
  }
2906
 
2907
  function ecwid_is_apiv1_enabled()
2910
  $ecwid_api_check_time = get_option('ecwid_api_check_time');
2911
  $now = time();
2912
 
2913
+ if ( $now > ($ecwid_api_check_time + ECWID_API_AVAILABILITY_CHECK_TIME) && get_ecwid_store_id() != Ecwid_Config::get_demo_store_id() ) {
2914
  $ecwid = ecwid_new_product_api();
2915
 
2916
  $ecwid_is_api_enabled = ($ecwid->is_api_enabled() ? 'on' : 'off');
includes/class-ecwid-admin.php CHANGED
@@ -15,7 +15,7 @@ class Ecwid_Admin {
15
  public function build_menu()
16
  {
17
 
18
- $is_newbie = get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
19
 
20
  add_menu_page(
21
  sprintf(__('%s shopping cart settings', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
@@ -42,7 +42,7 @@ class Ecwid_Admin {
42
  );
43
 
44
  global $ecwid_oauth;
45
- if (!$is_newbie && $ecwid_oauth->has_scope('allow_sso') && !get_option( 'ecwid_disable_dashboard' )) {
46
  add_submenu_page(
47
  self::ADMIN_SLUG,
48
  __('Sales', 'ecwid-shopping-cart'),
@@ -76,6 +76,7 @@ class Ecwid_Admin {
76
 
77
  add_submenu_page('', 'Ecwid debug', '', 'manage_options', 'ec_debug', 'ecwid_debug_do_page');
78
  add_submenu_page('', 'Ecwid get mobile app', '', 'manage_options', 'ec-admin-mobile', 'ecwid_admin_mobile_do_page');
 
79
 
80
  if (!Ecwid_Config::is_wl()) {
81
  add_submenu_page(
@@ -125,6 +126,17 @@ class Ecwid_Admin {
125
 
126
  static public function get_relative_dashboard_url() {
127
  return 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG;
128
- }}
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  $ecwid_admin = new Ecwid_Admin();
15
  public function build_menu()
16
  {
17
 
18
+ $is_newbie = get_ecwid_store_id() == Ecwid_Config::get_demo_store_id();
19
 
20
  add_menu_page(
21
  sprintf(__('%s shopping cart settings', 'ecwid-shopping-cart'), Ecwid_Config::get_brand()),
42
  );
43
 
44
  global $ecwid_oauth;
45
+ if (!$is_newbie && $ecwid_oauth->has_scope('allow_sso') && !self::disable_dashboard() ) {
46
  add_submenu_page(
47
  self::ADMIN_SLUG,
48
  __('Sales', 'ecwid-shopping-cart'),
76
 
77
  add_submenu_page('', 'Ecwid debug', '', 'manage_options', 'ec_debug', 'ecwid_debug_do_page');
78
  add_submenu_page('', 'Ecwid get mobile app', '', 'manage_options', 'ec-admin-mobile', 'ecwid_admin_mobile_do_page');
79
+ add_submenu_page('', 'Ecwid params', '', 'manage_options', 'ec-params', 'ecwid_params_do_page');
80
 
81
  if (!Ecwid_Config::is_wl()) {
82
  add_submenu_page(
126
 
127
  static public function get_relative_dashboard_url() {
128
  return 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG;
129
+ }
130
+
131
+ static public function disable_dashboard() {
132
+ if ( !isset( $_GET['reconnect'] ) ) {
133
+ if ( get_option( 'ecwid_disable_dashboard' ) == 'on' ) {
134
+ return true;
135
+ } elseif ( get_option( 'ecwid_disable_dashboard' ) != 'off' && @$_COOKIE[ 'ecwid_is_safari' ] == 'true' ) {
136
+ return true;
137
+ }
138
+ }
139
+ }
140
+ }
141
 
142
  $ecwid_admin = new Ecwid_Admin();
includes/class-ecwid-ajax-defer-renderer.php CHANGED
@@ -31,7 +31,7 @@ class Ecwid_Ajax_Defer_Renderer {
31
 
32
  public function init()
33
  {
34
- if ( $this->is_enabled() && !$this->_already_enabled ) {
35
  add_filter( 'ecwid_disable_widgets', '__return_true' );
36
  add_filter( 'ecwid_shortcode_custom_renderer', array( $this, 'get_custom_renderer' ) );
37
  add_filter( 'the_content', array( $this, 'add_shortcodes' ) );
@@ -55,7 +55,7 @@ class Ecwid_Ajax_Defer_Renderer {
55
  }
56
 
57
 
58
- public function is_enabled()
59
  {
60
  $option_value = get_option( self::OPTION_DEFER_RENDERING );
61
 
31
 
32
  public function init()
33
  {
34
+ if ( self::is_enabled() && !$this->_already_enabled ) {
35
  add_filter( 'ecwid_disable_widgets', '__return_true' );
36
  add_filter( 'ecwid_shortcode_custom_renderer', array( $this, 'get_custom_renderer' ) );
37
  add_filter( 'the_content', array( $this, 'add_shortcodes' ) );
55
  }
56
 
57
 
58
+ public static function is_enabled()
59
  {
60
  $option_value = get_option( self::OPTION_DEFER_RENDERING );
61
 
includes/class-ecwid-config.php CHANGED
@@ -16,6 +16,7 @@ class Ecwid_Config {
16
  const API_DOMAIN = 'config_api_domain';
17
  const FRONTEND_DOMAIN = 'config_frontend_domain';
18
  const CPANEL_DOMAIN = 'config_cpanel_domain';
 
19
 
20
  public static function is_wl() {
21
  return EcwidPlatform::get( self::IS_WL, false );
@@ -90,6 +91,10 @@ class Ecwid_Config {
90
  return EcwidPlatform::get( self::CPANEL_DOMAIN, 'my.ecwid.com' );
91
  }
92
 
 
 
 
 
93
  public static function load_from_ini() {
94
 
95
  $filename = apply_filters('ecwid_config_ini_path', ECWID_PLUGIN_DIR . 'config.ini');
@@ -122,7 +127,8 @@ class Ecwid_Config {
122
  self::STORE_ID => 'store_id',
123
  self::API_DOMAIN => 'api_domain',
124
  self::FRONTEND_DOMAIN => 'scriptjs_domain',
125
- self::CPANEL_DOMAIN => 'cp_domain'
 
126
  );
127
 
128
  $empty_is_allowed = array(
16
  const API_DOMAIN = 'config_api_domain';
17
  const FRONTEND_DOMAIN = 'config_frontend_domain';
18
  const CPANEL_DOMAIN = 'config_cpanel_domain';
19
+ const DEMO_STORE_ID = 'config_demo_store_id';
20
 
21
  public static function is_wl() {
22
  return EcwidPlatform::get( self::IS_WL, false );
91
  return EcwidPlatform::get( self::CPANEL_DOMAIN, 'my.ecwid.com' );
92
  }
93
 
94
+ public static function get_demo_store_id() {
95
+ return EcwidPlatform::get( self::DEMO_STORE_ID, 1003 );
96
+ }
97
+
98
  public static function load_from_ini() {
99
 
100
  $filename = apply_filters('ecwid_config_ini_path', ECWID_PLUGIN_DIR . 'config.ini');
127
  self::STORE_ID => 'store_id',
128
  self::API_DOMAIN => 'api_domain',
129
  self::FRONTEND_DOMAIN => 'scriptjs_domain',
130
+ self::CPANEL_DOMAIN => 'cp_domain',
131
+ self::DEMO_STORE_ID => 'demo_store_id'
132
  );
133
 
134
  $empty_is_allowed = array(
includes/class-ecwid-help-page.php CHANGED
@@ -22,7 +22,7 @@ class Ecwid_Help_Page {
22
  $to = get_option( 'ecwid_support_email' );
23
 
24
  $body_lines = array();
25
- if ( get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
26
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
27
  }
28
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
22
  $to = get_option( 'ecwid_support_email' );
23
 
24
  $body_lines = array();
25
+ if ( get_ecwid_store_id() != Ecwid_Config::get_demo_store_id() ) {
26
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
27
  }
28
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
includes/class-ecwid-message-manager.php CHANGED
@@ -253,10 +253,10 @@ TXT
253
 
254
  switch ($name) {
255
  case 'on_activate':
256
- return !$this->should_display_on_no_storeid_on_setup_pages() && $admin_page != 'toplevel_page_ec-store' && get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
257
 
258
  case 'on_storeid_set':
259
- return get_ecwid_store_id() != ECWID_DEMO_STORE_ID && @$_GET['settings-updated'] == 'true' && $admin_page == 'toplevel_page_ec-store';
260
 
261
  case 'on_no_storeid_on_setup_pages':
262
  return $this->should_display_on_no_storeid_on_setup_pages();
@@ -292,7 +292,7 @@ TXT
292
 
293
  $admin_page = $screen->base;
294
 
295
- $is_newbie = get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
296
 
297
  $is_ecwid_settings = in_array($admin_page, array('ecwid-store_page_ecwid-advanced', 'ecwid-store_page_ecwid-appearance'));
298
  $is_store_page = $admin_page == 'post' && isset($_GET['post']) && $_GET['post'] == Ecwid_Store_Page::get_current_store_page_id();
253
 
254
  switch ($name) {
255
  case 'on_activate':
256
+ return !$this->should_display_on_no_storeid_on_setup_pages() && $admin_page != 'toplevel_page_ec-store' && get_ecwid_store_id() == Ecwid_Config::get_demo_store_id();
257
 
258
  case 'on_storeid_set':
259
+ return get_ecwid_store_id() != Ecwid_Config::get_demo_store_id() && @$_GET['settings-updated'] == 'true' && $admin_page == 'toplevel_page_ec-store';
260
 
261
  case 'on_no_storeid_on_setup_pages':
262
  return $this->should_display_on_no_storeid_on_setup_pages();
292
 
293
  $admin_page = $screen->base;
294
 
295
+ $is_newbie = get_ecwid_store_id() == Ecwid_Config::get_demo_store_id();
296
 
297
  $is_ecwid_settings = in_array($admin_page, array('ecwid-store_page_ecwid-advanced', 'ecwid-store_page_ecwid-appearance'));
298
  $is_store_page = $admin_page == 'post' && isset($_GET['post']) && $_GET['post'] == Ecwid_Store_Page::get_current_store_page_id();
includes/class-ecwid-nav-menus.php CHANGED
@@ -113,7 +113,8 @@ class Ecwid_Nav_Menus {
113
  }
114
 
115
  public function enqueue_frontend_assets() {
116
- if ( Ecwid_Store_Page::get_current_store_page_id() != get_the_ID() ) {
 
117
  return;
118
  }
119
 
113
  }
114
 
115
  public function enqueue_frontend_assets() {
116
+
117
+ if ( Ecwid_Store_Page::get_current_store_page_id() != get_the_ID() && !Ecwid_Ajax_Defer_Renderer::is_enabled() ) {
118
  return;
119
  }
120
 
includes/class-ecwid-oauth.php CHANGED
@@ -148,7 +148,7 @@ class Ecwid_OAuth {
148
 
149
  public function disconnect_store()
150
  {
151
- update_option( 'ecwid_store_id', ECWID_DEMO_STORE_ID );
152
  $this->api->save_token( '' );
153
  update_option( 'ecwid_is_api_enabled', 'off' );
154
  update_option( 'ecwid_api_check_time', 0 );
148
 
149
  public function disconnect_store()
150
  {
151
+ update_option( 'ecwid_store_id', Ecwid_Config::get_demo_store_id() );
152
  $this->api->save_token( '' );
153
  update_option( 'ecwid_is_api_enabled', 'off' );
154
  update_option( 'ecwid_api_check_time', 0 );
includes/class-ecwid-popup-deactivate.php CHANGED
@@ -30,7 +30,7 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
30
  $to = 'plugins-feedback@ecwid.com';
31
 
32
  $body_lines = array();
33
- if ( get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
34
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
35
  }
36
 
@@ -43,14 +43,23 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
43
 
44
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
45
  $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
46
- $body_lines[] = 'Reason: ' . $reason['text'] . "\n" . $_GET['message'];
47
 
48
  global $current_user;
49
  $reply_to = $current_user->user_email;
50
 
 
 
 
 
 
 
 
 
 
51
  $result = wp_mail(
52
  $to,
53
- __( 'WordPress plugin deactivation feedback (store ID ' . get_ecwid_store_id() . ')', 'ecwid-shopping-cart' ),
54
  implode( PHP_EOL, $body_lines ),
55
  'Reply-To:' . $reply_to
56
  );
@@ -108,31 +117,37 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
108
  array(
109
  'text' => __( 'I have a problem using this plugin', 'ecwid-shopping-cart' ),
110
  'has_message' => true,
 
111
  'message_hint' => __( 'What was wrong?', 'ecwid-shopping-cart' ),
112
  ),
113
  array(
114
  'text' => __( 'The plugin is difficult to set up and use', 'ecwid-shopping-cart' ),
115
  'has_message' => true,
 
116
  'message_hint' => __( 'What was difficult?', 'ecwid-shopping-cart' )
117
  ),
118
  array(
119
- 'text' => __( 'The plugins doesn\'t support the feature I want', 'ecwid-shopping-cart' ),
120
  'has_message' => true,
 
121
  'message_hint' => __( 'What feature do you need?', 'ecwid-shopping-cart' )
122
  ),
123
  array(
124
  'text' => __( 'I found a better plugin', 'ecwid-shopping-cart' ),
125
  'has_message' => true,
 
126
  'message_hint' => __( 'Can you share the name of the plugin you chose?', 'ecwid-shopping-cart' )
127
  ),
128
  array(
129
  'text' => __( 'It\'s a temporary deactivation. Please do not ask me again.', 'ecwid-shopping-cart' ),
130
  'has_message' => false,
 
131
  'is_disable_message' => true
132
  ),
133
  array(
134
  'text' => __( 'Other', 'ecwid-shopping-cart' ),
135
  'has_message' => true,
 
136
  'message_hint' => __( 'Can you share your feedback? What was wrong?', 'ecwid-shopping-cart' )
137
  )
138
  );
30
  $to = 'plugins-feedback@ecwid.com';
31
 
32
  $body_lines = array();
33
+ if ( get_ecwid_store_id() != Ecwid_Config::get_demo_store_id() ) {
34
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
35
  }
36
 
43
 
44
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
45
  $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
46
+ $body_lines[] = 'Reason:' . $reason['text'] . "\n" . ( !empty( $_GET['message'] ) ? $_GET['message'] : '[no message]' );
47
 
48
  global $current_user;
49
  $reply_to = $current_user->user_email;
50
 
51
+ $subject_template = __( '[%s] WordPress plugin deactivation feedback (store ID: %s)', 'ecwid-shopping-cart' );
52
+
53
+ $prefix = $reason['code'];
54
+ if ( !empty( $_GET['message'] ) ) {
55
+ $prefix .= ', commented';
56
+ }
57
+
58
+ $subject = sprintf( $subject_template, $prefix, get_ecwid_store_id() );
59
+
60
  $result = wp_mail(
61
  $to,
62
+ $subject,
63
  implode( PHP_EOL, $body_lines ),
64
  'Reply-To:' . $reply_to
65
  );
117
  array(
118
  'text' => __( 'I have a problem using this plugin', 'ecwid-shopping-cart' ),
119
  'has_message' => true,
120
+ 'code' => 'problem',
121
  'message_hint' => __( 'What was wrong?', 'ecwid-shopping-cart' ),
122
  ),
123
  array(
124
  'text' => __( 'The plugin is difficult to set up and use', 'ecwid-shopping-cart' ),
125
  'has_message' => true,
126
+ 'code' => 'hard to use',
127
  'message_hint' => __( 'What was difficult?', 'ecwid-shopping-cart' )
128
  ),
129
  array(
130
+ 'text' => __( 'The plugin doesn\'t support the feature I want', 'ecwid-shopping-cart' ),
131
  'has_message' => true,
132
+ 'code' => 'no feature',
133
  'message_hint' => __( 'What feature do you need?', 'ecwid-shopping-cart' )
134
  ),
135
  array(
136
  'text' => __( 'I found a better plugin', 'ecwid-shopping-cart' ),
137
  'has_message' => true,
138
+ 'code' => 'found better',
139
  'message_hint' => __( 'Can you share the name of the plugin you chose?', 'ecwid-shopping-cart' )
140
  ),
141
  array(
142
  'text' => __( 'It\'s a temporary deactivation. Please do not ask me again.', 'ecwid-shopping-cart' ),
143
  'has_message' => false,
144
+ 'code' => 'temporary',
145
  'is_disable_message' => true
146
  ),
147
  array(
148
  'text' => __( 'Other', 'ecwid-shopping-cart' ),
149
  'has_message' => true,
150
+ 'code' => 'other',
151
  'message_hint' => __( 'Can you share your feedback? What was wrong?', 'ecwid-shopping-cart' )
152
  )
153
  );
includes/class-ecwid-seo-links.php CHANGED
@@ -195,13 +195,6 @@ JS;
195
  public function build_rewrite_rules( ) {
196
 
197
  if ( !self::is_enabled() ) return;
198
-
199
- if ( $this->is_store_on_home_page() ) {
200
- $patterns = $this->get_seo_links_patterns();
201
- foreach ( $patterns as $pattern ) {
202
- add_rewrite_rule( '^' . $pattern . '$', 'index.php?page_id=' . get_option( 'page_on_front' ), 'top' );
203
- }
204
- }
205
 
206
  $pages = Ecwid_Store_Page::get_store_pages_array();
207
 
@@ -237,6 +230,13 @@ JS;
237
  }
238
  }
239
  }
 
 
 
 
 
 
 
240
  }
241
 
242
 
195
  public function build_rewrite_rules( ) {
196
 
197
  if ( !self::is_enabled() ) return;
 
 
 
 
 
 
 
198
 
199
  $pages = Ecwid_Store_Page::get_store_pages_array();
200
 
230
  }
231
  }
232
  }
233
+
234
+ if ( $this->is_store_on_home_page() ) {
235
+ $patterns = $this->get_seo_links_patterns();
236
+ foreach ( $patterns as $pattern ) {
237
+ add_rewrite_rule( '^' . $pattern . '$', 'index.php?page_id=' . get_option( 'page_on_front' ), 'top' );
238
+ }
239
+ }
240
  }
241
 
242
 
includes/themes.php CHANGED
@@ -62,7 +62,8 @@ function ecwid_apply_theme($theme_name = null)
62
  'optimizepress' => array( 'css' ),
63
  'edge' => array( 'js', 'scroll' ),
64
  'newsmag' => array( 'css-no-parent'),
65
- 'optimizer' => array( 'css' )
 
66
  );
67
  $generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
68
 
@@ -92,6 +93,10 @@ function ecwid_apply_theme($theme_name = null)
92
  $theme_name = 'responsiveboat';
93
  }
94
 
 
 
 
 
95
  if (!$theme_name) {
96
  return;
97
  }
62
  'optimizepress' => array( 'css' ),
63
  'edge' => array( 'js', 'scroll' ),
64
  'newsmag' => array( 'css-no-parent'),
65
+ 'optimizer' => array( 'css' ),
66
+ 'businesso' => array( 'css' )
67
  );
68
  $generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
69
 
93
  $theme_name = 'responsiveboat';
94
  }
95
 
96
+ if ($theme_name == 'evolve-plus') {
97
+ $theme_name = 'evolve';
98
+ }
99
+
100
  if (!$theme_name) {
101
  return;
102
  }
js/admin.js CHANGED
@@ -1,4 +1,9 @@
1
  jQuery(document).ready(function() {
 
 
 
 
 
2
  window.ecwidOpenAdminPage = function(place) {
3
  jQuery('#ecwid-frame')[0].contentWindow.postMessage(JSON.stringify({
4
  ecwidAppNs: "ecwid-wp-plugin",
1
  jQuery(document).ready(function() {
2
+
3
+ var is_safari = navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf("Safari") > -1;
4
+
5
+ wpCookies.set('ecwid_is_safari', is_safari);
6
+
7
  window.ecwidOpenAdminPage = function(place) {
8
  jQuery('#ecwid-frame')[0].contentWindow.postMessage(JSON.stringify({
9
  ecwidAppNs: "ecwid-wp-plugin",
js/store-editor-common.js CHANGED
@@ -2,17 +2,17 @@ function ecwid_get_store_shortcode(content) {
2
 
3
  if (!wp.shortcode) return false;
4
  var found = false;
5
- var index = 0;
6
 
7
  for (var i = 0; i < ecwid_params.store_shortcodes.length; i++) {
8
  var candidate = false;
 
9
  while (candidate = wp.shortcode.next(ecwid_params.store_shortcodes[i], content, index)) {
10
 
11
  if (candidate && (!candidate.shortcode.attrs.named.widgets || candidate.shortcode.attrs.named.widgets.toLowerCase().indexOf('productbrowser') != -1)) {
12
  found = candidate;
13
  break;
14
  }
15
- index = found.index + 1;
16
  }
17
 
18
  if (found) break;
2
 
3
  if (!wp.shortcode) return false;
4
  var found = false;
 
5
 
6
  for (var i = 0; i < ecwid_params.store_shortcodes.length; i++) {
7
  var candidate = false;
8
+ var index = 0;
9
  while (candidate = wp.shortcode.next(ecwid_params.store_shortcodes[i], content, index)) {
10
 
11
  if (candidate && (!candidate.shortcode.attrs.named.widgets || candidate.shortcode.attrs.named.widgets.toLowerCase().indexOf('productbrowser') != -1)) {
12
  found = candidate;
13
  break;
14
  }
15
+ index = candidate.index + 1;
16
  }
17
 
18
  if (found) break;
lib/ecwid_platform.php CHANGED
@@ -160,24 +160,6 @@ class EcwidPlatform {
160
  }
161
  }
162
 
163
- if ( ( empty($return['data']) || $return['code'] != 200 ) && !isset($options['self_call']) ) {
164
-
165
- $log_url = 'http://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?805056&data_platform=wporg&data_wporg_error=remote_get_fails';
166
- $log_url .= '&data_url=' . urlencode(get_bloginfo('url'));
167
- $log_url .= '&data_target_url=' . urlencode($url);
168
- if (get_option('ecwid_http_use_stream', false)) {
169
- $log_url .= '&data_method=stream';
170
- } elseif (get_option('ecwid_fetch_url_use_file_get_contents')) {
171
- $log_url .= '&data_method=filegetcontents';
172
- }
173
-
174
- $log_url .= '&data_code=' . $return['code'];
175
- $log_url .= '&data_message=' . urlencode(@$return['message']);
176
-
177
- self::fetch_url($log_url, array('self_call' => 1));
178
- update_option('ecwid_remote_get_fails', 1);
179
- }
180
-
181
  return $return;
182
  }
183
 
160
  }
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  return $return;
164
  }
165
 
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: 5.7.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
 
@@ -149,6 +149,12 @@ You can use Ecwid’s built-in import tools to copy your store products from any
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
 
 
 
 
 
 
152
  = 5.7.1 =
153
  - **Fix for the “The requested product is not available” error message appeared in the version 5.7**. The issue was caused by the new “Default product” feature. Some users found that error message when adding their store to a new page in the plugin and specifying the default category for that page. Everything should work fine now.
154
 
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: 5.7.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
 
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
152
+ = 5.7.2 - Dec 20, 1017 =
153
+ - **Fixed a couple of bugs on the Ecwid dashboard page.** The store control panel might not appear in the Wordpress backend for some users (especially it was likely to happen in Safari browser). We fixed it. So if you experienced that issue in your Wordpress admin backend, this update should fix it for you.
154
+ - **Added fixes and layout improvements to make Ecwid e-commerce plugin compatible with “Abubize Business” and “Evolve Plus” Wordpress themes.** If you use one of those themes, you might notice layout issues on your store page caused by the theme styles overriding Ecwid styles. We fixed that. If you find any trouble in how Ecwid works with your theme, please let us know.
155
+ - **Fixed an issue in the way Ecwid shortcode is rendered in the Wordpress page editor.** You might notice the Wordpress editor froze when you changed the "widgets" part of the Ecwid shortcode in the editor. For example, if you put a shortcode with categories widget only (without product browser). We fixed it — now you can adjust the shortcode as you wish. Note this problem only affected the Wordpress editor — neither your store nor your control panel were affected. So, if you don't customize the shortcode content, you can just ignore this, everything is working fine for you.
156
+ - **Several minor fixes and improvements.** Ecwid is constantly updated with new cool ecommerce features. To see more updates and learn something new about selling online, see our blog.
157
+
158
  = 5.7.1 =
159
  - **Fix for the “The requested product is not available” error message appeared in the version 5.7**. The issue was caused by the new “Default product” feature. Some users found that error message when adding their store to a new page in the plugin and specifying the default category for that page. Everything should work fine now.
160
 
templates/admin-params.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Online store hidden parameters</h2>
2
+
3
+ <div style="max-width: 800px">
4
+ <b style="color: red">WARNING: ADVANCED CONFIGURATION AHEAD!</b> Changing these settings may significantly affect the plugin functionality, including admin settings and storefront. You should only continue if you are sure of what you are doing.
5
+ <br />
6
+ <br />
7
+ Having a problem working with the Online store plugin? Visit our <a target="_blank" href="https://support.ecwid.com">Help center</a> if you haven't yet.
8
+ </div>
9
+ <br />
10
+ <form method="POST" type="multipart/form-data" action="admin-post.php?action=<?php echo ecwid_get_update_params_action(); ?>">
11
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( ecwid_get_update_params_action() ); ?>" />
12
+
13
+ <?php foreach ( ecwid_get_update_params_options() as $key => $option ): ?>
14
+ <div><?php echo $key; ?>:
15
+ <span>
16
+ <?php if ( @$option['type'] == 'bool' ): ?>
17
+ <select name="option[<?php echo $key; ?>]">
18
+ <option value=""<?php if (get_option($key) == ''):?> selected="selected"<?php endif; ?>>off</option>
19
+ <option value="Y"<?php if (get_option($key) ):?> selected="selected"<?php endif; ?>>on</option>
20
+ </select>
21
+ <?php elseif ( @$option['type'] == 'string'): ?>
22
+ <input type="text" name="option[<?php echo $key; ?>]" value="<?php echo get_option( $key ); ?>">
23
+ <?php elseif ( @$option['values'] ): ?>
24
+ <select name="option[<?php echo $key; ?>]">
25
+ <?php foreach ( @$option['values'] as $value ): ?>
26
+ <option value="<?php echo $value; ?>"<?php if ( $value == get_option($key)): ?> selected="selected"<?php endif; ?>><?php echo $value; ?></option>
27
+ <?php endforeach; ?>
28
+ </select>
29
+ <?php endif; ?>
30
+
31
+ </span>
32
+
33
+ <?php echo get_option($key); ?>
34
+ </div>
35
+ <?php endforeach; ?>
36
+ <button class="btn btn-primary">submit</button>
37
+ </form>
templates/dashboard.php CHANGED
@@ -44,7 +44,14 @@
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" href="//<?php echo Ecwid_Config::get_cpanel_domain(); ?>/cp?source=wporg"><?php _e('Open control panel', 'ecwid-shopping-cart'); ?></a>
 
 
 
 
 
 
 
48
  </li>
49
  </ul>
50
 
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_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
 
templates/store-popup.php CHANGED
@@ -236,7 +236,7 @@
236
  <div class="media-frame-toolbar">
237
  <div class="media-toolbar">
238
  <div class="media-toolbar-secondary">
239
- <?php if (get_ecwid_store_id() != ECWID_DEMO_STORE_ID): ?>
240
  <div class="store-id"><?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?></div>
241
  <?php else: ?>
242
  <div class="store-id"><?php _e('Demo store', 'ecwid-shopping-cart'); ?></div>
236
  <div class="media-frame-toolbar">
237
  <div class="media-toolbar">
238
  <div class="media-toolbar-secondary">
239
+ <?php if (get_ecwid_store_id() != Ecwid_Config::get_demo_store_id()): ?>
240
  <div class="store-id"><?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?></div>
241
  <?php else: ?>
242
  <div class="store-id"><?php _e('Demo store', 'ecwid-shopping-cart'); ?></div>
templates/store-svg.php CHANGED
@@ -9,7 +9,7 @@
9
 
10
  <text x="245" y="93" text-anchor="middle" fill="#050303" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="20"><?php _e('Your store will be shown here!', 'ecwid-shopping-cart'); ?></text>
11
  <text x="245" y="115" text-anchor="middle" fill="#999999" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="14">
12
- <?php if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID): ?>
13
  <?php _e('Demo Store', 'ecwid-shopping-cart'); ?>
14
  <?php else: ?>
15
  <?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?>
9
 
10
  <text x="245" y="93" text-anchor="middle" fill="#050303" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="20"><?php _e('Your store will be shown here!', 'ecwid-shopping-cart'); ?></text>
11
  <text x="245" y="115" text-anchor="middle" fill="#999999" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="14">
12
+ <?php if (get_ecwid_store_id() == Ecwid_Config::get_demo_store_id()): ?>
13
  <?php _e('Demo Store', 'ecwid-shopping-cart'); ?>
14
  <?php else: ?>
15
  <?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?>