diff --git a/admin/admin-init.php b/admin/admin-init.php index 0f39ce69e37..f39d48b2b84 100644 --- a/admin/admin-init.php +++ b/admin/admin-init.php @@ -130,7 +130,7 @@ function woocommerce_get_current_post_type() { global $post, $typenow, $current_screen; - if( $current_screen && @$current_screen->post_type ) return $current_screen->post_type; + if( $current_screen && isset($current_screen->post_type) ) return $current_screen->post_type; if( $typenow ) return $typenow; diff --git a/admin/admin-settings.php b/admin/admin-settings.php index ca86c2d5c8c..ae6904e2012 100644 --- a/admin/admin-settings.php +++ b/admin/admin-settings.php @@ -614,7 +614,7 @@ function woocommerce_update_options($options) { if( isset( $_POST[ $value['id'] ] ) ) { update_option($value['id'], $_POST[$value['id']] ); } else { - @delete_option($value['id']); + delete_option($value['id']); } elseif (isset($value['type']) && $value['type']=='checkbox') : @@ -640,7 +640,7 @@ function woocommerce_update_options($options) { if(isset($value['id']) && isset($_POST[$value['id']])) { update_option($value['id'], woocommerce_clean($_POST[$value['id']])); } else { - @delete_option($value['id']); + delete_option($value['id']); } endif; diff --git a/classes/gateways/gateway-banktransfer.php b/classes/gateways/gateway-banktransfer.php index e52833095d8..b5ed700e2e3 100644 --- a/classes/gateways/gateway-banktransfer.php +++ b/classes/gateways/gateway-banktransfer.php @@ -165,14 +165,14 @@ class woocommerce_bacs extends woocommerce_payment_gateway { if(isset($_POST['woocommerce_bacs_enabled'])) update_option('woocommerce_bacs_enabled', 'yes'); else update_option('woocommerce_bacs_enabled', 'no'); - if(isset($_POST['woocommerce_bacs_title'])) update_option('woocommerce_bacs_title', woocommerce_clean($_POST['woocommerce_bacs_title'])); else @delete_option('woocommerce_bacs_title'); - if(isset($_POST['woocommerce_bacs_description'])) update_option('woocommerce_bacs_description', woocommerce_clean($_POST['woocommerce_bacs_description'])); else @delete_option('woocommerce_bacs_description'); - if(isset($_POST['woocommerce_bacs_account_name'])) update_option('woocommerce_bacs_account_name', woocommerce_clean($_POST['woocommerce_bacs_account_name'])); else @delete_option('woocommerce_bacs_account_name'); - if(isset($_POST['woocommerce_bacs_account_number'])) update_option('woocommerce_bacs_account_number', woocommerce_clean($_POST['woocommerce_bacs_account_number'])); else @delete_option('woocommerce_bacs_account_number'); - if(isset($_POST['woocommerce_bacs_sort_code'])) update_option('woocommerce_bacs_sort_code', woocommerce_clean($_POST['woocommerce_bacs_sort_code'])); else @delete_option('woocommerce_bacs_sort_code'); - if(isset($_POST['woocommerce_bacs_bank_name'])) update_option('woocommerce_bacs_bank_name', woocommerce_clean($_POST['woocommerce_bacs_bank_name'])); else @delete_option('woocommerce_bacs_bank_name'); - if(isset($_POST['woocommerce_bacs_iban'])) update_option('woocommerce_bacs_iban', woocommerce_clean($_POST['woocommerce_bacs_iban'])); else @delete_option('woocommerce_bacs_iban'); - if(isset($_POST['woocommerce_bacs_bic'])) update_option('woocommerce_bacs_bic', woocommerce_clean($_POST['woocommerce_bacs_bic'])); else @delete_option('woocommerce_bacs_bic'); + if(isset($_POST['woocommerce_bacs_title'])) update_option('woocommerce_bacs_title', woocommerce_clean($_POST['woocommerce_bacs_title'])); else delete_option('woocommerce_bacs_title'); + if(isset($_POST['woocommerce_bacs_description'])) update_option('woocommerce_bacs_description', woocommerce_clean($_POST['woocommerce_bacs_description'])); else delete_option('woocommerce_bacs_description'); + if(isset($_POST['woocommerce_bacs_account_name'])) update_option('woocommerce_bacs_account_name', woocommerce_clean($_POST['woocommerce_bacs_account_name'])); else delete_option('woocommerce_bacs_account_name'); + if(isset($_POST['woocommerce_bacs_account_number'])) update_option('woocommerce_bacs_account_number', woocommerce_clean($_POST['woocommerce_bacs_account_number'])); else delete_option('woocommerce_bacs_account_number'); + if(isset($_POST['woocommerce_bacs_sort_code'])) update_option('woocommerce_bacs_sort_code', woocommerce_clean($_POST['woocommerce_bacs_sort_code'])); else delete_option('woocommerce_bacs_sort_code'); + if(isset($_POST['woocommerce_bacs_bank_name'])) update_option('woocommerce_bacs_bank_name', woocommerce_clean($_POST['woocommerce_bacs_bank_name'])); else delete_option('woocommerce_bacs_bank_name'); + if(isset($_POST['woocommerce_bacs_iban'])) update_option('woocommerce_bacs_iban', woocommerce_clean($_POST['woocommerce_bacs_iban'])); else delete_option('woocommerce_bacs_iban'); + if(isset($_POST['woocommerce_bacs_bic'])) update_option('woocommerce_bacs_bic', woocommerce_clean($_POST['woocommerce_bacs_bic'])); else delete_option('woocommerce_bacs_bic'); } /** diff --git a/classes/gateways/gateway-cheque.php b/classes/gateways/gateway-cheque.php index 9a76ef4e11e..ed6784ad620 100755 --- a/classes/gateways/gateway-cheque.php +++ b/classes/gateways/gateway-cheque.php @@ -81,8 +81,8 @@ class woocommerce_cheque extends woocommerce_payment_gateway { if(isset($_POST['woocommerce_cheque_enabled'])) update_option('woocommerce_cheque_enabled', 'yes'); else update_option('woocommerce_cheque_enabled', 'no'); - if(isset($_POST['woocommerce_cheque_title'])) update_option('woocommerce_cheque_title', woocommerce_clean($_POST['woocommerce_cheque_title'])); else @delete_option('woocommerce_cheque_title'); - if(isset($_POST['woocommerce_cheque_description'])) update_option('woocommerce_cheque_description', woocommerce_clean($_POST['woocommerce_cheque_description'])); else @delete_option('woocommerce_cheque_description'); + if(isset($_POST['woocommerce_cheque_title'])) update_option('woocommerce_cheque_title', woocommerce_clean($_POST['woocommerce_cheque_title'])); else delete_option('woocommerce_cheque_title'); + if(isset($_POST['woocommerce_cheque_description'])) update_option('woocommerce_cheque_description', woocommerce_clean($_POST['woocommerce_cheque_description'])); else delete_option('woocommerce_cheque_description'); } /** diff --git a/classes/gateways/gateway-moneybookers.php b/classes/gateways/gateway-moneybookers.php index 29c56deef35..c83c080bb1e 100644 --- a/classes/gateways/gateway-moneybookers.php +++ b/classes/gateways/gateway-moneybookers.php @@ -89,10 +89,10 @@ class woocommerce_moneybookers extends woocommerce_payment_gateway { public function process_admin_options() { if(isset($_POST['woocommerce_moneybookers_enabled'])) update_option('woocommerce_moneybookers_enabled', 'yes'); else update_option('woocommerce_moneybookers_enabled', 'no'); - if(isset($_POST['woocommerce_moneybookers_title'])) update_option('woocommerce_moneybookers_title', woocommerce_clean($_POST['woocommerce_moneybookers_title'])); else @delete_option('woocommerce_moneybookers_title'); - if(isset($_POST['woocommerce_moneybookers_email'])) update_option('woocommerce_moneybookers_email', woocommerce_clean($_POST['woocommerce_moneybookers_email'])); else @delete_option('woocommerce_moneybookers_email'); - if(isset($_POST['woocommerce_moneybookers_secret_word'])) update_option('woocommerce_moneybookers_secret_word', woocommerce_clean($_POST['woocommerce_moneybookers_secret_word'])); else @delete_option('woocommerce_moneybookers_secret_word'); - if(isset($_POST['woocommerce_moneybookers_customer_id'])) update_option('woocommerce_moneybookers_customer_id', woocommerce_clean($_POST['woocommerce_moneybookers_customer_id'])); else @delete_option('woocommerce_moneybookers_customer_id'); + if(isset($_POST['woocommerce_moneybookers_title'])) update_option('woocommerce_moneybookers_title', woocommerce_clean($_POST['woocommerce_moneybookers_title'])); else delete_option('woocommerce_moneybookers_title'); + if(isset($_POST['woocommerce_moneybookers_email'])) update_option('woocommerce_moneybookers_email', woocommerce_clean($_POST['woocommerce_moneybookers_email'])); else delete_option('woocommerce_moneybookers_email'); + if(isset($_POST['woocommerce_moneybookers_secret_word'])) update_option('woocommerce_moneybookers_secret_word', woocommerce_clean($_POST['woocommerce_moneybookers_secret_word'])); else delete_option('woocommerce_moneybookers_secret_word'); + if(isset($_POST['woocommerce_moneybookers_customer_id'])) update_option('woocommerce_moneybookers_customer_id', woocommerce_clean($_POST['woocommerce_moneybookers_customer_id'])); else delete_option('woocommerce_moneybookers_customer_id'); } /** diff --git a/classes/gateways/gateway-paypal.php b/classes/gateways/gateway-paypal.php index af83ae4f402..78504f3ce73 100644 --- a/classes/gateways/gateway-paypal.php +++ b/classes/gateways/gateway-paypal.php @@ -113,9 +113,9 @@ class woocommerce_paypal extends woocommerce_payment_gateway { if(isset($_POST['woocommerce_paypal_enabled'])) update_option('woocommerce_paypal_enabled', 'yes'); else update_option('woocommerce_paypal_enabled', 'no'); - if(isset($_POST['woocommerce_paypal_title'])) update_option('woocommerce_paypal_title', woocommerce_clean($_POST['woocommerce_paypal_title'])); else @delete_option('woocommerce_paypal_title'); - if(isset($_POST['woocommerce_paypal_email'])) update_option('woocommerce_paypal_email', woocommerce_clean($_POST['woocommerce_paypal_email'])); else @delete_option('woocommerce_paypal_email'); - if(isset($_POST['woocommerce_paypal_description'])) update_option('woocommerce_paypal_description', woocommerce_clean($_POST['woocommerce_paypal_description'])); else @delete_option('woocommerce_paypal_description'); + if(isset($_POST['woocommerce_paypal_title'])) update_option('woocommerce_paypal_title', woocommerce_clean($_POST['woocommerce_paypal_title'])); else delete_option('woocommerce_paypal_title'); + if(isset($_POST['woocommerce_paypal_email'])) update_option('woocommerce_paypal_email', woocommerce_clean($_POST['woocommerce_paypal_email'])); else delete_option('woocommerce_paypal_email'); + if(isset($_POST['woocommerce_paypal_description'])) update_option('woocommerce_paypal_description', woocommerce_clean($_POST['woocommerce_paypal_description'])); else delete_option('woocommerce_paypal_description'); if(isset($_POST['woocommerce_paypal_testmode'])) update_option('woocommerce_paypal_testmode', 'yes'); else update_option('woocommerce_paypal_testmode', 'no'); diff --git a/classes/shipping/shipping-flat_rate.php b/classes/shipping/shipping-flat_rate.php index ac1afe461fa..072d0f87cc8 100644 --- a/classes/shipping/shipping-flat_rate.php +++ b/classes/shipping/shipping-flat_rate.php @@ -177,16 +177,16 @@ class flat_rate extends woocommerce_shipping_method { public function process_admin_options() { - if(isset($_POST['woocommerce_flat_rate_tax_status'])) update_option('woocommerce_flat_rate_tax_status', woocommerce_clean($_POST['woocommerce_flat_rate_tax_status'])); else @delete_option('woocommerce_flat_rate_tax_status'); + if(isset($_POST['woocommerce_flat_rate_tax_status'])) update_option('woocommerce_flat_rate_tax_status', woocommerce_clean($_POST['woocommerce_flat_rate_tax_status'])); else delete_option('woocommerce_flat_rate_tax_status'); if(isset($_POST['woocommerce_flat_rate_enabled'])) update_option('woocommerce_flat_rate_enabled', 'yes'); else update_option('woocommerce_flat_rate_enabled', 'no'); - if(isset($_POST['woocommerce_flat_rate_title'])) update_option('woocommerce_flat_rate_title', woocommerce_clean($_POST['woocommerce_flat_rate_title'])); else @delete_option('woocommerce_flat_rate_title'); - if(isset($_POST['woocommerce_flat_rate_type'])) update_option('woocommerce_flat_rate_type', woocommerce_clean($_POST['woocommerce_flat_rate_type'])); else @delete_option('woocommerce_flat_rate_type'); - if(isset($_POST['woocommerce_flat_rate_cost'])) update_option('woocommerce_flat_rate_cost', woocommerce_clean($_POST['woocommerce_flat_rate_cost'])); else @delete_option('woocommerce_flat_rate_cost'); - if(isset($_POST['woocommerce_flat_rate_handling_fee'])) update_option('woocommerce_flat_rate_handling_fee', woocommerce_clean($_POST['woocommerce_flat_rate_handling_fee'])); else @delete_option('woocommerce_flat_rate_handling_fee'); + if(isset($_POST['woocommerce_flat_rate_title'])) update_option('woocommerce_flat_rate_title', woocommerce_clean($_POST['woocommerce_flat_rate_title'])); else delete_option('woocommerce_flat_rate_title'); + if(isset($_POST['woocommerce_flat_rate_type'])) update_option('woocommerce_flat_rate_type', woocommerce_clean($_POST['woocommerce_flat_rate_type'])); else delete_option('woocommerce_flat_rate_type'); + if(isset($_POST['woocommerce_flat_rate_cost'])) update_option('woocommerce_flat_rate_cost', woocommerce_clean($_POST['woocommerce_flat_rate_cost'])); else delete_option('woocommerce_flat_rate_cost'); + if(isset($_POST['woocommerce_flat_rate_handling_fee'])) update_option('woocommerce_flat_rate_handling_fee', woocommerce_clean($_POST['woocommerce_flat_rate_handling_fee'])); else delete_option('woocommerce_flat_rate_handling_fee'); - if(isset($_POST['woocommerce_flat_rate_availability'])) update_option('woocommerce_flat_rate_availability', woocommerce_clean($_POST['woocommerce_flat_rate_availability'])); else @delete_option('woocommerce_flat_rate_availability'); + if(isset($_POST['woocommerce_flat_rate_availability'])) update_option('woocommerce_flat_rate_availability', woocommerce_clean($_POST['woocommerce_flat_rate_availability'])); else delete_option('woocommerce_flat_rate_availability'); if (isset($_POST['woocommerce_flat_rate_countries'])) $selected_countries = $_POST['woocommerce_flat_rate_countries']; else $selected_countries = array(); update_option('woocommerce_flat_rate_countries', $selected_countries); diff --git a/classes/shipping/shipping-free_shipping.php b/classes/shipping/shipping-free_shipping.php index e2fdaed2dc8..a5ea3d12bba 100644 --- a/classes/shipping/shipping-free_shipping.php +++ b/classes/shipping/shipping-free_shipping.php @@ -100,9 +100,9 @@ class free_shipping extends woocommerce_shipping_method { if(isset($_POST['woocommerce_free_shipping_enabled'])) update_option('woocommerce_free_shipping_enabled', 'yes'); else update_option('woocommerce_free_shipping_enabled', 'no'); - if(isset($_POST['woocommerce_free_shipping_title'])) update_option('woocommerce_free_shipping_title', woocommerce_clean($_POST['woocommerce_free_shipping_title'])); else @delete_option('woocommerce_free_shipping_title'); - if(isset($_POST['woocommerce_free_shipping_minimum_amount'])) update_option('woocommerce_free_shipping_minimum_amount', woocommerce_clean($_POST['woocommerce_free_shipping_minimum_amount'])); else @delete_option('woocommerce_free_shipping_minimum_amount'); - if(isset($_POST['woocommerce_free_shipping_availability'])) update_option('woocommerce_free_shipping_availability', woocommerce_clean($_POST['woocommerce_free_shipping_availability'])); else @delete_option('woocommerce_free_shipping_availability'); + if(isset($_POST['woocommerce_free_shipping_title'])) update_option('woocommerce_free_shipping_title', woocommerce_clean($_POST['woocommerce_free_shipping_title'])); else delete_option('woocommerce_free_shipping_title'); + if(isset($_POST['woocommerce_free_shipping_minimum_amount'])) update_option('woocommerce_free_shipping_minimum_amount', woocommerce_clean($_POST['woocommerce_free_shipping_minimum_amount'])); else delete_option('woocommerce_free_shipping_minimum_amount'); + if(isset($_POST['woocommerce_free_shipping_availability'])) update_option('woocommerce_free_shipping_availability', woocommerce_clean($_POST['woocommerce_free_shipping_availability'])); else delete_option('woocommerce_free_shipping_availability'); if (isset($_POST['woocommerce_free_shipping_countries'])) $selected_countries = $_POST['woocommerce_free_shipping_countries']; else $selected_countries = array(); update_option('woocommerce_free_shipping_countries', $selected_countries); diff --git a/woocommerce.php b/woocommerce.php index 5a41a857f56..b2f323d94e9 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -162,7 +162,7 @@ function woocommerce_init() { // Include template functions here so they are pluggable by themes include_once( 'woocommerce_template_functions.php' ); - @ob_start(); + ob_start(); $css = file_exists(get_stylesheet_directory() . '/woocommerce/style.css') ? get_stylesheet_directory_uri() . '/woocommerce/style.css' : woocommerce::plugin_url() . '/assets/css/woocommerce.css'; if (WOOCOMMERCE_USE_CSS) wp_register_style('woocommerce_frontend_styles', $css );