Skip to content

Commit 512ee01

Browse files
authored
Merge pull request #202 from moderntribe/release/3.14.0
packaged version 3.14.0
2 parents 3b9145b + 2b483a8 commit 512ee01

22 files changed

+255
-43
lines changed

CHANGELOG.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [3.14.0]
4+
5+
### Added
6+
- Added a missing entry to the 3.0.0 changelog regarding fixing the uninstaller.
7+
8+
### Fixed
9+
- When the site url changes, the connected channel site URL is also updated.
10+
11+
### Changed
12+
- Added a new notification in the Diagnostics panel to call out when template
13+
overrides are being used.
14+
- Enhanced the template for product cards by adding additional classes related
15+
to product statuses.
16+
- bc-\[product-id\]
17+
- bc-availability-*
18+
- bc-product-sale
19+
- bc-product-outofstock
20+
- bc-product-lowinventory
21+
322
## [3.13.0]
423

524
### Added
@@ -18,9 +37,6 @@
1837
upon completion of the order. This resolves an issue on smaller screens where
1938
the window would be stuck at the bottom of the page.
2039

21-
### Fixed
22-
23-
2440
## [3.12.0]
2541

2642
### Added

assets/css/bc-admin.css

+32-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/bc-admin.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/admin/scripts.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/admin/scripts.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/src/admin/templates/diagnostics.js

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ export const bigCommerceDiagnostics = data => (
2323
<h1 class="h1 bc-diagnostics-data--success">
2424
<i class="bc-icon icon-bc-order_confirmation"></i> ${I18N.messages.diagnostics_success_message}
2525
</h1>
26+
27+
${Object.values(data).map(group => (
28+
group.key === 'bigcommerce' ?
29+
Object.values(group.value).map(values => (
30+
values.key === 'templateoverrides' && values.value.length > 0 ?
31+
`<div class="bc-diagnostics-data__notice">
32+
<i class="dashicons-before dashicons-warning"></i>
33+
<span class="bc-diagnostics-data__notice--overrides">${I18N.messages.diagnostics_template_overrides_message}</span>
34+
</div>`
35+
: ''
36+
)).join('')
37+
: ''
38+
)).join('')}
39+
2640
${Object.values(data).map(group => (
2741
`<div class="bc-diagnostics-data__section bc-diagnostics-data__section-${group.key}">
2842
<h2 class="h2 bc-diagnostics-data__section-header">${group.label}</h2>

assets/pcss/admin/pages/settings/_plugin-settings.pcss

+25
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,31 @@
272272
}
273273
}
274274

275+
.bc-diagnostics-data__notice {
276+
background-color: var(--color-off-white);
277+
color: var(--color-bc-red);
278+
font-size: 1.35em;
279+
line-height: 1.55em;
280+
padding: 12px;
281+
margin-bottom: 25px;
282+
display: flex;
283+
flex-direction: row;
284+
flex-wrap: nowrap;
285+
286+
i {
287+
flex: 0 0 20px;
288+
margin-right: 10px;
289+
290+
&:before {
291+
line-height: 1.55em;
292+
}
293+
}
294+
295+
span {
296+
flex: 1;
297+
}
298+
}
299+
275300
.bc-settings-section--nav_menu {
276301

277302
.bc-settings-section__nav-menu-item-label {

bigcommerce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: BigCommerce for WordPress
44
Description: Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
55
Author: BigCommerce
6-
Version: 3.13.0
6+
Version: 3.14.0
77
Author URI: https://www.bigcommerce.com/wordpress
88
Requires PHP: 5.6.24
99
Text Domain: bigcommerce

build-timestamp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?php
2-
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '6.24.01.31.2020');
2+
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '6.12.02.21.2020');

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: bigcommerce, moderntribe, jbrinley, becomevocal, vincentlistrani,
33
Tags: ecommerce, online store, sell online, storefront, retail, online shop, bigcommerce, big commerce, e-commerce, physical products, buy buttons, commerce, shopping cart, checkout, cart, shop, headless commerce, shipping, payments, fulfillment
44
Requires at least: 4.6
55
Tested up to: 5.3
6-
Stable tag: 3.13.0
6+
Stable tag: 3.14.0
77
Requires PHP: 5.6.24
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

src/BigCommerce/Assets/Admin/JS_Localization.php

+14-13
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ public function get_data() {
2121
'oauth_popup_trigger' => __( 'Click here to authorize WordPress to connect to your BigCommerce account', 'bigcommerce' ),
2222
],
2323
'messages' => [
24-
'ajax_error' => __( 'There was an error submitting or retrieving your request. Please try again.', 'bigcommerce' ),
25-
'no_results' => __( 'We could not find any products that matched your query. Please clear your search and try again.', 'bigcommerce' ),
26-
'no_products' => __( 'We could not find any products that matched your query. Please edit this block and try again.', 'bigcommerce' ),
27-
'excessive_attempts' => __( 'We are still working on connecting your account. It should not be too much longer.', 'bigcommerce' ),
28-
'account_connection_error' => __( 'There was an error connecting your account:', 'bigcommerce' ),
29-
'account_connection_code' => __( 'Error Code:', 'bigcommerce' ),
30-
'account_connection_message' => __( 'Error Message:', 'bigcommerce' ),
31-
'account_creation_message' => __( "We're getting your account ready.", 'bigcommerce' ),
32-
'channel_confirmation' => __( "The %s channel will point to this site's URL and its route settings will be updated in BigCommerce.", 'bigcommerce' ),
33-
'diagnostics_success_message' => __( 'Data retrieved successfully', 'bigcommerce' ),
34-
'diagnostics_request_error_header' => __( 'Diagnostics Unavailable', 'bigcommerce' ),
35-
'diagnostics_request_error_message' => __( 'There was an error trying to retrieve information about your site. Please try again.', 'bigcommerce' ),
36-
'sync' => [
24+
'ajax_error' => __( 'There was an error submitting or retrieving your request. Please try again.', 'bigcommerce' ),
25+
'no_results' => __( 'We could not find any products that matched your query. Please clear your search and try again.', 'bigcommerce' ),
26+
'no_products' => __( 'We could not find any products that matched your query. Please edit this block and try again.', 'bigcommerce' ),
27+
'excessive_attempts' => __( 'We are still working on connecting your account. It should not be too much longer.', 'bigcommerce' ),
28+
'account_connection_error' => __( 'There was an error connecting your account:', 'bigcommerce' ),
29+
'account_connection_code' => __( 'Error Code:', 'bigcommerce' ),
30+
'account_connection_message' => __( 'Error Message:', 'bigcommerce' ),
31+
'account_creation_message' => __( "We're getting your account ready.", 'bigcommerce' ),
32+
'channel_confirmation' => __( "The %s channel will point to this site's URL and its route settings will be updated in BigCommerce.", 'bigcommerce' ),
33+
'diagnostics_success_message' => __( 'Data retrieved successfully', 'bigcommerce' ),
34+
'diagnostics_request_error_header' => __( 'Diagnostics Unavailable', 'bigcommerce' ),
35+
'diagnostics_request_error_message' => __( 'There was an error trying to retrieve information about your site. Please try again.', 'bigcommerce' ),
36+
'diagnostics_template_overrides_message' => __( 'If you are experiencing issues, it may be due to template overrides that rely on older versions of the plugin. Please review your overrides and remove any that may not be necessary.', 'bigcommerce' ),
37+
'sync' => [
3738
'success' => __( 'Products Successfully Synced', 'bigcommerce' ),
3839
'error' => __( 'There was an error syncing your products. Please try to import again. If the error persists, please contact support.', 'bigcommerce' ),
3940
'timeout' => __( 'The server is taking longer than expected to respond. We’ll keep trying, but it may take a few minutes to get things moving again. If the problem persists, try reducing the batch size in the Product Sync settings panel.', 'bigcommerce' ),

src/BigCommerce/Container/Settings.php

+20-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use BigCommerce\Settings\Sections\Next_Steps;
3737
use BigCommerce\Settings\Sections\Reviews;
3838
use BigCommerce\Settings\Sections\Troubleshooting_Diagnostics;
39+
use BigCommerce\Settings\Site_Update;
3940
use BigCommerce\Settings\Start_Over;
4041
use BigCommerce\Taxonomies\Channel\Channel;
4142
use Pimple\Container;
@@ -74,7 +75,7 @@ class Settings extends Provider {
7475
const IMPORT_LIVE_STATUS = 'settings.import_status_live';
7576
const START_OVER = 'settings.start_over';
7677
const ONBOARDING_PROGRESS = 'settings.onboarding.progress_bar';
77-
78+
const SITE_UPDATE = 'settings.site_update';
7879

7980
const CONFIG_STATUS = 'settings.configuration_status';
8081
const CONFIG_DISPLAY_MENUS = 'settings.configuration_display_menus';
@@ -103,6 +104,7 @@ public function register( Container $container ) {
103104
$this->diagnostics( $container );
104105
$this->set_menus_default_visibility( $container );
105106
$this->resources( $container );
107+
$this->site_update( $container );
106108

107109
}
108110

@@ -651,4 +653,21 @@ private function resources( Container $container ) {
651653
return $container[ self::RESOURCES_SCREEN ]->get_url();
652654
} ), 10, 1 );
653655
}
656+
657+
private function site_update( $container ) {
658+
$container[ self::SITE_UPDATE ] = function () use ( $container ) {
659+
return new Site_Update(
660+
$container[ Api::FACTORY ]->sites(),
661+
get_option( Channel::CHANNEL_ID )
662+
);
663+
};
664+
665+
add_filter( 'pre_update_option_siteurl', function( $option ) use ($container ) {
666+
return $container[ self::SITE_UPDATE ]->update_bc_channel_site_url( $option );
667+
});
668+
669+
add_filter( 'bigcommerce/settings/channel_site_url', $this->create_callback( 'channel_site_url', function ( $url ) use ( $container ) {
670+
return $container[ self::SITE_UPDATE ]->get_bc_channel_site_url( $url );
671+
} ), 10, 1 );
672+
}
654673
}

src/BigCommerce/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace BigCommerce;
55

66
class Plugin {
7-
const VERSION = '3.13.0';
7+
const VERSION = '3.14.0';
88

99
protected static $_instance;
1010

src/BigCommerce/Settings/Sections/Channels.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function render_other_channels() {
135135
}
136136

137137
/**
138-
* Retrive all Channel taxonomy terms with the
138+
* Retrieve all Channel taxonomy terms with the
139139
* given connection status.
140140
*
141141
* @param string $status

src/BigCommerce/Settings/Sections/Troubleshooting_Diagnostics.php

+9
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ public function get_diagnostics_data() {
290290
'key' => 'templateoverrides',
291291
'value' => $this->get_template_overrides(),
292292
],
293+
[
294+
'label' => __( 'Stored Channel URL', 'bigcommerce' ),
295+
'key' => 'bcsiteurl',
296+
'value' => $this->get_bc_url(),
297+
]
293298
],
294299
],
295300
];
@@ -303,6 +308,10 @@ public function get_diagnostics_data() {
303308
wp_die( '', '', [ 'response' => null ] );
304309
}
305310

311+
private function get_bc_url() {
312+
return apply_filters( 'bigcommerce/settings/channel_site_url', null );
313+
}
314+
306315

307316
/**
308317
* @return array List of active plugins
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
namespace BigCommerce\Settings;
4+
5+
6+
use BigCommerce\Api\v3\Api\SitesApi;
7+
use BigCommerce\Api\v3\ApiException;
8+
9+
class Site_Update {
10+
11+
/**
12+
* @var SitesApi
13+
*/
14+
private $sites_api;
15+
private $channel;
16+
17+
public function __construct( SitesApi $sites_api, $channel ) {
18+
$this->sites_api = $sites_api;
19+
$this->channel = $channel;
20+
}
21+
22+
/**
23+
* @param $option
24+
*
25+
* @return mixed
26+
*
27+
* @filter pre_update_option_siteurl
28+
*/
29+
public function update_bc_channel_site_url( $option ) {
30+
if ( ! $this->channel ) {
31+
return $option;
32+
}
33+
34+
try {
35+
$channel_site = $this->sites_api->getChannelSite( $this->channel );
36+
} catch ( ApiException $exception ) {
37+
return $option;
38+
}
39+
40+
$site_data = $channel_site->getData();
41+
$site_data->setUrl( $option );
42+
43+
try{
44+
$this->sites_api->putChannelSite( $this->channel, $site_data );
45+
} catch ( ApiException $exception ) {
46+
return $option;
47+
}
48+
49+
return $option;
50+
}
51+
52+
/**
53+
* @param $url
54+
*
55+
* @return string
56+
*
57+
* @filter bigcommerce/settings/channel_site_url
58+
*/
59+
public function get_bc_channel_site_url( $url ) {
60+
try {
61+
$channel_site = $this->sites_api->getChannelSite( $this->channel );
62+
} catch ( ApiException $exception ) {
63+
return $url;
64+
}
65+
66+
return $channel_site->getData()->getUrl();
67+
}
68+
}

src/BigCommerce/Templates/Product_Card.php

+15-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class Product_Card extends Controller {
2020

2121
protected $template = 'components/products/product-card.php';
2222
protected $wrapper_tag = 'div';
23-
protected $wrapper_classes = [ 'bc-product-card' ];
2423
protected $wrapper_attributes = [ 'data-js' => 'bc-product-loop-card' ];
2524

2625
protected function parse_options( array $options ) {
@@ -119,4 +118,18 @@ protected function get_form( Product $product ) {
119118

120119
return $component->render();
121120
}
122-
}
121+
122+
protected function get_wrapper_classes() {
123+
/** @var Product $product */
124+
$product = $this->options[ self::PRODUCT ];
125+
126+
return [
127+
'bc-product-card',
128+
'bc-' . $product->bc_id(),
129+
'bc-product-availability--' . $product->availability(),
130+
$product->out_of_stock() ? 'bc-product-outofstock' : '',
131+
$product->low_inventory() ? 'bc-product-lowinventory' : '',
132+
$product->on_sale() ? 'bc-product-sale' : '',
133+
];
134+
}
135+
}

src/BigCommerce/Templates/Related_Product.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Related_Product extends Controller {
1818

1919
protected $template = 'components/products/related-product-card.php';
2020
protected $wrapper_tag = 'div';
21-
protected $wrapper_classes = [ 'bc-product-card', 'bc-product-card--related' ];
2221
protected $wrapper_attributes = [ 'data-js' => 'bc-product-loop-card' ];
2322

2423
protected function parse_options( array $options ) {
@@ -99,4 +98,19 @@ protected function get_form( Product $product ) {
9998

10099
return $component->render();
101100
}
102-
}
101+
102+
protected function get_wrapper_classes() {
103+
/** @var Product $product */
104+
$product = $this->options[ self::PRODUCT ];
105+
106+
return [
107+
'bc-product-card',
108+
'bc-product-card--related',
109+
'bc-' . $product->bc_id(),
110+
'bc-product-availability--' . $product->availability(),
111+
$product->out_of_stock() ? 'bc-product-outofstock' : '',
112+
$product->low_inventory() ? 'bc-product-lowinventory' : '',
113+
$product->on_sale() ? 'bc-product-sale' : '',
114+
];
115+
}
116+
}

vendor/autoload.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
require_once __DIR__ . '/composer/autoload_real.php';
66

7-
return ComposerAutoloaderInit5238ee7ccd477b06ad89fd537de170a2::getLoader();
7+
return ComposerAutoloaderInit2e96b28ead25d1bf259e781ae2cb21fa::getLoader();

vendor/composer/autoload_classmap.php

+1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@
589589
'BigCommerce\\Settings\\Sections\\Units' => $baseDir . '/src/BigCommerce/Settings/Sections/Units.php',
590590
'BigCommerce\\Settings\\Sections\\Wishlists' => $baseDir . '/src/BigCommerce/Settings/Sections/Wishlists.php',
591591
'BigCommerce\\Settings\\Sections\\WithPages' => $baseDir . '/src/BigCommerce/Settings/Sections/WithPages.php',
592+
'BigCommerce\\Settings\\Site_Update' => $baseDir . '/src/BigCommerce/Settings/Site_Update.php',
592593
'BigCommerce\\Settings\\Start_Over' => $baseDir . '/src/BigCommerce/Settings/Start_Over.php',
593594
'BigCommerce\\Shortcodes\\Account_Profile' => $baseDir . '/src/BigCommerce/Shortcodes/Account_Profile.php',
594595
'BigCommerce\\Shortcodes\\Address_List' => $baseDir . '/src/BigCommerce/Shortcodes/Address_List.php',

0 commit comments

Comments
 (0)