plugin updates
This commit is contained in:
@@ -23,6 +23,7 @@ use Automattic\WooCommerce\Internal\Settings\OptionSanitizer;
|
||||
use Automattic\WooCommerce\Internal\Utilities\WebhookUtil;
|
||||
use Automattic\WooCommerce\Internal\Admin\Marketplace;
|
||||
use Automattic\WooCommerce\Proxies\LegacyProxy;
|
||||
use Automattic\WooCommerce\Utilities\TimeUtil;
|
||||
|
||||
/**
|
||||
* Main WooCommerce Class.
|
||||
@@ -36,7 +37,7 @@ final class WooCommerce {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $version = '8.5.2';
|
||||
public $version = '8.6.1';
|
||||
|
||||
/**
|
||||
* WooCommerce Schema version.
|
||||
@@ -265,6 +266,7 @@ final class WooCommerce {
|
||||
$container->get( FeaturesController::class );
|
||||
$container->get( WebhookUtil::class );
|
||||
$container->get( Marketplace::class );
|
||||
$container->get( TimeUtil::class );
|
||||
|
||||
/**
|
||||
* These classes have a register method for attaching hooks.
|
||||
@@ -296,13 +298,32 @@ final class WooCommerce {
|
||||
public function log_errors() {
|
||||
$error = error_get_last();
|
||||
if ( $error && in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
|
||||
$error_copy = $error;
|
||||
$message = $error_copy['message'];
|
||||
unset( $error_copy['message'] );
|
||||
|
||||
$context = array(
|
||||
'source' => 'fatal-errors',
|
||||
'error' => $error_copy,
|
||||
);
|
||||
|
||||
if ( false !== strpos( $message, 'Stack trace:' ) ) {
|
||||
$segments = explode( 'Stack trace:', $message );
|
||||
$message = str_replace( PHP_EOL, ' ', trim( $segments[0] ) );
|
||||
$backtrace = array_map(
|
||||
'trim',
|
||||
explode( PHP_EOL, $segments[1] )
|
||||
);
|
||||
|
||||
$context['backtrace'] = $backtrace;
|
||||
} else {
|
||||
$context['backtrace'] = true;
|
||||
}
|
||||
|
||||
$logger = wc_get_logger();
|
||||
$logger->critical(
|
||||
/* translators: 1: error message 2: file name and path 3: line number */
|
||||
sprintf( __( '%1$s in %2$s on line %3$s', 'woocommerce' ), $error['message'], $error['file'], $error['line'] ) . PHP_EOL,
|
||||
array(
|
||||
'source' => 'fatal-errors',
|
||||
)
|
||||
$message,
|
||||
$context
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user