Skip to content

Commit 68a805c

Browse files
authored
packaged version 4.24.0 (#332)
1 parent e2ae34c commit 68a805c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+506
-317
lines changed

CHANGELOG.md

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

3+
## [4.24.0]
4+
5+
### Added
6+
- Added separate logging section for webhooks. The section can be found under Settings -> Diagnostics -> Get Diagnostics. It shows entries from webhooks incoming requests(validation issues, endpoints triggering, webhooks errors)
7+
8+
### Fixed
9+
- Fixed the customer's cache purging during the import final cleanup. Cache cleanup was moved to a background cron job in order to prevent the import process freeze due to the high amount of customers in the store
10+
311
## [4.23.0]
412

513
### Added
@@ -1688,6 +1696,7 @@
16881696
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
16891697

16901698

1699+
[4.23.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.23.0...4.24.0
16911700
[4.23.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.22.0...4.23.0
16921701
[4.22.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.21.1...4.22.0
16931702
[4.21.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.20.1...4.21.0

assets/js/dist/admin/gutenberg/scripts.js

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

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

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

assets/js/dist/admin/scripts.js

+4-4
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

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

assets/js/dist/scripts.js

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

assets/js/dist/scripts.min.js

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

assets/js/src/admin/settings/account-reset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import delegate from 'delegate';
99
import * as tools from '../.././utils/tools';
1010

1111
const el = {
12-
container: tools.getNodes('bc-welcome-start-over-trigger')[0],
12+
container: tools.getNodes('bc-welcome-start-over-trigger'),
1313
};
1414

1515
const instances = {};

assets/js/src/admin/shortcode-ui/dialog-ui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const toggleShortcodeUIDialog = (event) => {
156156
return;
157157
}
158158

159-
initDialogUI(target, params);
159+
initDialogUI([target], params);
160160
};
161161

162162
const init = () => {

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

+20-16
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,43 @@ 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-
26+
2727
${Object.values(data).map(group => (
2828
group.key === 'bigcommerce' ?
2929
Object.values(group.value).map(values => (
3030
values.key === 'templateoverrides' && values.value.length > 0 ?
3131
`<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>
32+
<i class="dashicons-before dashicons-warning"></i>
33+
<span class="bc-diagnostics-data__notice--overrides">${I18N.messages.diagnostics_template_overrides_message}</span>
3434
</div>`
3535
: ''
3636
)).join('')
3737
: ''
3838
)).join('')}
39-
39+
4040
${Object.values(data).map(group => (
4141
`<div class="bc-diagnostics-data__section bc-diagnostics-data__section-${group.key}">
4242
<h2 class="h2 bc-diagnostics-data__section-header">${group.label}</h2>
43-
44-
${Object.values(group.value).map(values => (
45-
`
46-
<div class="bc-diagnostics-data__meta bc-diagnostics-data__meta-${values.key}">
43+
44+
${Object.values(group.value).map((values) => {
45+
if (!values.key) {
46+
return null;
47+
}
48+
49+
return (
50+
`<div class="bc-diagnostics-data__meta bc-diagnostics-data__meta-${values.key}">
4751
<div class="bc-diagnostics-data__meta-label">${values.label}</div>
4852
<div class="bc-diagnostics-data__meta-value">${
4953
50-
values.key === 'importlogs' ?
51-
`${bigCommerceDiagnosticsLog(values.value)}`
52-
:
53-
`${bigCommerceDiagnosticsValues(values)}`
54-
}
54+
values.key === 'importlogs' && values.value.length > 0 ?
55+
`${bigCommerceDiagnosticsLog(values.value)}`
56+
:
57+
`${bigCommerceDiagnosticsValues(values)}`
58+
}
5559
</div>
56-
</div>
57-
`
58-
)).join('')}
60+
</div>`
61+
);
62+
}).join('')}
5963
</div>`
6064
)).join('')}
6165
</div>

assets/js/src/public/page/address.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const getOptions = dialogID => ({
3535
contentClasses: 'bc-account-address-form__content',
3636
wrapperClasses: 'bc-account-address-form__wrapper',
3737
closeButtonClasses: 'bc-account-address-form__close-button bc-icon icon-bc-cross u-bc-visual-hide',
38+
ariaLabelledBy: 'bc-address-form',
3839
});
3940

4041
/**

assets/js/src/public/product/variants.js

-8
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,6 @@ const initializeUniqueFieldIDs = (options = [], productVariantsID = '') => {
552552
radio.setAttribute('id', fieldID);
553553
});
554554
}
555-
556-
// Set the same UID for each select field.
557-
if (fieldType === 'product-form-option-select') {
558-
tools.getNodes('select', true, option, true).forEach((select) => {
559-
const fieldID = `${select.getAttribute('id')}[${productVariantsID}]`;
560-
select.setAttribute('id', fieldID);
561-
});
562-
}
563555
});
564556
};
565557

assets/js/src/public/wish-list/manage-dialogs.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const getOptions = dialogID => ({
2626
contentClasses: 'bc-wish-list-dialog-content-wrapper',
2727
wrapperClasses: 'bc-wish-list-dialog__wrapper',
2828
closeButtonClasses: 'bc-product-quick-view__close-button bc-icon icon-bc-cross',
29+
ariaLabelledBy: 'bc-wish-list-dialog-title',
2930
});
3031

3132
/**

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: 4.23.0
6+
Version: 4.24.0
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', '5.41.01.24.2022');
2+
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '5.08.02.15.2022');

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: 5.8.1
6-
Stable tag: 4.23.0
6+
Stable tag: 4.24.0
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/Container/Import.php

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ private function cron( Container $container ) {
117117
}
118118
$container[ self::PARALLEL_RUNNER ]->run();
119119
} ), 10, 0 );
120+
121+
add_action( Processors\Cleanup::CLEAN_USERS_TRANSIENT, $this->create_callback( 'clean_users_group_transient', function () use ( $container ) {
122+
$container[ self::CLEANUP ]->clean_customer_group_transients();
123+
} ), 10, 0 );
120124
}
121125

122126
private function process( Container $container ) {

src/BigCommerce/Container/Log.php

+20-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
namespace BigCommerce\Container;
44

55
use BigCommerce\Api\v3\Api\CatalogApi;
6-
use BigCommerce\Import\Runner\Status;
76
use BigCommerce\Logging\Error_Log;
87
use BigCommerce\Settings\Sections\Troubleshooting_Diagnostics;
98
use Pimple\Container;
109
use BigCommerce\Logging\Error_Log as Logger;
1110

1211
class Log extends Provider {
1312

14-
const LOGGER = 'logger.log';
15-
const LOG_PATH = 'logger.log_path';
13+
const LOGGER = 'logger.log';
14+
const LOG_PATH = 'logger.log_path';
15+
const LOG_FOLDER_PATH = 'logger.log_folder_path';
1616

1717
/**
1818
* @param Container $container
@@ -32,8 +32,19 @@ public function register( Container $container ) {
3232
return apply_filters( 'bigcommerce/logger/path', $log_path );
3333
};
3434

35+
$container[ self::LOG_FOLDER_PATH ] = function ( Container $container ) {
36+
$log_path = trailingslashit( wp_upload_dir()['basedir'] ) . 'logs/bigcommerce/';
37+
38+
/**
39+
* Filter the path to the debug logging file
40+
*
41+
* @param string $log_path The full file system path to the log file
42+
*/
43+
return apply_filters( 'bigcommerce/logger/custom_path', $log_path );
44+
};
45+
3546
$container[ self::LOGGER ] = function ( Container $container ) {
36-
return new Logger( $container[ self::LOG_PATH ] );
47+
return new Logger( $container[ self::LOG_PATH ], $container[ self::LOG_FOLDER_PATH ] );
3748
};
3849

3950

@@ -51,15 +62,16 @@ public function register( Container $container ) {
5162
return $container[ self::LOGGER ]->add_log_to_diagnostics( $diagnostics );
5263
} ), 10, 1 );
5364

54-
$log = $this->create_callback( 'log', function ( $level = Error_Log::INFO, $message = '', $context = [] ) use ( $container ) {
55-
$container[ self::LOGGER ]->log( $level, $message, $context );
65+
$log = $this->create_callback( 'log', function ( $level = Error_Log::INFO, $message = '', $context = [], $path = '' ) use ( $container ) {
66+
$container[ self::LOGGER ]->log( $level, $message, $context, $path );
5667
} );
57-
add_action( 'bigcommerce/log', $log, 10, 3 );
68+
add_action( 'bigcommerce/log', $log, 10, 4 );
5869
add_action( 'bigcommerce/import/log', $log, 10, 3 );
5970

71+
6072
add_action( 'bigcommerce/import/error', $this->create_callback( 'log_import_error', function ( $message, $context = [] ) use ( $container ) {
6173
$container[ self::LOGGER ]->log( Error_Log::ERROR, $message, $context );
6274
} ), 10, 2 );
6375
}
6476
}
65-
}
77+
}

src/BigCommerce/Import/Processors/Cleanup.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
class Cleanup implements Import_Processor {
1515

16+
const CLEAN_USERS_TRANSIENT = 'bigcommerce_users_transient_clean';
17+
1618
/** @var int */
1719
private $batch;
1820

@@ -48,7 +50,7 @@ public function run( $abort = false, $pre_import = false ) {
4850
}
4951

5052

51-
$this->clean_customer_group_transients();
53+
wp_schedule_single_event( time(), self::CLEAN_USERS_TRANSIENT );
5254

5355
wp_unschedule_hook( Cron_Runner::START_CRON );
5456
wp_unschedule_hook( Cron_Runner::CONTINUE_CRON );
@@ -96,7 +98,7 @@ private function clean_tasks( $pre_import = false ) {
9698
/**
9799
* Remove customers group transient cache after sync in order to retrieve fresh groups data
98100
*/
99-
private function clean_customer_group_transients(): void {
101+
public function clean_customer_group_transients(): void {
100102
$users_ids = get_users( [ 'fields' => 'ID' ] );
101103

102104
foreach ( $users_ids as $users_id ) {

0 commit comments

Comments
 (0)