plugin updates

This commit is contained in:
Tony Volpe
2024-11-15 13:53:04 -05:00
parent 1293d604ca
commit 0238f0c4ca
2009 changed files with 163492 additions and 89543 deletions

View File

@@ -24,12 +24,14 @@ use Automattic\WooCommerce\Database\Migrations\MigrationHelper;
use Automattic\WooCommerce\Internal\Admin\Marketing\MarketingSpecs;
use Automattic\WooCommerce\Internal\Admin\Notes\WooSubscriptionsNotes;
use Automattic\WooCommerce\Internal\AssignDefaultCategory;
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer;
use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore;
use Automattic\WooCommerce\Internal\ProductAttributesLookup\DataRegenerator;
use Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore;
use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Register as Download_Directories;
use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Synchronize as Download_Directories_Sync;
use Automattic\WooCommerce\Internal\Utilities\DatabaseUtil;
use Automattic\WooCommerce\Utilities\StringUtil;
/**
@@ -416,7 +418,7 @@ function wc_update_209_brazillian_state() {
// phpcs:disable WordPress.DB.SlowDBQuery
// Update brazillian state codes.
// Update Brazilian state codes.
$wpdb->update(
$wpdb->postmeta,
array(
@@ -2598,7 +2600,7 @@ function wc_update_770_remove_multichannel_marketing_feature_options() {
/**
* Migrate transaction data which was being incorrectly stored in the postmeta table to HPOS tables.
*
* @return bool Whether there are pending migration recrods.
* @return bool Whether there are pending migration records.
*/
function wc_update_810_migrate_transactional_metadata_for_hpos() {
global $wpdb;
@@ -2691,7 +2693,7 @@ function wc_update_890_update_connect_to_woocommerce_note() {
* Disables the PayPal Standard gateway for stores that aren't using it.
*
* PayPal Standard has been deprecated since WooCommerce 5.5, but there are some stores that have it showing up in their
* list of available Payment methods even if it's not setup. In WooComerce 8.9 we will disable PayPal Standard for those stores
* list of available Payment methods even if it's not setup. In WooCommerce 8.9 we will disable PayPal Standard for those stores
* to reduce the amount of new connections to the legacy gateway.
*
* Shows an admin notice to inform the store owner that PayPal Standard has been disabled and suggests installing PayPal Payments.
@@ -2852,3 +2854,69 @@ function wc_update_930_migrate_user_meta_for_launch_your_store_tour() {
)
);
}
/**
* Recreate FTS index if it already exists, so that phone number can be added to the index.
*/
function wc_update_940_add_phone_to_order_address_fts_index(): void {
$fts_already_exists = get_option( CustomOrdersTableController::HPOS_FTS_ADDRESS_INDEX_CREATED_OPTION ) === 'yes';
if ( ! $fts_already_exists ) {
return;
}
$hpos_controller = wc_get_container()->get( CustomOrdersTableController::class );
$result = $hpos_controller->recreate_order_address_fts_index();
if ( ! $result['status'] ) {
if ( class_exists( 'WC_Admin_Settings ' ) ) {
WC_Admin_Settings::add_error( $result['message'] );
}
}
}
/**
* Remove user meta associated with the key 'woocommerce_admin_help_panel_highlight_shown'.
*
* This key is no longer needed since the help panel spotlight tour has been removed.
*
* @return void
*/
function wc_update_940_remove_help_panel_highlight_shown() {
global $wpdb;
$meta_key = 'woocommerce_admin_help_panel_highlight_shown';
$deletions = $wpdb->query(
$wpdb->prepare(
"DELETE FROM $wpdb->usermeta WHERE meta_key = %s",
$meta_key
)
);
// Get the WooCommerce logger to track the results of the deletion.
$logger = wc_get_logger();
if ( null === $logger ) {
return;
}
if ( false === $deletions ) {
$logger->notice(
'During the update to 9.4.0, WooCommerce attempted to remove user meta with the key "woocommerce_admin_help_panel_highlight_shown", but was unable to do so.',
array(
'source' => 'wc-updater',
)
);
} else {
$logger->info(
sprintf(
1 === $deletions
? 'During the update to 9.4.0, WooCommerce removed %d user meta row associated with the meta key "woocommerce_admin_help_panel_highlight_shown".'
: 'During the update to 9.4.0, WooCommerce removed %d user meta rows associated with the meta key "woocommerce_admin_help_panel_highlight_shown".',
number_format_i18n( $deletions )
),
array(
'source' => 'wc-updater',
)
);
}
}