Skip to content

Commit 702ecf6

Browse files
authored
Updates
1 parent 7ba7ad5 commit 702ecf6

File tree

5 files changed

+57
-16
lines changed

5 files changed

+57
-16
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ You must read files completely and thoroughly, with a minimum of 1500 lines per
3535
- Follow WordPress theme and plugin development guidelines.
3636
- Use WordPress REST API for custom endpoints and data retrieval.
3737
- Ensure all code is compatible with the WordPress ecosystem, including themes and plugins.
38-
- As this is a WordPress-focused project, avoid using frameworks or libraries that are not compatible with WordPress.
39-
- Do not use frameworks or libraries that are not commonly used in the WordPress ecosystem.
38+
- As this is a WordPress-focused project, avoid using frameworks or libraries that are not compatible or commonly used with WordPress.
4039
- Avoid using non-standard or experimental features that are not widely adopted in the WordPress community.
41-
- For any project that utilizes WooCommerce, ensure minimum version compatibility with WooCommerce 5.0+.
4240

4341
## WordPress Coding Standards
4442

@@ -63,7 +61,7 @@ You must read files completely and thoroughly, with a minimum of 1500 lines per
6361
- WordPress 6.5+ (minimum)
6462
- PHP 7.4+ (minimum)
6563
- WooCommerce 5.0+ (if applicable)
66-
- Do not use features or functions that are not available in these versions.
64+
- Do not use features or functions that are deprecated or not available in these versions.
6765

6866
## Version Control and Documentation
6967

@@ -86,7 +84,7 @@ You must read files completely and thoroughly, with a minimum of 1500 lines per
8684
- Note: changelog.txt has been removed from this project. Only maintain readme.txt (for WordPress.org) and CHANGELOG.md (for developers).
8785
- Please do not skip these locations, as the changelog files must be in sync with each other, and the version numbers must be consistent across all files.
8886
- I will instruct you when to update the version number, and you should not do this automatically. Always ask for confirmation before updating the version number.
89-
- When the version number is updated, ensure that the new version number is reflected in all relevant files, including the plugin header, changelog files, and documentation files.
87+
- When the version number is updated, ensure that the new version number is reflected in all relevant files, as outlined in Version Locations above.
9088
- When the version number is updated, make special note to update the "Unreleased" section in the changelog files to reflect the new version number and a brief description of the changes made. This ensures that all changes are documented and easily accessible for future reference.
9189

9290
# General Coding Standards
@@ -132,7 +130,7 @@ You must read files completely and thoroughly, with a minimum of 1500 lines per
132130
- If you encounter a security vulnerability in the codebase, do not disclose it publicly. Instead, report it privately to the project maintainers or through a responsible disclosure process.
133131
- If you are unsure about the security implications of a specific code change, ask for clarification or guidance before proceeding.
134132
- Always follow the principle of least privilege when implementing security features, ensuring that users and processes have only the permissions they need to perform their tasks.
135-
- If you encounter a security vulnerability in a third-party library or dependency, check if there is an updated version that addresses the issue. If not, consider alternatives or report the vulnerability to the library maintainers.
133+
- If you encounter a security vulnerability in a third-party library or dependency, check if there is an updated version that addresses the issue. If not, consider alternatives and notify me of the situation.
136134
- If there is a possible security vulnerability in the codebase, you should always ask for confirmation before proceeding with any changes. This ensures that the project maintainers are aware of the potential risk and can provide guidance on how to address it safely.
137135
- If I ask you to make changes that could potentially introduce security vulnerabilities, you should always ask for confirmation before proceeding. This ensures that the project maintainers are aware of the potential risk and can provide guidance on how to address it safely.
138136

@@ -150,7 +148,6 @@ You must read files completely and thoroughly, with a minimum of 1500 lines per
150148
- Only ask for confirmation when an action is destructive (e.g., data loss, deletion)
151149
- Always attempt to identify and fix bugs automatically
152150
- Only ask for manual intervention if domain-specific knowledge is required
153-
- Auto-generate missing files, boilerplate, and tests when possible
154151
- Auto-lint and format code using standard tools (e.g., Prettier, ESLint, dotnet format)
155152
- Changes should be made directly to the file in question. Example: admin.php should be modified directly, not by creating a new file like admin-changes.php.
156153
- New files may be created when appropriate, but they should be relevant to the task at hand, so long as they are not a rewrite of an existing file. We want to avoid unnecessary duplication of files.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [1.5.12] - 2025-08-02
7+
### Added
8+
- **Disable Post via Email**: New option to disable the post-via-email feature for enhanced security and performance.
9+
10+
### Security
11+
- **Hardened Disabling Filters**: Updated all feature-disabling filters to use `PHP_INT_MAX` priority, ensuring they cannot be overridden by other plugins or themes.
12+
613
## [1.5.11] - 2025-07-11
714
### Code Quality
815
- **WordPress Coding Standards**: Converted all code to use spaces instead of tabs for indentation

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![PHP Compatible](https://img.shields.io/badge/PHP-7.4%2B-purple.svg?logo=php)](https://www.php.net/)
66

77
## Current Version
8-
[![Version](https://img.shields.io/badge/Version-1.5.11-orange.svg?logo=github)](https://github.com/EngineScript/Simple-WP-Optimizer/releases/download/v1.5.11/simple-wp-optimizer-1.5.11.zip)
8+
[![Version](https://img.shields.io/badge/Version-1.5.12-orange.svg?logo=github)](https://github.com/EngineScript/Simple-WP-Optimizer/releases/download/v1.5.12/simple-wp-optimizer-1.5.12.zip)
99

1010
## Description
1111

readme.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: enginescript
33
Tags: optimization, performance, cleanup
44
Requires at least: 6.5
55
Tested up to: 6.8
6-
Stable tag: 1.5.11
6+
Stable tag: 1.5.12
77
Requires PHP: 7.4
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -43,6 +43,20 @@ No, the plugin has a simple interface where you can toggle features on and off.
4343

4444
== Changelog ==
4545

46+
= 1.5.12 =
47+
* ADDED: New option to disable the post-via-email feature for enhanced security and performance.
48+
* SECURITY: Hardened all feature-disabling filters to use `PHP_INT_MAX` priority, ensuring they cannot be overridden by other plugins or themes.
49+
50+
= 1.5.11 =
51+
* CODE QUALITY: Converted all code to use spaces instead of tabs for indentation
52+
* CODE STYLE: Fixed file comment header to use "/**" style instead of "/*" style
53+
* CODE STYLE: Added proper spacing around operators (e.g., `! defined` instead of `!defined`)
54+
* CODE STYLE: Added proper full stops to inline comments for consistency
55+
* CODE STYLE: Removed trailing whitespace from documentation blocks
56+
* VARIABLE NAMING: Converted variable names to use snake_case instead of camelCase for WordPress compliance
57+
* FUNCTION FORMATTING: Improved function parameter spacing and alignment
58+
* ARRAY FORMATTING: Enhanced array formatting with proper alignment and trailing commas
59+
4660
= 1.5.10 =
4761
* MAINTENANCE: Updated changelog and version references across documentation files for new release
4862
* DOCUMENTATION: Synced CHANGELOG.md and readme.txt as per project standards

simple-wp-optimizer.php

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Simple WP Optimizer
44
* Plugin URI: https://github.com/EngineScript/Simple-WP-Optimizer
55
* Description: Optimizes WordPress by removing unnecessary features and scripts to improve performance
6-
* Version: 1.5.11
6+
* Version: 1.5.12
77
* Author: EngineScript
88
* License: GPL v2 or later
99
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -53,7 +53,7 @@
5353

5454
// Define plugin version.
5555
if ( ! defined( 'ES_WP_OPTIMIZER_VERSION' ) ) {
56-
define( 'ES_WP_OPTIMIZER_VERSION', '1.5.11' );
56+
define( 'ES_WP_OPTIMIZER_VERSION', '1.5.12' );
5757
}
5858

5959
/**
@@ -101,6 +101,7 @@ function es_optimizer_get_default_options() {
101101
)
102102
),
103103
'disable_jetpack_ads' => 1,
104+
'disable_post_via_email' => 1,
104105
);
105106
}
106107

@@ -268,6 +269,14 @@ function es_optimizer_render_additional_options( $options ) {
268269
esc_html__( 'Disable Jetpack Ads', 'Simple-WP-Optimizer' ),
269270
esc_html__( 'Remove Jetpack advertisements and promotions', 'Simple-WP-Optimizer' )
270271
);
272+
273+
// Post via Email settings.
274+
es_optimizer_render_checkbox_option(
275+
$options,
276+
'disable_post_via_email',
277+
esc_html__( 'Disable Post via Email', 'Simple-WP-Optimizer' ),
278+
esc_html__( 'Disable WordPress post via email functionality for security and performance', 'Simple-WP-Optimizer' )
279+
);
271280
}
272281

273282
/**
@@ -409,6 +418,7 @@ function es_optimizer_validate_options( $input ) {
409418
'remove_recent_comments_style',
410419
'enable_dns_prefetch',
411420
'disable_jetpack_ads',
421+
'disable_post_via_email',
412422
);
413423

414424
foreach ( $checkboxes as $checkbox ) {
@@ -698,7 +708,7 @@ function remove_recent_comments_style() {
698708

699709
// Only proceed if the option is enabled.
700710
if ( isset( $options['remove_recent_comments_style'] ) && $options['remove_recent_comments_style'] ) {
701-
add_filter( 'show_recent_comments_widget_style', '__return_false', 99 );
711+
add_filter( 'show_recent_comments_widget_style', '__return_false', PHP_INT_MAX );
702712
}
703713
}
704714
add_action( 'init', 'remove_recent_comments_style' );
@@ -766,9 +776,22 @@ function disable_jetpack_ads() {
766776

767777
// Only proceed if the option is enabled.
768778
if ( isset( $options['disable_jetpack_ads'] ) && $options['disable_jetpack_ads'] ) {
769-
add_filter( 'jetpack_just_in_time_msgs', '__return_false', 20 );
770-
add_filter( 'jetpack_show_promotions', '__return_false', 20 );
771-
add_filter( 'jetpack_blaze_enabled', '__return_false' );
779+
add_filter( 'jetpack_just_in_time_msgs', '__return_false', PHP_INT_MAX );
780+
add_filter( 'jetpack_show_promotions', '__return_false', PHP_INT_MAX );
781+
add_filter( 'jetpack_blaze_enabled', '__return_false', PHP_INT_MAX );
782+
}
783+
}
784+
add_action( 'init', 'disable_jetpack_ads' );
785+
786+
/**
787+
* Disable WordPress post via email functionality.
788+
*/
789+
function disable_post_via_email() {
790+
$options = get_option( 'es_optimizer_options' );
791+
792+
// Only proceed if the option is enabled.
793+
if ( isset( $options['disable_post_via_email'] ) && $options['disable_post_via_email'] ) {
794+
add_filter( 'enable_post_by_email_configuration', '__return_false', PHP_INT_MAX );
772795
}
773796
}
774-
add_action( 'init', 'disable_jetpack_ads' );
797+
add_action( 'init', 'disable_post_via_email' );

0 commit comments

Comments
 (0)