Version Description
- Built-in Full-featured Store Control Panel. You can now manage your store, add new products, track sales and more right in your Wordpress site admin backend. No redirects, no external dashboards, no extra login/password you now have a single place and single login to manage your site and your store. To make it even better, we added the Products and Sales shortcuts to your Wordpress admin menu feel free to use them to easily access your inventory and sales list.
- New Drop-down Categories Menu. Noticed how Wordpress automatically updates your site menu adding your site pages to it? Ecwid now does it too: open "Appearance -> Menus" in your Wordpress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site. It will keep the categories list up to date even if you often change your store categories. Rest assured your customers can easily quickly get to the category of products they are interested in right from the site menu.
- More Store Menu Items for your site. In addition to the drop-down categories list, the new "Store" menus section under Appearance -> Menus provides "Search", "Cart" and "My Account" items. Add those quick links to your site for your customers to browse your store easier.
- Bug Fixes and Improvements. As usual, we fine-tuned the plugin and fixed a few bugs.
We wish you happy holidays and all the best in the New Year! Sincerely yours, Ecwid team.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 4.0.2 |
Comparing to | |
See all releases |
Code changes from version 4.0.1 to 4.0.2
- ecwid-shopping-cart.php +111 -45
- includes/class-ecwid-message-manager.php +43 -0
- includes/class-ecwid-oauth.php +1 -1
- lib/ecwid_platform.php +2 -2
- readme.txt +5 -3
- templates/connect.php +3 -3
- templates/dashboard.php +13 -0
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: 4.0.
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
@@ -983,10 +983,10 @@ function ecwid_content_started($content)
|
|
983 |
|
984 |
function ecwid_wrap_shortcode_content($content, $name, $attrs)
|
985 |
{
|
986 |
-
return "<!-- Ecwid shopping cart plugin v 4.0.
|
987 |
. ecwid_get_scriptjs_code(@$attrs['lang'])
|
988 |
. "<div class=\"ecwid-shopping-cart-$name\">$content</div>"
|
989 |
-
. "<!-- /noptimize --><!-- END Ecwid Shopping Cart v 4.0.
|
990 |
}
|
991 |
|
992 |
function ecwid_get_scriptjs_code($force_lang = null) {
|
@@ -1558,7 +1558,8 @@ function ecwid_build_menu() {
|
|
1558 |
'ecwid_general_settings_do_page'
|
1559 |
);
|
1560 |
|
1561 |
-
|
|
|
1562 |
add_submenu_page(
|
1563 |
'ecwid',
|
1564 |
__('Sales', 'ecwid-shopping-cart'),
|
@@ -1636,7 +1637,7 @@ function ecwid_nav_menu_items($items)
|
|
1636 |
|
1637 |
$items[$key]->menu_order += $counter;
|
1638 |
|
1639 |
-
if (in_array('ecwid-store-with-categories', $item->classes)) {
|
1640 |
foreach ($categories as $category) {
|
1641 |
$counter ++;
|
1642 |
$post = new stdClass;
|
@@ -1739,35 +1740,6 @@ function ecwid_nav_menu_links()
|
|
1739 |
<?php
|
1740 |
}
|
1741 |
|
1742 |
-
function ecwid_admin_do_page( $page ) {
|
1743 |
-
|
1744 |
-
global $ecwid_oauth;
|
1745 |
-
|
1746 |
-
Ecwid_Message_Manager::reset_hidden_messages();
|
1747 |
-
if ($page == 'dashboard') {
|
1748 |
-
$show_reconnect = true;
|
1749 |
-
}
|
1750 |
-
|
1751 |
-
$time = time();
|
1752 |
-
|
1753 |
-
$iframe_src = sprintf(
|
1754 |
-
'https://my.ecwid.com/api/v3/%s/sso?token=%s×tamp=%s&signature=%s&place=%s&inline&lang=%s',
|
1755 |
-
get_ecwid_store_id(),
|
1756 |
-
$ecwid_oauth->get_oauth_token(),
|
1757 |
-
$time,
|
1758 |
-
hash('sha256', get_ecwid_store_id() . $ecwid_oauth->get_oauth_token(). $time . Ecwid_OAuth::OAUTH_CLIENT_SECRET),
|
1759 |
-
$page,
|
1760 |
-
substr(get_bloginfo('language'), 0, 2)
|
1761 |
-
);
|
1762 |
-
|
1763 |
-
$result = wp_remote_get($iframe_src);
|
1764 |
-
if ($result['response']['code'] != 200) {
|
1765 |
-
require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
|
1766 |
-
} else {
|
1767 |
-
require_once ECWID_PLUGIN_DIR . '/templates/ecwid-admin.php';
|
1768 |
-
}
|
1769 |
-
}
|
1770 |
-
|
1771 |
function ecwid_admin_products_do_page() {
|
1772 |
ecwid_admin_do_page('products');
|
1773 |
}
|
@@ -1923,23 +1895,113 @@ function ecwid_get_register_link()
|
|
1923 |
|
1924 |
function ecwid_general_settings_do_page() {
|
1925 |
|
|
|
|
|
1926 |
$connection_error = isset( $_GET['connection_error'] );
|
1927 |
|
1928 |
-
|
|
|
|
|
|
|
|
|
|
|
1929 |
|
1930 |
-
|
1931 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1932 |
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1937 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1938 |
}
|
1939 |
|
1940 |
global $ecwid_oauth;
|
1941 |
|
1942 |
-
if ( get_option( 'ecwid_store_id' ) != ECWID_DEMO_STORE_ID && ! $ecwid_oauth->has_scope( 'allow_sso' ) && !isset($_GET['connection_error']) ) {
|
1943 |
require_once ECWID_PLUGIN_DIR . '/templates/reconnect-sso.php';
|
1944 |
|
1945 |
} else if (get_option('ecwid_store_id') == ECWID_DEMO_STORE_ID && !$no_oauth) {
|
@@ -1958,9 +2020,11 @@ function ecwid_general_settings_do_page() {
|
|
1958 |
$connection_error = isset($_GET['connection_error']);
|
1959 |
|
1960 |
require_once ECWID_PLUGIN_DIR . '/templates/reconnect.php';
|
1961 |
-
} else if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID
|
1962 |
|
1963 |
require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
|
|
|
|
|
1964 |
} else {
|
1965 |
|
1966 |
ecwid_admin_do_page( 'dashboard' );
|
@@ -2016,7 +2080,7 @@ function ecwid_admin_post_connect()
|
|
2016 |
|
2017 |
wp_redirect($ecwid_oauth->get_auth_dialog_url());
|
2018 |
} else if (!isset($_GET['reconnect'])) {
|
2019 |
-
wp_redirect('admin.php?page=ecwid&oauth=no');
|
2020 |
} else {
|
2021 |
wp_redirect('admin.php?page=ecwid&reconnect&connection_error');
|
2022 |
}
|
@@ -2029,8 +2093,10 @@ function ecwid_test_oauth($force = false)
|
|
2029 |
|
2030 |
$last_fail = get_option('ecwid_last_oauth_fail_time');
|
2031 |
|
2032 |
-
if ($last_fail
|
|
|
2033 |
$result = $ecwid_oauth->test_post();
|
|
|
2034 |
if ($result) {
|
2035 |
update_option('ecwid_last_oauth_fail_time', $last_fail = 0);
|
2036 |
} else {
|
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: 4.0.2
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
983 |
|
984 |
function ecwid_wrap_shortcode_content($content, $name, $attrs)
|
985 |
{
|
986 |
+
return "<!-- Ecwid shopping cart plugin v 4.0.2 --><!-- noptimize -->"
|
987 |
. ecwid_get_scriptjs_code(@$attrs['lang'])
|
988 |
. "<div class=\"ecwid-shopping-cart-$name\">$content</div>"
|
989 |
+
. "<!-- /noptimize --><!-- END Ecwid Shopping Cart v 4.0.2 -->";
|
990 |
}
|
991 |
|
992 |
function ecwid_get_scriptjs_code($force_lang = null) {
|
1558 |
'ecwid_general_settings_do_page'
|
1559 |
);
|
1560 |
|
1561 |
+
global $ecwid_oauth;
|
1562 |
+
if (!$is_newbie && $ecwid_oauth->has_scope( 'allow_sso' )) {
|
1563 |
add_submenu_page(
|
1564 |
'ecwid',
|
1565 |
__('Sales', 'ecwid-shopping-cart'),
|
1637 |
|
1638 |
$items[$key]->menu_order += $counter;
|
1639 |
|
1640 |
+
if (in_array('ecwid-store-with-categories', $item->classes) && !empty($categories)) {
|
1641 |
foreach ($categories as $category) {
|
1642 |
$counter ++;
|
1643 |
$post = new stdClass;
|
1740 |
<?php
|
1741 |
}
|
1742 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1743 |
function ecwid_admin_products_do_page() {
|
1744 |
ecwid_admin_do_page('products');
|
1745 |
}
|
1895 |
|
1896 |
function ecwid_general_settings_do_page() {
|
1897 |
|
1898 |
+
$store_id = get_option( 'ecwid_store_id' );
|
1899 |
+
|
1900 |
$connection_error = isset( $_GET['connection_error'] );
|
1901 |
|
1902 |
+
if ( $store_id == ECWID_DEMO_STORE_ID ) {
|
1903 |
+
$no_oauth = @$_GET['oauth'] == 'no';
|
1904 |
+
if ( isset( $connection_error ) && $no_oauth ) {
|
1905 |
+
require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
|
1906 |
+
} else {
|
1907 |
+
$register = ! $connection_error && ! isset( $_GET['connect'] ) && ! @$_COOKIE['ecwid_create_store_clicked'];
|
1908 |
|
1909 |
+
require_once( ECWID_PLUGIN_DIR . '/templates/landing.php' );
|
1910 |
+
}
|
1911 |
+
} else {
|
1912 |
+
global $ecwid_oauth;
|
1913 |
+
|
1914 |
+
if ( !$ecwid_oauth->has_scope( 'allow_sso' ) ) {
|
1915 |
+
if ( ecwid_test_oauth(true) ) {
|
1916 |
+
require_once ECWID_PLUGIN_DIR . '/templates/reconnect-sso.php';
|
1917 |
+
} else {
|
1918 |
+
require_once ECWID_PLUGIN_DIR . 'templates/dashboard.php';
|
1919 |
+
}
|
1920 |
+
} else {
|
1921 |
+
|
1922 |
+
if ($connection_error && isset($_GET['reconnect'])) {
|
1923 |
+
if (isset($_GET['reason'])) switch ($_GET['reason']) {
|
1924 |
+
case '1': $reconnect_message = "Message 1"; break;
|
1925 |
+
case '2': $reconnect_message = "Message 2"; break;
|
1926 |
+
}
|
1927 |
+
|
1928 |
+
$scopes = '';
|
1929 |
+
|
1930 |
+
$connection_error = isset($_GET['connection_error']);
|
1931 |
+
|
1932 |
+
require_once ECWID_PLUGIN_DIR . '/templates/reconnect.php';
|
1933 |
+
} else {
|
1934 |
+
$time = time();
|
1935 |
+
$page = 'dashboard';
|
1936 |
+
$iframe_src = sprintf(
|
1937 |
+
'https://my.ecwid.com/api/v3/%s/sso?token=%s×tamp=%s&signature=%s&place=%s&inline&lang=%s',
|
1938 |
+
get_ecwid_store_id(),
|
1939 |
+
$ecwid_oauth->get_oauth_token(),
|
1940 |
+
$time,
|
1941 |
+
hash( 'sha256', get_ecwid_store_id() . $ecwid_oauth->get_oauth_token() . $time . Ecwid_OAuth::OAUTH_CLIENT_SECRET ),
|
1942 |
+
$page,
|
1943 |
+
substr( get_bloginfo( 'language' ), 0, 2 )
|
1944 |
+
);
|
1945 |
+
|
1946 |
+
$result = wp_remote_get( $iframe_src );
|
1947 |
+
|
1948 |
+
if ( is_array( $result ) && $result['response']['code'] == 200 ) {
|
1949 |
+
ecwid_admin_do_page( 'dashboard' );
|
1950 |
+
} else {
|
1951 |
+
require_once ECWID_PLUGIN_DIR . '/templates/reconnect-sso.php';
|
1952 |
+
}
|
1953 |
+
}
|
1954 |
+
}
|
1955 |
+
}
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
function ecwid_admin_do_page( $page ) {
|
1959 |
|
1960 |
+
global $ecwid_oauth;
|
1961 |
+
|
1962 |
+
Ecwid_Message_Manager::reset_hidden_messages();
|
1963 |
+
if ($page == 'dashboard') {
|
1964 |
+
$show_reconnect = true;
|
1965 |
+
}
|
1966 |
+
|
1967 |
+
$time = time();
|
1968 |
+
|
1969 |
+
$iframe_src = sprintf(
|
1970 |
+
'https://my.ecwid.com/api/v3/%s/sso?token=%s×tamp=%s&signature=%s&place=%s&inline&lang=%s',
|
1971 |
+
get_ecwid_store_id(),
|
1972 |
+
$ecwid_oauth->get_oauth_token(),
|
1973 |
+
$time,
|
1974 |
+
hash('sha256', get_ecwid_store_id() . $ecwid_oauth->get_oauth_token(). $time . Ecwid_OAuth::OAUTH_CLIENT_SECRET),
|
1975 |
+
$page,
|
1976 |
+
substr(get_bloginfo('language'), 0, 2)
|
1977 |
+
);
|
1978 |
+
|
1979 |
+
$result = wp_remote_get($iframe_src);
|
1980 |
+
if ($result['response']['code'] != 200) {
|
1981 |
+
|
1982 |
+
if (ecwid_test_oauth(true)) {
|
1983 |
+
require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
|
1984 |
+
} else {
|
1985 |
+
require_once ECWID_PLUGIN_DIR . 'templates/dashboard.php';
|
1986 |
}
|
1987 |
+
} else {
|
1988 |
+
require_once ECWID_PLUGIN_DIR . '/templates/ecwid-admin.php';
|
1989 |
+
}
|
1990 |
+
}
|
1991 |
+
|
1992 |
+
function _ecwid_general_settings_do_page() {
|
1993 |
+
|
1994 |
+
$connection_error = isset( $_GET['connection_error'] );
|
1995 |
+
|
1996 |
+
$no_oauth = isset( $_GET['oauth'] ) && @$_GET['oauth'] == 'no';
|
1997 |
+
|
1998 |
+
if ( ! $no_oauth ) {
|
1999 |
+
$no_oauth = !ecwid_test_oauth();
|
2000 |
}
|
2001 |
|
2002 |
global $ecwid_oauth;
|
2003 |
|
2004 |
+
if ( get_option( 'ecwid_store_id' ) != ECWID_DEMO_STORE_ID && ! $ecwid_oauth->has_scope( 'allow_sso' ) && !isset($_GET['connection_error']) && !$no_oauth ) {
|
2005 |
require_once ECWID_PLUGIN_DIR . '/templates/reconnect-sso.php';
|
2006 |
|
2007 |
} else if (get_option('ecwid_store_id') == ECWID_DEMO_STORE_ID && !$no_oauth) {
|
2020 |
$connection_error = isset($_GET['connection_error']);
|
2021 |
|
2022 |
require_once ECWID_PLUGIN_DIR . '/templates/reconnect.php';
|
2023 |
+
} else if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID && ( isset($_GET['connection_error']) || $no_oauth ) ) {
|
2024 |
|
2025 |
require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
|
2026 |
+
} else if ( get_option( 'ecwid_last_oauth_fail_time' ) > 0 ) {
|
2027 |
+
require_once ECWID_PLUGIN_DIR . '/templates/dashboard.php';
|
2028 |
} else {
|
2029 |
|
2030 |
ecwid_admin_do_page( 'dashboard' );
|
2080 |
|
2081 |
wp_redirect($ecwid_oauth->get_auth_dialog_url());
|
2082 |
} else if (!isset($_GET['reconnect'])) {
|
2083 |
+
wp_redirect('admin.php?page=ecwid&oauth=no&connection_error');
|
2084 |
} else {
|
2085 |
wp_redirect('admin.php?page=ecwid&reconnect&connection_error');
|
2086 |
}
|
2093 |
|
2094 |
$last_fail = get_option('ecwid_last_oauth_fail_time');
|
2095 |
|
2096 |
+
if ( ($last_fail > 0 && $last_fail + 60*60*24 < time()) || $force) {
|
2097 |
+
|
2098 |
$result = $ecwid_oauth->test_post();
|
2099 |
+
|
2100 |
if ($result) {
|
2101 |
update_option('ecwid_last_oauth_fail_time', $last_fail = 0);
|
2102 |
} else {
|
includes/class-ecwid-message-manager.php
CHANGED
@@ -4,6 +4,8 @@ class Ecwid_Message_Manager
|
|
4 |
{
|
5 |
protected $messages = array();
|
6 |
|
|
|
|
|
7 |
protected function Ecwid_Message_Manager()
|
8 |
{
|
9 |
$this->init_messages();
|
@@ -20,6 +22,40 @@ class Ecwid_Message_Manager
|
|
20 |
}
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
public static function show_message($name, $params = array())
|
24 |
{
|
25 |
$mm = self::get_instance();
|
@@ -200,6 +236,13 @@ class Ecwid_Message_Manager
|
|
200 |
'primary_title' => __('Rate Ecwid at WordPress.org', 'ecwid-shopping-cart'),
|
201 |
'primary_url' => 'http://wordpress.org/support/view/plugin-reviews/ecwid-shopping-cart',
|
202 |
'hideable' => true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
)
|
204 |
);
|
205 |
}
|
4 |
{
|
5 |
protected $messages = array();
|
6 |
|
7 |
+
public $show_no_oauth = false;
|
8 |
+
|
9 |
protected function Ecwid_Message_Manager()
|
10 |
{
|
11 |
$this->init_messages();
|
22 |
}
|
23 |
}
|
24 |
|
25 |
+
public static function get_oauth_message($wp_remote_post_error = '')
|
26 |
+
{
|
27 |
+
if (!$wp_remote_post_error) {
|
28 |
+
$message = sprintf(
|
29 |
+
__( <<<TXT
|
30 |
+
Sorry, there is a problem. This page is supposed to display your store control panel. But this WordPress site doesn't seem to be able to connect to the Ecwid server, that's why there is no dashboard. This is caused by your server misconfiguration and can be fixed by your hosting provider.
|
31 |
+
<br /><br />
|
32 |
+
Here is a more techy description of the problem, please send it 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".
|
33 |
+
<br /><br />
|
34 |
+
Please also feel free to contact us at <a %s>wordpress@ecwid.com</a> and we will help you handle it with your hosting.
|
35 |
+
<br /><br />
|
36 |
+
Meanwhile, to manage your store, you can use the Ecwid Web Control Panel at <a %s>my.ecwid.com</a>. Your store front is working fine as well and you can check it here: <a %s>%s</a>.
|
37 |
+
TXT
|
38 |
+
|
39 |
+
),
|
40 |
+
'href="mailto:wordpress@ecwid.com"',
|
41 |
+
'target="_blank" href="http://my.ecwid.com"',
|
42 |
+
'href="' . ecwid_get_store_page_url() . '" target="_blank"',
|
43 |
+
ecwid_get_store_page_url()
|
44 |
+
);
|
45 |
+
} else {
|
46 |
+
$message = sprintf(
|
47 |
+
__('Sorry, there is a problem. This page is supposed to display your store Control Panel. However, this Wordpress site doesn\'t seem to be able to connect to the Ecwid server to show your store dashboard here. 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: "%s". Seems like HTTP POST requests are disabled on this server". <br /><br />Please feel free to contact us at <a %s>wordpress@ecwid.com</a> and we will help you contact your hosting and ask them to fix the issue. <br /><br /> Meanwhile, to manage your store, you can use the Ecwid Web Control Panel at <a %s>my.ecwid.com</a>. Your store front is working fine as well and you can check it here: <a %s>%s</a>.'),
|
48 |
+
$wp_remote_post_error,
|
49 |
+
'href="mailto:wordpress@ecwid.com"',
|
50 |
+
'target="_blank" href="http://my.ecwid.com"',
|
51 |
+
'href="' . ecwid_get_store_page_url() . '" target="_blank"',
|
52 |
+
ecwid_get_store_page_url()
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
return $message;
|
57 |
+
}
|
58 |
+
|
59 |
public static function show_message($name, $params = array())
|
60 |
{
|
61 |
$mm = self::get_instance();
|
236 |
'primary_title' => __('Rate Ecwid at WordPress.org', 'ecwid-shopping-cart'),
|
237 |
'primary_url' => 'http://wordpress.org/support/view/plugin-reviews/ecwid-shopping-cart',
|
238 |
'hideable' => true
|
239 |
+
),
|
240 |
+
|
241 |
+
'no_oauth' => array(
|
242 |
+
|
243 |
+
'message' => Ecwid_Message_Manager::get_oauth_message(),
|
244 |
+
'hideable' => false,
|
245 |
+
'type' => 'error'
|
246 |
)
|
247 |
);
|
248 |
}
|
includes/class-ecwid-oauth.php
CHANGED
@@ -144,7 +144,7 @@ class Ecwid_OAuth {
|
|
144 |
|
145 |
public function disconnect_store()
|
146 |
{
|
147 |
-
update_option( 'ecwid_store_id',
|
148 |
update_option( 'ecwid_oauth_token', '' );
|
149 |
update_option( 'ecwid_is_api_enabled', 'off' );
|
150 |
update_option( 'ecwid_api_check_time', 0 );
|
144 |
|
145 |
public function disconnect_store()
|
146 |
{
|
147 |
+
update_option( 'ecwid_store_id', ECWID_DEMO_STORE_ID );
|
148 |
update_option( 'ecwid_oauth_token', '' );
|
149 |
update_option( 'ecwid_is_api_enabled', 'off' );
|
150 |
update_option( 'ecwid_api_check_time', 0 );
|
lib/ecwid_platform.php
CHANGED
@@ -22,11 +22,11 @@ class EcwidPlatform {
|
|
22 |
$use_file_get_contents = get_option('ecwid_fetch_url_use_file_get_contents', false);
|
23 |
|
24 |
if ($use_file_get_contents == 'Y') {
|
25 |
-
$result = file_get_contents($url);
|
26 |
} else {
|
27 |
$result = wp_remote_get( $url, array( 'timeout' => get_option( 'ecwid_remote_get_timeout', 5 ) ) );
|
28 |
if (!is_array($result)) {
|
29 |
-
$result = file_get_contents($url);
|
30 |
if (!empty($result)) {
|
31 |
update_option('ecwid_fetch_url_use_file_get_contents', true);
|
32 |
}
|
22 |
$use_file_get_contents = get_option('ecwid_fetch_url_use_file_get_contents', false);
|
23 |
|
24 |
if ($use_file_get_contents == 'Y') {
|
25 |
+
$result = @file_get_contents($url);
|
26 |
} else {
|
27 |
$result = wp_remote_get( $url, array( 'timeout' => get_option( 'ecwid_remote_get_timeout', 5 ) ) );
|
28 |
if (!is_array($result)) {
|
29 |
+
$result = @file_get_contents($url);
|
30 |
if (!empty($result)) {
|
31 |
update_option('ecwid_fetch_url_use_file_get_contents', true);
|
32 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: ecwid
|
|
3 |
Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.4
|
6 |
-
Stable tag: 4.0.
|
7 |
|
8 |
Ecwid is a full-featured shopping cart that can be added to any Wordpress site in less than 5 minutes. Start using Ecwid for free today.
|
9 |
|
@@ -107,11 +107,13 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
|
|
107 |
* [Ecwid site](http://www.ecwid.com/?source=wporg-plugin-site "Ecwid Site")
|
108 |
|
109 |
== Changelog ==
|
110 |
-
= 4.0.
|
111 |
- **Built-in Full-featured Store Control Panel.** You can now manage your store, add new products, track sales and more right in your Wordpress site admin backend. No redirects, no external dashboards, no extra login/password – you now have a single place and single login to manage your site and your store. To make it even better, we added the Products and Sales shortcuts to your Wordpress admin menu – feel free to use them to easily access your inventory and sales list.
|
112 |
- **New Drop-down Categories Menu.** Noticed how Wordpress automatically updates your site menu adding your site pages to it? Ecwid now does it too: open "Appearance -> Menus" in your Wordpress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site. It will keep the categories list up to date even if you often change your store categories. Rest assured your customers can easily quickly get to the category of products they are interested in right from the site menu.
|
113 |
- **More Store Menu Items for your site.** In addition to the drop-down categories list, the new "Store" menus section under Appearance -> Menus provides "Search", "Cart" and "My Account" items. Add those quick links to your site for your customers to browse your store easier.
|
114 |
-
- **Bug Fixes and Improvements.** As usual, we fine-tuned the plugin and fixed a few bugs.
|
|
|
|
|
115 |
|
116 |
= 3.4.7 =
|
117 |
- Fixed a few layout issues in three popular Wordpress themes: Responsive, Attitude, ResponsiveBoat.
|
3 |
Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.4
|
6 |
+
Stable tag: 4.0.2
|
7 |
|
8 |
Ecwid is a full-featured shopping cart that can be added to any Wordpress site in less than 5 minutes. Start using Ecwid for free today.
|
9 |
|
107 |
* [Ecwid site](http://www.ecwid.com/?source=wporg-plugin-site "Ecwid Site")
|
108 |
|
109 |
== Changelog ==
|
110 |
+
= 4.0.2 =
|
111 |
- **Built-in Full-featured Store Control Panel.** You can now manage your store, add new products, track sales and more right in your Wordpress site admin backend. No redirects, no external dashboards, no extra login/password – you now have a single place and single login to manage your site and your store. To make it even better, we added the Products and Sales shortcuts to your Wordpress admin menu – feel free to use them to easily access your inventory and sales list.
|
112 |
- **New Drop-down Categories Menu.** Noticed how Wordpress automatically updates your site menu adding your site pages to it? Ecwid now does it too: open "Appearance -> Menus" in your Wordpress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site. It will keep the categories list up to date even if you often change your store categories. Rest assured your customers can easily quickly get to the category of products they are interested in right from the site menu.
|
113 |
- **More Store Menu Items for your site.** In addition to the drop-down categories list, the new "Store" menus section under Appearance -> Menus provides "Search", "Cart" and "My Account" items. Add those quick links to your site for your customers to browse your store easier.
|
114 |
+
- **Bug Fixes and Improvements.** As usual, we fine-tuned the plugin and fixed a few bugs.
|
115 |
+
|
116 |
+
We wish you happy holidays and all the best in the New Year! Sincerely yours, Ecwid team.
|
117 |
|
118 |
= 3.4.7 =
|
119 |
- Fixed a few layout issues in three popular Wordpress themes: Responsive, Attitude, ResponsiveBoat.
|
templates/connect.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
</div>
|
19 |
<div class="connect-button">
|
20 |
<a href="admin-post.php?action=ecwid_connect" class="with-oauth"><?php _e( 'Connect Ecwid store', 'ecwid-shopping-cart' ); ?></a>
|
21 |
-
<a id="ecwid-connect-no-oauth" href="admin-post.php?action=ecwid_connect" class="no-oauth"><?php _e( 'Save and connect', 'ecwid-shopping-cart' ); ?></a>
|
22 |
</div>
|
23 |
|
24 |
<?php if (!$connection_error): ?>
|
@@ -29,11 +29,11 @@
|
|
29 |
|
30 |
<?php else: ?>
|
31 |
|
32 |
-
|
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 endif; ?>
|
39 |
|
18 |
</div>
|
19 |
<div class="connect-button">
|
20 |
<a href="admin-post.php?action=ecwid_connect" class="with-oauth"><?php _e( 'Connect Ecwid store', 'ecwid-shopping-cart' ); ?></a>
|
21 |
+
<a id="ecwid-connect-no-oauth" href="admin-post.php?action=ecwid_connect" class="no-oauth" style="white-space: nowrap; width:auto"><?php _e( 'Save and connect', 'ecwid-shopping-cart' ); ?></a>
|
22 |
</div>
|
23 |
|
24 |
<?php if (!$connection_error): ?>
|
29 |
|
30 |
<?php else: ?>
|
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 endif; ?>
|
39 |
|
templates/dashboard.php
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="wrap ecwid-admin ecwid-dashboard">
|
2 |
<div class="box">
|
3 |
<div class="head">
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
$post_result = wp_remote_post('https://my.ecwid.com/api/oauth/token');
|
4 |
+
if (is_object($post_result) && @$post_result->get_error_message()) {
|
5 |
+
$message = $post_result->get_error_message();
|
6 |
+
}
|
7 |
+
if ($message) {
|
8 |
+
Ecwid_Message_Manager::show_message('no_oauth', array('message' => Ecwid_Message_Manager::get_oauth_message($message)));
|
9 |
+
} else {
|
10 |
+
}
|
11 |
+
*/
|
12 |
+
Ecwid_Message_Manager::show_message('no_oauth');
|
13 |
+
?>
|
14 |
<div class="wrap ecwid-admin ecwid-dashboard">
|
15 |
<div class="box">
|
16 |
<div class="head">
|