SiteOrigin CSS - Version 1.0.2

Version Description

  • Dequeue functionality the conflicted with WordPress color picker, if it's enqueued.
  • Removed wp_styles for compatibility with older versions of WordPress
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin CSS
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

Files changed (3) hide show
  1. .gitmodules +0 -0
  2. readme.txt +13 -1
  3. so-css.php +16 -11
.gitmodules DELETED
File without changes
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: css, design, edit, customize
3
  Requires at least: 3.9
4
  Tested up to: 4.2.2
5
- Stable tag: 1.0
6
  License: GPLv3 or later
7
  Contributors: gpriday
8
 
@@ -51,8 +51,20 @@ We're actively developing SiteOrigin CSS. Keep track of what's happening over on
51
  3. A full CSS editor that works in real-time with a preview of your site.
52
  4. Code completion for all your theme's selectors.
53
 
 
 
 
 
 
 
 
 
54
  == Changelog ==
55
 
 
 
 
 
56
  = 1.0.1 =
57
  * Fixed conflicts with CSS editor in SiteOrigin themes.
58
  * Force dequeue scripts that cause problems with main editing interface.
2
  Tags: css, design, edit, customize
3
  Requires at least: 3.9
4
  Tested up to: 4.2.2
5
+ Stable tag: 1.0.1
6
  License: GPLv3 or later
7
  Contributors: gpriday
8
 
51
  3. A full CSS editor that works in real-time with a preview of your site.
52
  4. Code completion for all your theme's selectors.
53
 
54
+ == Documentation ==
55
+
56
+ [Documentation](https://siteorigin.com/css/getting-started/) is available on SiteOrigin.
57
+
58
+ == Support ==
59
+
60
+ We offer free support on the [SiteOrigin support forums](https://siteorigin.com/thread/).
61
+
62
  == Changelog ==
63
 
64
+ = 1.0.2 =
65
+ * Dequeue functionality the conflicted with WordPress color picker, if it's enqueued.
66
+ * Removed wp_styles for compatibility with older versions of WordPress
67
+
68
  = 1.0.1 =
69
  * Fixed conflicts with CSS editor in SiteOrigin themes.
70
  * Force dequeue scripts that cause problems with main editing interface.
so-css.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin CSS
4
  Description: An advanced CSS editor from SiteOrigin.
5
- Version: 1.0.1
6
  Author: SiteOrigin
7
  Author URI: https://siteorigin.com
8
  Plugin URI: https://siteorigin.com/css/
@@ -13,7 +13,7 @@ License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  // Handle the legacy CSS editor that came with SiteOrigin themes
14
  include plugin_dir_path(__FILE__) . '/inc/legacy.php';
15
 
16
- define('SOCSS_VERSION', '1.0.1');
17
  define('SOCSS_JS_SUFFIX', '');
18
 
19
  /**
@@ -32,8 +32,8 @@ class SiteOrigin_CSS {
32
 
33
  // All the admin actions
34
  add_action( 'admin_menu', array($this, 'action_admin_menu') );
35
- add_action( 'admin_enqueue_scripts', array($this, 'enqueue_admin_scripts') );
36
- add_action( 'admin_enqueue_scripts', array($this, 'dequeue_admin_scripts'), 100 );
37
  add_action( 'load-appearance_page_so_custom_css', array($this, 'add_help_tab') );
38
  add_action( 'admin_footer', array($this, 'action_admin_footer') );
39
 
@@ -142,10 +142,12 @@ class SiteOrigin_CSS {
142
  wp_enqueue_script( 'codemirror', plugin_dir_url(__FILE__) . 'lib/codemirror/lib/codemirror' . SOCSS_JS_SUFFIX . '.js', array( 'underscore', 'backbone' ), '5.2.0' );
143
  wp_enqueue_script( 'codemirror-mode-css', plugin_dir_url(__FILE__) . 'lib/codemirror/mode/css/css' . SOCSS_JS_SUFFIX . '.js', array(), '5.2.0' );
144
 
145
- // Add in all the linting libs
146
- wp_enqueue_script( 'codemirror-lint', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/lint/lint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
147
- wp_enqueue_script( 'codemirror-lint-css', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/lint/css-lint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-lint-css-lib' ), '5.2.0' );
148
- wp_enqueue_script( 'codemirror-lint-css-lib', plugin_dir_url(__FILE__) . 'js/csslint' . SOCSS_JS_SUFFIX . '.js', array(), '0.10.0' );
 
 
149
 
150
  // The CodeMirror autocomplete library
151
  wp_enqueue_script( 'codemirror-show-hint', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/hint/show-hint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
@@ -383,10 +385,13 @@ class SiteOrigin_CSS {
383
  "`(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+`ism"=>"\n"
384
  );
385
 
386
- $styles = wp_styles();
387
- foreach( $styles->queue as $handle ) {
 
 
 
388
  if( $handle === 'siteorigin-css-inspector' || $handle === 'dashicons' ) continue;
389
- $style = $styles->registered[$handle];
390
  if( empty($style->src) || substr($style->src, 0, 4) !== 'http' ) continue;
391
  $response = wp_remote_get( $style->src );
392
  if( is_wp_error($response) || $response['response']['code'] !== 200 || empty($response['body']) ) continue;
2
  /*
3
  Plugin Name: SiteOrigin CSS
4
  Description: An advanced CSS editor from SiteOrigin.
5
+ Version: 1.0.2
6
  Author: SiteOrigin
7
  Author URI: https://siteorigin.com
8
  Plugin URI: https://siteorigin.com/css/
13
  // Handle the legacy CSS editor that came with SiteOrigin themes
14
  include plugin_dir_path(__FILE__) . '/inc/legacy.php';
15
 
16
+ define('SOCSS_VERSION', '1.0.2');
17
  define('SOCSS_JS_SUFFIX', '');
18
 
19
  /**
32
 
33
  // All the admin actions
34
  add_action( 'admin_menu', array($this, 'action_admin_menu') );
35
+ add_action( 'admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'), 20 );
36
+ add_action( 'admin_enqueue_scripts', array($this, 'dequeue_admin_scripts'), 19 );
37
  add_action( 'load-appearance_page_so_custom_css', array($this, 'add_help_tab') );
38
  add_action( 'admin_footer', array($this, 'action_admin_footer') );
39
 
142
  wp_enqueue_script( 'codemirror', plugin_dir_url(__FILE__) . 'lib/codemirror/lib/codemirror' . SOCSS_JS_SUFFIX . '.js', array( 'underscore', 'backbone' ), '5.2.0' );
143
  wp_enqueue_script( 'codemirror-mode-css', plugin_dir_url(__FILE__) . 'lib/codemirror/mode/css/css' . SOCSS_JS_SUFFIX . '.js', array(), '5.2.0' );
144
 
145
+ if( !wp_script_is( 'wp-color-picker' ) ) {
146
+ // Add in all the linting libs
147
+ wp_enqueue_script( 'codemirror-lint', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/lint/lint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
148
+ wp_enqueue_script( 'codemirror-lint-css', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/lint/css-lint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-lint-css-lib' ), '5.2.0' );
149
+ wp_enqueue_script( 'codemirror-lint-css-lib', plugin_dir_url(__FILE__) . 'js/csslint' . SOCSS_JS_SUFFIX . '.js', array(), '0.10.0' );
150
+ }
151
 
152
  // The CodeMirror autocomplete library
153
  wp_enqueue_script( 'codemirror-show-hint', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/hint/show-hint' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
385
  "`(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+`ism"=>"\n"
386
  );
387
 
388
+ global $wp_styles;
389
+ if( empty($wp_styles->queue) ) return;
390
+
391
+ // Make each of the scripts inline
392
+ foreach( $wp_styles->queue as $handle ) {
393
  if( $handle === 'siteorigin-css-inspector' || $handle === 'dashicons' ) continue;
394
+ $style = $wp_styles->registered[$handle];
395
  if( empty($style->src) || substr($style->src, 0, 4) !== 'http' ) continue;
396
  $response = wp_remote_get( $style->src );
397
  if( is_wp_error($response) || $response['response']['code'] !== 200 || empty($response['body']) ) continue;