Skip to content

Commit 0d385cc

Browse files
authored
Minor Changes
1 parent 05780b0 commit 0d385cc

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Simple WP Optimizer
22

3-
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6a23f01f0c0c440a958ce5857154ea70)](https://app.codacy.com/gh/EngineScript/simple-wp-optimizer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Github License](https://img.shields.io/badge/License-GPL%20v3-green.svg?logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.html)
3+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cf82cdb35973466abe7895e6d37666ed)](https://app.codacy.com/gh/EngineScript/simple-wp-optimizer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
4+
[![Github License](https://img.shields.io/badge/License-GPL%20v3-green.svg?logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.html)
45
[![WordPress Compatible](https://img.shields.io/badge/WordPress-6.5%2B-blue.svg?logo=wordpress)](https://wordpress.org/)
56
[![PHP Compatible](https://img.shields.io/badge/PHP-7.4%2B-purple.svg?logo=php)](https://www.php.net/)
67

simple-wp-optimizer.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,19 @@ function es_optimizer_render_checkbox_option( $options, $option_name, $title, $d
306306
<td>
307307
<label>
308308
<input type="checkbox" name="<?php
309-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
309+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
310310

311-
/*
312-
* Using printf with esc_attr for attribute name which cannot be avoided.
313-
* The $option_name values are hardcoded strings from render functions, not user input.
314-
* This is a controlled environment where these values are defined within the plugin.
315-
*/
316-
printf( 'es_optimizer_options[%s]', esc_attr( $option_name ) );
317-
?>" value="1"
311+
/*
312+
* Using printf with esc_attr for attribute name which cannot be avoided.
313+
* The $option_name values are hardcoded strings from render functions, not user input.
314+
* This is a controlled environment where these values are defined within the plugin.
315+
*/
316+
printf( 'es_optimizer_options[%s]', esc_attr( $option_name ) );
317+
?>" value="1"
318318
<?php checked( 1, isset( $options[ $option_name ] ) ? $options[ $option_name ] : 0 ); ?> />
319319
<?php
320-
// Using esc_html for secure output of descriptions.
321-
echo esc_html( $description );
320+
// Using esc_html for secure output of descriptions.
321+
echo esc_html( $description );
322322
?>
323323
</label>
324324
</td>
@@ -356,16 +356,19 @@ function es_optimizer_render_textarea_option( $options, $option_name, $title, $d
356356
?>
357357
</small></p>
358358
<textarea name="<?php
359-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
360-
/*
361-
* Using printf with esc_attr for attribute name which cannot be avoided.
362-
* The $option_name values are hardcoded strings from render functions, not user input.
363-
* This is a controlled environment where these values are defined within the plugin.
364-
*/
365-
printf( 'es_optimizer_options[%s]', esc_attr( $option_name ) );
366-
?>" rows="5" cols="50" class="large-text code"><?php
359+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
360+
361+
/*
362+
* Using printf with esc_attr for attribute name which cannot be avoided.
363+
* The $option_name values are hardcoded strings from render functions, not user input.
364+
* This is a controlled environment where these values are defined within the plugin.
365+
*/
366+
printf( 'es_optimizer_options[%s]', esc_attr( $option_name ) );
367+
?>" rows="5" cols="50" class="large-text code">
368+
<?php
367369
if ( isset( $options[ $option_name ] ) ) {
368370
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
371+
369372
/*
370373
* Using printf with esc_textarea is the most appropriate approach.
371374
* esc_textarea already properly escapes content for use inside textarea elements.

0 commit comments

Comments
 (0)