Skip to content

Commit d01cad7

Browse files
authored
Updates
1 parent 34c991e commit d01cad7

File tree

4 files changed

+25
-36
lines changed

4 files changed

+25
-36
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.4] - 2025-08-02
11+
12+
### Removed
13+
- **Plugin Checks:**
14+
- Removed WooCommerce activation check (`is_woocommerce_active()` method)
15+
- Removed WP Store Locator activation check (`is_wpsl_active()` method)
16+
- Removed `function_exists('wc_get_customer_order_count')` fallback check
17+
18+
### Changed
19+
- **Performance:**
20+
- Optimized for single-site deployment where WooCommerce and WP Store Locator are guaranteed to be active
21+
- Simplified code structure by removing unnecessary plugin availability validations
22+
- Direct function calls without existence checks for better performance
23+
1024
## [1.0.3] - 2025-07-25
1125

1226
### Fixed

class-optimizations-ace-mc.php

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

optimizations-ace-mc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Optimizations ACE MC
44
* Plugin URI: https://github.com/PDowney/optimizations-ace-mc
55
* Description: A lightweight WordPress optimization plugin with pre-configured performance enhancements for WooCommerce, WP Store Locator, and WordPress admin.
6-
* Version: 1.0.3
6+
* Version: 1.0.4
77
* Author: PDowney
88
* Author URI: https://github.com/PDowney
99
* License: GPL v3 or later
@@ -23,7 +23,7 @@
2323
}
2424

2525
// Define plugin constants.
26-
define( 'OPTIMIZATIONS_ACE_MC_VERSION', '1.0.3' );
26+
define( 'OPTIMIZATIONS_ACE_MC_VERSION', '1.0.4' );
2727
define( 'OPTIMIZATIONS_ACE_MC_PLUGIN_FILE', __FILE__ );
2828
define( 'OPTIMIZATIONS_ACE_MC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
2929
define( 'OPTIMIZATIONS_ACE_MC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

readme.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: optimization, performance, wp-optimizer, speed, seo
44
Requires at least: 6.5
55
Tested up to: 6.8
66
Requires PHP: 7.4
7-
Stable tag: 1.0.3
7+
Stable tag: 1.0.4
88
License: GPLv3 or later
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -49,6 +49,12 @@ Yes, this plugin focuses on basic optimizations and should work alongside other
4949

5050
== Changelog ==
5151

52+
= 1.0.4 - 2025-08-02 =
53+
* Removed: All fallback methods and plugin availability checks for single-site deployment
54+
* Removed: WooCommerce and WP Store Locator activation checks since plugins are guaranteed to be active
55+
* Simplified: Direct function calls without existence validation for better performance
56+
* Optimized: Code structure for dedicated single-site environment
57+
5258
= 1.0.3 - 2025-07-25 =
5359
* Fixed: Code standards compliance - string concatenation issues
5460
* Fixed: Variable alignment to follow WordPress coding standards

0 commit comments

Comments
 (0)