Fixed includes/class-wc-background-emailer.php PHPCS violations
This commit is contained in:
parent
820426a4d0
commit
3d4217143e
|
@ -2,13 +2,11 @@
|
|||
/**
|
||||
* Background Emailer
|
||||
*
|
||||
* @version 3.0.1
|
||||
* @package WooCommerce/Classes
|
||||
* @version 3.0.1
|
||||
* @package WooCommerce/Classes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'WC_Background_Process', false ) ) {
|
||||
include_once dirname( __FILE__ ) . '/abstracts/class-wc-background-process.php';
|
||||
|
@ -59,7 +57,7 @@ class WC_Background_Emailer extends WC_Background_Process {
|
|||
WC_Emails::send_queued_transactional_email( $callback['filter'], $callback['args'] );
|
||||
} catch ( Exception $e ) {
|
||||
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||
trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING );
|
||||
trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +87,7 @@ class WC_Background_Emailer extends WC_Background_Process {
|
|||
if ( ! headers_sent() ) {
|
||||
header( 'Connection: close' );
|
||||
}
|
||||
@ob_end_flush();
|
||||
@ob_end_flush(); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +115,7 @@ class WC_Background_Emailer extends WC_Background_Process {
|
|||
// Pass cookies through with the request so nonces function.
|
||||
$cookies = array();
|
||||
|
||||
foreach ( $_COOKIE as $name => $value ) {
|
||||
foreach ( $_COOKIE as $name => $value ) { // WPCS: input var ok.
|
||||
if ( 'PHPSESSID' === $name ) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
<exclude name="WordPress.VIP.RestrictedFunctions" />
|
||||
<exclude name="WordPress.VIP.RestrictedVariables.user_meta__wpdb__usermeta" />
|
||||
<exclude name="WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page" />
|
||||
<exclude name="WordPress.VIP.RestrictedVariables.cache_constraints___COOKIE" />
|
||||
</rule>
|
||||
<rule ref="WordPress.VIP.ValidatedSanitizedInput">
|
||||
<properties>
|
||||
|
|
Loading…
Reference in New Issue