diff --git a/includes/admin/reports/class-wc-report-stock.php b/includes/admin/reports/class-wc-report-stock.php
index 0d639a855c6..4d527df6f5f 100644
--- a/includes/admin/reports/class-wc-report-stock.php
+++ b/includes/admin/reports/class-wc-report-stock.php
@@ -91,7 +91,7 @@ class WC_Report_Stock extends WP_List_Table {
// Get variation data.
if ( $product->is_type( 'variation' ) ) {
- echo '
' . wc_get_formatted_variation( $product, true ) . '
';
+ echo '' . wp_kses_post( wc_get_formatted_variation( $product, true ) ) . '
';
}
break;
diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php
index 6190a77c21b..5a92fbdcb0e 100644
--- a/includes/class-wc-ajax.php
+++ b/includes/class-wc-ajax.php
@@ -943,7 +943,7 @@ class WC_AJAX {
if ( empty( $return ) ) {
$return[] = __( 'No products had their stock reduced - they may not have stock management enabled.', 'woocommerce' );
}
- echo implode( ', ', $return );
+ echo wp_kses_post( implode( ', ', $return ) );
}
wp_die();
}
@@ -983,7 +983,7 @@ class WC_AJAX {
if ( empty( $return ) ) {
$return[] = __( 'No products had their stock increased - they may not have stock management enabled.', 'woocommerce' );
}
- echo implode( ', ', $return );
+ echo wp_kses_post( implode( ', ', $return ) );
}
wp_die();
}
diff --git a/includes/log-handlers/class-wc-log-handler-file.php b/includes/log-handlers/class-wc-log-handler-file.php
index bae5de04e77..20c994d0b76 100644
--- a/includes/log-handlers/class-wc-log-handler-file.php
+++ b/includes/log-handlers/class-wc-log-handler-file.php
@@ -246,14 +246,9 @@ class WC_Log_Handler_File extends WC_Log_Handler {
if ( $file ) {
if ( is_file( $file ) && is_writable( $file ) ) {
- // Close first to be certain no processes keep it alive after it is unlinked.
- $this->close( $handle );
+ $this->close( $handle ); // Close first to be certain no processes keep it alive after it is unlinked.
$removed = unlink( $file );
- } elseif ( is_file( trailingslashit( WC_LOG_DIR ) . $handle . '.log' ) && is_writable( trailingslashit( WC_LOG_DIR ) . $handle . '.log' ) ) {
- $this->close( $handle );
- $removed = unlink( trailingslashit( WC_LOG_DIR ) . $handle . '.log' );
}
-
do_action( 'woocommerce_log_remove', $handle, $removed );
}
@@ -344,7 +339,7 @@ class WC_Log_Handler_File extends WC_Log_Handler {
*/
public static function get_log_file_path( $handle ) {
if ( function_exists( 'wp_hash' ) ) {
- return trailingslashit( WC_LOG_DIR ) . $handle . '-' . sanitize_file_name( wp_hash( $handle ) ) . '.log';
+ return trailingslashit( WC_LOG_DIR ) . sanitize_file_name( $handle . '-' . wp_hash( $handle ) . '.log' );
} else {
wc_doing_it_wrong( __METHOD__, __( 'This method should not be called before plugins_loaded.', 'woocommerce' ), '2.7' );
return false;