@@ -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