From 28c75c63dc246bbb7d9b7493ee24ecc41cdd7dd9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 15 Jul 2015 16:04:49 +0100 Subject: [PATCH 1/3] Unused code --- includes/admin/class-wc-admin-setup-wizard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index 86175e366f2..2b734967e8f 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -608,7 +608,7 @@ class WC_Admin_Setup_Wizard { 'tax_rate_order' => $loop ++, 'tax_rate_class' => '' ); - $tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate ); + WC_Tax::_insert_tax_rate( $tax_rate ); } } } From 47c47ab93c8a42e13ebc6caeb4c389eb862a6ba7 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 15 Jul 2015 16:14:32 +0100 Subject: [PATCH 2/3] Avoid set_time_limit error supression --- includes/admin/importers/class-wc-tax-rate-importer.php | 4 +++- includes/class-wc-ajax.php | 4 +++- includes/class-wc-download-handler.php | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/admin/importers/class-wc-tax-rate-importer.php b/includes/admin/importers/class-wc-tax-rate-importer.php index 6fac7b2cd66..4e24bfaabd0 100644 --- a/includes/admin/importers/class-wc-tax-rate-importer.php +++ b/includes/admin/importers/class-wc-tax-rate-importer.php @@ -75,7 +75,9 @@ class WC_Tax_Rate_Importer extends WP_Importer { if ( function_exists( 'gc_enable' ) ) { gc_enable(); } - @set_time_limit(0); + if ( function_exists( 'set_time_limit' ) && false === strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { + set_time_limit( 0 ); + } @ob_flush(); @flush(); @ini_set( 'auto_detect_line_endings', '1' ); diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index cacfdcc3e3c..8012d5565dd 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -844,7 +844,9 @@ class WC_AJAX { die(-1); } - @set_time_limit(0); + if ( function_exists( 'set_time_limit' ) && false === strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { + set_time_limit( 0 ); + } $post_id = intval( $_POST['post_id'] ); diff --git a/includes/class-wc-download-handler.php b/includes/class-wc-download-handler.php index f2f5a7484ac..4171d5b1f7f 100644 --- a/includes/class-wc-download-handler.php +++ b/includes/class-wc-download-handler.php @@ -338,11 +338,11 @@ class WC_Download_Handler { * Check and set certain server config variables to ensure downloads work as intended. */ private static function check_server_config() { - if ( ! ini_get('safe_mode') ) { - @set_time_limit(0); + if ( function_exists( 'set_time_limit' ) && false === strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { + set_time_limit( 0 ); } - if ( function_exists( 'get_magic_quotes_runtime' ) && get_magic_quotes_runtime() ) { - @set_magic_quotes_runtime(0); + if ( function_exists( 'get_magic_quotes_runtime' ) && get_magic_quotes_runtime() && version_compare( phpversion(), '5.4', '<' ) ) { + set_magic_quotes_runtime( 0 ); } if ( function_exists( 'apache_setenv' ) ) { @apache_setenv( 'no-gzip', 1 ); From 3749a10a4a3c0efb13e793a8736eae01142762ba Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 15 Jul 2015 16:16:10 +0100 Subject: [PATCH 3/3] empty $theme_file --- includes/admin/views/html-admin-page-status-report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index 6acb7494a26..270af82c313 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -687,7 +687,7 @@ if ( ! defined( 'ABSPATH' ) ) { $theme_file = false; } - if ( $theme_file ) { + if ( ! empty( $theme_file ) ) { $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file ); $theme_version = WC_Admin_Status::get_file_version( $theme_file );