Simple Custom CSS and JS - Version 3.6

Version Description

  • 09/07/2017
  • Fix: compatibility with the CSS Plus plugin
Download this release

Release Info

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

Code changes from version 2.10 to 3.6

assets/ccj_admin.js CHANGED
@@ -56,5 +56,53 @@ jQuery(document).ready( function($) {
56
  });
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  });
60
 
56
  });
57
  }
58
 
59
+ // Activate/deactivate codes with AJAX
60
+ $(".ccj_activate_deactivate").click( function(e) {
61
+ var url = $(this).attr('href');
62
+ var code_id = $(this).attr('data-code-id');
63
+ e.preventDefault();
64
+ $.ajax({
65
+ url: url,
66
+ success: function(data){
67
+ if (data === 'yes') {
68
+ ccj_activate_deactivate(code_id, false);
69
+ }
70
+ if (data === 'no') {
71
+ ccj_activate_deactivate(code_id, true);
72
+ }
73
+ }
74
+ });
75
+ });
76
+
77
+ // Toggle the signs for activating/deactivating codes
78
+ function ccj_activate_deactivate(code_id, action) {
79
+ var row = $('tr#post-'+code_id);
80
+ if ( action === true ) {
81
+ row.css('opacity', '1');
82
+ row.find('.row-actions .ccj_activate_deactivate')
83
+ .text(CCJ.deactivate)
84
+ .attr('title', CCJ.active_title);
85
+ row.find('td.active .dashicons')
86
+ .removeClass('dashicons-star-empty')
87
+ .addClass('dashicons-star-filled');
88
+ row.find('td.active .ccj_activate_deactivate')
89
+ .attr('title', CCJ.active_title);
90
+ $('#activate-action span').text(CCJ.active);
91
+ $('#activate-action .ccj_activate_deactivate').text(CCJ.deactivate);
92
+ } else {
93
+ row.css('opacity', '0.4');
94
+ row.find('.row-actions .ccj_activate_deactivate')
95
+ .text(CCJ.activate)
96
+ .attr('title', CCJ.deactive_title);
97
+ row.find('td.active .dashicons')
98
+ .removeClass('dashicons-star-filled')
99
+ .addClass('dashicons-star-empty');
100
+ row.find('td.active .ccj_activate_deactivate')
101
+ .attr('title', CCJ.deactive_title);
102
+ $('#activate-action span').text(CCJ.inactive);
103
+ $('#activate-action .ccj_activate_deactivate').text(CCJ.activate);
104
+ }
105
+ }
106
+
107
  });
108
 
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,19 +18,14 @@ if ( ! defined( 'ABSPATH' ) ) {
15
  }
16
 
17
  if ( ! class_exists( 'CustomCSSandJS' ) ) :
18
- define( 'CCJ_VERSION', '2.10' );
19
  /**
20
  * Main CustomCSSandJS Class
21
  *
22
  * @class CustomCSSandJS
23
  */
24
  final class CustomCSSandJS {
25
- public $plugins_url = '';
26
- public $plugin_dir_path = '';
27
- public $plugin_file = __FILE__;
28
  public $search_tree = false;
29
- public $upload_dir = '';
30
- public $upload_url = '';
31
  protected static $_instance = null;
32
 
33
 
@@ -50,14 +48,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
  /**
@@ -66,17 +64,16 @@ final class CustomCSSandJS {
66
  */
67
  public function __construct() {
68
  add_action( 'init', array( $this, 'register_post_type' ) );
69
- $this->plugins_url = plugins_url( '/', __FILE__ );
70
- $this->plugin_dir_path = plugin_dir_path( __FILE__ );
71
- $wp_upload_dir = wp_upload_dir();
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' );
78
  include_once( 'includes/admin-notices.php' );
79
- }
80
 
81
  $this->search_tree = get_option( 'custom-css-js-tree' );
82
 
@@ -98,6 +95,9 @@ final class CustomCSSandJS {
98
  if ( strpos( $_key, 'admin' ) !== false ) {
99
  $action = 'admin_';
100
  }
 
 
 
101
  if ( strpos( $_key, 'header' ) !== false ) {
102
  $action .= 'head';
103
  } else {
@@ -145,7 +145,7 @@ final class CustomCSSandJS {
145
 
146
  foreach( $args as $_post_id ) {
147
  if ( strstr( $_post_id, 'css' ) || strstr( $_post_id, 'js' ) ) {
148
- @include_once( $this->upload_dir . '/' . $_post_id );
149
  } else {
150
  $post = get_post( $_post_id );
151
  echo $before . $post->post_content . $after;
@@ -162,14 +162,14 @@ final class CustomCSSandJS {
162
 
163
  if ( strpos( $function, 'js' ) !== false ) {
164
  foreach( $args as $_filename ) {
165
- echo PHP_EOL . "<script type='text/javascript' src='".$this->upload_url . '/' . $_filename."'></script>" . PHP_EOL;
166
  }
167
  }
168
 
169
  if ( strpos( $function, 'css' ) !== false ) {
170
  foreach( $args as $_filename ) {
171
  $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
172
- echo PHP_EOL . "<link rel='stylesheet' id='".$shortfilename ."-css' href='".$this->upload_url . '/' . $_filename ."' type='text/css' media='all' />" . PHP_EOL;
173
  }
174
  }
175
  }
@@ -185,50 +185,182 @@ final class CustomCSSandJS {
185
  }
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  /**
189
  * Create the custom-css-js post type
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 +384,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.6
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
  /**
22
  * Main CustomCSSandJS Class
23
  *
24
  * @class CustomCSSandJS
25
  */
26
  final class CustomCSSandJS {
27
+
 
 
28
  public $search_tree = false;
 
 
29
  protected static $_instance = null;
30
 
31
 
48
  * Cloning is forbidden.
49
  */
50
  public function __clone() {
51
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'custom-css-js' ), '1.0' );
52
  }
53
 
54
  /**
55
  * Unserializing instances of this class is forbidden.
56
  */
57
  public function __wakeup() {
58
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'custom-css-js' ), '1.0' );
59
  }
60
 
61
  /**
64
  */
65
  public function __construct() {
66
  add_action( 'init', array( $this, 'register_post_type' ) );
67
+ $this->set_constants();
68
+
69
+ if ( is_admin() ) {
70
+ $this->load_plugin_textdomain();
71
+ add_action('admin_init', array($this, 'create_roles'));
 
72
  include_once( 'includes/admin-screens.php' );
73
  include_once( 'includes/admin-addons.php' );
74
  include_once( 'includes/admin-warnings.php' );
75
  include_once( 'includes/admin-notices.php' );
76
+ }
77
 
78
  $this->search_tree = get_option( 'custom-css-js-tree' );
79
 
95
  if ( strpos( $_key, 'admin' ) !== false ) {
96
  $action = 'admin_';
97
  }
98
+ if ( strpos( $_key, 'login' ) !== false ) {
99
+ $action = 'login_';
100
+ }
101
  if ( strpos( $_key, 'header' ) !== false ) {
102
  $action .= 'head';
103
  } else {
145
 
146
  foreach( $args as $_post_id ) {
147
  if ( strstr( $_post_id, 'css' ) || strstr( $_post_id, 'js' ) ) {
148
+ @include_once( CCJ_UPLOAD_DIR . '/' . $_post_id );
149
  } else {
150
  $post = get_post( $_post_id );
151
  echo $before . $post->post_content . $after;
162
 
163
  if ( strpos( $function, 'js' ) !== false ) {
164
  foreach( $args as $_filename ) {
165
+ echo PHP_EOL . "<script type='text/javascript' src='".CCJ_UPLOAD_URL. '/' . $_filename."'></script>" . PHP_EOL;
166
  }
167
  }
168
 
169
  if ( strpos( $function, 'css' ) !== false ) {
170
  foreach( $args as $_filename ) {
171
  $shortfilename = preg_replace( '@\.css\?v=.*$@', '', $_filename );
172
+ echo PHP_EOL . "<link rel='stylesheet' id='".$shortfilename ."-css' href='".CCJ_UPLOAD_URL. '/' . $_filename ."' type='text/css' media='all' />" . PHP_EOL;
173
  }
174
  }
175
  }
185
  }
186
  }
187
 
188
+
189
+ /**
190
+ * Set constants for later use
191
+ */
192
+ function set_constants() {
193
+ $dir = wp_upload_dir();
194
+ $constants = array(
195
+ 'CCJ_VERSION' => '3.6',
196
+ 'CCJ_UPLOAD_DIR' => $dir['basedir'] . '/custom-css-js',
197
+ 'CCJ_UPLOAD_URL' => $dir['baseurl'] . '/custom-css-js',
198
+ 'CCJ_PLUGIN_FILE' => __FILE__,
199
+ );
200
+ foreach( $constants as $_key => $_value ) {
201
+ if (!defined($_key)) {
202
+ define( $_key, $_value );
203
+ }
204
+ }
205
+ }
206
+
207
+
208
  /**
209
  * Create the custom-css-js post type
210
  */
211
  public function register_post_type() {
212
  $labels = array(
213
+ 'name' => _x( 'Custom Code', 'post type general name', 'custom-css-js'),
214
+ 'singular_name' => _x( 'Custom Code', 'post type singular name', 'custom-css-js'),
215
+ 'menu_name' => _x( 'Custom CSS & JS', 'admin menu', 'custom-css-js'),
216
+ 'name_admin_bar' => _x( 'Custom Code', 'add new on admin bar', 'custom-css-js'),
217
+ 'add_new' => _x( 'Add Custom Code', 'add new', 'custom-css-js'),
218
+ 'add_new_item' => __( 'Add Custom Code', 'custom-css-js'),
219
+ 'new_item' => __( 'New Custom Code', 'custom-css-js'),
220
+ 'edit_item' => __( 'Edit Custom Code', 'custom-css-js'),
221
+ 'view_item' => __( 'View Custom Code', 'custom-css-js'),
222
+ 'all_items' => __( 'All Custom Code', 'custom-css-js'),
223
+ 'search_items' => __( 'Search Custom Code', 'custom-css-js'),
224
+ 'parent_item_colon' => __( 'Parent Custom Code:', 'custom-css-js'),
225
+ 'not_found' => __( 'No Custom Code found.', 'custom-css-js'),
226
+ 'not_found_in_trash' => __( 'No Custom Code found in Trash.', 'custom-css-js')
227
+ );
228
+
229
+ $capability_type = 'custom_css';
230
+ $capabilities = array(
231
+ 'edit_post' => "edit_{$capability_type}",
232
+ 'read_post' => "read_{$capability_type}",
233
+ 'delete_post' => "delete_{$capability_type}",
234
+ 'edit_posts' => "edit_{$capability_type}s",
235
+ 'edit_others_posts' => "edit_others_{$capability_type}s",
236
+ 'publish_posts' => "publish_{$capability_type}s",
237
+ 'read' => "read",
238
+ 'delete_posts' => "delete_{$capability_type}s",
239
+ 'delete_published_posts' => "delete_published_{$capability_type}s",
240
+ 'delete_others_posts' => "delete_others_{$capability_type}s",
241
+ 'edit_published_posts' => "edit_published_{$capability_type}s",
242
+ 'create_posts' => "edit_{$capability_type}s",
243
  );
244
 
245
  $args = array(
246
+ 'labels' => $labels,
247
+ 'description' => __( 'Custom CSS and JS code', 'custom-css-js' ),
248
+ 'public' => false,
249
+ 'publicly_queryable' => false,
250
+ 'show_ui' => true,
251
+ 'show_in_menu' => true,
252
+ 'menu_position' => 100,
253
+ 'menu_icon' => 'dashicons-plus-alt',
254
+ 'query_var' => false,
255
+ 'rewrite' => array( 'slug' => 'custom-css-js' ),
256
+ 'capability_type' => $capability_type,
257
+ 'capabilities' => $capabilities,
258
+ 'has_archive' => true,
259
+ 'hierarchical' => false,
260
+ 'exclude_from_search' => true,
261
+ 'menu_position' => null,
262
+ 'can_export' => false,
263
+ 'supports' => array( 'title' )
264
  );
265
 
266
  register_post_type( 'custom-css-js', $args );
267
  }
268
 
269
+
270
+ /**
271
+ * Create roles and capabilities.
272
+ */
273
+ function create_roles() {
274
+ global $wp_roles;
275
+
276
+
277
+ if ( !current_user_can('update_plugins') )
278
+ return;
279
+
280
+ if ( ! class_exists( 'WP_Roles' ) ) {
281
+ return;
282
+ }
283
+
284
+ if ( ! isset( $wp_roles ) ) {
285
+ $wp_roles = new WP_Roles();
286
+ }
287
+
288
+ if ( isset($wp_roles->roles['css_js_designer']))
289
+ return;
290
+
291
+ // Add Web Designer role
292
+ add_role( 'css_js_designer', __( 'Web Designer', 'custom-css-js'), array(
293
+ 'level_9' => true,
294
+ 'level_8' => true,
295
+ 'level_7' => true,
296
+ 'level_6' => true,
297
+ 'level_5' => true,
298
+ 'level_4' => true,
299
+ 'level_3' => true,
300
+ 'level_2' => true,
301
+ 'level_1' => true,
302
+ 'level_0' => true,
303
+ 'read' => true,
304
+ 'read_private_pages' => true,
305
+ 'read_private_posts' => true,
306
+ 'edit_users' => true,
307
+ 'edit_posts' => true,
308
+ 'edit_pages' => true,
309
+ 'edit_published_posts' => true,
310
+ 'edit_published_pages' => true,
311
+ 'edit_private_pages' => true,
312
+ 'edit_private_posts' => true,
313
+ 'edit_others_posts' => true,
314
+ 'edit_others_pages' => true,
315
+ 'publish_posts' => true,
316
+ 'publish_pages' => true,
317
+ 'delete_posts' => true,
318
+ 'delete_pages' => true,
319
+ 'delete_private_pages' => true,
320
+ 'delete_private_posts' => true,
321
+ 'delete_published_pages' => true,
322
+ 'delete_published_posts' => true,
323
+ 'delete_others_posts' => true,
324
+ 'delete_others_pages' => true,
325
+ 'manage_categories' => true,
326
+ 'moderate_comments' => true,
327
+ 'unfiltered_html' => true,
328
+ 'upload_files' => true,
329
+ ) );
330
+
331
+ $capabilities = array();
332
+
333
+ $capability_types = array( 'custom_css' );
334
+
335
+ foreach ( $capability_types as $capability_type ) {
336
+
337
+ $capabilities[ $capability_type ] = array(
338
+ // Post type
339
+ "edit_{$capability_type}",
340
+ "read_{$capability_type}",
341
+ "delete_{$capability_type}",
342
+ "edit_{$capability_type}s",
343
+ "edit_others_{$capability_type}s",
344
+ "publish_{$capability_type}s",
345
+ "delete_{$capability_type}s",
346
+ "delete_published_{$capability_type}s",
347
+ "delete_others_{$capability_type}s",
348
+ "edit_published_{$capability_type}s",
349
+ );
350
+ }
351
+
352
+ foreach ( $capabilities as $cap_group ) {
353
+ foreach ( $cap_group as $cap ) {
354
+ $wp_roles->add_cap( 'css_js_designer', $cap );
355
+ $wp_roles->add_cap( 'administrator', $cap );
356
+ }
357
+ }
358
+ }
359
+
360
+
361
+ public function load_plugin_textdomain() {
362
+ load_plugin_textdomain( 'custom-css-js', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
363
+ }
364
 
365
  }
366
 
384
  function custom_css_js_plugin_action_links( $links ) {
385
 
386
  $settings_link = '<a href="edit.php?post_type=custom-css-js">' .
387
+ esc_html( __('Settings', 'custom-css-js' ) ) . '</a>';
388
 
389
  return array_merge( array( $settings_link), $links );
390
 
391
  }
392
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'custom_css_js_plugin_action_links' );
393
+
394
+
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
@@ -13,11 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  */
14
  class CustomCSSandJS_Admin {
15
 
16
- /**
17
- * An instance of the CustomCSSandJS class
18
- */
19
- private $main = '';
20
-
21
  /**
22
  * Default options for a new page
23
  */
@@ -40,8 +35,6 @@ class CustomCSSandJS_Admin {
40
  public function __construct() {
41
 
42
  $this->add_functions();
43
-
44
- $this->main = CustomCSSandJS();
45
  }
46
 
47
  /**
@@ -59,26 +52,27 @@ class CustomCSSandJS_Admin {
59
 
60
  // Add actions
61
  $actions = array(
62
- 'admin_menu' => 'admin_menu',
63
- 'admin_enqueue_scripts' => 'admin_enqueue_scripts',
64
- 'current_screen' => 'current_screen',
65
- 'admin_notices' => 'create_uploads_directory',
66
- 'edit_form_after_title' => 'codemirror_editor',
67
- 'add_meta_boxes' => 'add_meta_boxes',
68
- 'save_post' => 'options_save_meta_box_data',
69
- 'trashed_post' => 'trash_post',
70
- 'untrashed_post' => 'trash_post',
71
- 'admin_post_ccj-autosave' => 'ajax_autosave',
72
- 'wp_loaded' => 'compatibility_shortcoder',
73
- 'wp_ajax_ccj_active_code' => 'wp_ajax_ccj_active_code',
74
  );
75
  foreach( $actions as $_key => $_value ) {
76
  add_action( $_key, array( $this, $_value ) );
77
  }
78
 
79
 
80
- // Add some custom actions
81
  add_action( 'manage_custom-css-js_posts_custom_column', array( $this, 'manage_posts_columns' ), 10, 2 );
 
82
  }
83
 
84
 
@@ -89,16 +83,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
 
@@ -114,7 +109,7 @@ class CustomCSSandJS_Admin {
114
  return false;
115
 
116
  // Some handy variables
117
- $a = plugins_url( '/', $this->main->plugin_file ). 'assets';
118
  $cm = $a . '/codemirror';
119
  $v = CCJ_VERSION;
120
 
@@ -160,7 +155,13 @@ class CustomCSSandJS_Admin {
160
  public function cm_localize() {
161
 
162
  $vars = array(
163
- 'scroll' => '1'
 
 
 
 
 
 
164
  );
165
 
166
  if ( ! function_exists( 'is_plugin_active' ) ) {
@@ -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
 
@@ -304,15 +306,17 @@ class CustomCSSandJS_Admin {
304
  }
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
-
 
316
  }
317
  }
318
 
@@ -324,21 +328,24 @@ class CustomCSSandJS_Admin {
324
  function wp_ajax_ccj_active_code() {
325
  if ( ! isset( $_GET['code_id'] ) ) die();
326
 
327
- if ( check_admin_referer( 'ccj-active-code' ) ) {
328
- $code_id = absint( $_GET['code_id'] );
 
 
329
 
330
  if ( 'custom-css-js' === get_post_type( $code_id ) ) {
331
  $active = get_post_meta($code_id, '_active', true );
332
  if ( $active === false || $active === '' ) {
333
  $active = 'yes';
334
  }
 
335
  update_post_meta( $code_id, '_active', $active === 'yes' ? 'no' : 'yes' );
336
 
337
  $this->build_search_tree();
338
  }
339
  }
 
340
 
341
- wp_safe_redirect( wp_get_referer() ? remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), wp_get_referer() ) : admin_url( 'edit.php?post_type=custom-css-js' ) );
342
  die();
343
  }
344
 
@@ -359,10 +366,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
 
@@ -371,7 +378,6 @@ class CustomCSSandJS_Admin {
371
  }
372
 
373
 
374
-
375
  /**
376
  * Reformat the `post` screen
377
  */
@@ -381,19 +387,19 @@ class CustomCSSandJS_Admin {
381
 
382
  if ( isset( $_GET['post'] ) ) {
383
  $action = 'Edit';
384
- $language = $this->get_options( $_GET['post'] );
385
- $language = $language['language'];
386
  } else {
387
  $action = 'Add';
388
- $language = isset( $_GET['language'] ) ? $_GET['language'] : 'css';
389
  }
 
390
 
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 +407,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 +438,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 +450,22 @@ class CustomCSSandJS_Admin {
443
  }
444
  }
445
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  }
447
 
448
 
@@ -459,18 +482,18 @@ class CustomCSSandJS_Admin {
459
 
460
  if ( empty( $post->title ) && empty( $post->post_content ) ) {
461
  $new_post = true;
462
- $language = isset( $_GET['language'] ) ? $_GET['language'] : 'css';
463
  } else {
464
  $new_post = false;
465
  if ( ! isset( $_GET['post'] ) ) $_GET['post'] = $post->id;
466
- $language = $this->get_options( $_GET['post'] );
467
- $language = $language['language'];
468
  }
 
469
 
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 +501,13 @@ 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 +515,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 +523,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 +541,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 +550,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 +563,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 ); ?>" />
@@ -556,7 +585,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
556
 
557
 
558
  if ( isset( $_GET['language'] ) ) {
559
- $options['language'] = $_GET['language'];
560
  }
561
 
562
  $meta = $this->get_options_meta();
@@ -611,7 +640,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 +655,85 @@ 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 +742,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 +758,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 +823,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
  ),
@@ -843,7 +876,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
843
  }
844
 
845
  foreach( $defaults as $_field => $_default ) {
846
- $options[ $_field ] = isset( $_POST['custom_code_'.$_field] ) ? $_POST['custom_code_'.$_field] : $_default;
847
  }
848
 
849
  update_post_meta( $post_id, 'options', $options );
@@ -877,10 +910,10 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
877
  'Saved: '.date('M d Y | H:i:s').' */' . PHP_EOL;
878
  }
879
 
880
- if ( wp_is_writable( $this->main->upload_dir ) ) {
881
  $file_name = $post_id . '.' . $options['language'];
882
  $file_content = $before . stripslashes($_POST['content']) . $after;
883
- @file_put_contents( $this->main->upload_dir . '/' . $file_name , $file_content );
884
  }
885
 
886
 
@@ -902,7 +935,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
902
  return false;
903
  }
904
 
905
- $dir = $this->main->upload_dir;
906
 
907
  // Create the dir if it doesn't exist
908
  if ( ! file_exists( $dir ) ) {
@@ -912,8 +945,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 +954,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
 
@@ -1048,6 +1081,76 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
1048
  }
1049
 
1050
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1051
  }
1052
 
1053
  return new CustomCSSandJS_Admin();
13
  */
14
  class CustomCSSandJS_Admin {
15
 
 
 
 
 
 
16
  /**
17
  * Default options for a new page
18
  */
35
  public function __construct() {
36
 
37
  $this->add_functions();
 
 
38
  }
39
 
40
  /**
52
 
53
  // Add actions
54
  $actions = array(
55
+ 'admin_menu' => 'admin_menu',
56
+ 'admin_enqueue_scripts' => 'admin_enqueue_scripts',
57
+ 'current_screen' => 'current_screen',
58
+ 'admin_notices' => 'create_uploads_directory',
59
+ 'edit_form_after_title' => 'codemirror_editor',
60
+ 'add_meta_boxes' => 'add_meta_boxes',
61
+ 'save_post' => 'options_save_meta_box_data',
62
+ 'trashed_post' => 'trash_post',
63
+ 'untrashed_post' => 'trash_post',
64
+ 'wp_loaded' => 'compatibility_shortcoder',
65
+ 'wp_ajax_ccj_active_code' => 'wp_ajax_ccj_active_code',
66
+ 'post_submitbox_start' => 'post_submitbox_start',
67
  );
68
  foreach( $actions as $_key => $_value ) {
69
  add_action( $_key, array( $this, $_value ) );
70
  }
71
 
72
 
73
+ // Add some custom actions/filters
74
  add_action( 'manage_custom-css-js_posts_custom_column', array( $this, 'manage_posts_columns' ), 10, 2 );
75
+ add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
76
  }
77
 
78
 
83
  $menu_slug = 'edit.php?post_type=custom-css-js';
84
  $submenu_slug = 'post-new.php?post_type=custom-css-js';
85
 
86
+ remove_submenu_page( $menu_slug, $submenu_slug);
 
87
 
88
+ $title = __('Add Custom CSS', 'custom-css-js');
89
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug .'&language=css');
90
 
91
+ $title = __('Add Custom JS', 'custom-css-js');
92
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug . '&language=js');
93
+
94
+ $title = __('Add Custom HTML', 'custom-css-js');
95
+ add_submenu_page( $menu_slug, $title, $title, 'publish_custom_csss', $submenu_slug . '&language=html');
96
 
 
97
  }
98
 
99
 
109
  return false;
110
 
111
  // Some handy variables
112
+ $a = plugins_url( '/', CCJ_PLUGIN_FILE). 'assets';
113
  $cm = $a . '/codemirror';
114
  $v = CCJ_VERSION;
115
 
155
  public function cm_localize() {
156
 
157
  $vars = array(
158
+ 'scroll' => '1',
159
+ 'active' => __('Active', 'custom-css-js'),
160
+ 'inactive' => __('Inactive', 'custom-css-js'),
161
+ 'activate' => __('Activate', 'custom-css-js'),
162
+ 'deactivate' => __('Deactivate', 'custom-css-js'),
163
+ 'active_title' => __('The code is active. Click to deactivate it', 'custom-css-js'),
164
+ 'deactive_title' => __('The code is inactive. Click to activate it', 'custom-css-js'),
165
  );
166
 
167
  if ( ! function_exists( 'is_plugin_active' ) ) {
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
 
306
  }
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-' .$post_id );
 
310
  if ( $this->is_active( $post_id ) ) {
311
+ $active_title = __('The code is active. Click to deactivate it', 'custom-css-js');
312
+ $active_icon = 'dashicons-star-filled';
313
  } else {
314
+ $active_title = __('The code is inactive. Click to activate it', 'custom-css-js');
315
+ $active_icon = 'dashicons-star-empty ccj_row';
316
  }
317
+ echo '<a href="' . esc_url( $url ) . '" class="ccj_activate_deactivate" data-code-id="'.$post_id.'" title="'.$active_title . '">' .
318
+ '<span class="dashicons '.$active_icon.'"></span>'.
319
+ '</a>';
320
  }
321
  }
322
 
328
  function wp_ajax_ccj_active_code() {
329
  if ( ! isset( $_GET['code_id'] ) ) die();
330
 
331
+ $code_id = absint( $_GET['code_id'] );
332
+
333
+ $response = 'error';
334
+ if ( check_admin_referer( 'ccj-active-code-' . $code_id) ) {
335
 
336
  if ( 'custom-css-js' === get_post_type( $code_id ) ) {
337
  $active = get_post_meta($code_id, '_active', true );
338
  if ( $active === false || $active === '' ) {
339
  $active = 'yes';
340
  }
341
+ $response = $active;
342
  update_post_meta( $code_id, '_active', $active === 'yes' ? 'no' : 'yes' );
343
 
344
  $this->build_search_tree();
345
  }
346
  }
347
+ echo $response;
348
 
 
349
  die();
350
  }
351
 
366
  <script type="text/javascript">
367
  /* <![CDATA[ */
368
  jQuery(window).ready(function($){
369
+ var h1 = '<?php _e('Custom Code', 'custom-css-js'); ?> ';
370
+ 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>';
371
+ 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>';
372
+ 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>';
373
  $("#wpbody-content h1").html(h1);
374
  });
375
 
378
  }
379
 
380
 
 
381
  /**
382
  * Reformat the `post` screen
383
  */
387
 
388
  if ( isset( $_GET['post'] ) ) {
389
  $action = 'Edit';
390
+ $post_id = esc_attr($_GET['post']);
 
391
  } else {
392
  $action = 'Add';
393
+ $post_id = false;
394
  }
395
+ $language = $this->get_language($post_id);
396
 
397
  $title = $action . ' ' . strtoupper( $language ) . ' code';
398
 
399
  if ( $action == 'Edit' ) {
400
+ $title .= ' <a href="post-new.php?post_type=custom-css-js&language=css" class="page-title-action">'.__('Add CSS Code', 'custom-css-js') .'</a> ';
401
+ $title .= '<a href="post-new.php?post_type=custom-css-js&language=js" class="page-title-action">'.__('Add JS Code', 'custom-css-js') .'</a>';
402
+ $title .= '<a href="post-new.php?post_type=custom-css-js&language=html" class="page-title-action">'.__('Add HTML Code', 'custom-css-js') .'</a>';
403
  }
404
 
405
  ?>
407
  /* <![CDATA[ */
408
  jQuery(window).ready(function($){
409
  $("#wpbody-content h1").html('<?php echo $title; ?>');
410
+ $("#message.updated.notice").html('<p><?php _e('Code updated', 'custom-css-js'); ?></p>');
411
 
412
  var from_top = -$("#normal-sortables").height();
413
  if ( from_top != 0 ) {
438
  function remove_unallowed_metaboxes() {
439
  global $wp_meta_boxes;
440
 
441
+ // Side boxes
442
  $allowed = array( 'submitdiv', 'custom-code-options' );
443
 
444
  $allowed = apply_filters( 'custom-css-js-meta-boxes', $allowed );
450
  }
451
  }
452
  }
453
+
454
+ // Normal boxes
455
+ $allowed = array( 'slugdiv', 'previewdiv', 'url-rules', 'revisionsdiv' );
456
+
457
+ $allowed = apply_filters( 'custom-css-js-meta-boxes-normal', $allowed );
458
+
459
+ foreach( $wp_meta_boxes['custom-css-js']['normal'] as $_priority => $_boxes ) {
460
+ foreach( $_boxes as $_key => $_value ) {
461
+ if ( ! in_array( $_key, $allowed ) ) {
462
+ unset( $wp_meta_boxes['custom-css-js']['normal'][$_priority][$_key] );
463
+ }
464
+ }
465
+ }
466
+
467
+
468
+ unset($wp_meta_boxes['custom-css-js']['advanced']);
469
  }
470
 
471
 
482
 
483
  if ( empty( $post->title ) && empty( $post->post_content ) ) {
484
  $new_post = true;
485
+ $post_id = false;
486
  } else {
487
  $new_post = false;
488
  if ( ! isset( $_GET['post'] ) ) $_GET['post'] = $post->id;
489
+ $post_id = esc_attr($_GET['post']);
 
490
  }
491
+ $language = $this->get_language($post_id);
492
 
493
  switch ( $language ) {
494
  case 'js' :
495
  if ( $new_post ) {
496
+ $post->post_content = __('/* Add your JavaScript code here.
497
 
498
  If you are using the jQuery library, then don\'t forget to wrap your code inside jQuery.ready() as follows:
499
 
501
  // Your code in here
502
  });
503
 
504
+ --
505
+
506
+ If you want to link a JavaScript file that resides on another server (similar to
507
+ <script src="https://example.com/your-js-file.js"></script>), then please use
508
+ the "Add HTML Code" page, as this is a HTML code that links a JavaScript file.
509
+
510
+ End of comment */ ', 'custom-css-js') . PHP_EOL . PHP_EOL;
511
  }
512
  $code_mirror_mode = 'text/javascript';
513
  $code_mirror_before = '<script type="text/javascript">';
515
  break;
516
  case 'html' :
517
  if ( $new_post ) {
518
+ $post->post_content = __('<!-- Add HTML code to the header or the footer.
519
 
520
  For example, you can use the following code for loading the jQuery library from Google CDN:
521
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
523
  or the following one for loading the Bootstrap library from MaxCDN:
524
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
525
 
526
+ -- End of the comment --> ', 'custom-css-js') . PHP_EOL . PHP_EOL;
527
  }
528
  $code_mirror_mode = 'html';
529
  $code_mirror_before = '';
541
  break;
542
  default :
543
  if ( $new_post ) {
544
+ $post->post_content = __('/* Add your CSS code here.
545
 
546
  For example:
547
  .example {
550
 
551
  For brushing up on your CSS knowledge, check out http://www.w3schools.com/css/css_syntax.asp
552
 
553
+ End of comment */ ', 'custom-css-js') . PHP_EOL . PHP_EOL;
554
 
555
  }
556
  $code_mirror_mode = 'text/css';
563
  <form style="position: relative; margin-top: .5em;">
564
 
565
  <div class="code-mirror-before"><div><?php echo htmlentities( $code_mirror_before );?></div></div>
566
+ <textarea class="wp-editor-area" id="content" mode="<?php echo htmlentities($code_mirror_mode); ?>" name="content"><?php echo $post->post_content; ?></textarea>
567
  <div class="code-mirror-after"><div><?php echo htmlentities( $code_mirror_after );?></div></div>
568
 
569
  <input type="hidden" id="update-post_<?php echo $post->ID ?>" value="<?php echo wp_create_nonce('update-post_'. $post->ID ); ?>" />
585
 
586
 
587
  if ( isset( $_GET['language'] ) ) {
588
+ $options['language'] = $this->get_language();
589
  }
590
 
591
  $meta = $this->get_options_meta();
640
 
641
  <div class="ccj_only_premium ccj_only_premium-right">
642
  <div>
643
+ <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>
644
  </div>
645
  </div>
646
 
655
  function get_options_meta() {
656
  $options = array(
657
  'linking' => array(
658
+ 'title' => __('Linking type', 'custom-css-js'),
659
  'type' => 'radio',
660
  'default' => 'internal',
661
  'values' => array(
662
  'external' => array(
663
+ 'title' => __('External File', 'custom-css-js'),
664
  'dashicon' => 'media-code',
665
  ),
666
  'internal' => array(
667
+ 'title' => __('Internal', 'custom-css-js'),
668
  'dashicon' => 'editor-alignleft',
669
  ),
670
  ),
671
  ),
672
  'type' => array(
673
+ 'title' => __('Where on page', 'custom-css-js'),
674
  'type' => 'radio',
675
  'default' => 'header',
676
  'values' => array(
677
  'header' => array(
678
+ 'title' => __('Header', 'custom-css-js'),
679
  'dashicon' => 'arrow-up-alt2',
680
  ),
681
  'footer' => array(
682
+ 'title' => __('Footer', 'custom-css-js'),
683
  'dashicon' => 'arrow-down-alt2',
684
  ),
685
  ),
686
  ),
687
  'side' => array(
688
+ 'title' => __('Where in site', 'custom-css-js'),
689
  'type' => 'radio',
690
  'default' => 'frontend',
691
  'values' => array(
692
  'frontend' => array(
693
+ 'title' => __('In Frontend', 'custom-css-js'),
694
  'dashicon' => 'tagcloud',
695
  ),
696
  'admin' => array(
697
+ 'title' => __('In Admin', 'custom-css-js'),
698
  'dashicon' => 'id',
699
  ),
700
+ 'login' => array(
701
+ 'title' => __('On Login Page', 'custom-css-js'),
702
+ 'dashicon' => 'admin-network',
703
+ ),
704
  ),
705
  ),
706
  'preprocessor' => array(
707
+ 'title' => __('CSS Preprocessor', 'custom-css-js'),
708
  'type' => 'radio',
709
  'default' => 'none',
710
  'values' => array(
711
  'none' => array(
712
+ 'title' => __('None', 'custom-css-js'),
713
  ),
714
  'less' => array(
715
+ 'title' => __('Less', 'custom-css-js'),
716
  ),
717
  'sass' => array(
718
+ 'title' => __('SASS (only SCSS syntax)', 'custom-css-js'),
719
  ),
720
  ),
721
  'disabled' => true,
722
  ),
723
  'minify' => array(
724
+ 'title' => __('Minify the code', 'custom-css-js'),
725
  'type' => 'checkbox',
726
  'default' => false,
727
  'dashicon' => 'editor-contract',
728
  'disabled' => true,
729
  ),
730
  'priority' => array(
731
+ 'title' => __('Priority', 'custom-css-js'),
732
  'type' => 'select',
733
  'default' => 5,
734
  'dashicon' => 'sort',
735
  'values' => array(
736
+ 1 => _x('1 (highest)', '1 is the highest priority', 'custom-css-js'),
737
  2 => '2',
738
  3 => '3',
739
  4 => '4',
742
  7 => '7',
743
  8 => '8',
744
  9 => '9',
745
+ 10 => _x('10 (lowest)', '10 is the lowest priority', 'custom-css-js'),
746
  ),
747
  'disabled' => true,
748
  ),
758
  function get_options_meta_html() {
759
  $options = array(
760
  'type' => array(
761
+ 'title' => __('Where on page', 'custom-css-js'),
762
  'type' => 'radio',
763
  'default' => 'header',
764
  'values' => array(
765
  'header' => array(
766
+ 'title' => __('Header', 'custom-css-js'),
767
  'dashicon' => 'arrow-up-alt2',
768
  ),
769
  'footer' => array(
770
+ 'title' => __('Footer', 'custom-css-js'),
771
  'dashicon' => 'arrow-down-alt2',
772
  ),
773
  ),
774
  ),
775
  'side' => array(
776
+ 'title' => __('Where in site', 'custom-css-js'),
777
  'type' => 'radio',
778
  'default' => 'frontend',
779
  'values' => array(
780
  'frontend' => array(
781
+ 'title' => __('In Frontend', 'custom-css-js'),
782
  'dashicon' => 'tagcloud',
783
  ),
784
  'admin' => array(
785
+ 'title' => __('In Admin', 'custom-css-js'),
786
  'dashicon' => 'id',
787
  ),
788
  ),
789
  ),
790
  'linking' => array(
791
+ 'title' => __('On which device', 'custom-css-js'),
792
  'type' => 'radio',
793
  'default' => 'both',
794
  'dashicon' => '',
795
  'values' => array(
796
  'desktop' => array(
797
+ 'title' => __('Desktop', 'custom-css-js'),
798
  'dashicon' => 'desktop',
799
  ),
800
  'mobile' => array(
801
+ 'title' => __('Mobile', 'custom-css-js'),
802
  'dashicon' => 'smartphone',
803
  ),
804
  'both' => array(
805
+ 'title' => __('Both', 'custom-css-js'),
806
  'dashicon' => 'tablet',
807
  ),
808
  ),
809
  'disabled' => true,
810
  ),
811
  'priority' => array(
812
+ 'title' => __('Priority', 'custom-css-js'),
813
  'type' => 'select',
814
  'default' => 5,
815
  'dashicon' => 'sort',
816
  'values' => array(
817
+ 1 => _x('1 (highest)', '1 is the highest priority', 'custom-css-js'),
818
  2 => '2',
819
  3 => '3',
820
  4 => '4',
823
  7 => '7',
824
  8 => '8',
825
  9 => '9',
826
+ 10 => _x('10 (lowest)', '10 is the lowest priority', 'custom-css-js'),
827
  ),
828
  'disabled' => true,
829
  ),
876
  }
877
 
878
  foreach( $defaults as $_field => $_default ) {
879
+ $options[ $_field ] = isset( $_POST['custom_code_'.$_field] ) ? esc_attr($_POST['custom_code_'.$_field]) : $_default;
880
  }
881
 
882
  update_post_meta( $post_id, 'options', $options );
910
  'Saved: '.date('M d Y | H:i:s').' */' . PHP_EOL;
911
  }
912
 
913
+ if ( wp_is_writable( CCJ_UPLOAD_DIR ) ) {
914
  $file_name = $post_id . '.' . $options['language'];
915
  $file_content = $before . stripslashes($_POST['content']) . $after;
916
+ @file_put_contents( CCJ_UPLOAD_DIR . '/' . $file_name , $file_content );
917
  }
918
 
919
 
935
  return false;
936
  }
937
 
938
+ $dir = CCJ_UPLOAD_DIR;
939
 
940
  // Create the dir if it doesn't exist
941
  if ( ! file_exists( $dir ) ) {
945
  // Show a message if it couldn't create the dir
946
  if ( ! file_exists( $dir ) ) : ?>
947
  <div class="notice notice-error is-dismissible">
948
+ <p><?php printf(__('The %s directory could not be created', 'custom-css-js'), '<b>custom-css-js</b>'); ?></p>
949
+ <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>
950
  </div>
951
  <?php return; endif;
952
 
954
  // Show a message if the dir is not writable
955
  if ( ! wp_is_writable( $dir ) ) : ?>
956
  <div class="notice notice-error is-dismissible">
957
+ <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>
958
+ <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>
959
  </div>
960
  <?php return; endif;
961
 
1081
  }
1082
 
1083
 
1084
+ /**
1085
+ * Get the language for the current post
1086
+ */
1087
+ function get_language( $post_id = false ) {
1088
+ if( $post_id !== false ) {
1089
+ $options = $this->get_options( $post_id );
1090
+ $language = $options['language'];
1091
+ } else {
1092
+ $language = isset( $_GET['language'] ) ? esc_attr(strtolower($_GET['language'])) : 'css';
1093
+ }
1094
+ if ( !in_array($language, array('css', 'js', 'html'))) $language = 'css';
1095
+
1096
+ return $language;
1097
+ }
1098
+
1099
+
1100
+ /**
1101
+ * Show the activate/deactivate link in the row's action area
1102
+ */
1103
+ function post_row_actions($actions, $post) {
1104
+ if ( 'custom-css-js' !== $post->post_type ) {
1105
+ return $actions;
1106
+ }
1107
+
1108
+ $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=ccj_active_code&code_id=' . $post->ID), 'ccj-active-code-'. $post->ID );
1109
+ if ( $this->is_active( $post->ID) ) {
1110
+ $active_title = __('The code is active. Click to deactivate it', 'custom-css-js');
1111
+ $active_text = __('Deactivate', 'custom-css-js');
1112
+ } else {
1113
+ $active_title = __('The code is inactive. Click to activate it', 'custom-css-js');
1114
+ $active_text = __('Activate', 'custom-css-js');
1115
+ }
1116
+ $actions['activate'] = '<a href="' . esc_url( $url ) . '" title="'. $active_title . '" class="ccj_activate_deactivate" data-code-id="'.$post->ID.'">' . $active_text . '</a>';
1117
+
1118
+ return $actions;
1119
+ }
1120
+
1121
+
1122
+ /**
1123
+ * Show the activate/deactivate link in admin.
1124
+ */
1125
+ public function post_submitbox_start() {
1126
+ global $post;
1127
+
1128
+ if ( ! is_object( $post ) ) return;
1129
+
1130
+ if ( 'custom-css-js' !== $post->post_type ) return;
1131
+
1132
+ if ( !isset( $_GET['post'] ) ) return;
1133
+
1134
+ $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=ccj_active_code&code_id=' . $post->ID), 'ccj-active-code-'. $post->ID );
1135
+
1136
+
1137
+ if ( $this->is_active( $post->ID) ) {
1138
+ $text = __('Active', 'custom-css-js');
1139
+ $action = __('Deactivate', 'custom-css-js');
1140
+ } else {
1141
+ $text = __('Inactive', 'custom-css-js');
1142
+ $action = __('Activate', 'custom-css-js');
1143
+ }
1144
+ ?>
1145
+ <div id="activate-action"><span style="font-weight: bold;"><?php echo $text; ?></span>
1146
+ (<a class="ccj_activate_deactivate" data-code-id="<?php echo $post->ID; ?>" href="<?php echo esc_url( $url ); ?>"><?php echo $action ?></a>)
1147
+ </div>
1148
+ <?php
1149
+ }
1150
+
1151
+
1152
+
1153
+
1154
  }
1155
 
1156
  return new CustomCSSandJS_Admin();
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-tr_TR.mo ADDED
Binary file
languages/custom-css-js-tr_TR.po ADDED
@@ -0,0 +1,501 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-08-07 22:47+0300\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 2.0.3\n"
15
+ "Last-Translator: Adnan Uludag <auludag@mac.com>\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Language: tr_TR\n"
18
+
19
+ #: custom-css-js.php:56 custom-css-js.php:63
20
+ msgid "Cheatin&#8217; huh?"
21
+ msgstr "Kandırıkçılık ha?"
22
+
23
+ #: custom-css-js.php:198
24
+ msgctxt "post type general name"
25
+ msgid "Custom Code"
26
+ msgstr "Özel Kod"
27
+
28
+ #: custom-css-js.php:199
29
+ msgctxt "post type singular name"
30
+ msgid "Custom Code"
31
+ msgstr "Özel Kod"
32
+
33
+ #: custom-css-js.php:200
34
+ msgctxt "admin menu"
35
+ msgid "Custom CSS & JS"
36
+ msgstr "Özel CSS & JS"
37
+
38
+ #: custom-css-js.php:201
39
+ msgctxt "add new on admin bar"
40
+ msgid "Custom Code"
41
+ msgstr "Özel Kod"
42
+
43
+ #: custom-css-js.php:202
44
+ msgctxt "add new"
45
+ msgid "Add Custom Code"
46
+ msgstr "Özel Kod Ekle"
47
+
48
+ #: custom-css-js.php:203
49
+ msgid "Add Custom Code"
50
+ msgstr "Özel Kod Ekle"
51
+
52
+ #: custom-css-js.php:204
53
+ msgid "New Custom Code"
54
+ msgstr "Yeni Özel Kod"
55
+
56
+ #: custom-css-js.php:205
57
+ msgid "Edit Custom Code"
58
+ msgstr "Özel Kodu Düzenle"
59
+
60
+ #: custom-css-js.php:206
61
+ msgid "View Custom Code"
62
+ msgstr "Özel Kodu Görüntüle"
63
+
64
+ #: custom-css-js.php:207
65
+ msgid "All Custom Code"
66
+ msgstr "Tüm Özel Kodlar"
67
+
68
+ #: custom-css-js.php:208
69
+ msgid "Search Custom Code"
70
+ msgstr "Özel Kod ara"
71
+
72
+ #: custom-css-js.php:209
73
+ msgid "Parent Custom Code:"
74
+ msgstr "Ana Özel Kod:"
75
+
76
+ #: custom-css-js.php:210
77
+ msgid "No Custom Code found."
78
+ msgstr "Özel Kod bulunmadı."
79
+
80
+ #: custom-css-js.php:211
81
+ msgid "No Custom Code found in Trash."
82
+ msgstr "Çöp kutusunda özel kod bulunmadı."
83
+
84
+ #: custom-css-js.php:232
85
+ msgid "Custom CSS and JS code"
86
+ msgstr "Özel CSS ve JS Kodu"
87
+
88
+ #: custom-css-js.php:277
89
+ msgid "Web Designer"
90
+ msgstr "Web Tasarımcı"
91
+
92
+ #: custom-css-js.php:372
93
+ msgid "Settings"
94
+ msgstr "Ayarlar"
95
+
96
+ #: includes/admin-addons.php:42 includes/admin-screens.php:631
97
+ msgid "Available only in <br />Simple Custom CSS and JS Pro"
98
+ msgstr "Sadece <br />Simple Custom CSS and JS Pro<br />versiyonunda mevcut"
99
+
100
+ #: includes/admin-addons.php:54
101
+ msgid "Preview"
102
+ msgstr "Öngörünüm"
103
+
104
+ #: includes/admin-addons.php:55
105
+ msgid "Apply only on these URLs"
106
+ msgstr "Sadece bu URL lere uygula"
107
+
108
+ #: includes/admin-addons.php:56
109
+ msgid "Code Revisions"
110
+ msgstr "Kod revizyonları"
111
+
112
+ #: includes/admin-addons.php:67
113
+ msgid "Full URL on which to preview the changes ..."
114
+ msgstr "Değişikliklerin öngörünümünü istediğiniz URL in tam adresi …"
115
+
116
+ #: includes/admin-addons.php:68
117
+ msgid "Preview Changes"
118
+ msgstr "Değişiklikleri ön izle"
119
+
120
+ #: includes/admin-addons.php:82
121
+ msgid "All Website"
122
+ msgstr "Tüm Web Siteleri"
123
+
124
+ #: includes/admin-addons.php:83
125
+ msgid "First page"
126
+ msgstr "İlk Sayfa"
127
+
128
+ #: includes/admin-addons.php:84
129
+ msgid "Contains"
130
+ msgstr "içeriyor"
131
+
132
+ #: includes/admin-addons.php:85
133
+ msgid "Not contains"
134
+ msgstr "içermiyor"
135
+
136
+ #: includes/admin-addons.php:86
137
+ msgid "Is equal to"
138
+ msgstr "eşit"
139
+
140
+ #: includes/admin-addons.php:87
141
+ msgid "Not equal to"
142
+ msgstr "eşit değil"
143
+
144
+ #: includes/admin-addons.php:88
145
+ msgid "Starts with"
146
+ msgstr "Şunla başlıyor"
147
+
148
+ #: includes/admin-addons.php:89
149
+ msgid "Ends by"
150
+ msgstr "şunla bitiyor"
151
+
152
+ #: includes/admin-addons.php:100 includes/admin-addons.php:101
153
+ msgid "URL"
154
+ msgstr "URL"
155
+
156
+ #: includes/admin-addons.php:102
157
+ msgid "Text filter"
158
+ msgstr "Tekst süzgeci"
159
+
160
+ #: includes/admin-addons.php:103
161
+ msgid "Add"
162
+ msgstr "Ekle"
163
+
164
+ #: includes/admin-addons.php:114
165
+ msgctxt "revision date format"
166
+ msgid "F j, Y @ H:i:s"
167
+ msgstr "F j, Y @ H:i:s"
168
+
169
+ #: includes/admin-addons.php:136 includes/admin-addons.php:169
170
+ msgid "Compare"
171
+ msgstr "Karşılaştır"
172
+
173
+ #: includes/admin-addons.php:137
174
+ msgid "Revision"
175
+ msgstr "Revizyon"
176
+
177
+ #: includes/admin-addons.php:138 includes/admin-screens.php:268
178
+ msgid "Author"
179
+ msgstr "Yazar"
180
+
181
+ #: includes/admin-addons.php:139 includes/admin-addons.php:173
182
+ msgid "Delete"
183
+ msgstr "Sil"
184
+
185
+ #: includes/admin-addons.php:140 includes/admin-addons.php:163
186
+ msgid "Restore"
187
+ msgstr "Geri yükle"
188
+
189
+ #: includes/admin-notices.php:125
190
+ msgid "Get your discount now"
191
+ msgstr "Şimdi indirimi al"
192
+
193
+ #: includes/admin-notices.php:125 includes/admin-notices.php:190
194
+ msgid "Dismiss this notice"
195
+ msgstr "Bu uyarıyı yoksay"
196
+
197
+ #: includes/admin-screens.php:94
198
+ msgid "Add Custom CSS"
199
+ msgstr "Özel CSS Ekle"
200
+
201
+ #: includes/admin-screens.php:97
202
+ msgid "Add Custom JS"
203
+ msgstr "Özel JS Ekle"
204
+
205
+ #: includes/admin-screens.php:100
206
+ msgid "Add Custom HTML"
207
+ msgstr "Özel HTML Ekle"
208
+
209
+ #: includes/admin-screens.php:189
210
+ msgid "Options"
211
+ msgstr "Seçenekler"
212
+
213
+ #: includes/admin-screens.php:249
214
+ msgid "Add CSS code"
215
+ msgstr "CSS Kodu ekle"
216
+
217
+ #: includes/admin-screens.php:250
218
+ msgid "Add JS code"
219
+ msgstr "JS Kodu ekle"
220
+
221
+ #: includes/admin-screens.php:251
222
+ msgid "Add HTML code"
223
+ msgstr "HTML Kodu ekle"
224
+
225
+ #: includes/admin-screens.php:265
226
+ msgid "Active"
227
+ msgstr "Aktif"
228
+
229
+ #: includes/admin-screens.php:266
230
+ msgid "Type"
231
+ msgstr "Çeşidi"
232
+
233
+ #: includes/admin-screens.php:267
234
+ msgid "Title"
235
+ msgstr "Başlık"
236
+
237
+ #: includes/admin-screens.php:269
238
+ msgid "Date"
239
+ msgstr "Tarih"
240
+
241
+ #: includes/admin-screens.php:270
242
+ msgid "Modified"
243
+ msgstr "Değiştirilme"
244
+
245
+ #: includes/admin-screens.php:299
246
+ msgid "%s ago"
247
+ msgstr "%s önce"
248
+
249
+ #: includes/admin-screens.php:301
250
+ msgid "Y/m/d"
251
+ msgstr "Y/m/d"
252
+
253
+ #: includes/admin-screens.php:309
254
+ msgid "Toggle active"
255
+ msgstr "Aktiflik durumunu değiştir"
256
+
257
+ #: includes/admin-screens.php:311
258
+ msgid "The code is active. Click to deactivate it"
259
+ msgstr "Bu kod faal. Devre dışı bırakmak için tıklayınız"
260
+
261
+ #: includes/admin-screens.php:314
262
+ msgid "The code is inactive. Click to activate it"
263
+ msgstr "Bu kod faal değil. Faal hale getirmek için tıklayınız"
264
+
265
+ #: includes/admin-screens.php:365
266
+ msgid "Custom Code"
267
+ msgstr "Özel Kod"
268
+
269
+ #: includes/admin-screens.php:366 includes/admin-screens.php:397
270
+ msgid "Add CSS Code"
271
+ msgstr "CSS Kodu Ekle"
272
+
273
+ #: includes/admin-screens.php:367 includes/admin-screens.php:398
274
+ msgid "Add JS Code"
275
+ msgstr "JS Kodu Ekle"
276
+
277
+ #: includes/admin-screens.php:368 includes/admin-screens.php:399
278
+ msgid "Add HTML Code"
279
+ msgstr "HTML Kodu Ekle"
280
+
281
+ #: includes/admin-screens.php:407
282
+ msgid "Code updated"
283
+ msgstr "Kod güncellendi"
284
+
285
+ #: includes/admin-screens.php:490
286
+ msgid ""
287
+ "/* Add your JavaScript code here.\n"
288
+ " \n"
289
+ "If you are using the jQuery library, then don't forget to wrap your code "
290
+ "inside jQuery.ready() as follows:\n"
291
+ "\n"
292
+ "jQuery(document).ready(function( $ ){\n"
293
+ " // Your code in here \n"
294
+ "});\n"
295
+ "\n"
296
+ "End of comment */ "
297
+ msgstr ""
298
+ "/* Javascript kodunuzu buraya ekleyiniz..\n"
299
+ " \n"
300
+ "Eğer jQuery kutuphanesi kullaniyorsaniz, kodunuzu asagidaki gibi jQuery."
301
+ "ready() icine koymayi unutmayiniz:\n"
302
+ "\n"
303
+ "jQuery(document).ready(function( $ ){\n"
304
+ " //Kodunuz buraya gelecek \n"
305
+ "});\n"
306
+ "\n"
307
+ "Yorum sonu */ "
308
+
309
+ #: includes/admin-screens.php:506
310
+ msgid ""
311
+ "<!-- Add HTML code to the header or the footer. \n"
312
+ "\n"
313
+ "For example, you can use the following code for loading the jQuery library "
314
+ "from Google CDN:\n"
315
+ "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min."
316
+ "js\"></script>\n"
317
+ "\n"
318
+ "or the following one for loading the Bootstrap library from MaxCDN:\n"
319
+ "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/"
320
+ "bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-"
321
+ "BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" "
322
+ "crossorigin=\"anonymous\">\n"
323
+ "\n"
324
+ "-- End of the comment --> "
325
+ msgstr ""
326
+ "<!-- HTML kodunu sayfa üstbaşlığına (header) veya sayfa altbaşlığına "
327
+ "ekler. \n"
328
+ "\n"
329
+ "Örnegin, Google CDN den jQuery kutuphanesini cagirmak icin asagidaki kodu "
330
+ "kullanabilirsiniz:\n"
331
+ "<script src=“https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min."
332
+ "js”></script>\n"
333
+ "\n"
334
+ "veya MaxCDN den Bootstrap kutuphanesini cagirmak icin asagidakini "
335
+ "kullanabilirsiniz:\n"
336
+ "<link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/"
337
+ "bootstrap/3.3.7/css/bootstrap.min.css” integrity=“sha384-"
338
+ "BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u” "
339
+ "crossorigin=“anonymous”>\n"
340
+ "\n"
341
+ " -- Yorum Sonu --> "
342
+
343
+ #: includes/admin-screens.php:532
344
+ msgid ""
345
+ "/* Add your CSS code here.\n"
346
+ " \n"
347
+ "For example:\n"
348
+ ".example {\n"
349
+ " color: red;\n"
350
+ "}\n"
351
+ "\n"
352
+ "For brushing up on your CSS knowledge, check out http://www.w3schools.com/"
353
+ "css/css_syntax.asp\n"
354
+ "\n"
355
+ "End of comment */ "
356
+ msgstr ""
357
+ "/* CSS kodunuzu buraya ekleyiniz.\n"
358
+ " \n"
359
+ "Ornegin :\n"
360
+ ".ornek {\n"
361
+ " color: red;\n"
362
+ "}\n"
363
+ "\n"
364
+ "CSS bilgilerinizi parlatmak icin, suraya bakiniz: http://www.w3schools.com/"
365
+ "css/css_syntax.asp\n"
366
+ "\n"
367
+ "yorum sonu*/ "
368
+
369
+ #: includes/admin-screens.php:646
370
+ msgid "Linking type"
371
+ msgstr "Linkleme çeşidi"
372
+
373
+ #: includes/admin-screens.php:651
374
+ msgid "External File"
375
+ msgstr "Harici Dosya"
376
+
377
+ #: includes/admin-screens.php:655
378
+ msgid "Internal"
379
+ msgstr "Dahili"
380
+
381
+ #: includes/admin-screens.php:661 includes/admin-screens.php:745
382
+ msgid "Where on page"
383
+ msgstr "Sayfanın neresinde"
384
+
385
+ #: includes/admin-screens.php:666 includes/admin-screens.php:750
386
+ msgid "Header"
387
+ msgstr "Üstbaşlık (Header)"
388
+
389
+ #: includes/admin-screens.php:670 includes/admin-screens.php:754
390
+ msgid "Footer"
391
+ msgstr "Altbaşlık (Footer)"
392
+
393
+ #: includes/admin-screens.php:676 includes/admin-screens.php:760
394
+ msgid "Where in site"
395
+ msgstr "Sitede nerede"
396
+
397
+ #: includes/admin-screens.php:681 includes/admin-screens.php:765
398
+ msgid "In Frontend"
399
+ msgstr "Önyüzde"
400
+
401
+ #: includes/admin-screens.php:685 includes/admin-screens.php:769
402
+ msgid "In Admin"
403
+ msgstr "Yönetici panelinde"
404
+
405
+ #: includes/admin-screens.php:691
406
+ msgid "CSS Preprocessor"
407
+ msgstr "CSS Önişleyici"
408
+
409
+ #: includes/admin-screens.php:696
410
+ msgid "None"
411
+ msgstr "Yok"
412
+
413
+ #: includes/admin-screens.php:699
414
+ msgid "Less"
415
+ msgstr "Less"
416
+
417
+ #: includes/admin-screens.php:702
418
+ msgid "SASS (only SCSS syntax)"
419
+ msgstr "SASS (sadece SCSS yazımı)"
420
+
421
+ #: includes/admin-screens.php:708
422
+ msgid "Minify the code"
423
+ msgstr "Kodu küçült"
424
+
425
+ #: includes/admin-screens.php:715 includes/admin-screens.php:796
426
+ msgid "Priority"
427
+ msgstr "Öncelik"
428
+
429
+ #: includes/admin-screens.php:720 includes/admin-screens.php:801
430
+ msgctxt "1 is the highest priority"
431
+ msgid "1 (highest)"
432
+ msgstr "1 (En yüksek)"
433
+
434
+ #: includes/admin-screens.php:729 includes/admin-screens.php:810
435
+ msgctxt "10 is the lowest priority"
436
+ msgid "10 (lowest)"
437
+ msgstr "10 (en düşük)"
438
+
439
+ #: includes/admin-screens.php:775
440
+ msgid "On which device"
441
+ msgstr "Hangi cihazlarda"
442
+
443
+ #: includes/admin-screens.php:781
444
+ msgid "Desktop"
445
+ msgstr "Masaüstü"
446
+
447
+ #: includes/admin-screens.php:785
448
+ msgid "Mobile"
449
+ msgstr "Mobil"
450
+
451
+ #: includes/admin-screens.php:789
452
+ msgid "Both"
453
+ msgstr "Her ikisi"
454
+
455
+ #: includes/admin-screens.php:932
456
+ msgid "The %s directory could not be created"
457
+ msgstr "%s klasörü oluşturulamadı"
458
+
459
+ #: includes/admin-screens.php:933
460
+ msgid "Please run the following commands in order to make the directory"
461
+ msgstr "Klasör oluşturmak için lütfen aşağıdaki komutları çalıştırın"
462
+
463
+ #: includes/admin-screens.php:941
464
+ msgid ""
465
+ "The %s directory is not writable, therefore the CSS and JS files cannot be "
466
+ "saved."
467
+ msgstr ""
468
+ "%s klasörü yazılabilir değil, o yüzden CSS ve JS dosyaları kaydedilemedi."
469
+
470
+ #: includes/admin-screens.php:942
471
+ msgid "Please run the following command to make the directory writable"
472
+ msgstr "Lütfen klasörü yazılabilir yapmak için aşağıdaki komutu çalıştırın"
473
+
474
+ #: includes/admin-warnings.php:55
475
+ msgid ""
476
+ "Please remove the <b>custom-css-js</b> post type from the <b>qTranslate "
477
+ "settings</b> in order to avoid some malfunctions in the Simple Custom CSS & "
478
+ "JS plugin. Check out <a href=\"%s\" target=\"_blank\">this screenshot</a> "
479
+ "for more details on how to do that."
480
+ msgstr ""
481
+ "Simple Custom CSS & JS eklentisinde işlev bozukluklarından kaçınmak için "
482
+ "lütfen <b>qTranslate ayarlarından </b> <b>custom-css-js</b> yazı tipini "
483
+ "kaldırınız. Bunu nasıl yapacağınızın detayları hakkında <a href=“%s” "
484
+ "target=“_blank”>bu ekran görüntüsüne </a> bakınız."
485
+
486
+ #. Plugin URI of the plugin/theme
487
+ msgid "https://wordpress.org/plugins/custom-css-js/"
488
+ msgstr "https://wordpress.org/plugins/custom-css-js/"
489
+
490
+ #. Description of the plugin/theme
491
+ msgid "Easily add Custom CSS or JS to your website with an awesome editor."
492
+ msgstr ""
493
+ "Websitenize harika bir düzenleyici ile özel CSS veya JS i kolayca ekleyin."
494
+
495
+ #. Author of the plugin/theme
496
+ msgid "Diana Burduja"
497
+ msgstr "Diana Burduja"
498
+
499
+ #. Author URI of the plugin/theme
500
+ msgid "https://www.silkypress.com/"
501
+ msgstr "https://www.silkypress.com/"
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,56 @@ 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 +115,40 @@ $. 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.6
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
+ = My website has HTTPS urls, but the codes are linked as HTTP =
103
+ The URL for the linked Codes is built just like the URL for other media (from Media Library) by using the WordPress Address option found on the WP Admin -> Settings -> General page, as shown in [this screenshot](https://www.silkypress.com/wp-content/uploads/2016/12/ccj-siteurl.png). If the WordPress Address has HTTPS in the url, then the Custom Codes and all the other media will have HTTPS in the url.
104
+
105
+
106
  == Screenshots ==
107
 
108
  1. Manage Custom Codes
115
 
116
  == Changelog ==
117
 
118
+ = 3.6 =
119
+ * 09/07/2017
120
+ * Fix: compatibility with the CSS Plus plugin
121
+
122
+ = 3.5 =
123
+ * 08/25/2017
124
+ * Code refactoring
125
+ * Add activate/deactivate link to row actions and in Publish box
126
+ * Make the activate/deactivate links work with AJAX
127
+ * Add Turkish translation
128
+
129
+ = 3.4 =
130
+ * 07/11/2017
131
+ * Security fix according to VN: JVN#31459091 / TN: JPCERT#91837758
132
+
133
+ = 3.3 =
134
+ * 06/23/2017
135
+ * Feature: option for adding Codes to the Login Page
136
+
137
+ = 3.2 =
138
+ * 06/13/2017
139
+ * Fix: compatibility issue with the HTML Editor Syntax Highlighter plugin
140
+
141
+ = 3.1 =
142
+ * 05/14/2017
143
+ * Feature: prepare the plugin for translation
144
+
145
+ = 3.0 =
146
+ * 04/12/2017
147
+ * Feature: create the Web Designer role
148
+ * Feature: allow Custom Codes to be managed only by users with the right capabilities
149
+
150
  = 2.10 =
151
+ * 02/05/2017
152
  * Feature: circumvent external file caching by adding a GET parameter
153
  * Add special offer for Simple Custom CSS and JS pro
154
 
screenshot-1.jpg DELETED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-3.jpg DELETED
Binary file
screenshot-4.jpg DELETED
Binary file