Scripts n Styles - Version 3.4.5

Version Description

Download this release

Release Info

Developer WraithKenny
Plugin Icon wp plugin Scripts n Styles
Version 3.4.5
Comparing to
See all releases

Code changes from version 3.4.4 to 3.4.5

README.txt CHANGED
@@ -1,196 +1,196 @@
1
- === Scripts n Styles ===
2
- Contributors: WraithKenny, CaptainN
3
- Tags: admin, CSS, javascript, code, custom, Style
4
- Requires at least: 4.7.2
5
- Tested up to: 4.9
6
- Stable tag: 3.4.4
7
- License: GPLv3 or later
8
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
-
10
- This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
11
-
12
- == Description ==
13
-
14
- This plugin allows Admin users the ability to add custom CSS and JavaScript directly into individual Post, Pages or any other registered custom post types. You can also add classes to the body tag and the post container. There is a Global settings page for which you can write Scripts n Styles for the entire blog.
15
-
16
- Admin's can also add classes to the TinyMCE "Formats" dropdown which users can use to style posts and pages directly. As of Scripts n Styles 3+ styles are reflected in the post editor.
17
-
18
- Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
19
-
20
- = Notes about the implementation: =
21
-
22
- * Admin users, or more specifically, *any user with the `manage_options` and `unfiltered_html` capabilities* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
23
- * CSS Styles are embeded, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
24
- * JavaScript is embeded, not linked, at the bottom of the `body` (or `head`) element with `script` tags by using `wp-footer` (or `wp-head`). If your theme doesn't have this hook, this plugin (as well as most others) won't work.
25
- * **There is no input validation.** This plugin puts exactly what you type in the meta box directly into the `html` with no error checking. You are an Admin, and we trust you to be carefull. Try not to break anything.
26
- * Do to the licensing of the libraries used, this plugin is released "GPL 3.0 or later" if you care about those things.
27
-
28
- = Contact: =
29
-
30
- You'll have better luck contacting the other if you try me on [Twitter](http://twitter.com/WraithKenny) and [Github](https://github.com/unFocus/Scripts-n-Styles/issues). If that fails, I have an [open thread](http://wordpress.org/support/topic/contacting-scripts-n-styles-author "Contacting Scripts n Styles' author") on the support forums that will trigger an email.
31
-
32
- == Installation ==
33
-
34
- This plugin does not require any special activation or template tags. Just get it from wordpress.org/extend, install and activate like normal.
35
-
36
- == Frequently Asked Questions ==
37
-
38
- = Will I lose all of my custom Styles and Scripts if I uninstall the plugin? =
39
-
40
- Yes, absolutely. **YOU WLL LOSE ALL CUSTOMIZATIONS.** Be sure that you do not want these customizations before you uninstall.
41
-
42
- = Why would you do that to me? =
43
-
44
- Well, because plugins are supposed to, and should be expected to clean up after themselves. If you disable and uninstall the plugin, as a developer, I am supposed to assume that you no longer want me to store all of that now useless data in your database.
45
-
46
- = Can I get around that somehow? =
47
-
48
- Sure, if you are an Admin, just go to the plugin editor and wipe out the uninstall.php and then WordPress will not delete the meta data on uninstall.
49
-
50
- == Screenshots ==
51
-
52
- 1. Settings Page for Writing Scripts n Styles that apply to the whole blog.
53
- 2. The Scripts panel of the Meta Box.
54
- 3. The Styles panel of the Meta Box.
55
- 4. The Classes panel. Add classes to the Style dropdown!
56
- 5. Enqueue panel. You can enqueue jQuery from here if you need!
57
- 6. Your styles are reflected in the Editor.
58
-
59
- == Changelog ==
60
-
61
- = 3.4.4 =
62
- * Rename codemirror handle for compatibility
63
-
64
- = 3.4.3 =
65
- * No newline at end of file
66
- * Remove closing php tags
67
- * More guards against PHP 7.1 array conversion breaking change
68
-
69
- = 3.4.2 =
70
- * Silence alert debug message.
71
-
72
- = 3.4.1 =
73
- * Fix meta box saving.
74
-
75
- = 3.4 =
76
- * Add option to not delete data on uninstall
77
- * Version 4.0 will drop php support under 5.4
78
- * This version disables updates for installs with php < 5.4
79
- * 4.0 will launch when most have updated to 3.4 :) (and when it's done.)
80
-
81
- = 3.3 =
82
- * See the github repo commits
83
-
84
- = 3.2.1 =
85
- * metabox add shortcode bugfix
86
-
87
- = 3.2 =
88
- * Add AJAX to Shortcode Tab
89
- * Add "Chosen" for selects
90
- * General UI Improvements
91
- * Add CoffeeScript Support
92
- * Add Hoops Widget
93
- * Add Global Hoops Shortcodes
94
- * Add Markdown mode to code editor
95
- * Add (fix) code editor themes
96
- * Theme Support (Beta Feature)
97
-
98
- = 3.1.1 =
99
- * Add (fix) CodeMirror Themes
100
-
101
- = 3.1 =
102
- * Feature: Dynamic Shortcodes.
103
- * Feature: LESS.js support.
104
- * Bug Fix: Proper output escaping.
105
-
106
- = 3.0.3 =
107
- * Bug Fix: wpautop formatting.
108
-
109
- = 3.0.2 =
110
- * Bug Fix: Fatal Error on post save
111
-
112
- = 3.0.1 =
113
- * Option to show Metabox by default
114
- * Check upgrade in more places
115
- * Fix double Settings Message on general-options
116
- * Fix empty post showing on usage
117
- * Cleaned up constants (internal)
118
-
119
- = 3 =
120
- * AJAX Saving of Meta-box
121
- * Dynamically populate the Styles Dropdown for TinyMCE
122
- * Styles preview in Post Editor
123
- * Enqueue dependant scripts if you need (like jQuery)
124
- * Adjustable menu placement
125
- * CodeMirror Themes
126
-
127
- = 2.0.3 =
128
- * fixed some bugs
129
-
130
- = 2.0.1 =
131
- * Better selection of `post_types` to add Scripts-n-Styles
132
- * micro-optimization for storage of class names.
133
- * Adds option page for globally adding Scripts and Styles.
134
- * Defined a later priority for Scripts n Styles to print after other scripts and styles.
135
- * Added a box for Scripts to be included in the `head`.
136
- * Better adherence to coding standards.
137
- * Tabbed interface on metabox
138
- * added CodeMirror
139
- * began contextual help
140
-
141
- = 1.0.2 =
142
- * Added fields for `body_clas`s and `post_class`
143
- * Merged meta boxes
144
- * Cleaned up code
145
- * Improved compatibility
146
- * Added Screenshot
147
-
148
- = 1.0.1 =
149
- * Some small plugin meta data updates.
150
-
151
- = 1.0 =
152
- * Initial Release.
153
-
154
- == Upgrade Notice ==
155
-
156
- = 3.3 =
157
- Bug fixes and lib upgrades
158
-
159
- = 3.2.1 =
160
- Bug fix (add shortcode)
161
-
162
- = 3.2 =
163
- New Major Features
164
-
165
- = 3.1.1 =
166
- Add (fix) CodeMirror Themes
167
-
168
- = 3.1 =
169
- New Features and Bug fixes
170
-
171
- = 3.0.3 =
172
- Bug fix (wpauto issue)
173
-
174
- = 3.0.2 =
175
- Bug fix
176
-
177
- = 3.0.1 =
178
- Bug fixes
179
-
180
- = 3 =
181
- Adds new features.
182
-
183
- = 2 =
184
- Adds new features.
185
-
186
- = 1.0.3 =
187
- Adds a few new features.
188
-
189
- = 1.0.2 =
190
- Minor update. Adds a few new features.
191
-
192
- = 1.0.1 =
193
- Some small plugin meta data updates.
194
-
195
- = 1.0 =
196
- Initial Release, there is nothing to upgrade from.
1
+ === Scripts n Styles ===
2
+ Contributors: WraithKenny, CaptainN
3
+ Tags: admin, CSS, javascript, code, custom, Style
4
+ Requires at least: 4.9.8
5
+ Tested up to: 5.0
6
+ Stable tag: 3.4.5
7
+ License: GPLv3 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
+
10
+ This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
11
+
12
+ == Description ==
13
+
14
+ This plugin allows Admin users the ability to add custom CSS and JavaScript directly into individual Post, Pages or any other registered custom post types. You can also add classes to the body tag and the post container. There is a Global settings page for which you can write Scripts n Styles for the entire blog.
15
+
16
+ Admin's can also add classes to the TinyMCE "Formats" dropdown which users can use to style posts and pages directly. As of Scripts n Styles 3+ styles are reflected in the post editor.
17
+
18
+ Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
19
+
20
+ = Notes about the implementation: =
21
+
22
+ * Admin users, or more specifically, *any user with the `manage_options` and `unfiltered_html` capabilities* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
23
+ * CSS Styles are embeded, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
24
+ * JavaScript is embeded, not linked, at the bottom of the `body` (or `head`) element with `script` tags by using `wp-footer` (or `wp-head`). If your theme doesn't have this hook, this plugin (as well as most others) won't work.
25
+ * **There is no input validation.** This plugin puts exactly what you type in the meta box directly into the `html` with no error checking. You are an Admin, and we trust you to be carefull. Try not to break anything.
26
+ * Do to the licensing of the libraries used, this plugin is released "GPL 3.0 or later" if you care about those things.
27
+
28
+ = Contact: =
29
+
30
+ You'll have better luck contacting the other if you try me on [Twitter](http://twitter.com/WraithKenny1) and [Github](https://github.com/unFocus/Scripts-n-Styles/issues). If that fails, I have an [open thread](http://wordpress.org/support/topic/contacting-scripts-n-styles-author "Contacting Scripts n Styles' author") on the support forums that will trigger an email.
31
+
32
+ == Installation ==
33
+
34
+ This plugin does not require any special activation or template tags. Just get it from wordpress.org/extend, install and activate like normal.
35
+
36
+ == Frequently Asked Questions ==
37
+
38
+ = Will I lose all of my custom Styles and Scripts if I uninstall the plugin? =
39
+
40
+ Yes, absolutely. **YOU WLL LOSE ALL CUSTOMIZATIONS.** Be sure that you do not want these customizations before you uninstall.
41
+
42
+ = Why would you do that to me? =
43
+
44
+ Well, because plugins are supposed to, and should be expected to clean up after themselves. If you disable and uninstall the plugin, as a developer, I am supposed to assume that you no longer want me to store all of that now useless data in your database.
45
+
46
+ = Can I get around that somehow? =
47
+
48
+ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninstall.php and then WordPress will not delete the meta data on uninstall.
49
+
50
+ == Screenshots ==
51
+
52
+ 1. Settings Page for Writing Scripts n Styles that apply to the whole blog.
53
+ 2. The Scripts panel of the Meta Box.
54
+ 3. The Styles panel of the Meta Box.
55
+ 4. The Classes panel. Add classes to the Style dropdown!
56
+ 5. Enqueue panel. You can enqueue jQuery from here if you need!
57
+ 6. Your styles are reflected in the Editor.
58
+
59
+ == Changelog ==
60
+
61
+ = 3.4.4 =
62
+ * Rename codemirror handle for compatibility
63
+
64
+ = 3.4.3 =
65
+ * No newline at end of file
66
+ * Remove closing php tags
67
+ * More guards against PHP 7.1 array conversion breaking change
68
+
69
+ = 3.4.2 =
70
+ * Silence alert debug message.
71
+
72
+ = 3.4.1 =
73
+ * Fix meta box saving.
74
+
75
+ = 3.4 =
76
+ * Add option to not delete data on uninstall
77
+ * Version 4.0 will drop php support under 5.4
78
+ * This version disables updates for installs with php < 5.4
79
+ * 4.0 will launch when most have updated to 3.4 :) (and when it's done.)
80
+
81
+ = 3.3 =
82
+ * See the github repo commits
83
+
84
+ = 3.2.1 =
85
+ * metabox add shortcode bugfix
86
+
87
+ = 3.2 =
88
+ * Add AJAX to Shortcode Tab
89
+ * Add "Chosen" for selects
90
+ * General UI Improvements
91
+ * Add CoffeeScript Support
92
+ * Add Hoops Widget
93
+ * Add Global Hoops Shortcodes
94
+ * Add Markdown mode to code editor
95
+ * Add (fix) code editor themes
96
+ * Theme Support (Beta Feature)
97
+
98
+ = 3.1.1 =
99
+ * Add (fix) CodeMirror Themes
100
+
101
+ = 3.1 =
102
+ * Feature: Dynamic Shortcodes.
103
+ * Feature: LESS.js support.
104
+ * Bug Fix: Proper output escaping.
105
+
106
+ = 3.0.3 =
107
+ * Bug Fix: wpautop formatting.
108
+
109
+ = 3.0.2 =
110
+ * Bug Fix: Fatal Error on post save
111
+
112
+ = 3.0.1 =
113
+ * Option to show Metabox by default
114
+ * Check upgrade in more places
115
+ * Fix double Settings Message on general-options
116
+ * Fix empty post showing on usage
117
+ * Cleaned up constants (internal)
118
+
119
+ = 3 =
120
+ * AJAX Saving of Meta-box
121
+ * Dynamically populate the Styles Dropdown for TinyMCE
122
+ * Styles preview in Post Editor
123
+ * Enqueue dependant scripts if you need (like jQuery)
124
+ * Adjustable menu placement
125
+ * CodeMirror Themes
126
+
127
+ = 2.0.3 =
128
+ * fixed some bugs
129
+
130
+ = 2.0.1 =
131
+ * Better selection of `post_types` to add Scripts-n-Styles
132
+ * micro-optimization for storage of class names.
133
+ * Adds option page for globally adding Scripts and Styles.
134
+ * Defined a later priority for Scripts n Styles to print after other scripts and styles.
135
+ * Added a box for Scripts to be included in the `head`.
136
+ * Better adherence to coding standards.
137
+ * Tabbed interface on metabox
138
+ * added CodeMirror
139
+ * began contextual help
140
+
141
+ = 1.0.2 =
142
+ * Added fields for `body_clas`s and `post_class`
143
+ * Merged meta boxes
144
+ * Cleaned up code
145
+ * Improved compatibility
146
+ * Added Screenshot
147
+
148
+ = 1.0.1 =
149
+ * Some small plugin meta data updates.
150
+
151
+ = 1.0 =
152
+ * Initial Release.
153
+
154
+ == Upgrade Notice ==
155
+
156
+ = 3.3 =
157
+ Bug fixes and lib upgrades
158
+
159
+ = 3.2.1 =
160
+ Bug fix (add shortcode)
161
+
162
+ = 3.2 =
163
+ New Major Features
164
+
165
+ = 3.1.1 =
166
+ Add (fix) CodeMirror Themes
167
+
168
+ = 3.1 =
169
+ New Features and Bug fixes
170
+
171
+ = 3.0.3 =
172
+ Bug fix (wpauto issue)
173
+
174
+ = 3.0.2 =
175
+ Bug fix
176
+
177
+ = 3.0.1 =
178
+ Bug fixes
179
+
180
+ = 3 =
181
+ Adds new features.
182
+
183
+ = 2 =
184
+ Adds new features.
185
+
186
+ = 1.0.3 =
187
+ Adds a few new features.
188
+
189
+ = 1.0.2 =
190
+ Minor update. Adds a few new features.
191
+
192
+ = 1.0.1 =
193
+ Some small plugin meta data updates.
194
+
195
+ = 1.0 =
196
+ Initial Release, there is nothing to upgrade from.
includes/class-sns-meta-box.php CHANGED
@@ -20,7 +20,7 @@ class SnS_Admin_Meta_Box
20
  * Initializing method.
21
  */
22
  static function init() {
23
- add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
24
  add_action( 'save_post', array( __CLASS__, 'save_post' ) );
25
  }
26
 
@@ -422,4 +422,4 @@ class SnS_Admin_Meta_Box
422
  }
423
  return $o;
424
  }
425
- }
20
  * Initializing method.
21
  */
22
  static function init() {
23
+ add_action( 'current_screen', array( __CLASS__, 'add_meta_boxes' ) );
24
  add_action( 'save_post', array( __CLASS__, 'save_post' ) );
25
  }
26
 
422
  }
423
  return $o;
424
  }
425
+ }
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.png DELETED
Binary file
screenshot-6.png DELETED
Binary file
scripts-n-styles.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.unfocus.com/projects/scripts-n-styles/
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
- Version: 3.4.4
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  */
@@ -60,7 +60,7 @@ endif;
60
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
61
  * @author unFocus Projects
62
  * @link http://www.unfocus.com/ Author URI
63
- * @version 3.4.4
64
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
65
  * @copyright Copyright (c) 2010 - 2017, Kenneth Newman
66
  * @copyright Copyright (c) 2012, Kevin Newman
@@ -78,7 +78,7 @@ class Scripts_n_Styles
78
  /**#@+
79
  * @static
80
  */
81
- const VERSION = '3.4.4';
82
  static $file = __FILE__;
83
  static $cm_themes = array( 'default', '3024-day', '3024-night', 'ambiance',
84
  'base16-dark', 'base16-light',
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
+ Version: 3.4.5
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  */
60
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
61
  * @author unFocus Projects
62
  * @link http://www.unfocus.com/ Author URI
63
+ * @version 3.4.5
64
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
65
  * @copyright Copyright (c) 2010 - 2017, Kenneth Newman
66
  * @copyright Copyright (c) 2012, Kevin Newman
78
  /**#@+
79
  * @static
80
  */
81
+ const VERSION = '3.4.5';
82
  static $file = __FILE__;
83
  static $cm_themes = array( 'default', '3024-day', '3024-night', 'ambiance',
84
  'base16-dark', 'base16-light',