Skip to content

Commit 6734bb3

Browse files
authored
Merge pull request #419 from moderntribe/release/5.0.2
packaged version 5.0.2
2 parents a98f9e2 + 3510554 commit 6734bb3

25 files changed

+344
-112
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [5.0.2]
4+
5+
### Added
6+
- Add ability to use original image proportion on product single page. Go to Apperance → Bigcommerce → Product Single and change image size to original.
7+
8+
### Changed
9+
- Show variant SKU if product SKU is not added or missing
10+
11+
### Fixed
12+
- Prevent import fail on Analytics Settings retrieval due to outdated API use
13+
- Fix search issue with product widget block while using fast(headless) import. Allow searching by SKU, name
14+
315
## [5.0.1]
416

517
### Fixed
@@ -1877,6 +1889,7 @@
18771889
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
18781890

18791891

1892+
[5.0.2]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.1...5.0.2
18801893
[5.0.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.0...5.0.1
18811894
[5.0.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.37.0...5.0.0
18821895
[4.37.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.36.0...4.37.0

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: 5.0.1
6+
Version: 5.0.2
77
Author URI: https://www.bigcommerce.com/wordpress
88
Requires PHP: 7.4.0
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', '4.11.02.16.2023');
2+
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '3.41.03.24.2023');

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: 5.2
55
Tested up to: 6.0.3
6-
Stable tag: 5.0.1
6+
Stable tag: 5.0.2
77
Requires PHP: 7.4.0
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

src/BigCommerce/Api/Store_Api.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,14 @@ private function update_server_time() {
101101
public function get_analytics_settings() {
102102
try {
103103
$settings = $this->getCollection( '/settings/analytics' );
104+
105+
if ( empty( $settings ) ) {
106+
return [];
107+
}
104108
$settings = array_map( function ( Resource $resource ) {
105109
return get_object_vars( $resource->getUpdateFields() );
106110
}, $settings );
107-
} catch ( \Exception $e ) {
111+
} catch ( \Throwable $e ) {
108112
$settings = [];
109113
}
110114

src/BigCommerce/Container/Import.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private function process( Container $container ) {
234234
};
235235

236236
$container[ self::STORE ] = function ( Container $container ) {
237-
return new Processors\Store_Settings( $container[ Api::FACTORY ]->store(), $container[ self::CUSTOMER_DEFAULT_GROUP ], $container[ self::MSF_STOREFRONT_PROCESSOR ] );
237+
return new Processors\Store_Settings( $container[ Api::FACTORY ]->store(), $container[ self::CUSTOMER_DEFAULT_GROUP ], $container[ self::MSF_STOREFRONT_PROCESSOR ], $container[ Api::FACTORY ]->storefront_settings() );
238238
};
239239

240240
$container[ self::CURRENCIES ] = function ( Container $container ) {

src/BigCommerce/Container/Settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ private function accounts( Container $container ) {
440440

441441
private function analytics( Container $container ) {
442442
$container[ self::ANALYTICS_SECTION ] = function ( Container $container ) {
443-
return new Analytics_Settings( $container[ Api::FACTORY ]->store() );
443+
return new Analytics_Settings( $container[ Api::FACTORY ]->store(), $container[ Api::FACTORY ]->storefront_settings() );
444444
};
445445

446446
add_action( 'bigcommerce/settings/register/screen=' . Settings_Screen::NAME, $this->create_callback( 'analytics_settings_register', function () use ( $container ) {

src/BigCommerce/Customizer/Sections/Product_Single.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Product_Single {
2121
const ENABLE_PRICE_NONCE = 'bigcommerce_enable_price_nonce';
2222
const SIZE_DEFAULT = 'default';
2323
const SIZE_LARGE = 'large';
24+
const SIZE_ORIGINAL = 'original';
2425
const SIZE_CDN_STD = 'standard';
2526
const SIZE_CDN_THUMB = 'thumbnail';
2627

@@ -95,8 +96,9 @@ private function gallery_size( \WP_Customize_Manager $wp_customize ) {
9596
'type' => 'radio',
9697
'label' => __( 'Image Gallery Size', 'bigcommerce' ),
9798
'choices' => [
98-
self::SIZE_DEFAULT => __( 'Default', 'bigcommerce' ),
99-
self::SIZE_LARGE => __( 'Large', 'bigcommerce' ),
99+
self::SIZE_DEFAULT => __( 'Default', 'bigcommerce' ),
100+
self::SIZE_LARGE => __( 'Large', 'bigcommerce' ),
101+
self::SIZE_ORIGINAL => __( 'Original', 'bigcommerce' ),
100102
],
101103
] );
102104
}

src/BigCommerce/Editor/Editor_Dialog_Template.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use BigCommerce\Customizer\Sections\Product_Archive;
77
use BigCommerce\Exceptions\Channel_Not_Found_Exception;
8+
use BigCommerce\Import\Import_Type;
89
use BigCommerce\Rest\Products_Controller;
910
use BigCommerce\Rest\Shortcode_Controller;
1011
use BigCommerce\Taxonomies\Brand\Brand;
@@ -104,7 +105,7 @@ private function query_builder() {
104105

105106
return $this->render_template( 'query-builder.php', [
106107
'featured' => $featured,
107-
'sale' => $sale,
108+
'sale' => Import_Type::is_traditional_import() && $sale,
108109
'brands' => $brand_choices,
109110
'categories' => $category_choices,
110111
'channels' => $channels,

src/BigCommerce/Import/Processors/Store_Settings.php

+20-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66

77
use Bigcommerce\Api\Client;
88
use BigCommerce\Api\Store_Api;
9+
use BigCommerce\Api\v3\Api\SettingsApi;
910
use BigCommerce\Api\v3\ApiException;
1011
use BigCommerce\Import\Runner\Status;
1112
use BigCommerce\Logging\Error_Log;
1213
use BigCommerce\Post_Types\Product\Product;
1314
use BigCommerce\Settings;
15+
use BigCommerce\Taxonomies\Channel\Channel;
16+
use BigCommerce\Taxonomies\Channel\Connections;
1417

1518
class Store_Settings implements Import_Processor {
1619

@@ -39,8 +42,14 @@ class Store_Settings implements Import_Processor {
3942
*/
4043
private $storefront_processor;
4144

42-
public function __construct( Store_Api $store_api, Default_Customer_Group $default_customer_group, Storefront_Processor $storefront_processor ) {
45+
/**
46+
* @var \BigCommerce\Api\v3\Api\SettingsApi
47+
*/
48+
private $api_v3;
49+
50+
public function __construct( Store_Api $store_api, Default_Customer_Group $default_customer_group, Storefront_Processor $storefront_processor, SettingsApi $api ) {
4351
$this->store_api = $store_api;
52+
$this->api_v3 = $api;
4453
$this->default_customer_group = $default_customer_group;
4554
$this->storefront_processor = $storefront_processor;
4655
}
@@ -75,9 +84,16 @@ public function run() {
7584
];
7685

7786
if ( get_option( Settings\Sections\Analytics::SYNC_ANALYTICS, 1 ) ) {
78-
$analytics = $this->store_api->get_analytics_settings();
79-
$settings[ Settings\Sections\Analytics::FACEBOOK_PIXEL ] = $this->extract_facebook_pixel_id( $analytics );
80-
$settings[ Settings\Sections\Analytics::GOOGLE_ANALYTICS ] = $this->extract_google_analytics_id( $analytics );
87+
$connections = new Connections();
88+
$channel = $connections->current();
89+
$analytics = $this->api_v3->getStoreAnalyticsSettings( (int) get_term_meta( $channel->term_id, Channel::CHANNEL_ID, true ));
90+
91+
if ( ! empty( $analytics->data ) ) {
92+
$analytics = json_decode( json_encode( $analytics->data ), true );
93+
$settings[ Settings\Sections\Analytics::FACEBOOK_PIXEL ] = $this->extract_facebook_pixel_id( $analytics );
94+
$settings[ Settings\Sections\Analytics::GOOGLE_ANALYTICS ] = $this->extract_google_analytics_id( $analytics );
95+
}
96+
8197
}
8298

8399
do_action( 'bigcommerce/log', Error_Log::DEBUG, __( 'Retrieved store settings', 'bigcommerce' ), [

src/BigCommerce/Import/Task_Manager.php

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function run_next( $state ) {
100100
} catch ( No_Task_Found_Exception $e ) {
101101
do_action( 'bigcommerce/log', Error_Log::NOTICE, __( 'No handler found for current import state', 'bigcommerce' ), [
102102
'state' => $state,
103+
'import' => Import_Type::is_traditional_import() ? 'full' : 'headless',
103104
] );
104105
do_action( 'bigcommerce/log', Error_Log::DEBUG, $e->getTraceAsString(), [] );
105106

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 = '5.0.1';
7+
const VERSION = '5.0.2';
88

99
protected static $_instance;
1010

0 commit comments

Comments
 (0)