Plugin Directory

Changeset 3726634


Ignore:
Timestamp:
10/03/2026 07:09:18 PM (3 weeks ago)
Author:
diana_burduja
Message:

version 3.54.1

Location:
custom-css-js
Files:
2 added
8 edited
72 copied

Legend:

Unmodified
Added
Removed
  • custom-css-js/tags/3.54.1/changelog.txt

    r3539913 r3726634  
    11== Changelog ==
     2
     3= 3.54.1 =
     4* 10/03/2026
     5* Tweak: add translators' notes to translatable strings
     6* Fix: escape outputs as per the WordPress documentation.
     7
     8= 3.54 =
     9* 08/20/2026
     10* Compatibility with WP 7.1 (solved bug https://wordpress.org/support/topic/bug-fix-for-wordpress-7-1-html-snippets-returning-empty-in-__call/ )
     11* Change: update the minimum WP requirement to 4.2
    212
    313= 3.53 =
  • custom-css-js/tags/3.54.1/custom-css-js.php

    r3656511 r3726634  
    44 * Plugin URI:  https://wordpress.org/plugins/custom-css-js/
    55 * Description: Easily add Custom CSS or JS to your website with an awesome editor.
    6  * Version:     3.54
     6 * Version:     3.54.1
    77 * Author:      SilkyPress.com
    88 * Author URI:  https://www.silkypress.com
    … …  
    4949                 */
    5050                public function __clone() {
    51                         _doing_it_wrong( __FUNCTION__, __( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
     51                        _doing_it_wrong( __FUNCTION__, esc_html( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
    5252                }
    5353
    … …  
    5656                 */
    5757                public function __wakeup() {
    58                         _doing_it_wrong( __FUNCTION__, __( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
     58                        _doing_it_wrong( __FUNCTION__, esc_html( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
    5959                }
    6060
    … …  
    194194                                                        $custom_code = str_replace( array( ' type="text/javascript"', ' type="text/css"' ), '', $custom_code );
    195195                                                }
     196                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    196197                                                echo $custom_code;
    197198                                        } else {
     199                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    198200                                                echo @file_get_contents( CCJ_UPLOAD_DIR . '/' . $_filename );
    199201                                        }
    200202                                }
    201203
    202                                 if ( 'external' === $where && 'js' === $type ) {
    203                                         echo PHP_EOL . "<script{$type_attr} src='{$upload_url}{$_filename}'></script>" . PHP_EOL;
    204                                 }
    205 
    206                                 if ( 'external' === $where && 'css' === $type ) {
     204                                if ( 'external' === $where && 'js' === $type ) : ?><script<?php echo esc_html( $type_attr ); ?> src="<?php echo esc_url( $upload_url . $_filename ); ?>"></script>
     205<?php endif;
     206
     207                                if ( 'external' === $where && 'css' === $type ) :
    207208                                        $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
    208                                         echo PHP_EOL . "<link rel='stylesheet' id='{$shortfilename}-css' href='{$upload_url}{$_filename}'{$type_attr} media='all' />" . PHP_EOL;
    209                                 }
     209                                        ?><link rel="stylesheet" id="<?php echo esc_attr( $shortfilename ); ?>-css" href="<?php echo esc_url( $upload_url . $_filename ); ?>"<?php echo esc_html( $type_attr ); ?> media="all" />
     210<?php endif;
    210211
    211212                                if ( 'html' === $type ) {
    212213                                        $post = get_post( intval( $_filename ) );
    213214                                        if ( isset( $post->post_content ) && ! empty( $post->post_content ) ) {
     215                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    214216                                                echo $post->post_content;
    215217                                        }
    … …  
    282284                        $dir       = wp_upload_dir();
    283285                        $constants = array(
    284                                 'CCJ_VERSION'     => '3.54',
     286                                'CCJ_VERSION'     => '3.54.1',
    285287                                'CCJ_UPLOAD_DIR'  => $dir['basedir'] . '/custom-css-js',
    286288                                'CCJ_UPLOAD_URL'  => $dir['baseurl'] . '/custom-css-js',
  • custom-css-js/tags/3.54.1/includes/admin-addons.php

    r3656511 r3726634  
    4040    <div class="ccj_only_premium ccj_only_premium-first">
    4141        <div>
    42         <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e('This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); ?></a>
     42        <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e('This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); // phpcs:ignore  WordPress.Security.EscapeOutput.UnsafePrintingFunction ?></a>
    4343        </div>
    4444    </div>
    … …  
    6565<div id="preview-action">
    6666    <div>
    67     <input type="text" name="preview_url" id="ccj-preview_url" placeholder="<?php _e('Full URL on which to preview the changes ...', 'custom-css-js'); ?>" disabled="disabled" />
    68     <a class="preview button button-primary button-large" id="ccj-preview"><?php _e('Preview Changes', 'custom-css-js'); ?></a>
     67    <input type="text" name="preview_url" id="ccj-preview_url" placeholder="<?php esc_html_e('Full URL on which to preview the changes ...', 'custom-css-js'); ?>" disabled="disabled" />
     68    <a class="preview button button-primary button-large" id="ccj-preview"><?php esc_html_e('Preview Changes', 'custom-css-js'); ?></a>
    6969    </div>
    7070</div>
    … …  
    8080
    8181        $filters = array(
    82             'all'           => __('All Website', 'custom-css-js'),
    83             'first-page'    => __('Homepage', 'custom-css-js'),
    84             'contains'      => __('Contains', 'custom-css-js'),
    85             'not-contains'  => __('Not contains', 'custom-css-js'),
    86             'equal-to'      => __('Is equal to', 'custom-css-js'),
    87             'not-equal-to'  => __('Not equal to', 'custom-css-js'),
    88             'begins-with'   => __('Starts with', 'custom-css-js'),
    89             'ends-by'       => __('Ends by', 'custom-css-js'),
     82            'all'           => 'All Website',
     83            'first-page'    => 'Homepage',
     84            'contains'      => 'Contains',
     85            'not-contains'  => 'Not contains',
     86            'equal-to'      => 'Is equal to',
     87            'not-equal-to'  => 'Not equal to',
     88            'begins-with'   => 'Starts with',
     89            'ends-by'       => 'Ends by',
    9090        );
    91         $filters_html = '';
    92         foreach( $filters as $_key => $_value ) {
    93             $filters_html .= '<option value="'.$_key.'">' . $_value . '</option>';
    94         }
    9591
    9692        $applied_filters = '[{"value":"","type":"all","index":1}]';
    9793
    9894?>
    99         <input type="hidden" name="scan_anchor_filters" id="wplnst-scan-anchor-filters" value='<?php echo $applied_filters; ?>' />
    100     <table id="wplnst-elist-anchor-filters" class="wplnst-elist" cellspacing="0" cellpadding="0" border="0" data-editable="true" data-label="<?php _e('URL', 'custom-css-js'); ?>"></table>
    101         <?php _e('URL', 'custom-css-js'); ?> <select id="wplnst-af-new-type"><?php echo $filters_html ?></select>&nbsp;
    102         <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter', 'custom-css-js'); ?>" />&nbsp;
    103         <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php _e('Add', 'custom-css-js'); ?>" /></td>
     95        <input type="hidden" name="scan_anchor_filters" id="wplnst-scan-anchor-filters" value='<?php echo esc_js( $applied_filters); ?>' />
     96    <table id="wplnst-elist-anchor-filters" class="wplnst-elist" cellspacing="0" cellpadding="0" border="0" data-editable="true" data-label="<?php echo esc_attr('URL', 'custom-css-js'); ?>"></table>
     97                <?php esc_html_e('URL', 'custom-css-js'); ?>
     98                <select id="wplnst-af-new-type">
     99                        <?php foreach( $filters as $_key => $_value ) : ?>
     100                                <option value="<?php echo esc_attr( $_key ); ?>"><?php echo esc_html( $_value, 'custom-css-js' ); ?></option>
     101                        <?php endforeach; ?>
     102                </select>&nbsp;
     103        <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php echo esc_attr('Text filter', 'custom-css-js'); ?>" />&nbsp;
     104        <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php echo esc_attr('Add', 'custom-css-js'); ?>" /></td>
    104105
    105106<?php
    … …  
    134135    <table class="revisions">
    135136        <thead><tr>
    136         <th class="revisions-compare"><?php _e('Compare', 'custom-css-js'); ?></th>
    137         <th><?php _e('Revision', 'custom-css-js'); ?></th>
    138         <th><?php _e('Author', 'custom-css-js'); ?></th>
    139         <th><input type="checkbox" name="delete[]" value="all" id="ccj-delete-checkbox" /> <?php _e('Delete', 'custom-css-js'); ?></th>
    140         <th><?php _e('Restore', 'custom-css-js'); ?></th>
     137        <th class="revisions-compare"><?php esc_html_e('Compare', 'custom-css-js'); ?></th>
     138        <th><?php esc_html_e('Revision', 'custom-css-js'); ?></th>
     139        <th><?php esc_html_e('Author', 'custom-css-js'); ?></th>
     140        <th><input type="checkbox" name="delete[]" value="all" id="ccj-delete-checkbox" /> <?php esc_html_e('Delete', 'custom-css-js'); ?></th>
     141        <th><?php esc_html_e('Restore', 'custom-css-js'); ?></th>
    141142        </tr></thead>
    142143        <tbody>
    … …  
    146147        $restore_url = '#';
    147148
    148         $delete_disabled = '';
    149         $delete_tooltip = '';
    150149        $class = '';
    151150        ?>
    152         <tr class="<?php echo $class; ?>" id="<?php echo 'revision-row-' . $revision['ID']; ?>">
     151        <tr class="<?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( 'revision-row-' . $revision['ID'] ); ?>">
    153152            <td class="revisions-compare">
    154             <input type="radio" name="compare_left" value="<?php echo $revision['ID']; ?>" />
    155             <input type="radio" name="compare_right" value="<?php echo $revision['ID']; ?>" />
     153            <input type="radio" name="compare_left" value="<?php echo esc_attr( $revision['ID'] ); ?>" />
     154            <input type="radio" name="compare_right" value="<?php echo esc_attr( $revision['ID'] ); ?>" />
    156155            </td>
    157             <td><?php echo $revision['title']; ?></td>
    158             <td><?php echo $revision['post_author']; ?></td>
     156            <td><?php echo esc_html( $revision['title'] ); ?></td>
     157            <td><?php echo esc_html( $revision['post_author'] ); ?></td>
    159158            <td class="revisions-delete">
    160             <input type="checkbox" name="delete[]" value="<?php echo $revision['ID']; ?>" <?php echo $delete_disabled . $delete_tooltip; ?>/>
     159            <input type="checkbox" name="delete[]" value="<?php echo esc_attr( $revision['ID'] ); ?>">
    161160            </td>
    162161            <td class="revisions-restore">
    163                 <a href="<?php echo $restore_url; ?>"><?php _e('Restore', 'custom-css-js'); ?></a>
     162                <a href="<?php echo esc_url( $restore_url ); ?>"><?php esc_html_e('Restore', 'custom-css-js'); ?></a>
    164163            </td>
    165164        </tr>
  • custom-css-js/tags/3.54.1/includes/admin-config.php

    r3476672 r3726634  
    124124        <?php $this->config_page_header('editor'); ?>
    125125
    126         <form action="<?php echo admin_url('edit.php'); ?>?post_type=custom-css-js&page=custom-css-js-config" id="ccj_settings" method="post">
     126        <form action="<?php echo esc_url( admin_url('edit.php') ); ?>?post_type=custom-css-js&page=custom-css-js-config" id="ccj_settings" method="post">
    127127
    128128        <?php do_action( 'ccj_settings_form' ); ?>
    … …  
    139139    function config_page_header( $tab = 'editor' ) {
    140140 
    141         $url = '?post_type=custom-css-js&page=custom-css-js-config';
    142 
    143         $active = array('editor' => '', 'general' => '', 'debug' => '');
    144         $active[$tab] = 'nav-tab-active';
     141                $logo           = plugins_url( '/', CCJ_PLUGIN_FILE ) . 'assets/images/silkypress_logo.png';
     142                $silkypress_url = 'https://www.silkypress.com/?utm_source=wordpress&amp;utm_campaign=iz_free&amp;utm_medium=banner';
    145143
    146144        ?>
    147145        <style type="text/css">
    148             .custom-css-js_page_custom-css-js-config h1 { margin-bottom: 40px; }
     146            .custom-css-js_page_custom-css-js-config h1 { margin-bottom: 2em; margin-top: 1em; }
     147            .custom-css-js_page_custom-css-js-config h1 img { vertical-align: middle; }
     148            .custom-css-js_page_custom-css-js-config h1 a { text-decoration: none; }
     149            .custom-css-js_page_custom-css-js-config h1 a:hover { text-decoration: underline; }
    149150            .form-table { margin-left: 2%; width: 98%;}
    150151            .form-table th { width: 500px; }
    151152        </style>
    152         <h1><?php _e('Custom CSS & JS Settings'); ?></h1>
     153
     154                <h1>
     155                        <?php esc_html_e( 'Settings for the "Custom CSS & JS" plugin by ', 'custom-css-js' );  ?>
     156                        <img src="<?php echo esc_url( $logo ); ?>"> <a href="<?php echo esc_url( $silkypress_url ); ?>" target="_blank">SilkyPress.com</a>
     157                </h1>
    153158
    154159        <?php     
    … …  
    211216        }
    212217
    213         $ccj_htmlentities_help = __('If you want to use an HTML entity in your code (for example '. htmlentities('&gt; or &quot;').'), but the editor keeps on changing them to its equivalent character (&gt; and &quot; for the previous example), then you might want to enable this option.', 'custom-css-js');
    214 
    215         $ccj_htmlentities2_help = __('If you use HTML tags in your code (for example '.htmlentities('<input> or <textarea>').') and you notice that they disappear and the editor looks weird, then you need to enable this option.', 'custom-css-js');
    216 
    217         $remove_comments_help = __('In your page\'s HTML there is a comment added before and after the internal CSS or JS in order to help you locate your custom code. Enable this option in order to remove that comment.', 'custom-css-js');
    218 
    219         $remove_file_comments_help = __('Every externally linked custom code will have a 3-lines comment added at the beginning of the file. Enable this option in order to stop adding that comment to the externaly linked custom codes', 'custom-css-js');
    220 
    221218        ?>
    222219
    223         <h2><?php echo __('Editor Settings', 'custom-css-js'); ?></h2>
    224         <table class="form-table">
    225         <tr>
    226         <th scope="row"><label for="ccj_htmlentities"><?php _e('Keep the HTML entities, don\'t convert to its character', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php echo $ccj_htmlentities_help; ?>"></span>
    227         </label></th>
    228         <td><input type="checkbox" name="ccj_htmlentities" id="ccj_htmlentities" value="1" <?php checked($settings['ccj_htmlentities'], true); ?> />
     220        <h2><?php echo esc_html('Editor Settings', 'custom-css-js'); ?></h2>
     221        <table class="form-table">
     222        <tr>
     223                <th scope="row">
     224                        <label for="ccj_htmlentities">
     225                                <?php esc_html_e('Keep the HTML entities, don\'t convert to its character', 'custom-css-js'); ?>
     226                                <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php esc_html_e('If you want to use an HTML entity in your code (for example &amp;gt; or &amp;quot;), but the editor keeps on changing them to its equivalent character (&gt; and &quot; for the previous example), then you might want to enable this option.', 'custom-css-js'); ?>"></span>
     227                </label>
     228                </th><td>
     229                        <input type="checkbox" name="ccj_htmlentities" id="ccj_htmlentities" value="1" <?php checked($settings['ccj_htmlentities'], true); ?>>
    229230        </td>
    230         </tr>
    231         <tr>
    232         <th scope="row"><label for="ccj_htmlentities2"><?php _e('Encode the HTML entities', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php echo $ccj_htmlentities2_help; ?>"></span></label></th>
    233         <td><input type="checkbox" name="ccj_htmlentities2" id="ccj_htmlentities2" value="1" <?php checked($settings['ccj_htmlentities2'], true); ?> />
     231        </tr><tr>
     232                <th scope="row">
     233                        <label for="ccj_htmlentities2">
     234                                <?php esc_html_e('Encode the HTML entities', 'custom-css-js') ?>
     235                                <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php esc_html_e('If you use HTML tags in your code (for example &lt;input&gt; or &lt;textarea&gt;) and you notice that they disappear and the editor looks weird, then you need to enable this option.', 'custom-css-js'); ?>"></span>
     236                        </label>
     237                </th><td>
     238                        <input type="checkbox" name="ccj_htmlentities2" id="ccj_htmlentities2" value="1" <?php checked($settings['ccj_htmlentities2'], true); ?>>
    234239        </td>
    235         </tr>
    236         <tr>
    237         <th scope="row"><label for="ccj_autocomplete"><?php _e('Autocomplete in the editor', 'custom-css-js') ?></label></th>
    238         <td><input type="checkbox" name="ccj_autocomplete" id="ccj_autocomplete" value="1" <?php checked($settings['ccj_autocomplete'], true); ?> />
     240        </tr><tr>
     241                <th scope="row">
     242                        <label for="ccj_autocomplete">
     243                                <?php esc_html_e('Autocomplete in the editor', 'custom-css-js') ?>
     244                        </label>
     245                </th><td>
     246                        <input type="checkbox" name="ccj_autocomplete" id="ccj_autocomplete" value="1" <?php checked($settings['ccj_autocomplete'], true); ?>>
    239247        </td>
    240         </tr>
    241 
    242 
    243 
    244         </table>
    245 
    246 
    247        
    248         <?php if ( current_user_can('update_plugins') ) : ?>
    249             <?php $add_role_help = esc_html__('By default only the Administrator will be able to publish/edit/delete Custom Codes. By enabling this option there is also a "Web Designer" role created which can be assigned to a non-admin user in order to publish/edit/delete Custom Codes.', 'custom-css-js'); ?>
    250             <h2><?php echo __('General Settings', 'custom-css-js'); ?></h2>
    251             <table class="form-table">
    252             <tr>
    253             <th scope="row"><label for="add_role"><?php _e('Add the "Web Designer" role', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $add_role_help; ?>"></span></label></th>
    254             <td><input type="checkbox" name="add_role" id = "add_role" value="1" <?php checked($settings['add_role'], true); ?> />
     248        </tr>
     249        </table>
     250        <h2><?php esc_html_e('General Settings', 'custom-css-js'); ?></h2>
     251        <table class="form-table">
     252        <?php if ( current_user_can('update_plugins') ) : ?>
     253                <tr>
     254                        <th scope="row">
     255                                <label for="add_role">
     256                                        <?php esc_html_e('Add the "Web Designer" role', 'custom-css-js') ?>
     257                                        <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html__('By default only the Administrator will be able to publish/edit/delete Custom Codes. By enabling this option there is also a "Web Designer" role created which can be assigned to a non-admin user in order to publish/edit/delete Custom Codes.', 'custom-css-js'); ?>"></span>
     258                                </label>
     259                        </th><td>
     260                                <input type="checkbox" name="add_role" id = "add_role" value="1" <?php checked($settings['add_role'], true); ?>>
    255261            </td>
    256             </tr>
    257             </table>
    258         <?php endif; ?>
    259         <table class="form-table">
    260         <tr>
    261         <th scope="row"><label for="remove_comments"><?php _e('Remove comments for internal custom codes', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $remove_comments_help; ?>"></span></label></th>
    262         <td><input type="checkbox" name="remove_comments" id = "remove_comments" value="1" <?php checked($settings['remove_comments'], true); ?> />
    263         </td>
    264         </tr>
    265         <tr>
    266         <th scope="row"><label for="remove_file_comments"><?php _e('Remove comments from externally linked custom codes', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $remove_file_comments_help; ?>"></span></label></th>
    267         <td><input type="checkbox" name="remove_file_comments" id = "remove_file_comments" value="1" <?php checked($settings['remove_file_comments'], true); ?> />
    268         </td>
    269         </tr>
    270         </table>
    271 
    272         <table class="form-table">
    273         <tr>
    274         <th>&nbsp;</th>
    275         <td>
    276         <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save'); ?>" />
    277         <?php wp_nonce_field('ccj_settings', 'ccj_settings-nonce', false); ?>
    278         </td>
    279         </tr>
    280         </table>
    281 
    282         <?php
    283     }
     262                </tr>
     263        <?php endif; ?>
     264        <tr>
     265                <th scope="row">
     266                        <label for="remove_comments">
     267                                <?php esc_html_e('Remove comments for internal custom codes', 'custom-css-js') ?>
     268                                <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html_e('In your page\'s HTML there is a comment added before and after the internal CSS or JS in order to help you locate your custom code. Enable this option in order to remove that comment.', 'custom-css-js'); ?>"></span>
     269                        </label>
     270                </th><td>
     271                        <input type="checkbox" name="remove_comments" id = "remove_comments" value="1" <?php checked($settings['remove_comments'], true); ?>>
     272                </td>
     273        </tr><tr>
     274                <th scope="row">
     275                        <label for="remove_file_comments">
     276                                <?php esc_html_e('Remove comments from externally linked custom codes', 'custom-css-js') ?>
     277                                <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html_e('Every externally linked custom code will have a 3-lines comment added at the beginning of the file. Enable this option in order to stop adding that comment to the externaly linked custom codes', 'custom-css-js'); ?>"></span>
     278                        </label>
     279                </th><td>
     280                        <input type="checkbox" name="remove_file_comments" id = "remove_file_comments" value="1" <?php checked($settings['remove_file_comments'], true); ?>>
     281                </td>
     282        </tr><tr>
     283                <th>&nbsp;</th>
     284                <td>
     285                        <input type="submit" name="Submit" class="button-primary" value="<?php esc_html_e( 'Save', 'custom-css-js' ); ?>">
     286                        <?php wp_nonce_field('ccj_settings', 'ccj_settings-nonce', false); ?>
     287                </td>
     288        </tr>
     289        </table>
     290        <?php
     291        }
    284292}
    285293
  • custom-css-js/tags/3.54.1/includes/admin-notices.php

    r3424870 r3726634  
    1515
    1616    var $prefix = 'ccj_';
    17     var $activation_time = '';
     17    var $activation_time = 0;
    1818    var $version = '';
    1919    var $dismiss_notice = '';
    … …  
    6565        $p = $this->prefix;
    6666
    67         $this->activation_time = get_option( $p . '_activation_time', '' );
     67        $this->activation_time = (int)get_option( $p . '_activation_time', '' );
    6868        $this->version = get_option( $p.'_version', '' );
    6969        $this->dismiss_notice = get_option( $p.'_dismiss_notice', false );
    … …  
    113113
    114114        $expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
    115         $expiration_date = date( get_option( 'date_format') , $expiration_date );
    116 
    117         $expiration_period = date('j M', $this->activation_time - 3*86400 ) . ' - ' . date('j M', $this->activation_time + 2*86400 );
     115        $expiration_date = gmdate( get_option( 'date_format') , $expiration_date );
     116
     117        $expiration_period = gmdate('j M', $this->activation_time - 3*86400 ) . ' - ' . gmdate('j M', $this->activation_time + 2*86400 );
    118118
    119119
    … …  
    164164            ?>
    165165            <style type="text/css">
    166                 .<?php echo $p; ?>_note{ color: #bc1117; }
    167                 #<?php echo $p; ?>_notice { display: block; padding:  }
    168                 #<?php echo $p; ?>_notice b { color: #bc1117; }
    169                 #<?php echo $p; ?>_notice a { text-decoration: none; font-weight: bold; }
    170                 #<?php echo $p; ?>_notice a.dismiss_notice { font-weight: normal; }
     166                .<?php echo esc_attr( $p ); ?>_note{ color: #bc1117; }
     167                #<?php echo esc_attr( $p ); ?>_notice { display: block; padding:  }
     168                #<?php echo esc_attr( $p ); ?>_notice b { color: #bc1117; }
     169                #<?php echo esc_attr( $p ); ?>_notice a { text-decoration: none; font-weight: bold; }
     170                #<?php echo esc_attr( $p ); ?>_notice a.dismiss_notice { font-weight: normal; }
    171171            </style>
    172172
    173173            <script type='text/javascript'>
    174174                jQuery(function($){
    175                     $(document).on( 'click', '.<?php echo $p; ?>_notice .dismiss_notice', function() {
     175                    $(document).on( 'click', '.<?php echo esc_attr( $p ); ?>_notice .dismiss_notice', function() {
    176176                        var data = {
    177                             action: '<?php echo $p; ?>_notice_dismiss',
    178                             option: '<?php echo $option_name; ?>',
     177                            action: '<?php echo esc_attr( $p ); ?>_notice_dismiss',
     178                            option: '<?php echo esc_attr( $option_name ); ?>',
    179179                            nonce: $(this).parent().parent().data('nonce'),
    180180                        };
    181181                        $.post(ajaxurl, data, function(response ) {
    182                             $('#<?php echo $p; ?>_notice').fadeOut('slow');
     182                            $('#<?php echo esc_attr( $p ); ?>_notice').fadeOut('slow');
    183183                        });
    184184                    });
    … …  
    186186            </script>
    187187
    188                 <div id="<?php echo $p; ?>_notice" class="updated notice <?php echo $p; ?>_notice is-dismissible" data-nonce="<?php echo wp_create_nonce( $this->prefix .'_notice'); ?>">
    189             <p><?php echo $message ?></p>
    190             <button type="button" class="notice-dismiss">
    191             <span class="screen-reader-text"><?php _e('Dismiss this notice', 'custom-css-js'); ?></span>
     188                <div id="<?php echo esc_attr( $p ); ?>_notice" class="updated notice <?php echo esc_attr( $p ); ?>_notice is-dismissible" data-nonce="<?php echo  esc_attr( wp_create_nonce( $this->prefix .'_notice') ); ?>">
     189            <p><?php echo $message // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ; ?></p>
     190                        <span>
     191            <button type="button" class="notice-dismiss dismiss_notice">
     192            <span class="screen-reader-text"><?php esc_html_e('Dismiss this notice', 'custom-css-js'); ?></span>
    192193            </button>
     194                        </span>
    193195            </div>
    194196<?php
  • custom-css-js/tags/3.54.1/includes/admin-screens.php

    r3656511 r3726634  
    346346                ?>
    347347        <div class="updated buttons">
    348         <a href="post-new.php?post_type=custom-css-js&language=css" class="custom-btn custom-css-btn"><?php _e( 'Add CSS code', 'custom-css-js' ); ?></a>
    349         <a href="post-new.php?post_type=custom-css-js&language=js" class="custom-btn custom-js-btn"><?php _e( 'Add JS code', 'custom-css-js' ); ?></a>
    350         <a href="post-new.php?post_type=custom-css-js&language=html" class="custom-btn custom-js-btn"><?php _e( 'Add HTML code', 'custom-css-js' ); ?></a>
    351                 <!-- a href="post-new.php?post_type=custom-css-js&language=php" class="custom-btn custom-php-btn">Add PHP code</a -->
     348        <a href="post-new.php?post_type=custom-css-js&language=css" class="custom-btn custom-css-btn"><?php esc_html_e( 'Add CSS code', 'custom-css-js' ); ?></a>
     349        <a href="post-new.php?post_type=custom-css-js&language=js" class="custom-btn custom-js-btn"><?php esc_html_e( 'Add JS code', 'custom-css-js' ); ?></a>
     350        <a href="post-new.php?post_type=custom-css-js&language=html" class="custom-btn custom-js-btn"><?php esc_html_e( 'Add HTML code', 'custom-css-js' ); ?></a>
    352351        </div>
    353352                <?php
    … …  
    364363                        'active'    => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="' . __( 'Active', 'custom-css-js' ) . '"></span>',
    365364                        'type'      => __( 'Type', 'custom-css-js' ),
    366                         'name'      => __( 'Title' ),
    367                         'author'    => __( 'Author' ),
    368                         'published' => __( 'Published' ),
     365                        'name'      => __( 'Title', 'custom-css-js' ),
     366                        'author'    => __( 'Author', 'custom-css-js' ),
     367                        'published' => __( 'Published', 'custom-css-js' ),
    369368                        'modified'  => __( 'Modified', 'custom-css-js' ),
    370369                );
    … …  
    389388                        $edit_link = get_edit_post_link( $post_id );
    390389                        $title     = _draft_or_post_title( $post_id );
    391                         echo '<strong><a class="row-title" href="' . esc_url( $edit_link ) . '">' . esc_html( $title ) . '</a>';
    392                                 _post_states( $post );
    393                         echo '</strong>';
    394                 }
    395 
    396                 if ( 'type' === $column ) {
     390                        ?>
     391                        <strong>
     392                                <a class="row-title" href="<?php echo esc_url( $edit_link ); ?>"><?php echo esc_html( $title ); ?></a>
     393                                <?php _post_states( $post ); ?>
     394                        </strong>
     395                        <?php
     396                }
     397
     398                if ( 'type' === $column ) :
    397399                        $options = $this->get_options( $post_id );
    398                         echo '<span class="language language-' . $options['language'] . '">' . $options['language'] . '</span>';
    399                 }
     400                        ?>
     401                        <span class="language language-<?php echo esc_attr( $options['language'] ); ?>"><?php echo esc_attr( $options['language'] ); ?></span>
     402                <?php endif;
    400403
    401404                if ( 'modified' === $column || 'published' === $column ) {
    … …  
    403406
    404407                        if ( '0000-00-00 00:00:00' === $post->post_date ) {
    405                                 $t_time    = __( 'Unpublished' );
     408                                $t_time    = __( 'Unpublished', 'custom-css-js' );
    406409                                $h_time    = $t_time;
    407410                                $time_diff = 0;
    … …  
    412415                                if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
    413416                                        /* translators: %s: Human-readable time difference. */
    414                                         $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
     417                                        $h_time = sprintf( __( '%s ago', 'custom-css-js' ), human_time_diff( $time ) );
    415418                                } else {
    416419                                        $h_time = ( 'published' === $column ) ? get_the_time( __( 'Y/m/d' ), $post ) : get_the_modified_time( __( 'Y/m/d' ), $post );
    … …  
    418421                        }
    419422
    420                          echo $h_time;
     423                         echo esc_html( $h_time );
    421424                }
    422425
    … …  
    430433                                $active_icon  = 'dashicons-star-empty ccj_row';
    431434                        }
    432                         echo '<a href="' . esc_url( $url ) . '" class="ccj_activate_deactivate" data-code-id="' . $post_id . '" title="' . $active_title . '">' .
    433                                 '<span class="dashicons ' . $active_icon . '"></span>' .
    434                                 '</a>';
     435                        ?>     
     436                        <a href="<?php echo esc_url( $url ); ?>" class="ccj_activate_deactivate" data-code-id="<?php echo esc_attr( $post_id ); ?>" title="<?php echo esc_html( $active_title ); ?>">
     437                                <span class="dashicons <?php echo esc_attr( $active_icon ); ?>"></span>
     438                        </a>
     439                        <?php
    435440                }
    436441        }
    … …  
    507512                );
    508513
    509                 echo '<label class="screen-reader-text" for="custom-css-js-filter">' . esc_html__( 'Filter Code Type', 'custom-css-js' ) . '</label>';
    510                 echo '<select name="language_filter" id="custom-css-js-filter">';
    511                 echo '<option  value="">' . __( 'All Custom Codes', 'custom-css-js' ) . '</option>';
    512                 foreach ( $languages as $_lang => $_label ) {
    513                         $selected = selected( filter_input( INPUT_GET, 'language_filter' ), $_lang, false );
    514                         echo '<option ' . $selected . ' value="' . $_lang . '">' . $_label . '</option>';
    515                 }
    516                 echo '</select>';
     514                ?>
     515                <label class="screen-reader-text" for="custom-css-js-filter"><?php esc_html_e( 'Filter Code Type', 'custom-css-js' ); ?></label>
     516                <select name="language_filter" id="custom-css-js-filter">
     517                <option  value=""><?php esc_html_e( 'All Custom Codes', 'custom-css-js' ); ?></option>
     518                <?php foreach ( $languages as $_lang => $_label ) : ?>
     519                <option <?php echo esc_attr( selected( filter_input( INPUT_GET, 'language_filter' ), $_lang, false ) ); ?>  value="<?php echo esc_attr( $_lang ); ?>"><?php echo esc_html( $_label ); ?></option>
     520                <?php endforeach; ?>
     521                </select>
     522                <?php
    517523        }
    518524
    … …  
    596602                        }
    597603                }
    598                 echo $active;
     604                echo esc_html( $active );
    599605
    600606                die();
    … …  
    618624                         /* <![CDATA[ */
    619625                        jQuery(window).ready(function($){
    620                                 var h1 = '<?php _e( 'Custom Code', 'custom-css-js' ); ?> ';
    621                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php _e( 'Add CSS Code', 'custom-css-js' ); ?></a>';
    622                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php _e( 'Add JS Code', 'custom-css-js' ); ?></a>';
    623                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php _e( 'Add HTML Code', 'custom-css-js' ); ?></a>';
     626                                var h1 = '<?php esc_html_e( 'Custom Code', 'custom-css-js' ); ?> ';
     627                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php esc_html_e( 'Add CSS Code', 'custom-css-js' ); ?></a> ';
     628                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php esc_html_e( 'Add JS Code', 'custom-css-js' ); ?></a> ';
     629                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php esc_html_e( 'Add HTML Code', 'custom-css-js' ); ?></a>';
    624630                                $("#wpbody-content h1").html(h1);
    625631                        });
    … …  
    637643                $this->remove_unallowed_metaboxes();
    638644
    639                 $strings = array(
    640                         'Add CSS Code'   => __( 'Add CSS Code', 'custom-css-js' ),
    641                         'Add JS Code'    => __( 'Add JS Code', 'custom-css-js' ),
    642                         'Add HTML Code'  => __( 'Add HTML Code', 'custom-css-js' ),
    643                         'Edit CSS Code'  => __( 'Edit CSS Code', 'custom-css-js' ),
    644                         'Edit JS Code'   => __( 'Edit JS Code', 'custom-css-js' ),
    645                         'Edit HTML Code' => __( 'Edit HTML Code', 'custom-css-js' ),
    646                 );
    647 
    648                 if ( isset( $_GET['post'] ) ) {
    649                         $action  = 'Edit';
    650                         $post_id = esc_attr( $_GET['post'] );
    651                 } else {
    652                         $action  = 'Add';
    653                         $post_id = false;
    654                 }
     645                $post_id  = ( isset( $_GET['post'] ) ) ? esc_attr( $_GET['post'] ) : false;
     646                $action   = ( isset( $_GET['post'] ) ) ? __( 'Edit %s code', 'custom-css-js' ) : __( 'Add %s code', 'custom-css-js' );
    655647                $language = $this->get_language( $post_id );
    656 
    657                 $title = $action . ' ' . strtoupper( $language ) . ' Code';
    658                 $title = ( isset( $strings[ $title ] ) ) ? $strings[ $title ] : $strings['Add CSS Code'];
    659 
    660                 if ( $action == 'Edit' ) {
    661                         $title .= ' <a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">' . __( 'Add CSS Code', 'custom-css-js' ) . '</a> ';
    662                         $title .= '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">' . __( 'Add JS Code', 'custom-css-js' ) . '</a>';
    663                         $title .= '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">' . __( 'Add HTML Code', 'custom-css-js' ) . '</a>';
    664                 }
    665648
    666649                ?>
    … …  
    673656                         /* <![CDATA[ */
    674657                        jQuery(window).ready(function($){
    675                                 $("#wpbody-content h1").html('<?php echo $title; ?>');
    676                                 $("#message.updated.notice").html('<p><?php _e( 'Code updated', 'custom-css-js' ); ?></p>');
     658                                $("#wpbody-content h1").html(
     659                                        '<?php echo esc_html( sprintf( $action, strtoupper( $language ) ) ); ?>'
     660                                        <?php if ( $post_id != false ) : ?>
     661                                        + '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php esc_html_e( 'Add CSS Code', 'custom-css-js' ); ?></a>'
     662                                        + '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php esc_html_e( 'Add JS Code', 'custom-css-js' ); ?></a>'
     663                                        + '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php esc_html_e( 'Add HTML Code', 'custom-css-js' ); ?></a>'
     664                                        <?php endif; ?>);
     665                                $("#message.updated.notice").html('<p><?php esc_html_e( 'Code updated', 'custom-css-js' ); ?></p>');
    677666
    678667                                var from_top = -$("#normal-sortables").height();
    … …  
    857846
    858847                                <div class="code-mirror-buttons">
    859                                 <div class="button-left"><span rel="tipsy" original-title="<?php _e( 'Beautify Code', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-beautifier"><i class="ccj-i-beautifier"></i></button></span></div>
    860                                 <!--div class="button-left"><span rel="tipsy" original-title="<?php _e( 'Editor Settings', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-settings"><i class="ccj-i-settings"></i></button></span></div -->
    861                                 <div class="button-right" id="ccj-fullscreen-button" alt="<?php _e( 'Distraction-free writing mode', 'custom-css-js' ); ?>"><span rel="tipsy" original-title="<?php _e( 'Fullscreen', 'custom-css-js' ); ?>"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-fullscreen"></i></button></span></div>
     848                                <div class="button-left"><span rel="tipsy" original-title="<?php esc_html_e( 'Beautify Code', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-beautifier"><i class="ccj-i-beautifier"></i></button></span></div>
     849                                <!--div class="button-left"><span rel="tipsy" original-title="<?php esc_html_e( 'Editor Settings', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-settings"><i class="ccj-i-settings"></i></button></span></div -->
     850                                <div class="button-right" id="ccj-fullscreen-button" alt="<?php esc_html_e( 'Distraction-free writing mode', 'custom-css-js' ); ?>"><span rel="tipsy" original-title="<?php esc_html_e( 'Fullscreen', 'custom-css-js' ); ?>"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-fullscreen"></i></button></span></div>
    862851<input type="hidden" name="fullscreen" id="ccj-fullscreen-hidden" value="false" />
    863 <!-- div class="button-right" id="ccj-search-button" alt="Search"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-find"></i></button></div -->
    864 
    865852                                </div>
    866853
    867                                 <div class="code-mirror-before"><div class="code-mirror-before-<?php echo esc_attr($language); ?>"><?php echo htmlentities( $code_mirror_before ); ?></div></div>
    868                                 <textarea class="wp-editor-area" id="ccj_content" mode="<?php echo htmlentities( $code_mirror_mode ); ?>" name="content" autofocus><?php echo $post->post_content; ?></textarea>
    869                                 <div class="code-mirror-after"><div class="code-mirror-after-<?php echo esc_attr($language); ?>"><?php echo htmlentities( $code_mirror_after ); ?></div></div>
     854                                <div class="code-mirror-before">
     855                                        <div class="code-mirror-before-<?php echo esc_attr($language); ?>"><?php echo esc_html( $code_mirror_before ); ?></div>
     856                                </div>
     857                                <textarea class="wp-editor-area" id="ccj_content" mode="<?php echo esc_attr( $code_mirror_mode ); ?>" name="content" autofocus><?php echo esc_html($post->post_content); ?></textarea>
     858                                <div class="code-mirror-after">
     859                                        <div class="code-mirror-after-<?php echo esc_attr($language); ?>"><?php echo esc_html( $code_mirror_after ); ?></div>
     860                                </div>
    870861
    871862                                <table id="post-status-info"><tbody><tr>
    872863                                        <td class="autosave-info">
    873864                                        <span class="autosave-message">&nbsp;</span>
    874                                 <?php
    875                                 if ( 'auto-draft' != $post->post_status ) {
    876                                         echo '<span id="last-edit">';
     865                                <?php if ( 'auto-draft' != $post->post_status ) : ?>
     866                                        <span id="last-edit">
     867                                        <?php
    877868                                        if ( $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ) ) {
    878869                                                printf(
    879870                                                        /* translators: 1: display_name of the curren user, 2: date, 3: time. */
    880                                                         __( 'Last edited by %1$s on %2$s at %3$s', 'custom-css-js' ),
     871                                                        esc_html( 'Last edited by %1$s on %2$s at %3$s', 'custom-css-js' ),
    881872                                                        esc_html( $last_user->display_name ),
    882                                                         mysql2date( get_option( 'date_format' ), $post->post_modified ),
    883                                                         mysql2date( get_option( 'time_format' ), $post->post_modified )
     873                                                        esc_html( mysql2date( get_option( 'date_format' ), $post->post_modified ) ),
     874                                                        esc_html( mysql2date( get_option( 'time_format' ), $post->post_modified ) )
    884875                                                );
    885876                                        } else {
    886877                                                printf(
    887878                                                        /* translators: 1: display_name of the curren user, 2: time. */
    888                                                         __( 'Last edited on %1$s at %2$s', 'custom-css-js' ),
    889                                                         mysql2date( get_option( 'date_format' ), $post->post_modified ),
    890                                                         mysql2date( get_option( 'time_format' ), $post->post_modified )
     879                                                        esc_html( 'Last edited on %1$s at %2$s', 'custom-css-js' ),
     880                                                        esc_html( mysql2date( get_option( 'date_format' ), $post->post_modified ) ),
     881                                                        esc_html( mysql2date( get_option( 'time_format' ), $post->post_modified ) )
    891882                                                );
    892883                                        }
    893                                         echo '</span>';
    894                                 }
    895                                 ?>
     884                                        ?>
     885                                        </span>
     886                                        <?php endif; ?>
    896887                                        </td>
    897888                                </tr></tbody></table>
    898889
    899890
    900                                 <input type="hidden" id="update-post_<?php echo $post->ID; ?>" value="<?php echo wp_create_nonce( 'update-post_' . $post->ID ); ?>" />
     891                                <input type="hidden" id="update-post_<?php echo esc_attr( $post->ID ); ?>" value="<?php echo esc_attr( wp_create_nonce( 'update-post_' . $post->ID ) ); ?>">
    901892                <?php
    902893
    … …  
    930921                ?>
    931922                        <div class="options_meta_box">
    932                         <?php
    933 
    934                         $output = '';
    935 
    936                         foreach ( $meta as $_key => $a ) {
     923                        <?php foreach ( $meta as $_key => $a ) :
    937924                                $close_div = false;
    938925
    … …  
    941928                                        in_array( $_key, ['priority', 'minify', 'multisite' ] ) ) {
    942929                                        $close_div = true;
    943                                         $output   .= '<div class="ccj_opaque">';
     930                                        ?>
     931                                        <div class="ccj_opaque">
     932                                        <?php
    944933                                }
    945934
    946                                 // Don't show Pre-processors for JavaScript Codes
    947935                                if ( $options['language'] == 'js' && $_key == 'preprocessor' ) {
    948936                                        continue;
    949937                                }
    950 
    951                                 $output .= '<h3>' . esc_attr( $a['title'] ) . '</h3>' . PHP_EOL;
    952 
    953                                 $output .= $this->render_input( $_key, $a, $options );
    954 
    955                                 if ( $close_div ) {
    956                                         $output .= '</div>';
    957                                 }
    958                         }
    959 
    960                         echo $output;
    961 
    962                         ?>
    963 
    964                         <input type="hidden" name="custom_code_language" value="<?php echo $options['language']; ?>" />
     938                                ?>
     939
     940                                <h3><?php echo esc_html( $a['title'] ); ?></h3>
     941
     942                                <?php $this->render_input( $_key, $a, $options );
     943
     944                                if ( $close_div ) { ?>
     945                                        </div>
     946                                <?php }
     947                        endforeach; ?>
     948
     949                        <input type="hidden" name="custom_code_language" value="<?php echo esc_attr( $options['language'] ); ?>">
    965950
    966951                        <div style="clear: both;"></div>
    … …  
    970955                        <div class="ccj_only_premium ccj_only_premium-right">
    971956                                <div>
    972                                 <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e( 'This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js' ); ?></a>
     957                                <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e( 'This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js' ); // phpcs:ignore  WordPress.Security.EscapeOutput.UnsafePrintingFunction ?></a>
    973958                                </div>
    974959                        </div>
    … …  
    13591344                                        printf(
    13601345                                                /* translators: %s: folder name. */
    1361                                                 __( 'The %s directory could not be created', 'custom-css-js' ),
     1346                                                esc_html( 'The %s directory could not be created', 'custom-css-js' ),
    13621347                                                '<b>custom-css-js</b>'
    13631348                                        );
    13641349                                ?></p>
    1365                          <p><?php _e( 'Please run the following commands in order to make the directory', 'custom-css-js' ); ?>: <br /><strong>mkdir <?php echo $dir; ?>; </strong><br /><strong>chmod 777 <?php echo $dir; ?>;</strong></p>
     1350                         <p><?php esc_html_e( 'Please run the following commands in order to make the directory', 'custom-css-js' ); ?>: <br /><strong>mkdir <?php echo esc_html( $dir ); ?>; </strong><br /><strong>chmod 777 <?php echo esc_html( $dir ); ?>;</strong></p>
    13661351                        </div>
    13671352                        <?php
    … …  
    13761361                                        printf(
    13771362                                                /* translators: %s: folder name. */
    1378                                                 __( 'The %s directory is not writable, therefore the CSS and JS files cannot be saved.', 'custom-css-js' ),
    1379                                                 '<b>' . $dir . '</b>'
     1363                                                esc_html( 'The %s directory is not writable, therefore the CSS and JS files cannot be saved.', 'custom-css-js' ),
     1364                                                '<b>' . esc_html( $dir ) . '</b>'
    13801365                                        );
    13811366                                ?></p>
    1382                          <p><?php _e( 'Please run the following command to make the directory writable', 'custom-css-js' ); ?>:<br /><strong>chmod 777 <?php echo $dir; ?> </strong></p>
     1367                         <p><?php esc_html_e( 'Please run the following command to make the directory writable', 'custom-css-js' ); ?>:<br /><strong>chmod 777 <?php echo esc_html( $dir ); ?> </strong></p>
    13831368                        </div>
    13841369                        <?php
    … …  
    15011486        function render_input( $_key, $a, $options ) {
    15021487                $name   = 'custom_code_' . $_key;
    1503                 $output = '';
    15041488
    15051489                // Show radio type options
    15061490                if ( $a['type'] === 'radio' ) {
    1507                         $output .= '<div class="radio-group">' . PHP_EOL;
    1508                         foreach ( $a['values'] as $__key => $__value ) {
     1491                        ?>
     1492                        <div class="radio-group">
     1493                        <?php foreach ( $a['values'] as $__key => $__value ) :
    15091494                                $id        = $name . '-' . $__key;
    15101495                                $dashicons = isset( $__value['dashicon'] ) ? 'dashicons-before dashicons-' . $__value['dashicon'] : '';
    1511                                 $selected  = ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1512                                 $selected .= ( $__key == $options[ $_key ] ) ? ' checked="checked" ' : '';
    1513                                 $output   .= '<input type="radio" ' . $selected . 'value="' . $__key . '" name="' . $name . '" id="' . $id . '">' . PHP_EOL;
    1514                                 $output   .= '<label class="' . $dashicons . '" for="' . $id . '"> ' . esc_attr( $__value['title'] ) . '</label><br />' . PHP_EOL;
    1515                         }
    1516                         $output .= '</div>' . PHP_EOL;
     1496                                ?>
     1497                                <input type="radio"<?php checked( $__key == $options[ $_key ] ); disabled( isset( $a['disabled'] ) && $a['disabled'] ); ?> value="<?php echo esc_attr( $__key ); ?>" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>">
     1498                                <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $id ); ?>">
     1499                                        <?php echo esc_attr( $__value['title'] ) ; ?>
     1500                                </label><br />
     1501                        <?php endforeach; ?>
     1502                        </div>
     1503                        <?php
    15171504                }
    15181505
    15191506                // Show checkbox type options
    15201507                if ( $a['type'] == 'checkbox' ) {
    1521                         $output .= '<div class="radio-group">' . PHP_EOL;
    1522                         if ( isset( $a['values'] ) && count( $a['values'] ) > 0 ) {
     1508                        ?>
     1509                        <div class="radio-group">
     1510                        <?php if ( isset( $a['values'] ) && count( $a['values'] ) > 0 ) :
    15231511                                $current_values = explode(',', $options[ $_key ] );
    15241512                                foreach ( $a['values'] as $__key => $__value ) {
    15251513                                        $id        = $name . '-' . $__key;
    15261514                                        $dashicons = isset( $__value['dashicon'] ) ? 'dashicons-before dashicons-' . $__value['dashicon'] : '';
    1527                                         $selected  = ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1528                                         $selected .= ( in_array( $__key, $current_values ) ) ? ' checked="checked" ' : '';
    1529                                         $output   .= '<input type="checkbox" ' . $selected . ' value="1" name="' . $id . '" id="' . $id . '">' . PHP_EOL;
    1530                                         $output   .= '<label class="' . $dashicons . '" for="' . $id . '"> ' . $__value['title'] . '</label><br />' . PHP_EOL;
    1531                                 }
    1532                         } else {
     1515                                        ?>
     1516                                        <input type="checkbox" <?php checked( in_array( $__key, $current_values ) ); disabled( isset( $a['disabled'] ) && $a['disabled'] );  ?> value="1" name="<?php echo esc_attr( $id ); ?>" id="<?php echo esc_attr( $id ); ?>">
     1517                                        <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $id ); ?>"> <?php echo esc_html( $__value['title'] ); ?></label><br />
     1518                                <?php }
     1519                        else :
    15331520                                $dashicons = isset( $a['dashicon'] ) ? 'dashicons-before dashicons-' . $a['dashicon'] : '';
    1534                                 $selected  = ( isset( $options[ $_key ] ) && $options[ $_key ] == '1' ) ? ' checked="checked" ' : '';
    1535                                 $selected .= ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1536                                 $output   .= '<input type="checkbox" ' . $selected . ' value="1" name="' . $name . '" id="' . $name . '">' . PHP_EOL;
    1537                                 $output   .= '<label class="' . $dashicons . '" for="' . $name . '"> ' . $a['title'] . '</label>' . PHP_EOL;
    1538                         }
    1539                         $output .= '</div>' . PHP_EOL;
    1540                 }
     1521                                ?>
     1522                                <input type="checkbox" <?php checked( isset( $options[ $_key ] ) && $options[ $_key ] == '1' ); disabled( isset( $a['disabled'] ) && $a['disabled'] ); ?> value="1" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>">
     1523                                <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $name ); ?>"> <?php echo esc_html( $a['title'] ); ?></label>
     1524                        <?php endif; ?>
     1525                        </div>
     1526                <?php }
    15411527
    15421528                // Show select type options
    1543                 if ( $a['type'] == 'select' ) {
    1544                         $output .= '<div class="radio-group">' . PHP_EOL;
    1545                         $output .= '<select name="' . $name . '" id="' . $name . '">' . PHP_EOL;
    1546                         foreach ( $a['values'] as $__key => $__value ) {
    1547                                 $selected = ( isset( $options[ $_key ] ) && $options[ $_key ] == $__key ) ? ' selected="selected"' : '';
    1548                                 $output  .= '<option value="' . $__key . '"' . $selected . '>' . esc_attr( $__value ) . '</option>' . PHP_EOL;
    1549                         }
    1550                         $output .= '</select>' . PHP_EOL;
    1551                         $output .= '</div>' . PHP_EOL;
    1552                 }
    1553 
    1554                 return $output;
    1555 
     1529                if ( $a['type'] == 'select' ) { ?>
     1530                        <div class="radio-group">
     1531                        <select name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>">
     1532                        <?php foreach ( $a['values'] as $__key => $__value ) { ?>
     1533                                <option value="<?php echo esc_attr( $__key ); ?>"<?php selected( isset( $options[ $_key ] ) && $options[ $_key ] == $__key ); ?>><?php echo esc_html( $__value ); ?></option>
     1534                        <?php } ?>
     1535                        </select>
     1536                        </div>
     1537                <?php }
    15561538        }
    15571539
    … …  
    15911573                        $active_text  = __( 'Activate', 'custom-css-js' );
    15921574                }
    1593                 $actions['activate'] = '<a href="' . esc_url( $url ) . '" title="' . $active_title . '" class="ccj_activate_deactivate" data-code-id="' . $post->ID . '">' . $active_text . '</a>';
     1575                $actions['activate'] = '<a href="' . esc_url( $url ) . '" title="' . esc_html( $active_title ) . '" class="ccj_activate_deactivate" data-code-id="' . esc_attr( $post->ID ) . '">' . esc_html( $active_text ) . '</a>';
    15941576
    15951577                return $actions;
    … …  
    16251607                }
    16261608                ?>
    1627                 <div id="activate-action"><span style="font-weight: bold;"><?php echo $text; ?></span>
    1628                 (<a class="ccj_activate_deactivate" data-code-id="<?php echo $post->ID; ?>" href="<?php echo esc_url( $url ); ?>"><?php echo $action; ?></a>)
     1609                <div id="activate-action"><span style="font-weight: bold;"><?php echo esc_html( $text ); ?></span>
     1610                (<a class="ccj_activate_deactivate" data-code-id="<?php echo esc_attr( $post->ID ); ?>" href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $action ); ?></a>)
    16291611                </div>
    16301612                <?php
    … …  
    16791661                                <span id="sample-permalink"><a href="<?php echo esc_url( $permalink ); ?>"><?php echo esc_html( CCJ_UPLOAD_URL ) . '/'; ?><span id="editable-post-name"><?php echo esc_html( $filename ); ?></span>.<?php echo esc_html( $filetype ); ?></a></span>
    16801662                                &lrm;<span id="ccj-edit-slug-buttons"><button type="button" class="ccj-edit-slug button button-small hide-if-no-js" aria-label="Edit permalink">Edit</button></span>
    1681                                 <span id="editable-post-name-full" data-filetype="<?php echo $filetype; ?>"><?php echo esc_html( $filename ); ?></span>
     1663                                <span id="editable-post-name-full" data-filetype="<?php echo esc_attr( $filetype ); ?>"><?php echo esc_html( $filename ); ?></span>
    16821664                        </div>
    16831665                        <?php wp_nonce_field( 'ccj-permalink', 'ccj-permalink-nonce' ); ?>
  • custom-css-js/tags/3.54.1/includes/admin-warnings.php

    r3476672 r3726634  
    3131        <script type='text/javascript'>
    3232        jQuery(function($){
    33             $(document).on( 'click', '#<?php echo $slug; ?> .notice-dismiss', function() {
     33            $(document).on( 'click', '#<?php echo esc_attr( $slug ); ?> .notice-dismiss', function() {
    3434            var data = {
    3535                action: 'ccj_dismiss',
    36                 option: '<?php echo $slug; ?>',
     36                option: '<?php echo esc_attr( $slug ); ?>',
    3737                nonce: $(this).parent().data('nonce'),
    3838            };
    3939            $.post(ajaxurl, data, function(response ) {
    40                 $('#<?php echo $slug; ?>').fadeOut('slow');
     40                $('#<?php echo esc_attr( $slug ); ?>').fadeOut('slow');
    4141            });
    4242            });
  • custom-css-js/tags/3.54.1/readme.txt

    r3656511 r3726634  
    66Requires at least: 4.2
    77Tested up to: 7.1
    8 Stable tag: 3.54
     8Stable tag: 3.54.1
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
    … …  
    103103== Changelog ==
    104104
     105
     106= 3.54.1 =
     107* 10/03/2026
     108* Tweak: add translators' notes to translatable strings
     109* Fix: escape outputs as per the WordPress documentation.
     110
    105111= 3.54 =
    106112* 08/20/2026
  • custom-css-js/trunk/changelog.txt

    r3539913 r3726634  
    11== Changelog ==
     2
     3= 3.54.1 =
     4* 10/03/2026
     5* Tweak: add translators' notes to translatable strings
     6* Fix: escape outputs as per the WordPress documentation.
     7
     8= 3.54 =
     9* 08/20/2026
     10* Compatibility with WP 7.1 (solved bug https://wordpress.org/support/topic/bug-fix-for-wordpress-7-1-html-snippets-returning-empty-in-__call/ )
     11* Change: update the minimum WP requirement to 4.2
    212
    313= 3.53 =
  • custom-css-js/trunk/custom-css-js.php

    r3656511 r3726634  
    44 * Plugin URI:  https://wordpress.org/plugins/custom-css-js/
    55 * Description: Easily add Custom CSS or JS to your website with an awesome editor.
    6  * Version:     3.54
     6 * Version:     3.54.1
    77 * Author:      SilkyPress.com
    88 * Author URI:  https://www.silkypress.com
    … …  
    4949                 */
    5050                public function __clone() {
    51                         _doing_it_wrong( __FUNCTION__, __( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
     51                        _doing_it_wrong( __FUNCTION__, esc_html( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
    5252                }
    5353
    … …  
    5656                 */
    5757                public function __wakeup() {
    58                         _doing_it_wrong( __FUNCTION__, __( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
     58                        _doing_it_wrong( __FUNCTION__, esc_html( 'An error has occurred. Please reload the page and try again.' ), '1.0' );
    5959                }
    6060
    … …  
    194194                                                        $custom_code = str_replace( array( ' type="text/javascript"', ' type="text/css"' ), '', $custom_code );
    195195                                                }
     196                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    196197                                                echo $custom_code;
    197198                                        } else {
     199                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    198200                                                echo @file_get_contents( CCJ_UPLOAD_DIR . '/' . $_filename );
    199201                                        }
    200202                                }
    201203
    202                                 if ( 'external' === $where && 'js' === $type ) {
    203                                         echo PHP_EOL . "<script{$type_attr} src='{$upload_url}{$_filename}'></script>" . PHP_EOL;
    204                                 }
    205 
    206                                 if ( 'external' === $where && 'css' === $type ) {
     204                                if ( 'external' === $where && 'js' === $type ) : ?><script<?php echo esc_html( $type_attr ); ?> src="<?php echo esc_url( $upload_url . $_filename ); ?>"></script>
     205<?php endif;
     206
     207                                if ( 'external' === $where && 'css' === $type ) :
    207208                                        $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
    208                                         echo PHP_EOL . "<link rel='stylesheet' id='{$shortfilename}-css' href='{$upload_url}{$_filename}'{$type_attr} media='all' />" . PHP_EOL;
    209                                 }
     209                                        ?><link rel="stylesheet" id="<?php echo esc_attr( $shortfilename ); ?>-css" href="<?php echo esc_url( $upload_url . $_filename ); ?>"<?php echo esc_html( $type_attr ); ?> media="all" />
     210<?php endif;
    210211
    211212                                if ( 'html' === $type ) {
    212213                                        $post = get_post( intval( $_filename ) );
    213214                                        if ( isset( $post->post_content ) && ! empty( $post->post_content ) ) {
     215                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    214216                                                echo $post->post_content;
    215217                                        }
    … …  
    282284                        $dir       = wp_upload_dir();
    283285                        $constants = array(
    284                                 'CCJ_VERSION'     => '3.54',
     286                                'CCJ_VERSION'     => '3.54.1',
    285287                                'CCJ_UPLOAD_DIR'  => $dir['basedir'] . '/custom-css-js',
    286288                                'CCJ_UPLOAD_URL'  => $dir['baseurl'] . '/custom-css-js',
  • custom-css-js/trunk/includes/admin-addons.php

    r3656511 r3726634  
    4040    <div class="ccj_only_premium ccj_only_premium-first">
    4141        <div>
    42         <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e('This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); ?></a>
     42        <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e('This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); // phpcs:ignore  WordPress.Security.EscapeOutput.UnsafePrintingFunction ?></a>
    4343        </div>
    4444    </div>
    … …  
    6565<div id="preview-action">
    6666    <div>
    67     <input type="text" name="preview_url" id="ccj-preview_url" placeholder="<?php _e('Full URL on which to preview the changes ...', 'custom-css-js'); ?>" disabled="disabled" />
    68     <a class="preview button button-primary button-large" id="ccj-preview"><?php _e('Preview Changes', 'custom-css-js'); ?></a>
     67    <input type="text" name="preview_url" id="ccj-preview_url" placeholder="<?php esc_html_e('Full URL on which to preview the changes ...', 'custom-css-js'); ?>" disabled="disabled" />
     68    <a class="preview button button-primary button-large" id="ccj-preview"><?php esc_html_e('Preview Changes', 'custom-css-js'); ?></a>
    6969    </div>
    7070</div>
    … …  
    8080
    8181        $filters = array(
    82             'all'           => __('All Website', 'custom-css-js'),
    83             'first-page'    => __('Homepage', 'custom-css-js'),
    84             'contains'      => __('Contains', 'custom-css-js'),
    85             'not-contains'  => __('Not contains', 'custom-css-js'),
    86             'equal-to'      => __('Is equal to', 'custom-css-js'),
    87             'not-equal-to'  => __('Not equal to', 'custom-css-js'),
    88             'begins-with'   => __('Starts with', 'custom-css-js'),
    89             'ends-by'       => __('Ends by', 'custom-css-js'),
     82            'all'           => 'All Website',
     83            'first-page'    => 'Homepage',
     84            'contains'      => 'Contains',
     85            'not-contains'  => 'Not contains',
     86            'equal-to'      => 'Is equal to',
     87            'not-equal-to'  => 'Not equal to',
     88            'begins-with'   => 'Starts with',
     89            'ends-by'       => 'Ends by',
    9090        );
    91         $filters_html = '';
    92         foreach( $filters as $_key => $_value ) {
    93             $filters_html .= '<option value="'.$_key.'">' . $_value . '</option>';
    94         }
    9591
    9692        $applied_filters = '[{"value":"","type":"all","index":1}]';
    9793
    9894?>
    99         <input type="hidden" name="scan_anchor_filters" id="wplnst-scan-anchor-filters" value='<?php echo $applied_filters; ?>' />
    100     <table id="wplnst-elist-anchor-filters" class="wplnst-elist" cellspacing="0" cellpadding="0" border="0" data-editable="true" data-label="<?php _e('URL', 'custom-css-js'); ?>"></table>
    101         <?php _e('URL', 'custom-css-js'); ?> <select id="wplnst-af-new-type"><?php echo $filters_html ?></select>&nbsp;
    102         <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter', 'custom-css-js'); ?>" />&nbsp;
    103         <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php _e('Add', 'custom-css-js'); ?>" /></td>
     95        <input type="hidden" name="scan_anchor_filters" id="wplnst-scan-anchor-filters" value='<?php echo esc_js( $applied_filters); ?>' />
     96    <table id="wplnst-elist-anchor-filters" class="wplnst-elist" cellspacing="0" cellpadding="0" border="0" data-editable="true" data-label="<?php echo esc_attr('URL', 'custom-css-js'); ?>"></table>
     97                <?php esc_html_e('URL', 'custom-css-js'); ?>
     98                <select id="wplnst-af-new-type">
     99                        <?php foreach( $filters as $_key => $_value ) : ?>
     100                                <option value="<?php echo esc_attr( $_key ); ?>"><?php echo esc_html( $_value, 'custom-css-js' ); ?></option>
     101                        <?php endforeach; ?>
     102                </select>&nbsp;
     103        <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php echo esc_attr('Text filter', 'custom-css-js'); ?>" />&nbsp;
     104        <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php echo esc_attr('Add', 'custom-css-js'); ?>" /></td>
    104105
    105106<?php
    … …  
    134135    <table class="revisions">
    135136        <thead><tr>
    136         <th class="revisions-compare"><?php _e('Compare', 'custom-css-js'); ?></th>
    137         <th><?php _e('Revision', 'custom-css-js'); ?></th>
    138         <th><?php _e('Author', 'custom-css-js'); ?></th>
    139         <th><input type="checkbox" name="delete[]" value="all" id="ccj-delete-checkbox" /> <?php _e('Delete', 'custom-css-js'); ?></th>
    140         <th><?php _e('Restore', 'custom-css-js'); ?></th>
     137        <th class="revisions-compare"><?php esc_html_e('Compare', 'custom-css-js'); ?></th>
     138        <th><?php esc_html_e('Revision', 'custom-css-js'); ?></th>
     139        <th><?php esc_html_e('Author', 'custom-css-js'); ?></th>
     140        <th><input type="checkbox" name="delete[]" value="all" id="ccj-delete-checkbox" /> <?php esc_html_e('Delete', 'custom-css-js'); ?></th>
     141        <th><?php esc_html_e('Restore', 'custom-css-js'); ?></th>
    141142        </tr></thead>
    142143        <tbody>
    … …  
    146147        $restore_url = '#';
    147148
    148         $delete_disabled = '';
    149         $delete_tooltip = '';
    150149        $class = '';
    151150        ?>
    152         <tr class="<?php echo $class; ?>" id="<?php echo 'revision-row-' . $revision['ID']; ?>">
     151        <tr class="<?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( 'revision-row-' . $revision['ID'] ); ?>">
    153152            <td class="revisions-compare">
    154             <input type="radio" name="compare_left" value="<?php echo $revision['ID']; ?>" />
    155             <input type="radio" name="compare_right" value="<?php echo $revision['ID']; ?>" />
     153            <input type="radio" name="compare_left" value="<?php echo esc_attr( $revision['ID'] ); ?>" />
     154            <input type="radio" name="compare_right" value="<?php echo esc_attr( $revision['ID'] ); ?>" />
    156155            </td>
    157             <td><?php echo $revision['title']; ?></td>
    158             <td><?php echo $revision['post_author']; ?></td>
     156            <td><?php echo esc_html( $revision['title'] ); ?></td>
     157            <td><?php echo esc_html( $revision['post_author'] ); ?></td>
    159158            <td class="revisions-delete">
    160             <input type="checkbox" name="delete[]" value="<?php echo $revision['ID']; ?>" <?php echo $delete_disabled . $delete_tooltip; ?>/>
     159            <input type="checkbox" name="delete[]" value="<?php echo esc_attr( $revision['ID'] ); ?>">
    161160            </td>
    162161            <td class="revisions-restore">
    163                 <a href="<?php echo $restore_url; ?>"><?php _e('Restore', 'custom-css-js'); ?></a>
     162                <a href="<?php echo esc_url( $restore_url ); ?>"><?php esc_html_e('Restore', 'custom-css-js'); ?></a>
    164163            </td>
    165164        </tr>
  • custom-css-js/trunk/includes/admin-config.php

    r3476672 r3726634  
    124124        <?php $this->config_page_header('editor'); ?>
    125125
    126         <form action="<?php echo admin_url('edit.php'); ?>?post_type=custom-css-js&page=custom-css-js-config" id="ccj_settings" method="post">
     126        <form action="<?php echo esc_url( admin_url('edit.php') ); ?>?post_type=custom-css-js&page=custom-css-js-config" id="ccj_settings" method="post">
    127127
    128128        <?php do_action( 'ccj_settings_form' ); ?>
    … …  
    139139    function config_page_header( $tab = 'editor' ) {
    140140 
    141         $url = '?post_type=custom-css-js&page=custom-css-js-config';
    142 
    143         $active = array('editor' => '', 'general' => '', 'debug' => '');
    144         $active[$tab] = 'nav-tab-active';
     141                $logo           = plugins_url( '/', CCJ_PLUGIN_FILE ) . 'assets/images/silkypress_logo.png';
     142                $silkypress_url = 'https://www.silkypress.com/?utm_source=wordpress&amp;utm_campaign=iz_free&amp;utm_medium=banner';
    145143
    146144        ?>
    147145        <style type="text/css">
    148             .custom-css-js_page_custom-css-js-config h1 { margin-bottom: 40px; }
     146            .custom-css-js_page_custom-css-js-config h1 { margin-bottom: 2em; margin-top: 1em; }
     147            .custom-css-js_page_custom-css-js-config h1 img { vertical-align: middle; }
     148            .custom-css-js_page_custom-css-js-config h1 a { text-decoration: none; }
     149            .custom-css-js_page_custom-css-js-config h1 a:hover { text-decoration: underline; }
    149150            .form-table { margin-left: 2%; width: 98%;}
    150151            .form-table th { width: 500px; }
    151152        </style>
    152         <h1><?php _e('Custom CSS & JS Settings'); ?></h1>
     153
     154                <h1>
     155                        <?php esc_html_e( 'Settings for the "Custom CSS & JS" plugin by ', 'custom-css-js' );  ?>
     156                        <img src="<?php echo esc_url( $logo ); ?>"> <a href="<?php echo esc_url( $silkypress_url ); ?>" target="_blank">SilkyPress.com</a>
     157                </h1>
    153158
    154159        <?php     
    … …  
    211216        }
    212217
    213         $ccj_htmlentities_help = __('If you want to use an HTML entity in your code (for example '. htmlentities('&gt; or &quot;').'), but the editor keeps on changing them to its equivalent character (&gt; and &quot; for the previous example), then you might want to enable this option.', 'custom-css-js');
    214 
    215         $ccj_htmlentities2_help = __('If you use HTML tags in your code (for example '.htmlentities('<input> or <textarea>').') and you notice that they disappear and the editor looks weird, then you need to enable this option.', 'custom-css-js');
    216 
    217         $remove_comments_help = __('In your page\'s HTML there is a comment added before and after the internal CSS or JS in order to help you locate your custom code. Enable this option in order to remove that comment.', 'custom-css-js');
    218 
    219         $remove_file_comments_help = __('Every externally linked custom code will have a 3-lines comment added at the beginning of the file. Enable this option in order to stop adding that comment to the externaly linked custom codes', 'custom-css-js');
    220 
    221218        ?>
    222219
    223         <h2><?php echo __('Editor Settings', 'custom-css-js'); ?></h2>
    224         <table class="form-table">
    225         <tr>
    226         <th scope="row"><label for="ccj_htmlentities"><?php _e('Keep the HTML entities, don\'t convert to its character', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php echo $ccj_htmlentities_help; ?>"></span>
    227         </label></th>
    228         <td><input type="checkbox" name="ccj_htmlentities" id="ccj_htmlentities" value="1" <?php checked($settings['ccj_htmlentities'], true); ?> />
     220        <h2><?php echo esc_html('Editor Settings', 'custom-css-js'); ?></h2>
     221        <table class="form-table">
     222        <tr>
     223                <th scope="row">
     224                        <label for="ccj_htmlentities">
     225                                <?php esc_html_e('Keep the HTML entities, don\'t convert to its character', 'custom-css-js'); ?>
     226                                <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php esc_html_e('If you want to use an HTML entity in your code (for example &amp;gt; or &amp;quot;), but the editor keeps on changing them to its equivalent character (&gt; and &quot; for the previous example), then you might want to enable this option.', 'custom-css-js'); ?>"></span>
     227                </label>
     228                </th><td>
     229                        <input type="checkbox" name="ccj_htmlentities" id="ccj_htmlentities" value="1" <?php checked($settings['ccj_htmlentities'], true); ?>>
    229230        </td>
    230         </tr>
    231         <tr>
    232         <th scope="row"><label for="ccj_htmlentities2"><?php _e('Encode the HTML entities', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php echo $ccj_htmlentities2_help; ?>"></span></label></th>
    233         <td><input type="checkbox" name="ccj_htmlentities2" id="ccj_htmlentities2" value="1" <?php checked($settings['ccj_htmlentities2'], true); ?> />
     231        </tr><tr>
     232                <th scope="row">
     233                        <label for="ccj_htmlentities2">
     234                                <?php esc_html_e('Encode the HTML entities', 'custom-css-js') ?>
     235                                <span class="dashicons dashicons-editor-help tipsy-no-html" rel="tipsy" title="<?php esc_html_e('If you use HTML tags in your code (for example &lt;input&gt; or &lt;textarea&gt;) and you notice that they disappear and the editor looks weird, then you need to enable this option.', 'custom-css-js'); ?>"></span>
     236                        </label>
     237                </th><td>
     238                        <input type="checkbox" name="ccj_htmlentities2" id="ccj_htmlentities2" value="1" <?php checked($settings['ccj_htmlentities2'], true); ?>>
    234239        </td>
    235         </tr>
    236         <tr>
    237         <th scope="row"><label for="ccj_autocomplete"><?php _e('Autocomplete in the editor', 'custom-css-js') ?></label></th>
    238         <td><input type="checkbox" name="ccj_autocomplete" id="ccj_autocomplete" value="1" <?php checked($settings['ccj_autocomplete'], true); ?> />
     240        </tr><tr>
     241                <th scope="row">
     242                        <label for="ccj_autocomplete">
     243                                <?php esc_html_e('Autocomplete in the editor', 'custom-css-js') ?>
     244                        </label>
     245                </th><td>
     246                        <input type="checkbox" name="ccj_autocomplete" id="ccj_autocomplete" value="1" <?php checked($settings['ccj_autocomplete'], true); ?>>
    239247        </td>
    240         </tr>
    241 
    242 
    243 
    244         </table>
    245 
    246 
    247        
    248         <?php if ( current_user_can('update_plugins') ) : ?>
    249             <?php $add_role_help = esc_html__('By default only the Administrator will be able to publish/edit/delete Custom Codes. By enabling this option there is also a "Web Designer" role created which can be assigned to a non-admin user in order to publish/edit/delete Custom Codes.', 'custom-css-js'); ?>
    250             <h2><?php echo __('General Settings', 'custom-css-js'); ?></h2>
    251             <table class="form-table">
    252             <tr>
    253             <th scope="row"><label for="add_role"><?php _e('Add the "Web Designer" role', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $add_role_help; ?>"></span></label></th>
    254             <td><input type="checkbox" name="add_role" id = "add_role" value="1" <?php checked($settings['add_role'], true); ?> />
     248        </tr>
     249        </table>
     250        <h2><?php esc_html_e('General Settings', 'custom-css-js'); ?></h2>
     251        <table class="form-table">
     252        <?php if ( current_user_can('update_plugins') ) : ?>
     253                <tr>
     254                        <th scope="row">
     255                                <label for="add_role">
     256                                        <?php esc_html_e('Add the "Web Designer" role', 'custom-css-js') ?>
     257                                        <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html__('By default only the Administrator will be able to publish/edit/delete Custom Codes. By enabling this option there is also a "Web Designer" role created which can be assigned to a non-admin user in order to publish/edit/delete Custom Codes.', 'custom-css-js'); ?>"></span>
     258                                </label>
     259                        </th><td>
     260                                <input type="checkbox" name="add_role" id = "add_role" value="1" <?php checked($settings['add_role'], true); ?>>
    255261            </td>
    256             </tr>
    257             </table>
    258         <?php endif; ?>
    259         <table class="form-table">
    260         <tr>
    261         <th scope="row"><label for="remove_comments"><?php _e('Remove comments for internal custom codes', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $remove_comments_help; ?>"></span></label></th>
    262         <td><input type="checkbox" name="remove_comments" id = "remove_comments" value="1" <?php checked($settings['remove_comments'], true); ?> />
    263         </td>
    264         </tr>
    265         <tr>
    266         <th scope="row"><label for="remove_file_comments"><?php _e('Remove comments from externally linked custom codes', 'custom-css-js') ?> <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php echo $remove_file_comments_help; ?>"></span></label></th>
    267         <td><input type="checkbox" name="remove_file_comments" id = "remove_file_comments" value="1" <?php checked($settings['remove_file_comments'], true); ?> />
    268         </td>
    269         </tr>
    270         </table>
    271 
    272         <table class="form-table">
    273         <tr>
    274         <th>&nbsp;</th>
    275         <td>
    276         <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save'); ?>" />
    277         <?php wp_nonce_field('ccj_settings', 'ccj_settings-nonce', false); ?>
    278         </td>
    279         </tr>
    280         </table>
    281 
    282         <?php
    283     }
     262                </tr>
     263        <?php endif; ?>
     264        <tr>
     265                <th scope="row">
     266                        <label for="remove_comments">
     267                                <?php esc_html_e('Remove comments for internal custom codes', 'custom-css-js') ?>
     268                                <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html_e('In your page\'s HTML there is a comment added before and after the internal CSS or JS in order to help you locate your custom code. Enable this option in order to remove that comment.', 'custom-css-js'); ?>"></span>
     269                        </label>
     270                </th><td>
     271                        <input type="checkbox" name="remove_comments" id = "remove_comments" value="1" <?php checked($settings['remove_comments'], true); ?>>
     272                </td>
     273        </tr><tr>
     274                <th scope="row">
     275                        <label for="remove_file_comments">
     276                                <?php esc_html_e('Remove comments from externally linked custom codes', 'custom-css-js') ?>
     277                                <span class="dashicons dashicons-editor-help" rel="tipsy" title="<?php esc_html_e('Every externally linked custom code will have a 3-lines comment added at the beginning of the file. Enable this option in order to stop adding that comment to the externaly linked custom codes', 'custom-css-js'); ?>"></span>
     278                        </label>
     279                </th><td>
     280                        <input type="checkbox" name="remove_file_comments" id = "remove_file_comments" value="1" <?php checked($settings['remove_file_comments'], true); ?>>
     281                </td>
     282        </tr><tr>
     283                <th>&nbsp;</th>
     284                <td>
     285                        <input type="submit" name="Submit" class="button-primary" value="<?php esc_html_e( 'Save', 'custom-css-js' ); ?>">
     286                        <?php wp_nonce_field('ccj_settings', 'ccj_settings-nonce', false); ?>
     287                </td>
     288        </tr>
     289        </table>
     290        <?php
     291        }
    284292}
    285293
  • custom-css-js/trunk/includes/admin-notices.php

    r3424870 r3726634  
    1515
    1616    var $prefix = 'ccj_';
    17     var $activation_time = '';
     17    var $activation_time = 0;
    1818    var $version = '';
    1919    var $dismiss_notice = '';
    … …  
    6565        $p = $this->prefix;
    6666
    67         $this->activation_time = get_option( $p . '_activation_time', '' );
     67        $this->activation_time = (int)get_option( $p . '_activation_time', '' );
    6868        $this->version = get_option( $p.'_version', '' );
    6969        $this->dismiss_notice = get_option( $p.'_dismiss_notice', false );
    … …  
    113113
    114114        $expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
    115         $expiration_date = date( get_option( 'date_format') , $expiration_date );
    116 
    117         $expiration_period = date('j M', $this->activation_time - 3*86400 ) . ' - ' . date('j M', $this->activation_time + 2*86400 );
     115        $expiration_date = gmdate( get_option( 'date_format') , $expiration_date );
     116
     117        $expiration_period = gmdate('j M', $this->activation_time - 3*86400 ) . ' - ' . gmdate('j M', $this->activation_time + 2*86400 );
    118118
    119119
    … …  
    164164            ?>
    165165            <style type="text/css">
    166                 .<?php echo $p; ?>_note{ color: #bc1117; }
    167                 #<?php echo $p; ?>_notice { display: block; padding:  }
    168                 #<?php echo $p; ?>_notice b { color: #bc1117; }
    169                 #<?php echo $p; ?>_notice a { text-decoration: none; font-weight: bold; }
    170                 #<?php echo $p; ?>_notice a.dismiss_notice { font-weight: normal; }
     166                .<?php echo esc_attr( $p ); ?>_note{ color: #bc1117; }
     167                #<?php echo esc_attr( $p ); ?>_notice { display: block; padding:  }
     168                #<?php echo esc_attr( $p ); ?>_notice b { color: #bc1117; }
     169                #<?php echo esc_attr( $p ); ?>_notice a { text-decoration: none; font-weight: bold; }
     170                #<?php echo esc_attr( $p ); ?>_notice a.dismiss_notice { font-weight: normal; }
    171171            </style>
    172172
    173173            <script type='text/javascript'>
    174174                jQuery(function($){
    175                     $(document).on( 'click', '.<?php echo $p; ?>_notice .dismiss_notice', function() {
     175                    $(document).on( 'click', '.<?php echo esc_attr( $p ); ?>_notice .dismiss_notice', function() {
    176176                        var data = {
    177                             action: '<?php echo $p; ?>_notice_dismiss',
    178                             option: '<?php echo $option_name; ?>',
     177                            action: '<?php echo esc_attr( $p ); ?>_notice_dismiss',
     178                            option: '<?php echo esc_attr( $option_name ); ?>',
    179179                            nonce: $(this).parent().parent().data('nonce'),
    180180                        };
    181181                        $.post(ajaxurl, data, function(response ) {
    182                             $('#<?php echo $p; ?>_notice').fadeOut('slow');
     182                            $('#<?php echo esc_attr( $p ); ?>_notice').fadeOut('slow');
    183183                        });
    184184                    });
    … …  
    186186            </script>
    187187
    188                 <div id="<?php echo $p; ?>_notice" class="updated notice <?php echo $p; ?>_notice is-dismissible" data-nonce="<?php echo wp_create_nonce( $this->prefix .'_notice'); ?>">
    189             <p><?php echo $message ?></p>
    190             <button type="button" class="notice-dismiss">
    191             <span class="screen-reader-text"><?php _e('Dismiss this notice', 'custom-css-js'); ?></span>
     188                <div id="<?php echo esc_attr( $p ); ?>_notice" class="updated notice <?php echo esc_attr( $p ); ?>_notice is-dismissible" data-nonce="<?php echo  esc_attr( wp_create_nonce( $this->prefix .'_notice') ); ?>">
     189            <p><?php echo $message // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ; ?></p>
     190                        <span>
     191            <button type="button" class="notice-dismiss dismiss_notice">
     192            <span class="screen-reader-text"><?php esc_html_e('Dismiss this notice', 'custom-css-js'); ?></span>
    192193            </button>
     194                        </span>
    193195            </div>
    194196<?php
  • custom-css-js/trunk/includes/admin-screens.php

    r3656511 r3726634  
    346346                ?>
    347347        <div class="updated buttons">
    348         <a href="post-new.php?post_type=custom-css-js&language=css" class="custom-btn custom-css-btn"><?php _e( 'Add CSS code', 'custom-css-js' ); ?></a>
    349         <a href="post-new.php?post_type=custom-css-js&language=js" class="custom-btn custom-js-btn"><?php _e( 'Add JS code', 'custom-css-js' ); ?></a>
    350         <a href="post-new.php?post_type=custom-css-js&language=html" class="custom-btn custom-js-btn"><?php _e( 'Add HTML code', 'custom-css-js' ); ?></a>
    351                 <!-- a href="post-new.php?post_type=custom-css-js&language=php" class="custom-btn custom-php-btn">Add PHP code</a -->
     348        <a href="post-new.php?post_type=custom-css-js&language=css" class="custom-btn custom-css-btn"><?php esc_html_e( 'Add CSS code', 'custom-css-js' ); ?></a>
     349        <a href="post-new.php?post_type=custom-css-js&language=js" class="custom-btn custom-js-btn"><?php esc_html_e( 'Add JS code', 'custom-css-js' ); ?></a>
     350        <a href="post-new.php?post_type=custom-css-js&language=html" class="custom-btn custom-js-btn"><?php esc_html_e( 'Add HTML code', 'custom-css-js' ); ?></a>
    352351        </div>
    353352                <?php
    … …  
    364363                        'active'    => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="' . __( 'Active', 'custom-css-js' ) . '"></span>',
    365364                        'type'      => __( 'Type', 'custom-css-js' ),
    366                         'name'      => __( 'Title' ),
    367                         'author'    => __( 'Author' ),
    368                         'published' => __( 'Published' ),
     365                        'name'      => __( 'Title', 'custom-css-js' ),
     366                        'author'    => __( 'Author', 'custom-css-js' ),
     367                        'published' => __( 'Published', 'custom-css-js' ),
    369368                        'modified'  => __( 'Modified', 'custom-css-js' ),
    370369                );
    … …  
    389388                        $edit_link = get_edit_post_link( $post_id );
    390389                        $title     = _draft_or_post_title( $post_id );
    391                         echo '<strong><a class="row-title" href="' . esc_url( $edit_link ) . '">' . esc_html( $title ) . '</a>';
    392                                 _post_states( $post );
    393                         echo '</strong>';
    394                 }
    395 
    396                 if ( 'type' === $column ) {
     390                        ?>
     391                        <strong>
     392                                <a class="row-title" href="<?php echo esc_url( $edit_link ); ?>"><?php echo esc_html( $title ); ?></a>
     393                                <?php _post_states( $post ); ?>
     394                        </strong>
     395                        <?php
     396                }
     397
     398                if ( 'type' === $column ) :
    397399                        $options = $this->get_options( $post_id );
    398                         echo '<span class="language language-' . $options['language'] . '">' . $options['language'] . '</span>';
    399                 }
     400                        ?>
     401                        <span class="language language-<?php echo esc_attr( $options['language'] ); ?>"><?php echo esc_attr( $options['language'] ); ?></span>
     402                <?php endif;
    400403
    401404                if ( 'modified' === $column || 'published' === $column ) {
    … …  
    403406
    404407                        if ( '0000-00-00 00:00:00' === $post->post_date ) {
    405                                 $t_time    = __( 'Unpublished' );
     408                                $t_time    = __( 'Unpublished', 'custom-css-js' );
    406409                                $h_time    = $t_time;
    407410                                $time_diff = 0;
    … …  
    412415                                if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
    413416                                        /* translators: %s: Human-readable time difference. */
    414                                         $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
     417                                        $h_time = sprintf( __( '%s ago', 'custom-css-js' ), human_time_diff( $time ) );
    415418                                } else {
    416419                                        $h_time = ( 'published' === $column ) ? get_the_time( __( 'Y/m/d' ), $post ) : get_the_modified_time( __( 'Y/m/d' ), $post );
    … …  
    418421                        }
    419422
    420                          echo $h_time;
     423                         echo esc_html( $h_time );
    421424                }
    422425
    … …  
    430433                                $active_icon  = 'dashicons-star-empty ccj_row';
    431434                        }
    432                         echo '<a href="' . esc_url( $url ) . '" class="ccj_activate_deactivate" data-code-id="' . $post_id . '" title="' . $active_title . '">' .
    433                                 '<span class="dashicons ' . $active_icon . '"></span>' .
    434                                 '</a>';
     435                        ?>     
     436                        <a href="<?php echo esc_url( $url ); ?>" class="ccj_activate_deactivate" data-code-id="<?php echo esc_attr( $post_id ); ?>" title="<?php echo esc_html( $active_title ); ?>">
     437                                <span class="dashicons <?php echo esc_attr( $active_icon ); ?>"></span>
     438                        </a>
     439                        <?php
    435440                }
    436441        }
    … …  
    507512                );
    508513
    509                 echo '<label class="screen-reader-text" for="custom-css-js-filter">' . esc_html__( 'Filter Code Type', 'custom-css-js' ) . '</label>';
    510                 echo '<select name="language_filter" id="custom-css-js-filter">';
    511                 echo '<option  value="">' . __( 'All Custom Codes', 'custom-css-js' ) . '</option>';
    512                 foreach ( $languages as $_lang => $_label ) {
    513                         $selected = selected( filter_input( INPUT_GET, 'language_filter' ), $_lang, false );
    514                         echo '<option ' . $selected . ' value="' . $_lang . '">' . $_label . '</option>';
    515                 }
    516                 echo '</select>';
     514                ?>
     515                <label class="screen-reader-text" for="custom-css-js-filter"><?php esc_html_e( 'Filter Code Type', 'custom-css-js' ); ?></label>
     516                <select name="language_filter" id="custom-css-js-filter">
     517                <option  value=""><?php esc_html_e( 'All Custom Codes', 'custom-css-js' ); ?></option>
     518                <?php foreach ( $languages as $_lang => $_label ) : ?>
     519                <option <?php echo esc_attr( selected( filter_input( INPUT_GET, 'language_filter' ), $_lang, false ) ); ?>  value="<?php echo esc_attr( $_lang ); ?>"><?php echo esc_html( $_label ); ?></option>
     520                <?php endforeach; ?>
     521                </select>
     522                <?php
    517523        }
    518524
    … …  
    596602                        }
    597603                }
    598                 echo $active;
     604                echo esc_html( $active );
    599605
    600606                die();
    … …  
    618624                         /* <![CDATA[ */
    619625                        jQuery(window).ready(function($){
    620                                 var h1 = '<?php _e( 'Custom Code', 'custom-css-js' ); ?> ';
    621                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php _e( 'Add CSS Code', 'custom-css-js' ); ?></a>';
    622                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php _e( 'Add JS Code', 'custom-css-js' ); ?></a>';
    623                                 h1 += '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php _e( 'Add HTML Code', 'custom-css-js' ); ?></a>';
     626                                var h1 = '<?php esc_html_e( 'Custom Code', 'custom-css-js' ); ?> ';
     627                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php esc_html_e( 'Add CSS Code', 'custom-css-js' ); ?></a> ';
     628                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php esc_html_e( 'Add JS Code', 'custom-css-js' ); ?></a> ';
     629                                h1 += '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php esc_html_e( 'Add HTML Code', 'custom-css-js' ); ?></a>';
    624630                                $("#wpbody-content h1").html(h1);
    625631                        });
    … …  
    637643                $this->remove_unallowed_metaboxes();
    638644
    639                 $strings = array(
    640                         'Add CSS Code'   => __( 'Add CSS Code', 'custom-css-js' ),
    641                         'Add JS Code'    => __( 'Add JS Code', 'custom-css-js' ),
    642                         'Add HTML Code'  => __( 'Add HTML Code', 'custom-css-js' ),
    643                         'Edit CSS Code'  => __( 'Edit CSS Code', 'custom-css-js' ),
    644                         'Edit JS Code'   => __( 'Edit JS Code', 'custom-css-js' ),
    645                         'Edit HTML Code' => __( 'Edit HTML Code', 'custom-css-js' ),
    646                 );
    647 
    648                 if ( isset( $_GET['post'] ) ) {
    649                         $action  = 'Edit';
    650                         $post_id = esc_attr( $_GET['post'] );
    651                 } else {
    652                         $action  = 'Add';
    653                         $post_id = false;
    654                 }
     645                $post_id  = ( isset( $_GET['post'] ) ) ? esc_attr( $_GET['post'] ) : false;
     646                $action   = ( isset( $_GET['post'] ) ) ? __( 'Edit %s code', 'custom-css-js' ) : __( 'Add %s code', 'custom-css-js' );
    655647                $language = $this->get_language( $post_id );
    656 
    657                 $title = $action . ' ' . strtoupper( $language ) . ' Code';
    658                 $title = ( isset( $strings[ $title ] ) ) ? $strings[ $title ] : $strings['Add CSS Code'];
    659 
    660                 if ( $action == 'Edit' ) {
    661                         $title .= ' <a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">' . __( 'Add CSS Code', 'custom-css-js' ) . '</a> ';
    662                         $title .= '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">' . __( 'Add JS Code', 'custom-css-js' ) . '</a>';
    663                         $title .= '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">' . __( 'Add HTML Code', 'custom-css-js' ) . '</a>';
    664                 }
    665648
    666649                ?>
    … …  
    673656                         /* <![CDATA[ */
    674657                        jQuery(window).ready(function($){
    675                                 $("#wpbody-content h1").html('<?php echo $title; ?>');
    676                                 $("#message.updated.notice").html('<p><?php _e( 'Code updated', 'custom-css-js' ); ?></p>');
     658                                $("#wpbody-content h1").html(
     659                                        '<?php echo esc_html( sprintf( $action, strtoupper( $language ) ) ); ?>'
     660                                        <?php if ( $post_id != false ) : ?>
     661                                        + '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action"><?php esc_html_e( 'Add CSS Code', 'custom-css-js' ); ?></a>'
     662                                        + '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action"><?php esc_html_e( 'Add JS Code', 'custom-css-js' ); ?></a>'
     663                                        + '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action"><?php esc_html_e( 'Add HTML Code', 'custom-css-js' ); ?></a>'
     664                                        <?php endif; ?>);
     665                                $("#message.updated.notice").html('<p><?php esc_html_e( 'Code updated', 'custom-css-js' ); ?></p>');
    677666
    678667                                var from_top = -$("#normal-sortables").height();
    … …  
    857846
    858847                                <div class="code-mirror-buttons">
    859                                 <div class="button-left"><span rel="tipsy" original-title="<?php _e( 'Beautify Code', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-beautifier"><i class="ccj-i-beautifier"></i></button></span></div>
    860                                 <!--div class="button-left"><span rel="tipsy" original-title="<?php _e( 'Editor Settings', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-settings"><i class="ccj-i-settings"></i></button></span></div -->
    861                                 <div class="button-right" id="ccj-fullscreen-button" alt="<?php _e( 'Distraction-free writing mode', 'custom-css-js' ); ?>"><span rel="tipsy" original-title="<?php _e( 'Fullscreen', 'custom-css-js' ); ?>"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-fullscreen"></i></button></span></div>
     848                                <div class="button-left"><span rel="tipsy" original-title="<?php esc_html_e( 'Beautify Code', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-beautifier"><i class="ccj-i-beautifier"></i></button></span></div>
     849                                <!--div class="button-left"><span rel="tipsy" original-title="<?php esc_html_e( 'Editor Settings', 'custom-css-js' ); ?>"><button type="button" tabindex="-1" id="ccj-settings"><i class="ccj-i-settings"></i></button></span></div -->
     850                                <div class="button-right" id="ccj-fullscreen-button" alt="<?php esc_html_e( 'Distraction-free writing mode', 'custom-css-js' ); ?>"><span rel="tipsy" original-title="<?php esc_html_e( 'Fullscreen', 'custom-css-js' ); ?>"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-fullscreen"></i></button></span></div>
    862851<input type="hidden" name="fullscreen" id="ccj-fullscreen-hidden" value="false" />
    863 <!-- div class="button-right" id="ccj-search-button" alt="Search"><button role="presentation" type="button" tabindex="-1"><i class="ccj-i-find"></i></button></div -->
    864 
    865852                                </div>
    866853
    867                                 <div class="code-mirror-before"><div class="code-mirror-before-<?php echo esc_attr($language); ?>"><?php echo htmlentities( $code_mirror_before ); ?></div></div>
    868                                 <textarea class="wp-editor-area" id="ccj_content" mode="<?php echo htmlentities( $code_mirror_mode ); ?>" name="content" autofocus><?php echo $post->post_content; ?></textarea>
    869                                 <div class="code-mirror-after"><div class="code-mirror-after-<?php echo esc_attr($language); ?>"><?php echo htmlentities( $code_mirror_after ); ?></div></div>
     854                                <div class="code-mirror-before">
     855                                        <div class="code-mirror-before-<?php echo esc_attr($language); ?>"><?php echo esc_html( $code_mirror_before ); ?></div>
     856                                </div>
     857                                <textarea class="wp-editor-area" id="ccj_content" mode="<?php echo esc_attr( $code_mirror_mode ); ?>" name="content" autofocus><?php echo esc_html($post->post_content); ?></textarea>
     858                                <div class="code-mirror-after">
     859                                        <div class="code-mirror-after-<?php echo esc_attr($language); ?>"><?php echo esc_html( $code_mirror_after ); ?></div>
     860                                </div>
    870861
    871862                                <table id="post-status-info"><tbody><tr>
    872863                                        <td class="autosave-info">
    873864                                        <span class="autosave-message">&nbsp;</span>
    874                                 <?php
    875                                 if ( 'auto-draft' != $post->post_status ) {
    876                                         echo '<span id="last-edit">';
     865                                <?php if ( 'auto-draft' != $post->post_status ) : ?>
     866                                        <span id="last-edit">
     867                                        <?php
    877868                                        if ( $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ) ) {
    878869                                                printf(
    879870                                                        /* translators: 1: display_name of the curren user, 2: date, 3: time. */
    880                                                         __( 'Last edited by %1$s on %2$s at %3$s', 'custom-css-js' ),
     871                                                        esc_html( 'Last edited by %1$s on %2$s at %3$s', 'custom-css-js' ),
    881872                                                        esc_html( $last_user->display_name ),
    882                                                         mysql2date( get_option( 'date_format' ), $post->post_modified ),
    883                                                         mysql2date( get_option( 'time_format' ), $post->post_modified )
     873                                                        esc_html( mysql2date( get_option( 'date_format' ), $post->post_modified ) ),
     874                                                        esc_html( mysql2date( get_option( 'time_format' ), $post->post_modified ) )
    884875                                                );
    885876                                        } else {
    886877                                                printf(
    887878                                                        /* translators: 1: display_name of the curren user, 2: time. */
    888                                                         __( 'Last edited on %1$s at %2$s', 'custom-css-js' ),
    889                                                         mysql2date( get_option( 'date_format' ), $post->post_modified ),
    890                                                         mysql2date( get_option( 'time_format' ), $post->post_modified )
     879                                                        esc_html( 'Last edited on %1$s at %2$s', 'custom-css-js' ),
     880                                                        esc_html( mysql2date( get_option( 'date_format' ), $post->post_modified ) ),
     881                                                        esc_html( mysql2date( get_option( 'time_format' ), $post->post_modified ) )
    891882                                                );
    892883                                        }
    893                                         echo '</span>';
    894                                 }
    895                                 ?>
     884                                        ?>
     885                                        </span>
     886                                        <?php endif; ?>
    896887                                        </td>
    897888                                </tr></tbody></table>
    898889
    899890
    900                                 <input type="hidden" id="update-post_<?php echo $post->ID; ?>" value="<?php echo wp_create_nonce( 'update-post_' . $post->ID ); ?>" />
     891                                <input type="hidden" id="update-post_<?php echo esc_attr( $post->ID ); ?>" value="<?php echo esc_attr( wp_create_nonce( 'update-post_' . $post->ID ) ); ?>">
    901892                <?php
    902893
    … …  
    930921                ?>
    931922                        <div class="options_meta_box">
    932                         <?php
    933 
    934                         $output = '';
    935 
    936                         foreach ( $meta as $_key => $a ) {
     923                        <?php foreach ( $meta as $_key => $a ) :
    937924                                $close_div = false;
    938925
    … …  
    941928                                        in_array( $_key, ['priority', 'minify', 'multisite' ] ) ) {
    942929                                        $close_div = true;
    943                                         $output   .= '<div class="ccj_opaque">';
     930                                        ?>
     931                                        <div class="ccj_opaque">
     932                                        <?php
    944933                                }
    945934
    946                                 // Don't show Pre-processors for JavaScript Codes
    947935                                if ( $options['language'] == 'js' && $_key == 'preprocessor' ) {
    948936                                        continue;
    949937                                }
    950 
    951                                 $output .= '<h3>' . esc_attr( $a['title'] ) . '</h3>' . PHP_EOL;
    952 
    953                                 $output .= $this->render_input( $_key, $a, $options );
    954 
    955                                 if ( $close_div ) {
    956                                         $output .= '</div>';
    957                                 }
    958                         }
    959 
    960                         echo $output;
    961 
    962                         ?>
    963 
    964                         <input type="hidden" name="custom_code_language" value="<?php echo $options['language']; ?>" />
     938                                ?>
     939
     940                                <h3><?php echo esc_html( $a['title'] ); ?></h3>
     941
     942                                <?php $this->render_input( $_key, $a, $options );
     943
     944                                if ( $close_div ) { ?>
     945                                        </div>
     946                                <?php }
     947                        endforeach; ?>
     948
     949                        <input type="hidden" name="custom_code_language" value="<?php echo esc_attr( $options['language'] ); ?>">
    965950
    966951                        <div style="clear: both;"></div>
    … …  
    970955                        <div class="ccj_only_premium ccj_only_premium-right">
    971956                                <div>
    972                                 <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e( 'This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js' ); ?></a>
     957                                <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank"><?php _e( 'This section is available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js' ); // phpcs:ignore  WordPress.Security.EscapeOutput.UnsafePrintingFunction ?></a>
    973958                                </div>
    974959                        </div>
    … …  
    13591344                                        printf(
    13601345                                                /* translators: %s: folder name. */
    1361                                                 __( 'The %s directory could not be created', 'custom-css-js' ),
     1346                                                esc_html( 'The %s directory could not be created', 'custom-css-js' ),
    13621347                                                '<b>custom-css-js</b>'
    13631348                                        );
    13641349                                ?></p>
    1365                          <p><?php _e( 'Please run the following commands in order to make the directory', 'custom-css-js' ); ?>: <br /><strong>mkdir <?php echo $dir; ?>; </strong><br /><strong>chmod 777 <?php echo $dir; ?>;</strong></p>
     1350                         <p><?php esc_html_e( 'Please run the following commands in order to make the directory', 'custom-css-js' ); ?>: <br /><strong>mkdir <?php echo esc_html( $dir ); ?>; </strong><br /><strong>chmod 777 <?php echo esc_html( $dir ); ?>;</strong></p>
    13661351                        </div>
    13671352                        <?php
    … …  
    13761361                                        printf(
    13771362                                                /* translators: %s: folder name. */
    1378                                                 __( 'The %s directory is not writable, therefore the CSS and JS files cannot be saved.', 'custom-css-js' ),
    1379                                                 '<b>' . $dir . '</b>'
     1363                                                esc_html( 'The %s directory is not writable, therefore the CSS and JS files cannot be saved.', 'custom-css-js' ),
     1364                                                '<b>' . esc_html( $dir ) . '</b>'
    13801365                                        );
    13811366                                ?></p>
    1382                          <p><?php _e( 'Please run the following command to make the directory writable', 'custom-css-js' ); ?>:<br /><strong>chmod 777 <?php echo $dir; ?> </strong></p>
     1367                         <p><?php esc_html_e( 'Please run the following command to make the directory writable', 'custom-css-js' ); ?>:<br /><strong>chmod 777 <?php echo esc_html( $dir ); ?> </strong></p>
    13831368                        </div>
    13841369                        <?php
    … …  
    15011486        function render_input( $_key, $a, $options ) {
    15021487                $name   = 'custom_code_' . $_key;
    1503                 $output = '';
    15041488
    15051489                // Show radio type options
    15061490                if ( $a['type'] === 'radio' ) {
    1507                         $output .= '<div class="radio-group">' . PHP_EOL;
    1508                         foreach ( $a['values'] as $__key => $__value ) {
     1491                        ?>
     1492                        <div class="radio-group">
     1493                        <?php foreach ( $a['values'] as $__key => $__value ) :
    15091494                                $id        = $name . '-' . $__key;
    15101495                                $dashicons = isset( $__value['dashicon'] ) ? 'dashicons-before dashicons-' . $__value['dashicon'] : '';
    1511                                 $selected  = ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1512                                 $selected .= ( $__key == $options[ $_key ] ) ? ' checked="checked" ' : '';
    1513                                 $output   .= '<input type="radio" ' . $selected . 'value="' . $__key . '" name="' . $name . '" id="' . $id . '">' . PHP_EOL;
    1514                                 $output   .= '<label class="' . $dashicons . '" for="' . $id . '"> ' . esc_attr( $__value['title'] ) . '</label><br />' . PHP_EOL;
    1515                         }
    1516                         $output .= '</div>' . PHP_EOL;
     1496                                ?>
     1497                                <input type="radio"<?php checked( $__key == $options[ $_key ] ); disabled( isset( $a['disabled'] ) && $a['disabled'] ); ?> value="<?php echo esc_attr( $__key ); ?>" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>">
     1498                                <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $id ); ?>">
     1499                                        <?php echo esc_attr( $__value['title'] ) ; ?>
     1500                                </label><br />
     1501                        <?php endforeach; ?>
     1502                        </div>
     1503                        <?php
    15171504                }
    15181505
    15191506                // Show checkbox type options
    15201507                if ( $a['type'] == 'checkbox' ) {
    1521                         $output .= '<div class="radio-group">' . PHP_EOL;
    1522                         if ( isset( $a['values'] ) && count( $a['values'] ) > 0 ) {
     1508                        ?>
     1509                        <div class="radio-group">
     1510                        <?php if ( isset( $a['values'] ) && count( $a['values'] ) > 0 ) :
    15231511                                $current_values = explode(',', $options[ $_key ] );
    15241512                                foreach ( $a['values'] as $__key => $__value ) {
    15251513                                        $id        = $name . '-' . $__key;
    15261514                                        $dashicons = isset( $__value['dashicon'] ) ? 'dashicons-before dashicons-' . $__value['dashicon'] : '';
    1527                                         $selected  = ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1528                                         $selected .= ( in_array( $__key, $current_values ) ) ? ' checked="checked" ' : '';
    1529                                         $output   .= '<input type="checkbox" ' . $selected . ' value="1" name="' . $id . '" id="' . $id . '">' . PHP_EOL;
    1530                                         $output   .= '<label class="' . $dashicons . '" for="' . $id . '"> ' . $__value['title'] . '</label><br />' . PHP_EOL;
    1531                                 }
    1532                         } else {
     1515                                        ?>
     1516                                        <input type="checkbox" <?php checked( in_array( $__key, $current_values ) ); disabled( isset( $a['disabled'] ) && $a['disabled'] );  ?> value="1" name="<?php echo esc_attr( $id ); ?>" id="<?php echo esc_attr( $id ); ?>">
     1517                                        <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $id ); ?>"> <?php echo esc_html( $__value['title'] ); ?></label><br />
     1518                                <?php }
     1519                        else :
    15331520                                $dashicons = isset( $a['dashicon'] ) ? 'dashicons-before dashicons-' . $a['dashicon'] : '';
    1534                                 $selected  = ( isset( $options[ $_key ] ) && $options[ $_key ] == '1' ) ? ' checked="checked" ' : '';
    1535                                 $selected .= ( isset( $a['disabled'] ) && $a['disabled'] ) ? ' disabled="disabled"' : '';
    1536                                 $output   .= '<input type="checkbox" ' . $selected . ' value="1" name="' . $name . '" id="' . $name . '">' . PHP_EOL;
    1537                                 $output   .= '<label class="' . $dashicons . '" for="' . $name . '"> ' . $a['title'] . '</label>' . PHP_EOL;
    1538                         }
    1539                         $output .= '</div>' . PHP_EOL;
    1540                 }
     1521                                ?>
     1522                                <input type="checkbox" <?php checked( isset( $options[ $_key ] ) && $options[ $_key ] == '1' ); disabled( isset( $a['disabled'] ) && $a['disabled'] ); ?> value="1" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>">
     1523                                <label class="<?php echo esc_attr( $dashicons ); ?>" for="<?php echo esc_attr( $name ); ?>"> <?php echo esc_html( $a['title'] ); ?></label>
     1524                        <?php endif; ?>
     1525                        </div>
     1526                <?php }
    15411527
    15421528                // Show select type options
    1543                 if ( $a['type'] == 'select' ) {
    1544                         $output .= '<div class="radio-group">' . PHP_EOL;
    1545                         $output .= '<select name="' . $name . '" id="' . $name . '">' . PHP_EOL;
    1546                         foreach ( $a['values'] as $__key => $__value ) {
    1547                                 $selected = ( isset( $options[ $_key ] ) && $options[ $_key ] == $__key ) ? ' selected="selected"' : '';
    1548                                 $output  .= '<option value="' . $__key . '"' . $selected . '>' . esc_attr( $__value ) . '</option>' . PHP_EOL;
    1549                         }
    1550                         $output .= '</select>' . PHP_EOL;
    1551                         $output .= '</div>' . PHP_EOL;
    1552                 }
    1553 
    1554                 return $output;
    1555 
     1529                if ( $a['type'] == 'select' ) { ?>
     1530                        <div class="radio-group">
     1531                        <select name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>">
     1532                        <?php foreach ( $a['values'] as $__key => $__value ) { ?>
     1533                                <option value="<?php echo esc_attr( $__key ); ?>"<?php selected( isset( $options[ $_key ] ) && $options[ $_key ] == $__key ); ?>><?php echo esc_html( $__value ); ?></option>
     1534                        <?php } ?>
     1535                        </select>
     1536                        </div>
     1537                <?php }
    15561538        }
    15571539
    … …  
    15911573                        $active_text  = __( 'Activate', 'custom-css-js' );
    15921574                }
    1593                 $actions['activate'] = '<a href="' . esc_url( $url ) . '" title="' . $active_title . '" class="ccj_activate_deactivate" data-code-id="' . $post->ID . '">' . $active_text . '</a>';
     1575                $actions['activate'] = '<a href="' . esc_url( $url ) . '" title="' . esc_html( $active_title ) . '" class="ccj_activate_deactivate" data-code-id="' . esc_attr( $post->ID ) . '">' . esc_html( $active_text ) . '</a>';
    15941576
    15951577                return $actions;
    … …  
    16251607                }
    16261608                ?>
    1627                 <div id="activate-action"><span style="font-weight: bold;"><?php echo $text; ?></span>
    1628                 (<a class="ccj_activate_deactivate" data-code-id="<?php echo $post->ID; ?>" href="<?php echo esc_url( $url ); ?>"><?php echo $action; ?></a>)
     1609                <div id="activate-action"><span style="font-weight: bold;"><?php echo esc_html( $text ); ?></span>
     1610                (<a class="ccj_activate_deactivate" data-code-id="<?php echo esc_attr( $post->ID ); ?>" href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $action ); ?></a>)
    16291611                </div>
    16301612                <?php
    … …  
    16791661                                <span id="sample-permalink"><a href="<?php echo esc_url( $permalink ); ?>"><?php echo esc_html( CCJ_UPLOAD_URL ) . '/'; ?><span id="editable-post-name"><?php echo esc_html( $filename ); ?></span>.<?php echo esc_html( $filetype ); ?></a></span>
    16801662                                &lrm;<span id="ccj-edit-slug-buttons"><button type="button" class="ccj-edit-slug button button-small hide-if-no-js" aria-label="Edit permalink">Edit</button></span>
    1681                                 <span id="editable-post-name-full" data-filetype="<?php echo $filetype; ?>"><?php echo esc_html( $filename ); ?></span>
     1663                                <span id="editable-post-name-full" data-filetype="<?php echo esc_attr( $filetype ); ?>"><?php echo esc_html( $filename ); ?></span>
    16821664                        </div>
    16831665                        <?php wp_nonce_field( 'ccj-permalink', 'ccj-permalink-nonce' ); ?>
  • custom-css-js/trunk/includes/admin-warnings.php

    r3476672 r3726634  
    3131        <script type='text/javascript'>
    3232        jQuery(function($){
    33             $(document).on( 'click', '#<?php echo $slug; ?> .notice-dismiss', function() {
     33            $(document).on( 'click', '#<?php echo esc_attr( $slug ); ?> .notice-dismiss', function() {
    3434            var data = {
    3535                action: 'ccj_dismiss',
    36                 option: '<?php echo $slug; ?>',
     36                option: '<?php echo esc_attr( $slug ); ?>',
    3737                nonce: $(this).parent().data('nonce'),
    3838            };
    3939            $.post(ajaxurl, data, function(response ) {
    40                 $('#<?php echo $slug; ?>').fadeOut('slow');
     40                $('#<?php echo esc_attr( $slug ); ?>').fadeOut('slow');
    4141            });
    4242            });
  • custom-css-js/trunk/readme.txt

    r3656511 r3726634  
    66Requires at least: 4.2
    77Tested up to: 7.1
    8 Stable tag: 3.54
     8Stable tag: 3.54.1
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
    … …  
    103103== Changelog ==
    104104
     105
     106= 3.54.1 =
     107* 10/03/2026
     108* Tweak: add translators' notes to translatable strings
     109* Fix: escape outputs as per the WordPress documentation.
     110
    105111= 3.54 =
    106112* 08/20/2026
Note: See TracChangeset for help on using the changeset viewer.