plugin updates

This commit is contained in:
Tony Volpe
2024-09-17 10:43:54 -04:00
parent 44b413346f
commit b7c8882c8c
1359 changed files with 58219 additions and 11364 deletions

View File

@@ -10,6 +10,7 @@ defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Internal\AssignDefaultCategory;
use Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController;
use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonAdminBarBadge;
use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonCacheInvalidator;
use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonRequestHandler;
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
@@ -26,8 +27,10 @@ use Automattic\WooCommerce\Internal\Traits\AccessiblePrivateMethods;
use Automattic\WooCommerce\Internal\Utilities\LegacyRestApiStub;
use Automattic\WooCommerce\Internal\Utilities\WebhookUtil;
use Automattic\WooCommerce\Internal\Admin\Marketplace;
use Automattic\WooCommerce\Internal\McStats;
use Automattic\WooCommerce\Proxies\LegacyProxy;
use Automattic\WooCommerce\Utilities\{LoggingUtil, RestApiUtil, TimeUtil};
use Automattic\WooCommerce\Internal\Logging\RemoteLogger;
/**
* Main WooCommerce Class.
@@ -43,7 +46,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '9.2.3';
public $version = '9.3.1';
/**
* WooCommerce Schema version.
@@ -309,6 +312,7 @@ final class WooCommerce {
self::add_filter( 'robots_txt', array( $this, 'robots_txt' ) );
add_filter( 'wp_plugin_dependencies_slug', array( $this, 'convert_woocommerce_slug' ) );
self::add_filter( 'woocommerce_register_log_handlers', array( $this, 'register_remote_log_handler' ) );
// These classes set up hooks on instantiation.
$container = wc_get_container();
@@ -326,6 +330,7 @@ final class WooCommerce {
$container->get( WebhookUtil::class );
$container->get( Marketplace::class );
$container->get( TimeUtil::class );
$container->get( ComingSoonAdminBarBadge::class );
$container->get( ComingSoonCacheInvalidator::class );
$container->get( ComingSoonRequestHandler::class );
@@ -402,6 +407,12 @@ final class WooCommerce {
$context
);
// Record fatal error stats.
$container = wc_get_container();
$mc_stats = $container->get( McStats::class );
$mc_stats->add( 'error', 'fatal-errors-during-shutdown' );
$mc_stats->do_server_side_stats();
/**
* Action triggered when there are errors during shutdown.
*
@@ -415,8 +426,6 @@ final class WooCommerce {
* Define WC Constants.
*/
private function define_constants() {
$upload_dir = wp_upload_dir( null, false );
$this->define( 'WC_ABSPATH', dirname( WC_PLUGIN_FILE ) . '/' );
$this->define( 'WC_PLUGIN_BASENAME', plugin_basename( WC_PLUGIN_FILE ) );
$this->define( 'WC_VERSION', $this->version );
@@ -435,8 +444,9 @@ final class WooCommerce {
*/
if ( defined( 'WC_LOG_DIR' ) ) {
$this->define( 'WC_LOG_DIR_CUSTOM', true );
} else {
$this->define( 'WC_LOG_DIR', LoggingUtil::get_log_directory( false ) );
}
$this->define( 'WC_LOG_DIR', LoggingUtil::get_log_directory() );
// These three are kept defined for compatibility, but are no longer used.
$this->define( 'WC_NOTICE_MIN_PHP_VERSION', '7.2' );
@@ -702,6 +712,11 @@ final class WooCommerce {
*/
include_once WC_ABSPATH . 'includes/wccom-site/class-wc-wccom-site.php';
/**
* Product Usage
*/
include_once WC_ABSPATH . 'includes/product-usage/class-wc-product-usage.php';
/**
* Libraries and packages.
*/
@@ -1304,4 +1319,16 @@ final class WooCommerce {
}
return $slug;
}
/**
* Register the remote log handler.
*
* @param \WC_Log_Handler[] $handlers The handlers to register.
*
* @return \WC_Log_Handler[]
*/
private function register_remote_log_handler( $handlers ) {
$handlers[] = wc_get_container()->get( RemoteLogger::class );
return $handlers;
}
}