Skip to content

Commit e1f2283

Browse files
authored
Updates
1 parent b80a4f3 commit e1f2283

File tree

4 files changed

+53
-15
lines changed

4 files changed

+53
-15
lines changed

.github/workflows/wp-compatibility-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
echo "✅ Cleanup complete"
7070
7171
- name: WordPress Plugin Check
72-
uses: WordPress/[email protected].3
72+
uses: WordPress/[email protected].2
7373
with:
7474
# Build directory - using repository root
7575
build-dir: './'

CHANGELOG.md

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

66
## [Unreleased]
77

8+
### Added
9+
- Added new option to remove RSD (Really Simple Discovery) link from WordPress header
10+
- Added DNS prefetch domains: `https://s.w.org`, `https://wordpress.com`, and `https://cdnjs.cloudflare.com`
11+
12+
### Changed
13+
- Updated default DNS prefetch domains to remove deprecated Google CDN URLs (`ajax.googleapis.com` and `apis.google.com`)
14+
- All optimization options are now disabled by default for better user control
15+
- Improved DNS prefetch textarea display to eliminate extra whitespace on first line
16+
17+
### Fixed
18+
- Fixed WordPress coding standards compliance: PHP opening and closing tags now on separate lines
19+
- Fixed indentation in textarea rendering function (3 tabs instead of 4)
20+
821
## [1.7.0] - 2025-01-27
922

1023
### Changed

readme.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ No, the plugin has a simple interface where you can toggle features on and off.
4343

4444
== Changelog ==
4545

46+
= Unreleased =
47+
* **FEATURE**: Added new option to remove RSD (Really Simple Discovery) link from WordPress header
48+
* **ENHANCEMENT**: Added DNS prefetch domains for WordPress.org, WordPress.com, and Cloudflare CDN
49+
* **OPTIMIZATION**: Updated default DNS prefetch domains by removing deprecated Google CDN URLs
50+
* **USER EXPERIENCE**: All optimization options are now disabled by default for better user control
51+
* **CODE QUALITY**: Fixed WordPress coding standards compliance for PHP tag formatting and indentation
52+
4653
= 1.7.0 =
4754
* **ARCHITECTURE**: Major plugin architecture refactor - completely restructured initialization to use WordPress `plugins_loaded` hook
4855
* **ARCHITECTURE**: Improved plugin load order by removing immediate global scope execution

simple-wp-optimizer.php

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function es_optimizer_get_default_options() {
182182
'remove_jquery_migrate' => 0,
183183
'disable_classic_theme_styles' => 0,
184184
'remove_wp_version' => 0,
185+
'remove_rsd_link' => 0,
185186
'remove_wlw_manifest' => 0,
186187
'remove_shortlink' => 0,
187188
'remove_recent_comments_style' => 0,
@@ -191,8 +192,9 @@ function es_optimizer_get_default_options() {
191192
array(
192193
'https://fonts.googleapis.com',
193194
'https://fonts.gstatic.com',
194-
'https://ajax.googleapis.com',
195-
'https://apis.google.com',
195+
'https://s.w.org',
196+
'https://wordpress.com',
197+
'https://cdnjs.cloudflare.com',
196198
)
197199
),
198200
'disable_jetpack_ads' => 0,
@@ -350,6 +352,14 @@ function es_optimizer_render_header_options( $options ) {
350352
esc_html__( 'Remove WordPress version from header (security benefit)', 'simple-wp-optimizer' )
351353
);
352354

355+
// RSD Link settings.
356+
es_optimizer_render_checkbox_option(
357+
$options,
358+
'remove_rsd_link',
359+
esc_html__( 'Remove RSD Link', 'simple-wp-optimizer' ),
360+
esc_html__( 'Remove Really Simple Discovery (RSD) link from header', 'simple-wp-optimizer' )
361+
);
362+
353363
// WLW Manifest settings.
354364
es_optimizer_render_checkbox_option(
355365
$options,
@@ -504,18 +514,20 @@ function es_optimizer_render_textarea_option( $options, $option_name, $title, $d
504514
*/
505515
printf( 'es_optimizer_options[%s]', esc_attr( $option_name ) );
506516
?>
507-
" rows="5" cols="50" class="large-text code"><?php
508-
if ( isset( $options[ $option_name ] ) ) {
509-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
510-
511-
/*
512-
* Using printf with esc_textarea is the most appropriate approach.
513-
* esc_textarea already properly escapes content for use inside textarea elements.
514-
* This function is designed specifically for this purpose and ensures data is properly escaped.
515-
*/
516-
printf( '%s', esc_textarea( $options[ $option_name ] ) );
517-
}
518-
?></textarea>
517+
" rows="5" cols="50" class="large-text code">
518+
<?php
519+
if ( isset( $options[ $option_name ] ) ) {
520+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
521+
522+
/*
523+
* Using printf with esc_textarea is the most appropriate approach.
524+
* esc_textarea already properly escapes content for use inside textarea elements.
525+
* This function is designed specifically for this purpose and ensures data is properly escaped.
526+
*/
527+
printf( '%s', esc_textarea( $options[ $option_name ] ) );
528+
}
529+
?>
530+
</textarea>
519531
</td>
520532
</tr>
521533
<?php
@@ -564,6 +576,7 @@ function es_optimizer_validate_options( $input ) {
564576
'remove_jquery_migrate',
565577
'disable_classic_theme_styles',
566578
'remove_wp_version',
579+
'remove_rsd_link',
567580
'remove_wlw_manifest',
568581
'remove_shortlink',
569582
'remove_recent_comments_style',
@@ -864,6 +877,11 @@ function remove_header_items() {
864877
remove_action( 'wp_head', 'wp_generator' );
865878
}
866879

880+
// Remove RSD Link.
881+
if ( isset( $options['remove_rsd_link'] ) && $options['remove_rsd_link'] ) {
882+
remove_action( 'wp_head', 'rsd_link' );
883+
}
884+
867885
// Remove Windows Live Writer Manifest.
868886
if ( isset( $options['remove_wlw_manifest'] ) && $options['remove_wlw_manifest'] ) {
869887
remove_action( 'wp_head', 'wlwmanifest_link' );

0 commit comments

Comments
 (0)