Simple Custom CSS and JS - Version 3.2

Version Description

  • 06/13/2017
  • Fix: compatibility issue with the HTML Editor Syntax Highlighter plugin
Download this release

Release Info

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

Code changes from version 2.10 to 3.2

custom-css-js.php CHANGED
@@ -3,11 +3,14 @@
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: 2.10
7
  * Author: Diana Burduja
8
  * Author URI: https://www.silkypress.com/
9
  * License: GPL2
10
  *
 
 
 
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -15,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
15
  }
16
 
17
  if ( ! class_exists( 'CustomCSSandJS' ) ) :
18
- define( 'CCJ_VERSION', '2.10' );
19
  /**
20
  * Main CustomCSSandJS Class
21
  *
@@ -50,14 +53,14 @@ final class CustomCSSandJS {
50
  * Cloning is forbidden.
51
  */
52
  public function __clone() {
53
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0' );
54
  }
55
 
56
  /**
57
  * Unserializing instances of this class is forbidden.
58
  */
59
  public function __wakeup() {
60
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0' );
61
  }
62
 
63
  /**
@@ -72,6 +75,8 @@ final class CustomCSSandJS {
72
  $this->upload_dir = $wp_upload_dir['basedir'] . '/custom-css-js';
73
  $this->upload_url = $wp_upload_dir['baseurl'] . '/custom-css-js';
74
  if ( is_admin() ) {
 
 
75
  include_once( 'includes/admin-screens.php' );
76
  include_once( 'includes/admin-addons.php' );
77
  include_once( 'includes/admin-warnings.php' );
@@ -190,45 +195,157 @@ final class CustomCSSandJS {
190
  */
191
  public function register_post_type() {
192
  $labels = array(
193
- 'name' => _x( 'Custom Code', 'post type general name'),
194
- 'singular_name' => _x( 'Custom Code', 'post type singular name'),
195
- 'menu_name' => _x( 'Custom CSS & JS', 'admin menu'),
196
- 'name_admin_bar' => _x( 'Custom Code', 'add new on admin bar'),
197
- 'add_new' => _x( 'Add Custom Code', 'add new'),
198
- 'add_new_item' => __( 'Add Custom Code'),
199
- 'new_item' => __( 'New Custom Code'),
200
- 'edit_item' => __( 'Edit Custom Code'),
201
- 'view_item' => __( 'View Custom Code'),
202
- 'all_items' => __( 'All Custom Code'),
203
- 'search_items' => __( 'Search Custom Code'),
204
- 'parent_item_colon' => __( 'Parent Custom Code:'),
205
- 'not_found' => __( 'No Custom Code found.'),
206
- 'not_found_in_trash' => __( 'No Custom Code found in Trash.')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  );
208
 
209
  $args = array(
210
- 'labels' => $labels,
211
- 'description' => __( 'Custom CSS and JS code' ),
212
- 'public' => false,
213
- 'publicly_queryable' => false,
214
- 'show_ui' => true,
215
- 'show_in_menu' => true,
216
- 'menu_position' => 100,
217
- 'menu_icon' => 'dashicons-plus-alt',
218
- 'query_var' => false,
219
- 'rewrite' => array( 'slug' => 'custom-css-js' ),
220
- 'capability_type' => 'post',
221
- 'has_archive' => true,
222
- 'hierarchical' => false,
223
- 'exclude_from_search' => true,
224
- 'menu_position' => null,
225
- 'can_export' => false,
226
- 'supports' => array( 'title' )
 
227
  );
228
 
229
  register_post_type( 'custom-css-js', $args );
230
  }
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  }
234
 
@@ -252,9 +369,11 @@ CustomCSSandJS();
252
  function custom_css_js_plugin_action_links( $links ) {
253
 
254
  $settings_link = '<a href="edit.php?post_type=custom-css-js">' .
255
- esc_html( __('Settings' ) ) . '</a>';
256
 
257
  return array_merge( array( $settings_link), $links );
258
 
259
  }
260
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'custom_css_js_plugin_action_links' );
 
 
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.2
7
  * Author: Diana Burduja
8
  * Author URI: https://www.silkypress.com/
9
  * License: GPL2
10
  *
11
+ * Text Domain: custom-css-js
12
+ * Domain Path: /languages/
13
+ *
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
18
  }
19
 
20
  if ( ! class_exists( 'CustomCSSandJS' ) ) :
21
+ define( 'CCJ_VERSION', '3.2' );
22
  /**
23
  * Main CustomCSSandJS Class
24
  *
53
  * Cloning is forbidden.
54
  */
55
  public function __clone() {
56
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'custom-css-js' ), '1.0' );
57
  }
58
 
59
  /**
60
  * Unserializing instances of this class is forbidden.
61
  */
62
  public function __wakeup() {
63
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'custom-css-js' ), '1.0' );
64
  }
65
 
66
  /**
75
  $this->upload_dir = $wp_upload_dir['basedir'] . '/custom-css-js';
76
  $this->upload_url = $wp_upload_dir['baseurl'] . '/custom-css-js';
77
  if ( is_admin() ) {
78
+ $this->load_plugin_textdomain();
79
+ add_action('admin_init', array($this, 'create_roles'));
80
  include_once( 'includes/admin-screens.php' );
81
  include_once( 'includes/admin-addons.php' );
82
  include_once( 'includes/admin-warnings.php' );
195
  */
196
  public function register_post_type() {
197
  $labels = array(
198
+ 'name' => _x( 'Custom Code', 'post type general name', 'custom-css-js'),
199
+ 'singular_name' => _x( 'Custom Code', 'post type singular name', 'custom-css-js'),
200
+ 'menu_name' => _x( 'Custom CSS & JS', 'admin menu', 'custom-css-js'),
201
+ 'name_admin_bar' => _x( 'Custom Code', 'add new on admin bar', 'custom-css-js'),
202
+ 'add_new' => _x( 'Add Custom Code', 'add new', 'custom-css-js'),
203
+ 'add_new_item' => __( 'Add Custom Code', 'custom-css-js'),
204
+ 'new_item' => __( 'New Custom Code', 'custom-css-js'),
205
+ 'edit_item' => __( 'Edit Custom Code', 'custom-css-js'),
206
+ 'view_item' => __( 'View Custom Code', 'custom-css-js'),
207
+ 'all_items' => __( 'All Custom Code', 'custom-css-js'),
208
+ 'search_items' => __( 'Search Custom Code', 'custom-css-js'),
209
+ 'parent_item_colon' => __( 'Parent Custom Code:', 'custom-css-js'),
210
+ 'not_found' => __( 'No Custom Code found.', 'custom-css-js'),
211
+ 'not_found_in_trash' => __( 'No Custom Code found in Trash.', 'custom-css-js')
212
+ );
213
+
214
+ $capability_type = 'custom_css';
215
+ $capabilities = array(
216
+ 'edit_post' => "edit_{$capability_type}",
217
+ 'read_post' => "read_{$capability_type}",
218
+ 'delete_post' => "delete_{$capability_type}",
219
+ 'edit_posts' => "edit_{$capability_type}s",
220
+ 'edit_others_posts' => "edit_others_{$capability_type}s",
221
+ 'publish_posts' => "publish_{$capability_type}s",
222
+ 'read' => "read",
223
+ 'delete_posts' => "delete_{$capability_type}s",
224
+ 'delete_published_posts' => "delete_published_{$capability_type}s",
225
+ 'delete_others_posts' => "delete_others_{$capability_type}s",
226
+ 'edit_published_posts' => "edit_published_{$capability_type}s",
227
+ 'create_posts' => "edit_{$capability_type}s",
228
  );
229
 
230
  $args = array(
231
+ 'labels' => $labels,
232
+ 'description' => __( 'Custom CSS and JS code', 'custom-css-js' ),
233
+ 'public' => false,
234
+ 'publicly_queryable' => false,
235
+ 'show_ui' => true,
236
+ 'show_in_menu' => true,
237
+ 'menu_position' => 100,
238
+ 'menu_icon' => 'dashicons-plus-alt',
239
+ 'query_var' => false,
240
+ 'rewrite' => array( 'slug' => 'custom-css-js' ),
241
+ 'capability_type' => $capability_type,
242
+ 'capabilities' => $capabilities,
243
+ 'has_archive' => true,
244
+ 'hierarchical' => false,
245
+ 'exclude_from_search' => true,
246
+ 'menu_position' => null,
247
+ 'can_export' => false,
248
+ 'supports' => array( 'title' )
249
  );
250
 
251
  register_post_type( 'custom-css-js', $args );
252
  }
253
 
254
+
255
+ /**
256
+ * Create roles and capabilities.
257
+ */
258
+ function create_roles() {
259
+ global $wp_roles;
260
+
261
+
262
+ if ( !current_user_can('update_plugins') )
263
+ return;
264
+
265
+ if ( ! class_exists( 'WP_Roles' ) ) {
266
+ return;
267
+ }
268
+
269
+ if ( ! isset( $wp_roles ) ) {
270
+ $wp_roles = new WP_Roles();
271
+ }
272
+
273
+ if ( isset($wp_roles->roles['css_js_designer']))
274
+ return;
275
+
276
+ // Add Web Designer role
277
+ add_role( 'css_js_designer', __( 'Web Designer', 'custom-css-js'), array(
278
+ 'level_9' => true,
279
+ 'level_8' => true,
280
+ 'level_7' => true,
281
+ 'level_6' => true,
282
+ 'level_5' => true,
283
+ 'level_4' => true,
284
+ 'level_3' => true,
285
+ 'level_2' => true,
286
+ 'level_1' => true,
287
+ 'level_0' => true,
288
+ 'read' => true,
289
+ 'read_private_pages' => true,
290
+ 'read_private_posts' => true,
291
+ 'edit_users' => true,
292
+ 'edit_posts' => true,
293
+ 'edit_pages' => true,
294
+ 'edit_published_posts' => true,
295
+ 'edit_published_pages' => true,
296
+ 'edit_private_pages' => true,
297
+ 'edit_private_posts' => true,
298
+ 'edit_others_posts' => true,
299
+ 'edit_others_pages' => true,
300
+ 'publish_posts' => true,
301
+ 'publish_pages' => true,
302
+ 'delete_posts' => true,
303
+ 'delete_pages' => true,
304
+ 'delete_private_pages' => true,
305
+ 'delete_private_posts' => true,
306
+ 'delete_published_pages' => true,
307
+ 'delete_published_posts' => true,
308
+ 'delete_others_posts' => true,
309
+ 'delete_others_pages' => true,
310
+ 'manage_categories' => true,
311
+ 'moderate_comments' => true,
312
+ 'unfiltered_html' => true,
313
+ 'upload_files' => true,
314
+ ) );
315
+
316
+ $capabilities = array();
317
+
318
+ $capability_types = array( 'custom_css' );
319
+
320
+ foreach ( $capability_types as $capability_type ) {
321
+
322
+ $capabilities[ $capability_type ] = array(
323
+ // Post type
324
+ "edit_{$capability_type}",
325
+ "read_{$capability_type}",
326
+ "delete_{$capability_type}",
327
+ "edit_{$capability_type}s",
328
+ "edit_others_{$capability_type}s",
329
+ "publish_{$capability_type}s",
330
+ "delete_{$capability_type}s",
331
+ "delete_published_{$capability_type}s",
332
+ "delete_others_{$capability_type}s",
333
+ "edit_published_{$capability_type}s",
334
+ );
335
+ }
336
+
337
+ foreach ( $capabilities as $cap_group ) {
338
+ foreach ( $cap_group as $cap ) {
339
+ $wp_roles->add_cap( 'css_js_designer', $cap );
340
+ $wp_roles->add_cap( 'administrator', $cap );
341
+ }
342
+ }
343
+ }
344
+
345
+
346
+ public function load_plugin_textdomain() {
347
+ load_plugin_textdomain( 'custom-css-js', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
348
+ }
349
 
350
  }
351
 
369
  function custom_css_js_plugin_action_links( $links ) {
370
 
371
  $settings_link = '<a href="edit.php?post_type=custom-css-js">' .
372
+ esc_html( __('Settings', 'custom-css-js' ) ) . '</a>';
373
 
374
  return array_merge( array( $settings_link), $links );
375
 
376
  }
377
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'custom_css_js_plugin_action_links' );
378
+
379
+
includes/admin-addons.php CHANGED
@@ -39,7 +39,7 @@ class CustomCSSandJS_Addons {
39
  ?>
40
  <div class="ccj_only_premium ccj_only_premium-first">
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">Available only in <br />Simple Custom CSS and JS Pro</a>
43
  </div>
44
  </div>
45
  <?php
@@ -51,9 +51,9 @@ class CustomCSSandJS_Addons {
51
  */
52
  function add_meta_boxes() {
53
 
54
- add_meta_box( 'previewdiv', __('Preview'), array( $this, 'previews_meta_box_callback' ), 'custom-css-js', 'normal' );
55
- add_meta_box( 'url-rules', __('Apply only on these URLs'), array( $this, 'url_rules_meta_box_callback' ), 'custom-css-js', 'normal' );
56
- add_meta_box( 'revisionsdiv', __('Code Revisions'), array( $this, 'revisions_meta_box_callback' ), 'custom-css-js', 'normal' );
57
  }
58
 
59
 
@@ -64,8 +64,8 @@ class CustomCSSandJS_Addons {
64
  ?>
65
  <div id="preview-action">
66
  <div>
67
- <input type="text" name="preview_url" id="ccj-preview_url" placeholder="Full URL on which to preview the changes ..." disabled="disabled" />
68
- <a class="preview button button-primary button-large" id="ccj-preview">Preview Changes</a>
69
  </div>
70
  </div>
71
  <?php
@@ -79,14 +79,14 @@ class CustomCSSandJS_Addons {
79
  function url_rules_meta_box_callback( $post ) {
80
 
81
  $filters = array(
82
- 'all' => __('All Website'),
83
- 'first-page' => __('First page'),
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
  );
91
  $filters_html = '';
92
  foreach( $filters as $_key => $_value ) {
@@ -97,10 +97,10 @@ class CustomCSSandJS_Addons {
97
 
98
  ?>
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'); ?>"></table>
101
- <?php _e('URL'); ?> <select id="wplnst-af-new-type"><?php echo $filters_html ?></select>&nbsp;
102
- <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter'); ?>" />&nbsp;
103
- <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php _e('Add'); ?>" /></td>
104
 
105
  <?php
106
  }
@@ -133,11 +133,11 @@ class CustomCSSandJS_Addons {
133
  ?>
134
  <table class="revisions">
135
  <thead><tr>
136
- <th class="revisions-compare">Compare</th>
137
- <th>Revision</th>
138
- <th>Author</th>
139
- <th><input type="checkbox" name="delete[]" value="all" id="ccj-delete-checkbox" /> Delete</th>
140
- <th>Restore</th>
141
  </tr></thead>
142
  <tbody>
143
  <?php foreach( $revisions as $revision ) : ?>
@@ -160,17 +160,17 @@ class CustomCSSandJS_Addons {
160
  <input type="checkbox" name="delete[]" value="<?php echo $revision['ID']; ?>" <?php echo $delete_disabled . $delete_tooltip; ?>/>
161
  </td>
162
  <td class="revisions-restore">
163
- <a href="<?php echo $restore_url; ?>"><?php _e('Restore'); ?></a>
164
  </td>
165
  </tr>
166
  <?php endforeach; ?>
167
  <tr>
168
  <td>
169
- <input type="button" class="button-secondary" value="<?php esc_attr_e('Compare'); ?>" id="revisions-compare-button" />
170
  </td>
171
  <td colspan="2"> &nbsp;</td>
172
  <td>
173
- <input type="button" class="button-secondary" value="<?php esc_attr_e('Delete'); ?>" id="revisions-delete-button" />
174
  </td>
175
  <td> &nbsp; </td>
176
  </tr>
39
  ?>
40
  <div class="ccj_only_premium ccj_only_premium-first">
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('Available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); ?></a>
43
  </div>
44
  </div>
45
  <?php
51
  */
52
  function add_meta_boxes() {
53
 
54
+ add_meta_box( 'previewdiv', __('Preview', 'custom-css-js'), array( $this, 'previews_meta_box_callback' ), 'custom-css-js', 'normal' );
55
+ add_meta_box( 'url-rules', __('Apply only on these URLs', 'custom-css-js'), array( $this, 'url_rules_meta_box_callback' ), 'custom-css-js', 'normal' );
56
+ add_meta_box( 'revisionsdiv', __('Code Revisions', 'custom-css-js'), array( $this, 'revisions_meta_box_callback' ), 'custom-css-js', 'normal' );
57
  }
58
 
59
 
64
  ?>
65
  <div id="preview-action">
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>
69
  </div>
70
  </div>
71
  <?php
79
  function url_rules_meta_box_callback( $post ) {
80
 
81
  $filters = array(
82
+ 'all' => __('All Website', 'custom-css-js'),
83
+ 'first-page' => __('First page', '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'),
90
  );
91
  $filters_html = '';
92
  foreach( $filters as $_key => $_value ) {
97
 
98
  ?>
99
  <input type="hidden" name="scan_anchor_filters" id="wplnst-scan-anchor-filters" value='<?php echo $applied_filters; ?>' />
100
+ <table id="wplnst-elist-anchor-filters" class="wplnst-elist" cellspacing="0" cellpadding="0" border="0" data-editable="true" data-label="<?php _e('URL', 'custom-css-js'); ?>"></table>
101
+ <?php _e('URL', 'custom-css-js'); ?> <select id="wplnst-af-new-type"><?php echo $filters_html ?></select>&nbsp;
102
+ <input id="wplnst-af-new" type="text" class="regular-text" value="" placeholder="<?php _e('Text filter', 'custom-css-js'); ?>" />&nbsp;
103
+ <input class="button button-primary" type="button" id="wplnst-af-new-add" value="<?php _e('Add', 'custom-css-js'); ?>" /></td>
104
 
105
  <?php
106
  }
133
  ?>
134
  <table class="revisions">
135
  <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>
141
  </tr></thead>
142
  <tbody>
143
  <?php foreach( $revisions as $revision ) : ?>
160
  <input type="checkbox" name="delete[]" value="<?php echo $revision['ID']; ?>" <?php echo $delete_disabled . $delete_tooltip; ?>/>
161
  </td>
162
  <td class="revisions-restore">
163
+ <a href="<?php echo $restore_url; ?>"><?php _e('Restore', 'custom-css-js'); ?></a>
164
  </td>
165
  </tr>
166
  <?php endforeach; ?>
167
  <tr>
168
  <td>
169
+ <input type="button" class="button-secondary" value="<?php esc_attr_e('Compare', 'custom-css-js'); ?>" id="revisions-compare-button" />
170
  </td>
171
  <td colspan="2"> &nbsp;</td>
172
  <td>
173
+ <input type="button" class="button-secondary" value="<?php esc_attr_e('Delete', 'custom-css-js'); ?>" id="revisions-delete-button" />
174
  </td>
175
  <td> &nbsp; </td>
176
  </tr>
includes/admin-notices.php CHANGED
@@ -44,7 +44,7 @@ class CustomCSSandJS_Notices {
44
 
45
  if ( !isset($screen->post_type) || $screen->post_type !== 'custom-css-js' )
46
  return;
47
-
48
  if ( ! $notice = $this->choose_notice() )
49
  return;
50
 
@@ -86,18 +86,18 @@ class CustomCSSandJS_Notices {
86
  $days_passed = ceil( ( $now - $this->activation_time ) / 86400 );
87
 
88
  switch ( $days_passed ) {
89
- case 1 : return '1_day';
90
- case 2 : return '2_day';
91
- case 3 : break; //return '3_day';
 
92
  case 4 : break;
93
  case 5 : break;
94
- case 6 : break;
95
- case 7 : break; // return '7_day';
96
  case 8 : break;
97
  case 9 : break;
98
  case 10 : break;
99
- case 11 : break;
100
- case 12 : break; //return '12_day';
101
  }
102
  }
103
 
@@ -122,7 +122,7 @@ class CustomCSSandJS_Notices {
122
  $link = 'https://www.silkypress.com/simple-custom-css-js-pro/?a=' . $this->convert_numbers_letters( $this->activation_time ) . '&utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner';
123
  }
124
 
125
- $lower_part = sprintf( '<div style="margin-top: 7px;"><a href="%s" target="_blank">%s</a> | <a href="#" class="dismiss_notice" target="_parent">%s</a></div>', $link, 'Get your discount now', 'Dismiss this notice' );
126
 
127
  switch ( $notice ) {
128
  case '1_day' :
44
 
45
  if ( !isset($screen->post_type) || $screen->post_type !== 'custom-css-js' )
46
  return;
47
+
48
  if ( ! $notice = $this->choose_notice() )
49
  return;
50
 
86
  $days_passed = ceil( ( $now - $this->activation_time ) / 86400 );
87
 
88
  switch ( $days_passed ) {
89
+ case 0 : return '1_day';
90
+ case 1 : return '2_day';
91
+ case 2 : break; //return '3_day';
92
+ case 3 : break;
93
  case 4 : break;
94
  case 5 : break;
95
+ case 6 : break; // return '7_day';
96
+ case 7 : break;
97
  case 8 : break;
98
  case 9 : break;
99
  case 10 : break;
100
+ case 11 : break; //return '12_day';
 
101
  }
102
  }
103
 
122
  $link = 'https://www.silkypress.com/simple-custom-css-js-pro/?a=' . $this->convert_numbers_letters( $this->activation_time ) . '&utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner';
123
  }
124
 
125
+ $lower_part = sprintf( '<div style="margin-top: 7px;"><a href="%s" target="_blank">%s</a> | <a href="#" class="dismiss_notice" target="_parent">%s</a></div>', $link, __('Get your discount now', 'custom-css-js'), __('Dismiss this notice', 'custom-css-js') );
126
 
127
  switch ( $notice ) {
128
  case '1_day' :
includes/admin-screens.php CHANGED
@@ -89,16 +89,17 @@ class CustomCSSandJS_Admin {
89
  $menu_slug = 'edit.php?post_type=custom-css-js';
90
  $submenu_slug = 'post-new.php?post_type=custom-css-js';
91
 
92
- $title = __('Add Custom CSS');
93
- add_submenu_page( $menu_slug, $title, $title, 'manage_options', $submenu_slug .'&language=css');
94
 
95
- $title = __('Add Custom JS');
96
- add_submenu_page( $menu_slug, $title, $title, 'manage_options', $submenu_slug . '&language=js');
97
 
98
- $title = __('Add Custom HTML');
99
- add_submenu_page( $menu_slug, $title, $title, 'manage_options', $submenu_slug . '&language=html');
 
 
 
100
 
101
- remove_submenu_page( $menu_slug, $submenu_slug);
102
  }
103
 
104
 
@@ -173,6 +174,7 @@ class CustomCSSandJS_Admin {
173
  'advanced-ads-code-highlighter/advanced-ads-code-highlighter.php',
174
  'wp-custom-backend-css/wp-custom-backend-css.php',
175
  'custom-css-whole-site-and-per-post/h5ab-custom-styling.php',
 
176
  );
177
 
178
  foreach( $conflicting_plugins as $_plugin ) {
@@ -185,7 +187,7 @@ class CustomCSSandJS_Admin {
185
  }
186
 
187
  public function add_meta_boxes() {
188
- add_meta_box('custom-code-options', __('Options'), array( $this, 'custom_code_options_meta_box_callback'), 'custom-css-js', 'side', 'low');
189
 
190
  remove_meta_box( 'slugdiv', 'custom-css-js', 'normal' );
191
  }
@@ -245,9 +247,9 @@ class CustomCSSandJS_Admin {
245
  }
246
  ?>
247
  <div class="updated buttons">
248
- <a href="post-new.php?post_type=custom-css-js&language=css" class="custom-btn custom-css-btn">Add CSS code</a>
249
- <a href="post-new.php?post_type=custom-css-js&language=js" class="custom-btn custom-js-btn">Add JS code</a>
250
- <a href="post-new.php?post_type=custom-css-js&language=html" class="custom-btn custom-js-btn">Add HTML code</a>
251
  <!-- a href="post-new.php?post_type=custom-css-js&language=php" class="custom-btn custom-php-btn">Add PHP code</a -->
252
  </div>
253
  <?php
@@ -260,13 +262,13 @@ class CustomCSSandJS_Admin {
260
  */
261
  function manage_custom_posts_columns( $columns ) {
262
  return array(
263
- 'cb' => '<input type="checkbox" />',
264
- 'active' => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="Active"></span>',
265
- 'type' => 'Type',
266
- 'title' => 'Title',
267
- 'author' => 'Author',
268
- 'date' => 'Date',
269
- 'modified' => 'Modified',
270
  );
271
  }
272
 
@@ -305,11 +307,13 @@ class CustomCSSandJS_Admin {
305
 
306
  if ( $column == 'active' ) {
307
  $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=ccj_active_code&code_id=' . $post_id ), 'ccj-active-code' );
308
- echo '<a href="' . esc_url( $url ) . '" title="'. __( 'Toggle active' ) . '">';
309
  if ( $this->is_active( $post_id ) ) {
310
- echo '<span class="dashicons dashicons-star-filled" title="The code is active. Click to inactivate it"></span>';
 
311
  } else {
312
- echo '<span class="dashicons dashicons-star-empty ccj_row" title="The code is inactive. Click to activate it"></span>';
 
313
  }
314
  echo '</a>';
315
 
@@ -359,10 +363,10 @@ class CustomCSSandJS_Admin {
359
  <script type="text/javascript">
360
  /* <![CDATA[ */
361
  jQuery(window).ready(function($){
362
- var h1 = 'Custom Code ';
363
- h1 += '<a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">Add CSS Code</a>';
364
- h1 += '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">Add JS Code</a>';
365
- h1 += '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">Add HTML Code</a>';
366
  $("#wpbody-content h1").html(h1);
367
  });
368
 
@@ -391,9 +395,9 @@ class CustomCSSandJS_Admin {
391
  $title = $action . ' ' . strtoupper( $language ) . ' code';
392
 
393
  if ( $action == 'Edit' ) {
394
- $title .= ' <a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">Add CSS Code</a> ';
395
- $title .= '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">Add JS Code</a>';
396
- $title .= '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">Add HTML Code</a>';
397
  }
398
 
399
  ?>
@@ -401,7 +405,7 @@ class CustomCSSandJS_Admin {
401
  /* <![CDATA[ */
402
  jQuery(window).ready(function($){
403
  $("#wpbody-content h1").html('<?php echo $title; ?>');
404
- $("#message.updated.notice").html('<p>Code updated</p>');
405
 
406
  var from_top = -$("#normal-sortables").height();
407
  if ( from_top != 0 ) {
@@ -432,6 +436,7 @@ class CustomCSSandJS_Admin {
432
  function remove_unallowed_metaboxes() {
433
  global $wp_meta_boxes;
434
 
 
435
  $allowed = array( 'submitdiv', 'custom-code-options' );
436
 
437
  $allowed = apply_filters( 'custom-css-js-meta-boxes', $allowed );
@@ -443,6 +448,19 @@ class CustomCSSandJS_Admin {
443
  }
444
  }
445
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  }
447
 
448
 
@@ -470,7 +488,7 @@ class CustomCSSandJS_Admin {
470
  switch ( $language ) {
471
  case 'js' :
472
  if ( $new_post ) {
473
- $post->post_content = '/* Add your JavaScript code here.
474
 
475
  If you are using the jQuery library, then don\'t forget to wrap your code inside jQuery.ready() as follows:
476
 
@@ -478,7 +496,7 @@ jQuery(document).ready(function( $ ){
478
  // Your code in here
479
  });
480
 
481
- End of comment */ ' . PHP_EOL . PHP_EOL;
482
  }
483
  $code_mirror_mode = 'text/javascript';
484
  $code_mirror_before = '<script type="text/javascript">';
@@ -486,7 +504,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
486
  break;
487
  case 'html' :
488
  if ( $new_post ) {
489
- $post->post_content = '<!-- Add HTML code to the header or the footer.
490
 
491
  For example, you can use the following code for loading the jQuery library from Google CDN:
492
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
@@ -494,7 +512,7 @@ For example, you can use the following code for loading the jQuery library from
494
  or the following one for loading the Bootstrap library from MaxCDN:
495
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
496
 
497
- -- End of the comment --> ' . PHP_EOL . PHP_EOL;
498
  }
499
  $code_mirror_mode = 'html';
500
  $code_mirror_before = '';
@@ -512,7 +530,7 @@ or the following one for loading the Bootstrap library from MaxCDN:
512
  break;
513
  default :
514
  if ( $new_post ) {
515
- $post->post_content = '/* Add your CSS code here.
516
 
517
  For example:
518
  .example {
@@ -521,7 +539,7 @@ For example:
521
 
522
  For brushing up on your CSS knowledge, check out http://www.w3schools.com/css/css_syntax.asp
523
 
524
- End of comment */ ' . PHP_EOL . PHP_EOL;
525
 
526
  }
527
  $code_mirror_mode = 'text/css';
@@ -534,7 +552,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
534
  <form style="position: relative; margin-top: .5em;">
535
 
536
  <div class="code-mirror-before"><div><?php echo htmlentities( $code_mirror_before );?></div></div>
537
- <textarea class="wp-editor-area" id="content" mode="<?php echo htmlentities($code_mirror_mode); ?>" name="content"><?php echo htmlentities($post->post_content); ?></textarea>
538
  <div class="code-mirror-after"><div><?php echo htmlentities( $code_mirror_after );?></div></div>
539
 
540
  <input type="hidden" id="update-post_<?php echo $post->ID ?>" value="<?php echo wp_create_nonce('update-post_'. $post->ID ); ?>" />
@@ -611,7 +629,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
611
 
612
  <div class="ccj_only_premium ccj_only_premium-right">
613
  <div>
614
- <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank">Available only in <br />Simple Custom CSS and JS Pro</a>
615
  </div>
616
  </div>
617
 
@@ -626,81 +644,81 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
626
  function get_options_meta() {
627
  $options = array(
628
  'linking' => array(
629
- 'title' => 'Linking type',
630
  'type' => 'radio',
631
  'default' => 'internal',
632
  'values' => array(
633
  'external' => array(
634
- 'title' => 'External File',
635
  'dashicon' => 'media-code',
636
  ),
637
  'internal' => array(
638
- 'title' => 'Internal',
639
  'dashicon' => 'editor-alignleft',
640
  ),
641
  ),
642
  ),
643
  'type' => array(
644
- 'title' => 'Where on page',
645
  'type' => 'radio',
646
  'default' => 'header',
647
  'values' => array(
648
  'header' => array(
649
- 'title' => 'Header',
650
  'dashicon' => 'arrow-up-alt2',
651
  ),
652
  'footer' => array(
653
- 'title' => 'Footer',
654
  'dashicon' => 'arrow-down-alt2',
655
  ),
656
  ),
657
  ),
658
  'side' => array(
659
- 'title' => 'Where in site',
660
  'type' => 'radio',
661
  'default' => 'frontend',
662
  'values' => array(
663
  'frontend' => array(
664
- 'title' => 'In Frontend',
665
  'dashicon' => 'tagcloud',
666
  ),
667
  'admin' => array(
668
- 'title' => 'In Admin',
669
  'dashicon' => 'id',
670
  ),
671
  ),
672
  ),
673
  'preprocessor' => array(
674
- 'title' => 'CSS Preprocessor',
675
  'type' => 'radio',
676
  'default' => 'none',
677
  'values' => array(
678
  'none' => array(
679
- 'title' => 'None',
680
  ),
681
  'less' => array(
682
- 'title' => 'Less',
683
  ),
684
  'sass' => array(
685
- 'title' => 'SASS (only SCSS syntax)',
686
  ),
687
  ),
688
  'disabled' => true,
689
  ),
690
  'minify' => array(
691
- 'title' => 'Minify the code',
692
  'type' => 'checkbox',
693
  'default' => false,
694
  'dashicon' => 'editor-contract',
695
  'disabled' => true,
696
  ),
697
  'priority' => array(
698
- 'title' => 'Priority',
699
  'type' => 'select',
700
  'default' => 5,
701
  'dashicon' => 'sort',
702
  'values' => array(
703
- 1 => '1 (highest)',
704
  2 => '2',
705
  3 => '3',
706
  4 => '4',
@@ -709,7 +727,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
709
  7 => '7',
710
  8 => '8',
711
  9 => '9',
712
- 10 => '10 (lowest)',
713
  ),
714
  'disabled' => true,
715
  ),
@@ -725,63 +743,63 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
725
  function get_options_meta_html() {
726
  $options = array(
727
  'type' => array(
728
- 'title' => 'Where on page',
729
  'type' => 'radio',
730
  'default' => 'header',
731
  'values' => array(
732
  'header' => array(
733
- 'title' => 'Header',
734
  'dashicon' => 'arrow-up-alt2',
735
  ),
736
  'footer' => array(
737
- 'title' => 'Footer',
738
  'dashicon' => 'arrow-down-alt2',
739
  ),
740
  ),
741
  ),
742
  'side' => array(
743
- 'title' => 'Where in site',
744
  'type' => 'radio',
745
  'default' => 'frontend',
746
  'values' => array(
747
  'frontend' => array(
748
- 'title' => 'In Frontend',
749
  'dashicon' => 'tagcloud',
750
  ),
751
  'admin' => array(
752
- 'title' => 'In Admin',
753
  'dashicon' => 'id',
754
  ),
755
  ),
756
  ),
757
  'linking' => array(
758
- 'title' => 'On which device',
759
  'type' => 'radio',
760
  'default' => 'both',
761
  'dashicon' => '',
762
  'values' => array(
763
  'desktop' => array(
764
- 'title' => 'Desktop',
765
  'dashicon' => 'desktop',
766
  ),
767
  'mobile' => array(
768
- 'title' => 'Mobile',
769
  'dashicon' => 'smartphone',
770
  ),
771
  'both' => array(
772
- 'title' => 'Both',
773
  'dashicon' => 'tablet',
774
  ),
775
  ),
776
  'disabled' => true,
777
  ),
778
  'priority' => array(
779
- 'title' => 'Priority',
780
  'type' => 'select',
781
  'default' => 5,
782
  'dashicon' => 'sort',
783
  'values' => array(
784
- 1 => '1 (highest)',
785
  2 => '2',
786
  3 => '3',
787
  4 => '4',
@@ -790,7 +808,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
790
  7 => '7',
791
  8 => '8',
792
  9 => '9',
793
- 10 => '10 (lowest)',
794
  ),
795
  'disabled' => true,
796
  ),
@@ -912,8 +930,8 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
912
  // Show a message if it couldn't create the dir
913
  if ( ! file_exists( $dir ) ) : ?>
914
  <div class="notice notice-error is-dismissible">
915
- <p>The <b>custom-css-js</b> directory could not be created</p>
916
- <p>Please run the following commands in order to make the directory: <br /><strong>mkdir <?php echo $dir; ?>; </strong><br /><strong>chmod 777 <?php echo $dir; ?>;</strong></p>
917
  </div>
918
  <?php return; endif;
919
 
@@ -921,8 +939,8 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
921
  // Show a message if the dir is not writable
922
  if ( ! wp_is_writable( $dir ) ) : ?>
923
  <div class="notice notice-error is-dismissible">
924
- <p>The <b><?php echo $dir; ?></b> directory is not writable, therefore the CSS and JS files cannot be saved.</p>
925
- <p>Please run the following command to make the directory writable:<br /><strong>chmod 777 <?php echo $dir; ?> </strong></p>
926
  </div>
927
  <?php return; endif;
928
 
89
  $menu_slug = 'edit.php?post_type=custom-css-js';
90
  $submenu_slug = 'post-new.php?post_type=custom-css-js';
91
 
92
+ remove_submenu_page( $menu_slug, $submenu_slug);
 
93
 
94
+ $title = __('Add Custom CSS', 'custom-css-js');
95
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug .'&language=css');
96
 
97
+ $title = __('Add Custom JS', 'custom-css-js');
98
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug . '&language=js');
99
+
100
+ $title = __('Add Custom HTML', 'custom-css-js');
101
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug . '&language=html');
102
 
 
103
  }
104
 
105
 
174
  'advanced-ads-code-highlighter/advanced-ads-code-highlighter.php',
175
  'wp-custom-backend-css/wp-custom-backend-css.php',
176
  'custom-css-whole-site-and-per-post/h5ab-custom-styling.php',
177
+ 'html-editor-syntax-highlighter/html-editor-syntax-highlighter.php',
178
  );
179
 
180
  foreach( $conflicting_plugins as $_plugin ) {
187
  }
188
 
189
  public function add_meta_boxes() {
190
+ add_meta_box('custom-code-options', __('Options', 'custom-css-js'), array( $this, 'custom_code_options_meta_box_callback'), 'custom-css-js', 'side', 'low');
191
 
192
  remove_meta_box( 'slugdiv', 'custom-css-js', 'normal' );
193
  }
247
  }
248
  ?>
249
  <div class="updated buttons">
250
+ <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>
251
+ <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>
252
+ <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>
253
  <!-- a href="post-new.php?post_type=custom-css-js&language=php" class="custom-btn custom-php-btn">Add PHP code</a -->
254
  </div>
255
  <?php
262
  */
263
  function manage_custom_posts_columns( $columns ) {
264
  return array(
265
+ 'cb' => '<input type="checkbox" />',
266
+ 'active' => '<span class="ccj-dashicons dashicons dashicons-star-empty" title="'.__('Active', 'custom-css-js') .'"></span>',
267
+ 'type' => __('Type', 'custom-css-js'),
268
+ 'title' => __('Title', 'custom-css-js'),
269
+ 'author' => __('Author', 'custom-css-js'),
270
+ 'date' => __('Date', 'custom-css-js'),
271
+ 'modified' => __('Modified', 'custom-css-js'),
272
  );
273
  }
274
 
307
 
308
  if ( $column == 'active' ) {
309
  $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=ccj_active_code&code_id=' . $post_id ), 'ccj-active-code' );
310
+ echo '<a href="' . esc_url( $url ) . '" title="'. __( 'Toggle active', 'custom-css-js' ) . '">';
311
  if ( $this->is_active( $post_id ) ) {
312
+ $active_title = __('The code is active. Click to deactivate it', 'custom-css-js');
313
+ echo '<span class="dashicons dashicons-star-filled" title="'.$active_title.'"></span>';
314
  } else {
315
+ $active_title = __('The code is inactive. Click to activate it', 'custom-css-js');
316
+ echo '<span class="dashicons dashicons-star-empty ccj_row" title="'.$active_title.'"></span>';
317
  }
318
  echo '</a>';
319
 
363
  <script type="text/javascript">
364
  /* <![CDATA[ */
365
  jQuery(window).ready(function($){
366
+ var h1 = '<?php _e('Custom Code', 'custom-css-js'); ?> ';
367
+ 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>';
368
+ 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>';
369
+ 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>';
370
  $("#wpbody-content h1").html(h1);
371
  });
372
 
395
  $title = $action . ' ' . strtoupper( $language ) . ' code';
396
 
397
  if ( $action == 'Edit' ) {
398
+ $title .= ' <a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">'.__('Add CSS Code', 'custom-css-js') .'</a> ';
399
+ $title .= '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">'.__('Add JS Code', 'custom-css-js') .'</a>';
400
+ $title .= '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">'.__('Add HTML Code', 'custom-css-js') .'</a>';
401
  }
402
 
403
  ?>
405
  /* <![CDATA[ */
406
  jQuery(window).ready(function($){
407
  $("#wpbody-content h1").html('<?php echo $title; ?>');
408
+ $("#message.updated.notice").html('<p><?php _e('Code updated', 'custom-css-js'); ?></p>');
409
 
410
  var from_top = -$("#normal-sortables").height();
411
  if ( from_top != 0 ) {
436
  function remove_unallowed_metaboxes() {
437
  global $wp_meta_boxes;
438
 
439
+ // Side boxes
440
  $allowed = array( 'submitdiv', 'custom-code-options' );
441
 
442
  $allowed = apply_filters( 'custom-css-js-meta-boxes', $allowed );
448
  }
449
  }
450
  }
451
+
452
+ // Normal boxes
453
+ $allowed = array( 'slugdiv', 'previewdiv', 'url-rules', 'revisionsdiv' );
454
+
455
+ $allowed = apply_filters( 'custom-css-js-meta-boxes-normal', $allowed );
456
+
457
+ foreach( $wp_meta_boxes['custom-css-js']['normal'] as $_priority => $_boxes ) {
458
+ foreach( $_boxes as $_key => $_value ) {
459
+ if ( ! in_array( $_key, $allowed ) ) {
460
+ unset( $wp_meta_boxes['custom-css-js']['normal'][$_priority][$_key] );
461
+ }
462
+ }
463
+ }
464
  }
465
 
466
 
488
  switch ( $language ) {
489
  case 'js' :
490
  if ( $new_post ) {
491
+ $post->post_content = __('/* Add your JavaScript code here.
492
 
493
  If you are using the jQuery library, then don\'t forget to wrap your code inside jQuery.ready() as follows:
494
 
496
  // Your code in here
497
  });
498
 
499
+ End of comment */ ', 'custom-css-js') . PHP_EOL . PHP_EOL;
500
  }
501
  $code_mirror_mode = 'text/javascript';
502
  $code_mirror_before = '<script type="text/javascript">';
504
  break;
505
  case 'html' :
506
  if ( $new_post ) {
507
+ $post->post_content = __('<!-- Add HTML code to the header or the footer.
508
 
509
  For example, you can use the following code for loading the jQuery library from Google CDN:
510
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
512
  or the following one for loading the Bootstrap library from MaxCDN:
513
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
514
 
515
+ -- End of the comment --> ', 'custom-css-js') . PHP_EOL . PHP_EOL;
516
  }
517
  $code_mirror_mode = 'html';
518
  $code_mirror_before = '';
530
  break;
531
  default :
532
  if ( $new_post ) {
533
+ $post->post_content = __('/* Add your CSS code here.
534
 
535
  For example:
536
  .example {
539
 
540
  For brushing up on your CSS knowledge, check out http://www.w3schools.com/css/css_syntax.asp
541
 
542
+ End of comment */ ', 'custom-css-js') . PHP_EOL . PHP_EOL;
543
 
544
  }
545
  $code_mirror_mode = 'text/css';
552
  <form style="position: relative; margin-top: .5em;">
553
 
554
  <div class="code-mirror-before"><div><?php echo htmlentities( $code_mirror_before );?></div></div>
555
+ <textarea class="wp-editor-area" id="content" mode="<?php echo htmlentities($code_mirror_mode); ?>" name="content"><?php echo $post->post_content; ?></textarea>
556
  <div class="code-mirror-after"><div><?php echo htmlentities( $code_mirror_after );?></div></div>
557
 
558
  <input type="hidden" id="update-post_<?php echo $post->ID ?>" value="<?php echo wp_create_nonce('update-post_'. $post->ID ); ?>" />
629
 
630
  <div class="ccj_only_premium ccj_only_premium-right">
631
  <div>
632
+ <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('Available only in <br />Simple Custom CSS and JS Pro', 'custom-css-js'); ?></a>
633
  </div>
634
  </div>
635
 
644
  function get_options_meta() {
645
  $options = array(
646
  'linking' => array(
647
+ 'title' => __('Linking type', 'custom-css-js'),
648
  'type' => 'radio',
649
  'default' => 'internal',
650
  'values' => array(
651
  'external' => array(
652
+ 'title' => __('External File', 'custom-css-js'),
653
  'dashicon' => 'media-code',
654
  ),
655
  'internal' => array(
656
+ 'title' => __('Internal', 'custom-css-js'),
657
  'dashicon' => 'editor-alignleft',
658
  ),
659
  ),
660
  ),
661
  'type' => array(
662
+ 'title' => __('Where on page', 'custom-css-js'),
663
  'type' => 'radio',
664
  'default' => 'header',
665
  'values' => array(
666
  'header' => array(
667
+ 'title' => __('Header', 'custom-css-js'),
668
  'dashicon' => 'arrow-up-alt2',
669
  ),
670
  'footer' => array(
671
+ 'title' => __('Footer', 'custom-css-js'),
672
  'dashicon' => 'arrow-down-alt2',
673
  ),
674
  ),
675
  ),
676
  'side' => array(
677
+ 'title' => __('Where in site', 'custom-css-js'),
678
  'type' => 'radio',
679
  'default' => 'frontend',
680
  'values' => array(
681
  'frontend' => array(
682
+ 'title' => __('In Frontend', 'custom-css-js'),
683
  'dashicon' => 'tagcloud',
684
  ),
685
  'admin' => array(
686
+ 'title' => __('In Admin', 'custom-css-js'),
687
  'dashicon' => 'id',
688
  ),
689
  ),
690
  ),
691
  'preprocessor' => array(
692
+ 'title' => __('CSS Preprocessor', 'custom-css-js'),
693
  'type' => 'radio',
694
  'default' => 'none',
695
  'values' => array(
696
  'none' => array(
697
+ 'title' => __('None', 'custom-css-js'),
698
  ),
699
  'less' => array(
700
+ 'title' => __('Less', 'custom-css-js'),
701
  ),
702
  'sass' => array(
703
+ 'title' => __('SASS (only SCSS syntax)', 'custom-css-js'),
704
  ),
705
  ),
706
  'disabled' => true,
707
  ),
708
  'minify' => array(
709
+ 'title' => __('Minify the code', 'custom-css-js'),
710
  'type' => 'checkbox',
711
  'default' => false,
712
  'dashicon' => 'editor-contract',
713
  'disabled' => true,
714
  ),
715
  'priority' => array(
716
+ 'title' => __('Priority', 'custom-css-js'),
717
  'type' => 'select',
718
  'default' => 5,
719
  'dashicon' => 'sort',
720
  'values' => array(
721
+ 1 => _x('1 (highest)', '1 is the highest priority', 'custom-css-js'),
722
  2 => '2',
723
  3 => '3',
724
  4 => '4',
727
  7 => '7',
728
  8 => '8',
729
  9 => '9',
730
+ 10 => _x('10 (lowest)', '10 is the lowest priority', 'custom-css-js'),
731
  ),
732
  'disabled' => true,
733
  ),
743
  function get_options_meta_html() {
744
  $options = array(
745
  'type' => array(
746
+ 'title' => __('Where on page', 'custom-css-js'),
747
  'type' => 'radio',
748
  'default' => 'header',
749
  'values' => array(
750
  'header' => array(
751
+ 'title' => __('Header', 'custom-css-js'),
752
  'dashicon' => 'arrow-up-alt2',
753
  ),
754
  'footer' => array(
755
+ 'title' => __('Footer', 'custom-css-js'),
756
  'dashicon' => 'arrow-down-alt2',
757
  ),
758
  ),
759
  ),
760
  'side' => array(
761
+ 'title' => __('Where in site', 'custom-css-js'),
762
  'type' => 'radio',
763
  'default' => 'frontend',
764
  'values' => array(
765
  'frontend' => array(
766
+ 'title' => __('In Frontend', 'custom-css-js'),
767
  'dashicon' => 'tagcloud',
768
  ),
769
  'admin' => array(
770
+ 'title' => __('In Admin', 'custom-css-js'),
771
  'dashicon' => 'id',
772
  ),
773
  ),
774
  ),
775
  'linking' => array(
776
+ 'title' => __('On which device', 'custom-css-js'),
777
  'type' => 'radio',
778
  'default' => 'both',
779
  'dashicon' => '',
780
  'values' => array(
781
  'desktop' => array(
782
+ 'title' => __('Desktop', 'custom-css-js'),
783
  'dashicon' => 'desktop',
784
  ),
785
  'mobile' => array(
786
+ 'title' => __('Mobile', 'custom-css-js'),
787
  'dashicon' => 'smartphone',
788
  ),
789
  'both' => array(
790
+ 'title' => __('Both', 'custom-css-js'),
791
  'dashicon' => 'tablet',
792
  ),
793
  ),
794
  'disabled' => true,
795
  ),
796
  'priority' => array(
797
+ 'title' => __('Priority', 'custom-css-js'),
798
  'type' => 'select',
799
  'default' => 5,
800
  'dashicon' => 'sort',
801
  'values' => array(
802
+ 1 => _x('1 (highest)', '1 is the highest priority', 'custom-css-js'),
803
  2 => '2',
804
  3 => '3',
805
  4 => '4',
808
  7 => '7',
809
  8 => '8',
810
  9 => '9',
811
+ 10 => _x('10 (lowest)', '10 is the lowest priority', 'custom-css-js'),
812
  ),
813
  'disabled' => true,
814
  ),
930
  // Show a message if it couldn't create the dir
931
  if ( ! file_exists( $dir ) ) : ?>
932
  <div class="notice notice-error is-dismissible">
933
+ <p><?php printf(__('The %s directory could not be created', 'custom-css-js'), '<b>custom-css-js</b>'); ?></p>
934
+ <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>
935
  </div>
936
  <?php return; endif;
937
 
939
  // Show a message if the dir is not writable
940
  if ( ! wp_is_writable( $dir ) ) : ?>
941
  <div class="notice notice-error is-dismissible">
942
+ <p><?php printf(__('The %s directory is not writable, therefore the CSS and JS files cannot be saved.', 'custom-css-js'), '<b>'.$dir.'</b>'); ?></p>
943
+ <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>
944
  </div>
945
  <?php return; endif;
946
 
includes/admin-warnings.php CHANGED
@@ -52,7 +52,7 @@ class CustomCSSandJS_Warnings {
52
  function check_qtranslate_notice() {
53
  $id = 'ccj_dismiss_qtranslate';
54
  $class = 'notice notice-warning is-dismissible';
55
- $message = __( 'Please remove the <b>custom-css-js</b> post type from the <b>qTranslate settings</b> in order to avoid some malfunctions in the Simple Custom CSS & JS plugin. Check out <a href="https://www.silkypress.com/wp-content/uploads/2016/08/ccj_qtranslate_compatibility.png" target="_blank">this screenshot</a> for more details on how to do that.' );
56
 
57
  printf( '<div class="%1$s" id="%2$s"><p>%3$s</p></div>', $class, $id, $message );
58
 
52
  function check_qtranslate_notice() {
53
  $id = 'ccj_dismiss_qtranslate';
54
  $class = 'notice notice-warning is-dismissible';
55
+ $message = sprintf(__( 'Please remove the <b>custom-css-js</b> post type from the <b>qTranslate settings</b> in order to avoid some malfunctions in the Simple Custom CSS & JS plugin. Check out <a href="%s" target="_blank">this screenshot</a> for more details on how to do that.', 'custom-css-js'), 'https://www.silkypress.com/wp-content/uploads/2016/08/ccj_qtranslate_compatibility.png' );
56
 
57
  printf( '<div class="%1$s" id="%2$s"><p>%3$s</p></div>', $class, $id, $message );
58
 
languages/custom-css-js.pot ADDED
@@ -0,0 +1,455 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2017 Simple Custom CSS and JS
2
+ # This file is distributed under the same license as the Simple Custom CSS and JS package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Simple Custom CSS and JS 3.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/custom-css-js-"
7
+ "svn\n"
8
+ "POT-Creation-Date: 2017-05-13 18:45:06+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+
16
+ #: custom-css-js.php:56 custom-css-js.php:63
17
+ msgid "Cheatin&#8217; huh?"
18
+ msgstr ""
19
+
20
+ #: custom-css-js.php:198
21
+ msgctxt "post type general name"
22
+ msgid "Custom Code"
23
+ msgstr ""
24
+
25
+ #: custom-css-js.php:199
26
+ msgctxt "post type singular name"
27
+ msgid "Custom Code"
28
+ msgstr ""
29
+
30
+ #: custom-css-js.php:200
31
+ msgctxt "admin menu"
32
+ msgid "Custom CSS & JS"
33
+ msgstr ""
34
+
35
+ #: custom-css-js.php:201
36
+ msgctxt "add new on admin bar"
37
+ msgid "Custom Code"
38
+ msgstr ""
39
+
40
+ #: custom-css-js.php:202
41
+ msgctxt "add new"
42
+ msgid "Add Custom Code"
43
+ msgstr ""
44
+
45
+ #: custom-css-js.php:203
46
+ msgid "Add Custom Code"
47
+ msgstr ""
48
+
49
+ #: custom-css-js.php:204
50
+ msgid "New Custom Code"
51
+ msgstr ""
52
+
53
+ #: custom-css-js.php:205
54
+ msgid "Edit Custom Code"
55
+ msgstr ""
56
+
57
+ #: custom-css-js.php:206
58
+ msgid "View Custom Code"
59
+ msgstr ""
60
+
61
+ #: custom-css-js.php:207
62
+ msgid "All Custom Code"
63
+ msgstr ""
64
+
65
+ #: custom-css-js.php:208
66
+ msgid "Search Custom Code"
67
+ msgstr ""
68
+
69
+ #: custom-css-js.php:209
70
+ msgid "Parent Custom Code:"
71
+ msgstr ""
72
+
73
+ #: custom-css-js.php:210
74
+ msgid "No Custom Code found."
75
+ msgstr ""
76
+
77
+ #: custom-css-js.php:211
78
+ msgid "No Custom Code found in Trash."
79
+ msgstr ""
80
+
81
+ #: custom-css-js.php:232
82
+ msgid "Custom CSS and JS code"
83
+ msgstr ""
84
+
85
+ #: custom-css-js.php:277
86
+ msgid "Web Designer"
87
+ msgstr ""
88
+
89
+ #: custom-css-js.php:372
90
+ msgid "Settings"
91
+ msgstr ""
92
+
93
+ #: includes/admin-addons.php:42 includes/admin-screens.php:631
94
+ msgid "Available only in <br />Simple Custom CSS and JS Pro"
95
+ msgstr ""
96
+
97
+ #: includes/admin-addons.php:54
98
+ msgid "Preview"
99
+ msgstr ""
100
+
101
+ #: includes/admin-addons.php:55
102
+ msgid "Apply only on these URLs"
103
+ msgstr ""
104
+
105
+ #: includes/admin-addons.php:56
106
+ msgid "Code Revisions"
107
+ msgstr ""
108
+
109
+ #: includes/admin-addons.php:67
110
+ msgid "Full URL on which to preview the changes ..."
111
+ msgstr ""
112
+
113
+ #: includes/admin-addons.php:68
114
+ msgid "Preview Changes"
115
+ msgstr ""
116
+
117
+ #: includes/admin-addons.php:82
118
+ msgid "All Website"
119
+ msgstr ""
120
+
121
+ #: includes/admin-addons.php:83
122
+ msgid "First page"
123
+ msgstr ""
124
+
125
+ #: includes/admin-addons.php:84
126
+ msgid "Contains"
127
+ msgstr ""
128
+
129
+ #: includes/admin-addons.php:85
130
+ msgid "Not contains"
131
+ msgstr ""
132
+
133
+ #: includes/admin-addons.php:86
134
+ msgid "Is equal to"
135
+ msgstr ""
136
+
137
+ #: includes/admin-addons.php:87
138
+ msgid "Not equal to"
139
+ msgstr ""
140
+
141
+ #: includes/admin-addons.php:88
142
+ msgid "Starts with"
143
+ msgstr ""
144
+
145
+ #: includes/admin-addons.php:89
146
+ msgid "Ends by"
147
+ msgstr ""
148
+
149
+ #: includes/admin-addons.php:100 includes/admin-addons.php:101
150
+ msgid "URL"
151
+ msgstr ""
152
+
153
+ #: includes/admin-addons.php:102
154
+ msgid "Text filter"
155
+ msgstr ""
156
+
157
+ #: includes/admin-addons.php:103
158
+ msgid "Add"
159
+ msgstr ""
160
+
161
+ #: includes/admin-addons.php:114
162
+ msgctxt "revision date format"
163
+ msgid "F j, Y @ H:i:s"
164
+ msgstr ""
165
+
166
+ #: includes/admin-addons.php:136 includes/admin-addons.php:169
167
+ msgid "Compare"
168
+ msgstr ""
169
+
170
+ #: includes/admin-addons.php:137
171
+ msgid "Revision"
172
+ msgstr ""
173
+
174
+ #: includes/admin-addons.php:138 includes/admin-screens.php:268
175
+ msgid "Author"
176
+ msgstr ""
177
+
178
+ #: includes/admin-addons.php:139 includes/admin-addons.php:173
179
+ msgid "Delete"
180
+ msgstr ""
181
+
182
+ #: includes/admin-addons.php:140 includes/admin-addons.php:163
183
+ msgid "Restore"
184
+ msgstr ""
185
+
186
+ #: includes/admin-notices.php:125
187
+ msgid "Get your discount now"
188
+ msgstr ""
189
+
190
+ #: includes/admin-notices.php:125 includes/admin-notices.php:190
191
+ msgid "Dismiss this notice"
192
+ msgstr ""
193
+
194
+ #: includes/admin-screens.php:94
195
+ msgid "Add Custom CSS"
196
+ msgstr ""
197
+
198
+ #: includes/admin-screens.php:97
199
+ msgid "Add Custom JS"
200
+ msgstr ""
201
+
202
+ #: includes/admin-screens.php:100
203
+ msgid "Add Custom HTML"
204
+ msgstr ""
205
+
206
+ #: includes/admin-screens.php:189
207
+ msgid "Options"
208
+ msgstr ""
209
+
210
+ #: includes/admin-screens.php:249
211
+ msgid "Add CSS code"
212
+ msgstr ""
213
+
214
+ #: includes/admin-screens.php:250
215
+ msgid "Add JS code"
216
+ msgstr ""
217
+
218
+ #: includes/admin-screens.php:251
219
+ msgid "Add HTML code"
220
+ msgstr ""
221
+
222
+ #: includes/admin-screens.php:265
223
+ msgid "Active"
224
+ msgstr ""
225
+
226
+ #: includes/admin-screens.php:266
227
+ msgid "Type"
228
+ msgstr ""
229
+
230
+ #: includes/admin-screens.php:267
231
+ msgid "Title"
232
+ msgstr ""
233
+
234
+ #: includes/admin-screens.php:269
235
+ msgid "Date"
236
+ msgstr ""
237
+
238
+ #: includes/admin-screens.php:270
239
+ msgid "Modified"
240
+ msgstr ""
241
+
242
+ #: includes/admin-screens.php:299
243
+ msgid "%s ago"
244
+ msgstr ""
245
+
246
+ #: includes/admin-screens.php:301
247
+ msgid "Y/m/d"
248
+ msgstr ""
249
+
250
+ #: includes/admin-screens.php:309
251
+ msgid "Toggle active"
252
+ msgstr ""
253
+
254
+ #: includes/admin-screens.php:311
255
+ msgid "The code is active. Click to deactivate it"
256
+ msgstr ""
257
+
258
+ #: includes/admin-screens.php:314
259
+ msgid "The code is inactive. Click to activate it"
260
+ msgstr ""
261
+
262
+ #: includes/admin-screens.php:365
263
+ msgid "Custom Code"
264
+ msgstr ""
265
+
266
+ #: includes/admin-screens.php:366 includes/admin-screens.php:397
267
+ msgid "Add CSS Code"
268
+ msgstr ""
269
+
270
+ #: includes/admin-screens.php:367 includes/admin-screens.php:398
271
+ msgid "Add JS Code"
272
+ msgstr ""
273
+
274
+ #: includes/admin-screens.php:368 includes/admin-screens.php:399
275
+ msgid "Add HTML Code"
276
+ msgstr ""
277
+
278
+ #: includes/admin-screens.php:407
279
+ msgid "Code updated"
280
+ msgstr ""
281
+
282
+ #: includes/admin-screens.php:490
283
+ msgid ""
284
+ "/* Add your JavaScript code here.\n"
285
+ " \n"
286
+ "If you are using the jQuery library, then don't forget to wrap your code "
287
+ "inside jQuery.ready() as follows:\n"
288
+ "\n"
289
+ "jQuery(document).ready(function( $ ){\n"
290
+ " // Your code in here \n"
291
+ "});\n"
292
+ "\n"
293
+ "End of comment */ "
294
+ msgstr ""
295
+
296
+ #: includes/admin-screens.php:506
297
+ msgid ""
298
+ "<!-- Add HTML code to the header or the footer. \n"
299
+ "\n"
300
+ "For example, you can use the following code for loading the jQuery library "
301
+ "from Google CDN:\n"
302
+ "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min."
303
+ "js\"></script>\n"
304
+ "\n"
305
+ "or the following one for loading the Bootstrap library from MaxCDN:\n"
306
+ "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/"
307
+ "bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-"
308
+ "BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" "
309
+ "crossorigin=\"anonymous\">\n"
310
+ "\n"
311
+ "-- End of the comment --> "
312
+ msgstr ""
313
+
314
+ #: includes/admin-screens.php:532
315
+ msgid ""
316
+ "/* Add your CSS code here.\n"
317
+ " \n"
318
+ "For example:\n"
319
+ ".example {\n"
320
+ " color: red;\n"
321
+ "}\n"
322
+ "\n"
323
+ "For brushing up on your CSS knowledge, check out http://www.w3schools.com/"
324
+ "css/css_syntax.asp\n"
325
+ "\n"
326
+ "End of comment */ "
327
+ msgstr ""
328
+
329
+ #: includes/admin-screens.php:646
330
+ msgid "Linking type"
331
+ msgstr ""
332
+
333
+ #: includes/admin-screens.php:651
334
+ msgid "External File"
335
+ msgstr ""
336
+
337
+ #: includes/admin-screens.php:655
338
+ msgid "Internal"
339
+ msgstr ""
340
+
341
+ #: includes/admin-screens.php:661 includes/admin-screens.php:745
342
+ msgid "Where on page"
343
+ msgstr ""
344
+
345
+ #: includes/admin-screens.php:666 includes/admin-screens.php:750
346
+ msgid "Header"
347
+ msgstr ""
348
+
349
+ #: includes/admin-screens.php:670 includes/admin-screens.php:754
350
+ msgid "Footer"
351
+ msgstr ""
352
+
353
+ #: includes/admin-screens.php:676 includes/admin-screens.php:760
354
+ msgid "Where in site"
355
+ msgstr ""
356
+
357
+ #: includes/admin-screens.php:681 includes/admin-screens.php:765
358
+ msgid "In Frontend"
359
+ msgstr ""
360
+
361
+ #: includes/admin-screens.php:685 includes/admin-screens.php:769
362
+ msgid "In Admin"
363
+ msgstr ""
364
+
365
+ #: includes/admin-screens.php:691
366
+ msgid "CSS Preprocessor"
367
+ msgstr ""
368
+
369
+ #: includes/admin-screens.php:696
370
+ msgid "None"
371
+ msgstr ""
372
+
373
+ #: includes/admin-screens.php:699
374
+ msgid "Less"
375
+ msgstr ""
376
+
377
+ #: includes/admin-screens.php:702
378
+ msgid "SASS (only SCSS syntax)"
379
+ msgstr ""
380
+
381
+ #: includes/admin-screens.php:708
382
+ msgid "Minify the code"
383
+ msgstr ""
384
+
385
+ #: includes/admin-screens.php:715 includes/admin-screens.php:796
386
+ msgid "Priority"
387
+ msgstr ""
388
+
389
+ #: includes/admin-screens.php:720 includes/admin-screens.php:801
390
+ msgctxt "1 is the highest priority"
391
+ msgid "1 (highest)"
392
+ msgstr ""
393
+
394
+ #: includes/admin-screens.php:729 includes/admin-screens.php:810
395
+ msgctxt "10 is the lowest priority"
396
+ msgid "10 (lowest)"
397
+ msgstr ""
398
+
399
+ #: includes/admin-screens.php:775
400
+ msgid "On which device"
401
+ msgstr ""
402
+
403
+ #: includes/admin-screens.php:781
404
+ msgid "Desktop"
405
+ msgstr ""
406
+
407
+ #: includes/admin-screens.php:785
408
+ msgid "Mobile"
409
+ msgstr ""
410
+
411
+ #: includes/admin-screens.php:789
412
+ msgid "Both"
413
+ msgstr ""
414
+
415
+ #: includes/admin-screens.php:932
416
+ msgid "The %s directory could not be created"
417
+ msgstr ""
418
+
419
+ #: includes/admin-screens.php:933
420
+ msgid "Please run the following commands in order to make the directory"
421
+ msgstr ""
422
+
423
+ #: includes/admin-screens.php:941
424
+ msgid ""
425
+ "The %s directory is not writable, therefore the CSS and JS files cannot be "
426
+ "saved."
427
+ msgstr ""
428
+
429
+ #: includes/admin-screens.php:942
430
+ msgid "Please run the following command to make the directory writable"
431
+ msgstr ""
432
+
433
+ #: includes/admin-warnings.php:55
434
+ msgid ""
435
+ "Please remove the <b>custom-css-js</b> post type from the <b>qTranslate "
436
+ "settings</b> in order to avoid some malfunctions in the Simple Custom CSS & "
437
+ "JS plugin. Check out <a href=\"%s\" target=\"_blank\">this screenshot</a> "
438
+ "for more details on how to do that."
439
+ msgstr ""
440
+
441
+ #. Plugin URI of the plugin/theme
442
+ msgid "https://wordpress.org/plugins/custom-css-js/"
443
+ msgstr ""
444
+
445
+ #. Description of the plugin/theme
446
+ msgid "Easily add Custom CSS or JS to your website with an awesome editor."
447
+ msgstr ""
448
+
449
+ #. Author of the plugin/theme
450
+ msgid "Diana Burduja"
451
+ msgstr ""
452
+
453
+ #. Author URI of the plugin/theme
454
+ msgid "https://www.silkypress.com/"
455
+ msgstr ""
readme.txt CHANGED
@@ -5,8 +5,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=diana
5
  Email: diana@burduja.eu
6
  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
7
  Requires at least: 3.0.1
8
- Tested up to: 4.7
9
- Stable tag: 2.10
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
@@ -24,46 +24,6 @@ Customize your WordPress site's appearance by easily adding custom CSS and JS co
24
  * Add as many codes as you want
25
  * Keep your changes also when you change the theme
26
 
27
- = Frequently Asked Questions =
28
-
29
- * **What if I want to add multiple external CSS codes?**
30
- If you write multiple codes of the same type (for example: two external CSS codes), then all of them will be printed one after another
31
-
32
- * **Will this plugin affect the loading time?**
33
- When you click the `Save` button the codes will be cached in files, so there are no tedious database queries.
34
-
35
- * **Does the plugin modify the code I write in the editor?**
36
- No, the code is printed exactly as in the editor. It is not modified/checked/validated in any way. You take the full responsability for what is written in there.
37
-
38
- * **My code doesn't show on the website**
39
- Try one of the following:
40
- 1. If you are using any caching plugin (like "W3 Total Cache" or "WP Fastest Cache"), then don't forget to delete the cache before seing the code printed on the website.
41
- 2. Make sure the code is in **Published** state (not **Draft** or **in Trash**).
42
- 3. Check if the `wp-content/uploads/custom-css-js` folder exists and is writable
43
-
44
- * **Does it work with a Multisite Network?**
45
- Yes.
46
-
47
- * **What if I change the theme?**
48
- The CSS and JS are independent of the theme and they will persist through a theme change. This is particularly useful if you apply CSS and JS for modifying a plugin's output.
49
-
50
- * **Can I use a CSS preprocesor like LESS or Sass?**
51
- For the moment only plain CSS is supported, but you can check out the [Pro version](https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner) in case you need a CSS preprocessor.
52
-
53
- * **Can I upload images for use with my CSS?**
54
- Yes. You can upload an image to your Media Library, then refer to it by its direct URL from within the CSS stylesheet. For example:
55
- `div#content {
56
- background-image: url('http://example.com/wp-content/uploads/2015/12/image.jpg');
57
- }`
58
-
59
- * **Can I use CSS rules like @import and @font-face?**
60
- Yes.
61
-
62
- * **CSS Help.**
63
- If you are just starting with CSS, then here you'll find some resources:
64
- * [codecademy.com - Learn HTML & CSS](https://www.codecademy.com/learn/web)
65
- * [Wordpress.org - Finding Your CSS Styles](https://codex.wordpress.org/Finding_Your_CSS_Styles)
66
-
67
  == Installation ==
68
 
69
  * From the WP admin panel, click "Plugins" -> "Add new".
@@ -93,16 +53,54 @@ OR...
93
  = Requirements =
94
  PHP >= 5.3
95
 
96
- = Browser requirements =
97
  * Firefox - version 4 and up
98
  * Chrome - any version
99
  * Safari - version 5.2 and up
100
  * Internet Explorer - version 8 and up
101
  * Opera - version 9 and up
102
 
103
- = Small incompatibilities =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  * If the [qTranslate X](https://wordpress.org/plugins/qtranslate-x/) plugin is adding some `[:]` or `[:en]` characters to your code, then you need to remove the `custom-css-js` post type from the qTranslate settings. Check out [this screenshot](https://www.silkypress.com/wp-content/uploads/2016/08/ccj_qtranslate_compatibility.png) on how to do that.
105
 
 
 
106
  == Screenshots ==
107
 
108
  1. Manage Custom Codes
@@ -115,8 +113,21 @@ $. Add/Edit HTML
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  = 2.10 =
119
- * 02/05/2016
120
  * Feature: circumvent external file caching by adding a GET parameter
121
  * Add special offer for Simple Custom CSS and JS pro
122
 
5
  Email: diana@burduja.eu
6
  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
7
  Requires at least: 3.0.1
8
+ Tested up to: 4.8
9
+ Stable tag: 3.2
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
24
  * Add as many codes as you want
25
  * Keep your changes also when you change the theme
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  == Installation ==
28
 
29
  * From the WP admin panel, click "Plugins" -> "Add new".
53
  = Requirements =
54
  PHP >= 5.3
55
 
56
+ **Browser requirements**
57
  * Firefox - version 4 and up
58
  * Chrome - any version
59
  * Safari - version 5.2 and up
60
  * Internet Explorer - version 8 and up
61
  * Opera - version 9 and up
62
 
63
+ = What if I want to add multiple external CSS codes? =
64
+ If you write multiple codes of the same type (for example: two external CSS codes), then all of them will be printed one after another
65
+
66
+ = Will this plugin affect the loading time? =
67
+ When you click the `Save` button the codes will be cached in files, so there are no tedious database queries.
68
+
69
+ = Does the plugin modify the code I write in the editor? =
70
+ No, the code is printed exactly as in the editor. It is not modified/checked/validated in any way. You take the full responsability for what is written in there.
71
+
72
+ = My code doesn't show on the website =
73
+ Try one of the following:
74
+ 1. If you are using any caching plugin (like "W3 Total Cache" or "WP Fastest Cache"), then don't forget to delete the cache before seing the code printed on the website.
75
+ 2. Make sure the code is in **Published** state (not **Draft** or **in Trash**).
76
+ 3. Check if the `wp-content/uploads/custom-css-js` folder exists and is writable
77
+
78
+ = Does it work with a Multisite Network? =
79
+ Yes.
80
+
81
+ = What if I change the theme? =
82
+ The CSS and JS are independent of the theme and they will persist through a theme change. This is particularly useful if you apply CSS and JS for modifying a plugin's output.
83
+
84
+ = Can I use a CSS preprocesor like LESS or Sass? =
85
+ For the moment only plain CSS is supported, but you can check out the [Pro version](https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner) in case you need a CSS preprocessor.
86
+
87
+ = Can I upload images for use with my CSS? =
88
+ Yes. You can upload an image to your Media Library, then refer to it by its direct URL from within the CSS stylesheet. For example:
89
+ `div#content {
90
+ background-image: url('http://example.com/wp-content/uploads/2015/12/image.jpg');
91
+ }`
92
+
93
+ = Can I use CSS rules like @import and @font-face? =
94
+ Yes.
95
+
96
+ = Who can publish/edit/delete Custom Codes? =
97
+ By default only the Administrator will be able to publish/edit/delete Custom Codes. Check out [this article](https://www.silkypress.com/simple_custom_css_js/user-capabilities-simple-custom-css-js-plugin/) for more details on roles and user capabilities customizations.
98
+
99
+ = Compatibility with qTranslate X plugin =
100
  * If the [qTranslate X](https://wordpress.org/plugins/qtranslate-x/) plugin is adding some `[:]` or `[:en]` characters to your code, then you need to remove the `custom-css-js` post type from the qTranslate settings. Check out [this screenshot](https://www.silkypress.com/wp-content/uploads/2016/08/ccj_qtranslate_compatibility.png) on how to do that.
101
 
102
+
103
+
104
  == Screenshots ==
105
 
106
  1. Manage Custom Codes
113
 
114
  == Changelog ==
115
 
116
+ = 3.2 =
117
+ * 06/13/2017
118
+ * Fix: compatibility issue with the HTML Editor Syntax Highlighter plugin
119
+
120
+ = 3.1 =
121
+ * 05/14/2017
122
+ * Feature: prepare the plugin for translation
123
+
124
+ = 3.0 =
125
+ * 04/12/2017
126
+ * Feature: create the Web Designer role
127
+ * Feature: allow Custom Codes to be managed only by users with the right capabilities
128
+
129
  = 2.10 =
130
+ * 02/05/2017
131
  * Feature: circumvent external file caching by adding a GET parameter
132
  * Add special offer for Simple Custom CSS and JS pro
133
 
screenshot-1.jpg DELETED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-3.jpg DELETED
Binary file
screenshot-4.jpg DELETED
Binary file