Changeset 3726634
- Timestamp:
- 10/03/2026 07:09:18 PM (3 weeks ago)
- Location:
- custom-css-js
- Files:
-
- 2 added
- 8 edited
- 72 copied
-
tags/3.54.1 (copied) (copied from custom-css-js/trunk )
-
tags/3.54.1/assets/ccj_admin-url_rules.js (copied) (copied from custom-css-js/trunk/assets/ccj_admin-url_rules.js )
-
tags/3.54.1/assets/ccj_admin.css (copied) (copied from custom-css-js/trunk/assets/ccj_admin.css )
-
tags/3.54.1/assets/ccj_admin.js (copied) (copied from custom-css-js/trunk/assets/ccj_admin.js )
-
tags/3.54.1/assets/codemirror.min.css (copied) (copied from custom-css-js/trunk/assets/codemirror.min.css )
-
tags/3.54.1/assets/codemirror.min.js (copied) (copied from custom-css-js/trunk/assets/codemirror.min.js )
-
tags/3.54.1/assets/codemirror/addon/comment (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/comment )
-
tags/3.54.1/assets/codemirror/addon/comment/comment.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/comment/comment.js )
-
tags/3.54.1/assets/codemirror/addon/dialog/dialog.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/dialog/dialog.css )
-
tags/3.54.1/assets/codemirror/addon/dialog/dialog.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/dialog/dialog.js )
-
tags/3.54.1/assets/codemirror/addon/display (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/display )
-
tags/3.54.1/assets/codemirror/addon/display/fullscreen.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/display/fullscreen.css )
-
tags/3.54.1/assets/codemirror/addon/display/fullscreen.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/display/fullscreen.js )
-
tags/3.54.1/assets/codemirror/addon/edit/closebrackets.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/edit/closebrackets.js )
-
tags/3.54.1/assets/codemirror/addon/edit/matchbrackets.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/edit/matchbrackets.js )
-
tags/3.54.1/assets/codemirror/addon/edit/matchtags.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/edit/matchtags.js )
-
tags/3.54.1/assets/codemirror/addon/fold (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold )
-
tags/3.54.1/assets/codemirror/addon/fold/brace-fold.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/brace-fold.js )
-
tags/3.54.1/assets/codemirror/addon/fold/comment-fold.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/comment-fold.js )
-
tags/3.54.1/assets/codemirror/addon/fold/foldcode.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/foldcode.js )
-
tags/3.54.1/assets/codemirror/addon/fold/foldgutter.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/foldgutter.css )
-
tags/3.54.1/assets/codemirror/addon/fold/foldgutter.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/foldgutter.js )
-
tags/3.54.1/assets/codemirror/addon/fold/indent-fold.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/indent-fold.js )
-
tags/3.54.1/assets/codemirror/addon/fold/markdown-fold.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/markdown-fold.js )
-
tags/3.54.1/assets/codemirror/addon/fold/xml-fold.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/fold/xml-fold.js )
-
tags/3.54.1/assets/codemirror/addon/hint (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint )
-
tags/3.54.1/assets/codemirror/addon/hint/anyword-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/anyword-hint.js )
-
tags/3.54.1/assets/codemirror/addon/hint/css-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/css-hint.js )
-
tags/3.54.1/assets/codemirror/addon/hint/html-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/html-hint.js )
-
tags/3.54.1/assets/codemirror/addon/hint/javascript-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/javascript-hint.js )
-
tags/3.54.1/assets/codemirror/addon/hint/show-hint.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/show-hint.css )
-
tags/3.54.1/assets/codemirror/addon/hint/show-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/show-hint.js )
-
tags/3.54.1/assets/codemirror/addon/hint/xml-hint.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/hint/xml-hint.js )
-
tags/3.54.1/assets/codemirror/addon/scroll/simplescrollbars.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/scroll/simplescrollbars.css )
-
tags/3.54.1/assets/codemirror/addon/scroll/simplescrollbars.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/scroll/simplescrollbars.js )
-
tags/3.54.1/assets/codemirror/addon/search/jump-to-line.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/jump-to-line.js )
-
tags/3.54.1/assets/codemirror/addon/search/match-highlighter.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/match-highlighter.js )
-
tags/3.54.1/assets/codemirror/addon/search/matchesonscrollbar.css (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/matchesonscrollbar.css )
-
tags/3.54.1/assets/codemirror/addon/search/matchesonscrollbar.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/matchesonscrollbar.js )
-
tags/3.54.1/assets/codemirror/addon/search/search.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/search.js )
-
tags/3.54.1/assets/codemirror/addon/search/searchcursor.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/search/searchcursor.js )
-
tags/3.54.1/assets/codemirror/addon/selection (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/selection )
-
tags/3.54.1/assets/codemirror/addon/selection/active-line.js (copied) (copied from custom-css-js/trunk/assets/codemirror/addon/selection/active-line.js )
-
tags/3.54.1/assets/codemirror/lib/codemirror.css (copied) (copied from custom-css-js/trunk/assets/codemirror/lib/codemirror.css )
-
tags/3.54.1/assets/codemirror/lib/codemirror.js (copied) (copied from custom-css-js/trunk/assets/codemirror/lib/codemirror.js )
-
tags/3.54.1/assets/codemirror/lib/util (copied) (copied from custom-css-js/trunk/assets/codemirror/lib/util )
-
tags/3.54.1/assets/codemirror/mode/css/css.js (copied) (copied from custom-css-js/trunk/assets/codemirror/mode/css/css.js )
-
tags/3.54.1/assets/codemirror/mode/htmlmixed/htmlmixed.js (copied) (copied from custom-css-js/trunk/assets/codemirror/mode/htmlmixed/htmlmixed.js )
-
tags/3.54.1/assets/codemirror/mode/javascript/javascript.js (copied) (copied from custom-css-js/trunk/assets/codemirror/mode/javascript/javascript.js )
-
tags/3.54.1/assets/codemirror/mode/xml/xml.js (copied) (copied from custom-css-js/trunk/assets/codemirror/mode/xml/xml.js )
-
tags/3.54.1/assets/codemirror/theme/3024-night.css (copied) (copied from custom-css-js/trunk/assets/codemirror/theme/3024-night.css )
-
tags/3.54.1/assets/empty.css (copied) (copied from custom-css-js/trunk/assets/empty.css )
-
tags/3.54.1/assets/empty.js (copied) (copied from custom-css-js/trunk/assets/empty.js )
-
tags/3.54.1/assets/images/silkypress_logo.png (added)
-
tags/3.54.1/assets/images/ui-icons_444444_256x240.png (copied) (copied from custom-css-js/trunk/assets/images/ui-icons_444444_256x240.png )
-
tags/3.54.1/assets/jquery-ui.css (copied) (copied from custom-css-js/trunk/assets/jquery-ui.css )
-
tags/3.54.1/assets/jquery.tipsy.js (copied) (copied from custom-css-js/trunk/assets/jquery.tipsy.js )
-
tags/3.54.1/assets/js.cookie.js (copied) (copied from custom-css-js/trunk/assets/js.cookie.js )
-
tags/3.54.1/assets/tipsy.css (copied) (copied from custom-css-js/trunk/assets/tipsy.css )
-
tags/3.54.1/changelog.txt (copied) (copied from custom-css-js/trunk/changelog.txt ) (1 diff)
-
tags/3.54.1/custom-css-js.php (copied) (copied from custom-css-js/trunk/custom-css-js.php ) (5 diffs)
-
tags/3.54.1/includes/admin-addons.php (copied) (copied from custom-css-js/trunk/includes/admin-addons.php ) (5 diffs)
-
tags/3.54.1/includes/admin-config.php (copied) (copied from custom-css-js/trunk/includes/admin-config.php ) (3 diffs)
-
tags/3.54.1/includes/admin-install.php (copied) (copied from custom-css-js/trunk/includes/admin-install.php )
-
tags/3.54.1/includes/admin-notices.php (copied) (copied from custom-css-js/trunk/includes/admin-notices.php ) (5 diffs)
-
tags/3.54.1/includes/admin-screens.php (copied) (copied from custom-css-js/trunk/includes/admin-screens.php ) (22 diffs)
-
tags/3.54.1/includes/admin-warnings.php (copied) (copied from custom-css-js/trunk/includes/admin-warnings.php ) (1 diff)
-
tags/3.54.1/languages/custom-css-js-fr_FR.mo (copied) (copied from custom-css-js/trunk/languages/custom-css-js-fr_FR.mo )
-
tags/3.54.1/languages/custom-css-js-fr_FR.po (copied) (copied from custom-css-js/trunk/languages/custom-css-js-fr_FR.po )
-
tags/3.54.1/languages/custom-css-js-pl_PL.po (copied) (copied from custom-css-js/trunk/languages/custom-css-js-pl_PL.po )
-
tags/3.54.1/languages/custom-css-js-tr_TR.po (copied) (copied from custom-css-js/trunk/languages/custom-css-js-tr_TR.po )
-
tags/3.54.1/languages/custom-css-js.pot (copied) (copied from custom-css-js/trunk/languages/custom-css-js.pot )
-
tags/3.54.1/readme.txt (copied) (copied from custom-css-js/trunk/readme.txt ) (2 diffs)
-
trunk/assets/images/silkypress_logo.png (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/custom-css-js.php (modified) (5 diffs)
-
trunk/includes/admin-addons.php (modified) (5 diffs)
-
trunk/includes/admin-config.php (modified) (3 diffs)
-
trunk/includes/admin-notices.php (modified) (5 diffs)
-
trunk/includes/admin-screens.php (modified) (22 diffs)
-
trunk/includes/admin-warnings.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-css-js/tags/3.54.1/changelog.txt
r3539913 r3726634 1 1 == 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 2 12 3 13 = 3.53 = -
custom-css-js/tags/3.54.1/custom-css-js.php
r3656511 r3726634 4 4 * Plugin URI: https://wordpress.org/plugins/custom-css-js/ 5 5 * Description: Easily add Custom CSS or JS to your website with an awesome editor. 6 * Version: 3.54 6 * Version: 3.54.1 7 7 * Author: SilkyPress.com 8 8 * Author URI: https://www.silkypress.com … … 49 49 */ 50 50 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' ); 52 52 } 53 53 … … 56 56 */ 57 57 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' ); 59 59 } 60 60 … … 194 194 $custom_code = str_replace( array( ' type="text/javascript"', ' type="text/css"' ), '', $custom_code ); 195 195 } 196 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 196 197 echo $custom_code; 197 198 } else { 199 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 198 200 echo @file_get_contents( CCJ_UPLOAD_DIR . '/' . $_filename ); 199 201 } 200 202 } 201 203 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 ) : 207 208 $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; 210 211 211 212 if ( 'html' === $type ) { 212 213 $post = get_post( intval( $_filename ) ); 213 214 if ( isset( $post->post_content ) && ! empty( $post->post_content ) ) { 215 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 214 216 echo $post->post_content; 215 217 } … … 282 284 $dir = wp_upload_dir(); 283 285 $constants = array( 284 'CCJ_VERSION' => '3.54 ',286 'CCJ_VERSION' => '3.54.1', 285 287 'CCJ_UPLOAD_DIR' => $dir['basedir'] . '/custom-css-js', 286 288 'CCJ_UPLOAD_URL' => $dir['baseurl'] . '/custom-css-js', -
custom-css-js/tags/3.54.1/includes/admin-addons.php
r3656511 r3726634 40 40 <div class="ccj_only_premium ccj_only_premium-first"> 41 41 <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> 43 43 </div> 44 44 </div> … … 65 65 <div id="preview-action"> 66 66 <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> 69 69 </div> 70 70 </div> … … 80 80 81 81 $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', 90 90 ); 91 $filters_html = '';92 foreach( $filters as $_key => $_value ) {93 $filters_html .= '<option value="'.$_key.'">' . $_value . '</option>';94 }95 91 96 92 $applied_filters = '[{"value":"","type":"all","index":1}]'; 97 93 98 94 ?> 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> 102 <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter', 'custom-css-js'); ?>" /> 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> 103 <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php echo esc_attr('Text filter', 'custom-css-js'); ?>" /> 104 <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php echo esc_attr('Add', 'custom-css-js'); ?>" /></td> 104 105 105 106 <?php … … 134 135 <table class="revisions"> 135 136 <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> 141 142 </tr></thead> 142 143 <tbody> … … 146 147 $restore_url = '#'; 147 148 148 $delete_disabled = '';149 $delete_tooltip = '';150 149 $class = ''; 151 150 ?> 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'] ); ?>"> 153 152 <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'] ); ?>" /> 156 155 </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> 159 158 <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'] ); ?>"> 161 160 </td> 162 161 <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> 164 163 </td> 165 164 </tr> -
custom-css-js/tags/3.54.1/includes/admin-config.php
r3476672 r3726634 124 124 <?php $this->config_page_header('editor'); ?> 125 125 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"> 127 127 128 128 <?php do_action( 'ccj_settings_form' ); ?> … … 139 139 function config_page_header( $tab = 'editor' ) { 140 140 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&utm_campaign=iz_free&utm_medium=banner'; 145 143 146 144 ?> 147 145 <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; } 149 150 .form-table { margin-left: 2%; width: 98%;} 150 151 .form-table th { width: 500px; } 151 152 </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> 153 158 154 159 <?php … … 211 216 } 212 217 213 $ccj_htmlentities_help = __('If you want to use an HTML entity in your code (for example '. htmlentities('> or "').'), but the editor keeps on changing them to its equivalent character (> and " 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 221 218 ?> 222 219 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 &gt; or &quot;), but the editor keeps on changing them to its equivalent character (> and " 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); ?>> 229 230 </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 <input> or <textarea>) 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); ?>> 234 239 </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); ?>> 239 247 </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); ?>> 255 261 </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> </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> </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 } 284 292 } 285 293 -
custom-css-js/tags/3.54.1/includes/admin-notices.php
r3424870 r3726634 15 15 16 16 var $prefix = 'ccj_'; 17 var $activation_time = '';17 var $activation_time = 0; 18 18 var $version = ''; 19 19 var $dismiss_notice = ''; … … 65 65 $p = $this->prefix; 66 66 67 $this->activation_time = get_option( $p . '_activation_time', '' );67 $this->activation_time = (int)get_option( $p . '_activation_time', '' ); 68 68 $this->version = get_option( $p.'_version', '' ); 69 69 $this->dismiss_notice = get_option( $p.'_dismiss_notice', false ); … … 113 113 114 114 $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 ); 118 118 119 119 … … 164 164 ?> 165 165 <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; } 171 171 </style> 172 172 173 173 <script type='text/javascript'> 174 174 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() { 176 176 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 ); ?>', 179 179 nonce: $(this).parent().parent().data('nonce'), 180 180 }; 181 181 $.post(ajaxurl, data, function(response ) { 182 $('#<?php echo $p; ?>_notice').fadeOut('slow');182 $('#<?php echo esc_attr( $p ); ?>_notice').fadeOut('slow'); 183 183 }); 184 184 }); … … 186 186 </script> 187 187 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> 192 193 </button> 194 </span> 193 195 </div> 194 196 <?php -
custom-css-js/tags/3.54.1/includes/admin-screens.php
r3656511 r3726634 346 346 ?> 347 347 <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> 352 351 </div> 353 352 <?php … … 364 363 'active' => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="' . __( 'Active', 'custom-css-js' ) . '"></span>', 365 364 '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' ), 369 368 'modified' => __( 'Modified', 'custom-css-js' ), 370 369 ); … … 389 388 $edit_link = get_edit_post_link( $post_id ); 390 389 $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 ) : 397 399 $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; 400 403 401 404 if ( 'modified' === $column || 'published' === $column ) { … … 403 406 404 407 if ( '0000-00-00 00:00:00' === $post->post_date ) { 405 $t_time = __( 'Unpublished' );408 $t_time = __( 'Unpublished', 'custom-css-js' ); 406 409 $h_time = $t_time; 407 410 $time_diff = 0; … … 412 415 if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { 413 416 /* 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 ) ); 415 418 } else { 416 419 $h_time = ( 'published' === $column ) ? get_the_time( __( 'Y/m/d' ), $post ) : get_the_modified_time( __( 'Y/m/d' ), $post ); … … 418 421 } 419 422 420 echo $h_time;423 echo esc_html( $h_time ); 421 424 } 422 425 … … 430 433 $active_icon = 'dashicons-star-empty ccj_row'; 431 434 } 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 435 440 } 436 441 } … … 507 512 ); 508 513 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 517 523 } 518 524 … … 596 602 } 597 603 } 598 echo $active;604 echo esc_html( $active ); 599 605 600 606 die(); … … 618 624 /* <![CDATA[ */ 619 625 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>'; 624 630 $("#wpbody-content h1").html(h1); 625 631 }); … … 637 643 $this->remove_unallowed_metaboxes(); 638 644 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' ); 655 647 $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 }665 648 666 649 ?> … … 673 656 /* <![CDATA[ */ 674 657 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>'); 677 666 678 667 var from_top = -$("#normal-sortables").height(); … … 857 846 858 847 <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> 862 851 <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 865 852 </div> 866 853 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> 870 861 871 862 <table id="post-status-info"><tbody><tr> 872 863 <td class="autosave-info"> 873 864 <span class="autosave-message"> </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 877 868 if ( $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ) ) { 878 869 printf( 879 870 /* 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' ), 881 872 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 ) ) 884 875 ); 885 876 } else { 886 877 printf( 887 878 /* 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 ) ) 891 882 ); 892 883 } 893 echo '</span>';894 }895 ?>884 ?> 885 </span> 886 <?php endif; ?> 896 887 </td> 897 888 </tr></tbody></table> 898 889 899 890 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 ) ); ?>"> 901 892 <?php 902 893 … … 930 921 ?> 931 922 <div class="options_meta_box"> 932 <?php 933 934 $output = ''; 935 936 foreach ( $meta as $_key => $a ) { 923 <?php foreach ( $meta as $_key => $a ) : 937 924 $close_div = false; 938 925 … … 941 928 in_array( $_key, ['priority', 'minify', 'multisite' ] ) ) { 942 929 $close_div = true; 943 $output .= '<div class="ccj_opaque">'; 930 ?> 931 <div class="ccj_opaque"> 932 <?php 944 933 } 945 934 946 // Don't show Pre-processors for JavaScript Codes947 935 if ( $options['language'] == 'js' && $_key == 'preprocessor' ) { 948 936 continue; 949 937 } 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'] ); ?>"> 965 950 966 951 <div style="clear: both;"></div> … … 970 955 <div class="ccj_only_premium ccj_only_premium-right"> 971 956 <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> 973 958 </div> 974 959 </div> … … 1359 1344 printf( 1360 1345 /* 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' ), 1362 1347 '<b>custom-css-js</b>' 1363 1348 ); 1364 1349 ?></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> 1366 1351 </div> 1367 1352 <?php … … 1376 1361 printf( 1377 1362 /* 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>' 1380 1365 ); 1381 1366 ?></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> 1383 1368 </div> 1384 1369 <?php … … 1501 1486 function render_input( $_key, $a, $options ) { 1502 1487 $name = 'custom_code_' . $_key; 1503 $output = '';1504 1488 1505 1489 // Show radio type options 1506 1490 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 ) : 1509 1494 $id = $name . '-' . $__key; 1510 1495 $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 1517 1504 } 1518 1505 1519 1506 // Show checkbox type options 1520 1507 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 ) : 1523 1511 $current_values = explode(',', $options[ $_key ] ); 1524 1512 foreach ( $a['values'] as $__key => $__value ) { 1525 1513 $id = $name . '-' . $__key; 1526 1514 $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 : 1533 1520 $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 } 1541 1527 1542 1528 // 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 } 1556 1538 } 1557 1539 … … 1591 1573 $active_text = __( 'Activate', 'custom-css-js' ); 1592 1574 } 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>'; 1594 1576 1595 1577 return $actions; … … 1625 1607 } 1626 1608 ?> 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>) 1629 1611 </div> 1630 1612 <?php … … 1679 1661 <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> 1680 1662 ‎<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> 1682 1664 </div> 1683 1665 <?php wp_nonce_field( 'ccj-permalink', 'ccj-permalink-nonce' ); ?> -
custom-css-js/tags/3.54.1/includes/admin-warnings.php
r3476672 r3726634 31 31 <script type='text/javascript'> 32 32 jQuery(function($){ 33 $(document).on( 'click', '#<?php echo $slug; ?> .notice-dismiss', function() {33 $(document).on( 'click', '#<?php echo esc_attr( $slug ); ?> .notice-dismiss', function() { 34 34 var data = { 35 35 action: 'ccj_dismiss', 36 option: '<?php echo $slug; ?>',36 option: '<?php echo esc_attr( $slug ); ?>', 37 37 nonce: $(this).parent().data('nonce'), 38 38 }; 39 39 $.post(ajaxurl, data, function(response ) { 40 $('#<?php echo $slug; ?>').fadeOut('slow');40 $('#<?php echo esc_attr( $slug ); ?>').fadeOut('slow'); 41 41 }); 42 42 }); -
custom-css-js/tags/3.54.1/readme.txt
r3656511 r3726634 6 6 Requires at least: 4.2 7 7 Tested up to: 7.1 8 Stable tag: 3.54 8 Stable tag: 3.54.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 103 103 == Changelog == 104 104 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 105 111 = 3.54 = 106 112 * 08/20/2026 -
custom-css-js/trunk/changelog.txt
r3539913 r3726634 1 1 == 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 2 12 3 13 = 3.53 = -
custom-css-js/trunk/custom-css-js.php
r3656511 r3726634 4 4 * Plugin URI: https://wordpress.org/plugins/custom-css-js/ 5 5 * Description: Easily add Custom CSS or JS to your website with an awesome editor. 6 * Version: 3.54 6 * Version: 3.54.1 7 7 * Author: SilkyPress.com 8 8 * Author URI: https://www.silkypress.com … … 49 49 */ 50 50 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' ); 52 52 } 53 53 … … 56 56 */ 57 57 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' ); 59 59 } 60 60 … … 194 194 $custom_code = str_replace( array( ' type="text/javascript"', ' type="text/css"' ), '', $custom_code ); 195 195 } 196 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 196 197 echo $custom_code; 197 198 } else { 199 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 198 200 echo @file_get_contents( CCJ_UPLOAD_DIR . '/' . $_filename ); 199 201 } 200 202 } 201 203 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 ) : 207 208 $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; 210 211 211 212 if ( 'html' === $type ) { 212 213 $post = get_post( intval( $_filename ) ); 213 214 if ( isset( $post->post_content ) && ! empty( $post->post_content ) ) { 215 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 214 216 echo $post->post_content; 215 217 } … … 282 284 $dir = wp_upload_dir(); 283 285 $constants = array( 284 'CCJ_VERSION' => '3.54 ',286 'CCJ_VERSION' => '3.54.1', 285 287 'CCJ_UPLOAD_DIR' => $dir['basedir'] . '/custom-css-js', 286 288 'CCJ_UPLOAD_URL' => $dir['baseurl'] . '/custom-css-js', -
custom-css-js/trunk/includes/admin-addons.php
r3656511 r3726634 40 40 <div class="ccj_only_premium ccj_only_premium-first"> 41 41 <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> 43 43 </div> 44 44 </div> … … 65 65 <div id="preview-action"> 66 66 <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> 69 69 </div> 70 70 </div> … … 80 80 81 81 $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', 90 90 ); 91 $filters_html = '';92 foreach( $filters as $_key => $_value ) {93 $filters_html .= '<option value="'.$_key.'">' . $_value . '</option>';94 }95 91 96 92 $applied_filters = '[{"value":"","type":"all","index":1}]'; 97 93 98 94 ?> 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> 102 <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter', 'custom-css-js'); ?>" /> 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> 103 <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php echo esc_attr('Text filter', 'custom-css-js'); ?>" /> 104 <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php echo esc_attr('Add', 'custom-css-js'); ?>" /></td> 104 105 105 106 <?php … … 134 135 <table class="revisions"> 135 136 <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> 141 142 </tr></thead> 142 143 <tbody> … … 146 147 $restore_url = '#'; 147 148 148 $delete_disabled = '';149 $delete_tooltip = '';150 149 $class = ''; 151 150 ?> 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'] ); ?>"> 153 152 <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'] ); ?>" /> 156 155 </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> 159 158 <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'] ); ?>"> 161 160 </td> 162 161 <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> 164 163 </td> 165 164 </tr> -
custom-css-js/trunk/includes/admin-config.php
r3476672 r3726634 124 124 <?php $this->config_page_header('editor'); ?> 125 125 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"> 127 127 128 128 <?php do_action( 'ccj_settings_form' ); ?> … … 139 139 function config_page_header( $tab = 'editor' ) { 140 140 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&utm_campaign=iz_free&utm_medium=banner'; 145 143 146 144 ?> 147 145 <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; } 149 150 .form-table { margin-left: 2%; width: 98%;} 150 151 .form-table th { width: 500px; } 151 152 </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> 153 158 154 159 <?php … … 211 216 } 212 217 213 $ccj_htmlentities_help = __('If you want to use an HTML entity in your code (for example '. htmlentities('> or "').'), but the editor keeps on changing them to its equivalent character (> and " 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 221 218 ?> 222 219 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 &gt; or &quot;), but the editor keeps on changing them to its equivalent character (> and " 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); ?>> 229 230 </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 <input> or <textarea>) 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); ?>> 234 239 </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); ?>> 239 247 </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); ?>> 255 261 </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> </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> </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 } 284 292 } 285 293 -
custom-css-js/trunk/includes/admin-notices.php
r3424870 r3726634 15 15 16 16 var $prefix = 'ccj_'; 17 var $activation_time = '';17 var $activation_time = 0; 18 18 var $version = ''; 19 19 var $dismiss_notice = ''; … … 65 65 $p = $this->prefix; 66 66 67 $this->activation_time = get_option( $p . '_activation_time', '' );67 $this->activation_time = (int)get_option( $p . '_activation_time', '' ); 68 68 $this->version = get_option( $p.'_version', '' ); 69 69 $this->dismiss_notice = get_option( $p.'_dismiss_notice', false ); … … 113 113 114 114 $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 ); 118 118 119 119 … … 164 164 ?> 165 165 <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; } 171 171 </style> 172 172 173 173 <script type='text/javascript'> 174 174 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() { 176 176 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 ); ?>', 179 179 nonce: $(this).parent().parent().data('nonce'), 180 180 }; 181 181 $.post(ajaxurl, data, function(response ) { 182 $('#<?php echo $p; ?>_notice').fadeOut('slow');182 $('#<?php echo esc_attr( $p ); ?>_notice').fadeOut('slow'); 183 183 }); 184 184 }); … … 186 186 </script> 187 187 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> 192 193 </button> 194 </span> 193 195 </div> 194 196 <?php -
custom-css-js/trunk/includes/admin-screens.php
r3656511 r3726634 346 346 ?> 347 347 <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> 352 351 </div> 353 352 <?php … … 364 363 'active' => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="' . __( 'Active', 'custom-css-js' ) . '"></span>', 365 364 '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' ), 369 368 'modified' => __( 'Modified', 'custom-css-js' ), 370 369 ); … … 389 388 $edit_link = get_edit_post_link( $post_id ); 390 389 $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 ) : 397 399 $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; 400 403 401 404 if ( 'modified' === $column || 'published' === $column ) { … … 403 406 404 407 if ( '0000-00-00 00:00:00' === $post->post_date ) { 405 $t_time = __( 'Unpublished' );408 $t_time = __( 'Unpublished', 'custom-css-js' ); 406 409 $h_time = $t_time; 407 410 $time_diff = 0; … … 412 415 if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { 413 416 /* 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 ) ); 415 418 } else { 416 419 $h_time = ( 'published' === $column ) ? get_the_time( __( 'Y/m/d' ), $post ) : get_the_modified_time( __( 'Y/m/d' ), $post ); … … 418 421 } 419 422 420 echo $h_time;423 echo esc_html( $h_time ); 421 424 } 422 425 … … 430 433 $active_icon = 'dashicons-star-empty ccj_row'; 431 434 } 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 435 440 } 436 441 } … … 507 512 ); 508 513 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 517 523 } 518 524 … … 596 602 } 597 603 } 598 echo $active;604 echo esc_html( $active ); 599 605 600 606 die(); … … 618 624 /* <![CDATA[ */ 619 625 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>'; 624 630 $("#wpbody-content h1").html(h1); 625 631 }); … … 637 643 $this->remove_unallowed_metaboxes(); 638 644 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' ); 655 647 $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 }665 648 666 649 ?> … … 673 656 /* <![CDATA[ */ 674 657 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>'); 677 666 678 667 var from_top = -$("#normal-sortables").height(); … … 857 846 858 847 <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> 862 851 <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 865 852 </div> 866 853 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> 870 861 871 862 <table id="post-status-info"><tbody><tr> 872 863 <td class="autosave-info"> 873 864 <span class="autosave-message"> </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 877 868 if ( $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ) ) { 878 869 printf( 879 870 /* 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' ), 881 872 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 ) ) 884 875 ); 885 876 } else { 886 877 printf( 887 878 /* 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 ) ) 891 882 ); 892 883 } 893 echo '</span>';894 }895 ?>884 ?> 885 </span> 886 <?php endif; ?> 896 887 </td> 897 888 </tr></tbody></table> 898 889 899 890 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 ) ); ?>"> 901 892 <?php 902 893 … … 930 921 ?> 931 922 <div class="options_meta_box"> 932 <?php 933 934 $output = ''; 935 936 foreach ( $meta as $_key => $a ) { 923 <?php foreach ( $meta as $_key => $a ) : 937 924 $close_div = false; 938 925 … … 941 928 in_array( $_key, ['priority', 'minify', 'multisite' ] ) ) { 942 929 $close_div = true; 943 $output .= '<div class="ccj_opaque">'; 930 ?> 931 <div class="ccj_opaque"> 932 <?php 944 933 } 945 934 946 // Don't show Pre-processors for JavaScript Codes947 935 if ( $options['language'] == 'js' && $_key == 'preprocessor' ) { 948 936 continue; 949 937 } 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'] ); ?>"> 965 950 966 951 <div style="clear: both;"></div> … … 970 955 <div class="ccj_only_premium ccj_only_premium-right"> 971 956 <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> 973 958 </div> 974 959 </div> … … 1359 1344 printf( 1360 1345 /* 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' ), 1362 1347 '<b>custom-css-js</b>' 1363 1348 ); 1364 1349 ?></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> 1366 1351 </div> 1367 1352 <?php … … 1376 1361 printf( 1377 1362 /* 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>' 1380 1365 ); 1381 1366 ?></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> 1383 1368 </div> 1384 1369 <?php … … 1501 1486 function render_input( $_key, $a, $options ) { 1502 1487 $name = 'custom_code_' . $_key; 1503 $output = '';1504 1488 1505 1489 // Show radio type options 1506 1490 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 ) : 1509 1494 $id = $name . '-' . $__key; 1510 1495 $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 1517 1504 } 1518 1505 1519 1506 // Show checkbox type options 1520 1507 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 ) : 1523 1511 $current_values = explode(',', $options[ $_key ] ); 1524 1512 foreach ( $a['values'] as $__key => $__value ) { 1525 1513 $id = $name . '-' . $__key; 1526 1514 $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 : 1533 1520 $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 } 1541 1527 1542 1528 // 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 } 1556 1538 } 1557 1539 … … 1591 1573 $active_text = __( 'Activate', 'custom-css-js' ); 1592 1574 } 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>'; 1594 1576 1595 1577 return $actions; … … 1625 1607 } 1626 1608 ?> 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>) 1629 1611 </div> 1630 1612 <?php … … 1679 1661 <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> 1680 1662 ‎<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> 1682 1664 </div> 1683 1665 <?php wp_nonce_field( 'ccj-permalink', 'ccj-permalink-nonce' ); ?> -
custom-css-js/trunk/includes/admin-warnings.php
r3476672 r3726634 31 31 <script type='text/javascript'> 32 32 jQuery(function($){ 33 $(document).on( 'click', '#<?php echo $slug; ?> .notice-dismiss', function() {33 $(document).on( 'click', '#<?php echo esc_attr( $slug ); ?> .notice-dismiss', function() { 34 34 var data = { 35 35 action: 'ccj_dismiss', 36 option: '<?php echo $slug; ?>',36 option: '<?php echo esc_attr( $slug ); ?>', 37 37 nonce: $(this).parent().data('nonce'), 38 38 }; 39 39 $.post(ajaxurl, data, function(response ) { 40 $('#<?php echo $slug; ?>').fadeOut('slow');40 $('#<?php echo esc_attr( $slug ); ?>').fadeOut('slow'); 41 41 }); 42 42 }); -
custom-css-js/trunk/readme.txt
r3656511 r3726634 6 6 Requires at least: 4.2 7 7 Tested up to: 7.1 8 Stable tag: 3.54 8 Stable tag: 3.54.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 103 103 == Changelog == 104 104 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 105 111 = 3.54 = 106 112 * 08/20/2026
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)