Simple Custom CSS and JS - Version 3.26

Version Description

  • 05/08/2019
  • Fix: remove the Codemirror library added from WP Core
  • Tweak: use protocol relative urls for custom code linked file
  • Declare compatibility with WordPress 5.2
Download this release

Release Info

Developer diana_burduja
Plugin Icon 128x128 Simple Custom CSS and JS
Version 3.26
Comparing to
See all releases

Code changes from version 3.25 to 3.26

Files changed (3) hide show
  1. custom-css-js.php +6 -4
  2. includes/admin-screens.php +2 -0
  3. readme.txt +8 -2
custom-css-js.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Custom CSS and JS
4
  * Plugin URI: https://wordpress.org/plugins/custom-css-js/
5
  * Description: Easily add Custom CSS or JS to your website with an awesome editor.
6
- * Version: 3.25
7
  * Author: SilkyPress.com
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
@@ -169,17 +169,19 @@ final class CustomCSSandJS {
169
  if ( strpos( $function, 'footer' ) !== false ) {
170
  $in_footer = true;
171
  }
 
 
172
 
173
  if ( strpos( $function, 'js' ) !== false ) {
174
  foreach( $args as $_filename ) {
175
- echo PHP_EOL . "<script type='text/javascript' src='".CCJ_UPLOAD_URL. '/' . $_filename."'></script>" . PHP_EOL;
176
  }
177
  }
178
 
179
  if ( strpos( $function, 'css' ) !== false ) {
180
  foreach( $args as $_filename ) {
181
  $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
182
- echo PHP_EOL . "<link rel='stylesheet' id='".$shortfilename ."-css' href='".CCJ_UPLOAD_URL. '/' . $_filename ."' type='text/css' media='all' />" . PHP_EOL;
183
  }
184
  }
185
  }
@@ -202,7 +204,7 @@ final class CustomCSSandJS {
202
  function set_constants() {
203
  $dir = wp_upload_dir();
204
  $constants = array(
205
- 'CCJ_VERSION' => '3.25',
206
  'CCJ_UPLOAD_DIR' => $dir['basedir'] . '/custom-css-js',
207
  'CCJ_UPLOAD_URL' => $dir['baseurl'] . '/custom-css-js',
208
  'CCJ_PLUGIN_FILE' => __FILE__,
3
  * Plugin Name: Simple Custom CSS and JS
4
  * Plugin URI: https://wordpress.org/plugins/custom-css-js/
5
  * Description: Easily add Custom CSS or JS to your website with an awesome editor.
6
+ * Version: 3.26
7
  * Author: SilkyPress.com
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
169
  if ( strpos( $function, 'footer' ) !== false ) {
170
  $in_footer = true;
171
  }
172
+
173
+ $upload_url = str_replace(array('https://', 'http://'), '//', CCJ_UPLOAD_URL) . '/';
174
 
175
  if ( strpos( $function, 'js' ) !== false ) {
176
  foreach( $args as $_filename ) {
177
+ echo PHP_EOL . "<script type='text/javascript' src='".$upload_url . $_filename."'></script>" . PHP_EOL;
178
  }
179
  }
180
 
181
  if ( strpos( $function, 'css' ) !== false ) {
182
  foreach( $args as $_filename ) {
183
  $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
184
+ echo PHP_EOL . "<link rel='stylesheet' id='".$shortfilename ."-css' href='".$upload_url . $_filename."' type='text/css' media='all' />" . PHP_EOL;
185
  }
186
  }
187
  }
204
  function set_constants() {
205
  $dir = wp_upload_dir();
206
  $constants = array(
207
+ 'CCJ_VERSION' => '3.26',
208
  'CCJ_UPLOAD_DIR' => $dir['basedir'] . '/custom-css-js',
209
  'CCJ_UPLOAD_URL' => $dir['baseurl'] . '/custom-css-js',
210
  'CCJ_PLUGIN_FILE' => __FILE__,
includes/admin-screens.php CHANGED
@@ -130,6 +130,8 @@ class CustomCSSandJS_Admin {
130
 
131
  // Only for the new/edit Code's page
132
  if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
 
 
133
  wp_enqueue_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css', array(), $v );
134
  wp_enqueue_script( 'ccj-codemirror', $cm . '/lib/codemirror.js', array( 'jquery' ), $v, false);
135
  wp_enqueue_style( 'ccj-codemirror', $cm . '/lib/codemirror.css', array(), $v );
130
 
131
  // Only for the new/edit Code's page
132
  if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
133
+ wp_deregister_script('wp-codemirror');
134
+
135
  wp_enqueue_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css', array(), $v );
136
  wp_enqueue_script( 'ccj-codemirror', $cm . '/lib/codemirror.js', array( 'jquery' ), $v, false);
137
  wp_enqueue_style( 'ccj-codemirror', $cm . '/lib/codemirror.css', array(), $v );
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: diana_burduja
4
  Email: diana@burduja.eu
5
  Tags: CSS, JS, javascript, custom CSS, custom JS, custom style, site css, add style, customize theme, custom code, external css, css3, style, styles, stylesheet, theme, editor, design, admin
6
  Requires at least: 3.0.1
7
- Tested up to: 5.1
8
- Stable tag: 3.25
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Requires PHP: 5.2.4
@@ -105,6 +105,12 @@ $. Add/Edit HTML
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
108
  = 3.25 =
109
  * 04/21/2019
110
  * Tweak: update the Bootstrap and jQuery library links
4
  Email: diana@burduja.eu
5
  Tags: CSS, JS, javascript, custom CSS, custom JS, custom style, site css, add style, customize theme, custom code, external css, css3, style, styles, stylesheet, theme, editor, design, admin
6
  Requires at least: 3.0.1
7
+ Tested up to: 5.2
8
+ Stable tag: 3.26
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Requires PHP: 5.2.4
105
 
106
  == Changelog ==
107
 
108
+ = 3.26 =
109
+ * 05/08/2019
110
+ * Fix: remove the Codemirror library added from WP Core
111
+ * Tweak: use protocol relative urls for custom code linked file
112
+ * Declare compatibility with WordPress 5.2
113
+
114
  = 3.25 =
115
  * 04/21/2019
116
  * Tweak: update the Bootstrap and jQuery library links