@@ -73,11 +73,6 @@ private function init_optimizations() {
7373 * Initialize WooCommerce-specific optimizations.
7474 */
7575 private function init_woocommerce_optimizations () {
76- // Only run if WooCommerce is active.
77- if ( ! $ this ->is_woocommerce_active () ) {
78- return ;
79- }
80-
8176 // Show empty categories in WooCommerce.
8277 add_filter ( 'woocommerce_product_subcategories_hide_empty ' , '__return_false ' );
8378
@@ -96,11 +91,6 @@ private function init_woocommerce_optimizations() {
9691 * Initialize WP Store Locator optimizations.
9792 */
9893 private function init_wpsl_optimizations () {
99- // Only run if WP Store Locator is active.
100- if ( ! $ this ->is_wpsl_active () ) {
101- return ;
102- }
103-
10494 // Show store categories in store locator.
10595 add_filter ( 'wpsl_store_meta ' , array ( $ this , 'add_store_categories_to_meta ' ), 10 , 2 );
10696 add_filter ( 'wpsl_info_window_template ' , array ( $ this , 'customize_info_window_template ' ) );
@@ -123,24 +113,6 @@ private function init_admin_optimizations() {
123113 add_filter ( 'manage_users_sortable_columns ' , array ( $ this , 'make_user_registration_date_sortable ' ) );
124114 }
125115
126- /**
127- * Check if WooCommerce is active.
128- *
129- * @return bool
130- */
131- private function is_woocommerce_active () {
132- return class_exists ( 'WooCommerce ' );
133- }
134-
135- /**
136- * Check if WP Store Locator is active.
137- *
138- * @return bool
139- */
140- private function is_wpsl_active () {
141- return class_exists ( 'WPSL_Frontend ' );
142- }
143-
144116 /**
145117 * Add order count column to users table.
146118 *
@@ -162,11 +134,8 @@ public function add_user_order_count_column( $columns ) {
162134 */
163135 public function display_user_order_count_column ( $ output , $ column_name , $ user_id ) {
164136 if ( 'user_order_count ' === $ column_name ) {
165- if ( function_exists ( 'wc_get_customer_order_count ' ) ) {
166- $ order_count = wc_get_customer_order_count ( absint ( $ user_id ) );
167- return esc_html ( number_format_i18n ( $ order_count ) );
168- }
169- return '0 ' ;
137+ $ order_count = wc_get_customer_order_count ( absint ( $ user_id ) );
138+ return esc_html ( number_format_i18n ( $ order_count ) );
170139 }
171140 return $ output ;
172141 }
0 commit comments