Simple Custom CSS and JS - Version 2.9

Version Description

  • 12/05/2016
  • Compatibility with WP4.7. The "custom HTML code" was not showing up anymore
Download this release

Release Info

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

Code changes from version 2.10 to 2.9

assets/ccj_admin.css CHANGED
@@ -163,10 +163,6 @@ i.ccj-i-fullscreen:before {
163
  .radio-group { line-height: 30px; padding-left: 10px; }
164
  .radio-group .dashicons-before:before { margin: 7px 3px 0 3px; }
165
  .options_meta_box select { margin-left: 10px; }
166
- #custom-code-options .options_meta_box select {
167
- margin-left: 0px;
168
- width: 100%;
169
- }
170
 
171
 
172
 
@@ -358,7 +354,7 @@ height: 3px;
358
  color: white;
359
  }
360
  .ccj_only_premium>div {
361
- font-family:sans-serif;font-size:13px;text-align: center; border-radius: 5px; float: left; background-color: rgb(51, 51, 51); color: white; width: 207px; padding: 20px 20px;
362
  }
363
  .ccj_only_premium a {
364
  color: white; text-decoration: none;
@@ -370,10 +366,9 @@ height: 3px;
370
  .ccj_only_premium-right {
371
  width: 80px;
372
  margin-left: 130px;
373
- margin-top: -120px;
374
  }
375
  .ccj_only_premium-right>div {
376
- width: 200px;
377
  padding: 10px;
378
- margin-left: -110px;
379
  }
163
  .radio-group { line-height: 30px; padding-left: 10px; }
164
  .radio-group .dashicons-before:before { margin: 7px 3px 0 3px; }
165
  .options_meta_box select { margin-left: 10px; }
 
 
 
 
166
 
167
 
168
 
354
  color: white;
355
  }
356
  .ccj_only_premium>div {
357
+ font-family:sans-serif;font-size:13px;text-align: center; border-radius: 5px; float: left; background-color: rgb(51, 51, 51); color: white; width: 147px; padding: 20px 50px;
358
  }
359
  .ccj_only_premium a {
360
  color: white; text-decoration: none;
366
  .ccj_only_premium-right {
367
  width: 80px;
368
  margin-left: 130px;
369
+ margin-top: -60px;
370
  }
371
  .ccj_only_premium-right>div {
372
+ width: 100px;
373
  padding: 10px;
 
374
  }
custom-css-js.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Custom CSS and JS
4
  * Plugin URI: https://wordpress.org/plugins/custom-css-js/
5
  * Description: Easily add Custom CSS or JS to your website with an awesome editor.
6
- * Version: 2.10
7
  * Author: Diana Burduja
8
  * Author URI: https://www.silkypress.com/
9
  * License: GPL2
@@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
15
  }
16
 
17
  if ( ! class_exists( 'CustomCSSandJS' ) ) :
18
- define( 'CCJ_VERSION', '2.10' );
19
  /**
20
  * Main CustomCSSandJS Class
21
  *
@@ -75,7 +75,6 @@ final class CustomCSSandJS {
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' );
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.9
7
  * Author: Diana Burduja
8
  * Author URI: https://www.silkypress.com/
9
  * License: GPL2
15
  }
16
 
17
  if ( ! class_exists( 'CustomCSSandJS' ) ) :
18
+ define( 'CCJ_VERSION', '2.9' );
19
  /**
20
  * Main CustomCSSandJS Class
21
  *
75
  include_once( 'includes/admin-screens.php' );
76
  include_once( 'includes/admin-addons.php' );
77
  include_once( 'includes/admin-warnings.php' );
 
78
  }
79
 
80
  $this->search_tree = get_option( 'custom-css-js-tree' );
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
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">Only available in Premium version</a>
43
  </div>
44
  </div>
45
  <?php
includes/admin-notices.php CHANGED
@@ -17,7 +17,7 @@ class CustomCSSandJS_Notices {
17
  var $activation_time = '';
18
  var $version = '';
19
  var $dismiss_notice = '';
20
- var $expiration_days = 2;
21
 
22
  /**
23
  * Constructor
@@ -40,17 +40,10 @@ class CustomCSSandJS_Notices {
40
  * Hooked from 'admin_notices'
41
  */
42
  public function admin_notices() {
43
- $screen = get_current_screen();
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
 
51
- if ( time() - $this->activation_time <= 3600 )
52
- return;
53
-
54
  $message = $this->get_message( $notice );
55
 
56
  $this->print_message( $notice, $message );
@@ -88,16 +81,16 @@ class CustomCSSandJS_Notices {
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
 
@@ -107,30 +100,28 @@ class CustomCSSandJS_Notices {
107
  public function get_message( $notice ) {
108
 
109
  $message = '';
110
- $percentage = '30';
111
  $product_name = 'Simple Custom CSS and JS PRO';
112
 
113
  $expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
114
  $expiration_date = date( get_option( 'date_format') , $expiration_date );
115
 
116
- $expiration_period = date('j M', $this->activation_time - 3*86400 ) . ' - ' . date('j M', $this->activation_time + 2*86400 );
117
-
118
 
119
  if ( $notice == '12_days' ) {
120
- $link = 'https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner';
121
  } else {
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' :
129
- $message = '<div>Only between '. $expiration_period .': <b>'.$percentage.'% Off from <a href="'.$link.'" target="_blank">'.$product_name.'</a></b> for our WordPress.org users.</div>' . $lower_part;
130
  break;
131
 
132
  case '2_day' :
133
- $message = '<div><b>Limited offer ending today</b>. '.$percentage.'% Off from <a href="'.$link.'" target="_blank">'.$product_name.'</a> for our WordPress.org users. </div>' . $lower_part;
134
  break;
135
 
136
  case '3_day' :
17
  var $activation_time = '';
18
  var $version = '';
19
  var $dismiss_notice = '';
20
+ var $expiration_days = 3;
21
 
22
  /**
23
  * Constructor
40
  * Hooked from 'admin_notices'
41
  */
42
  public function admin_notices() {
 
 
 
 
43
 
44
  if ( ! $notice = $this->choose_notice() )
45
  return;
46
 
 
 
 
47
  $message = $this->get_message( $notice );
48
 
49
  $this->print_message( $notice, $message );
81
  switch ( $days_passed ) {
82
  case 1 : return '1_day';
83
  case 2 : return '2_day';
84
+ case 3 : return '3_day';
85
+ case 4 :
86
+ case 5 :
87
+ case 6 :
88
+ case 7 : return '7_day';
89
+ case 8 :
90
+ case 9 :
91
+ case 10 :
92
+ case 11 :
93
+ case 12 : return '12_day';
94
  }
95
  }
96
 
100
  public function get_message( $notice ) {
101
 
102
  $message = '';
103
+ $percentage = '40';
104
  $product_name = 'Simple Custom CSS and JS PRO';
105
 
106
  $expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
107
  $expiration_date = date( get_option( 'date_format') , $expiration_date );
108
 
 
 
109
 
110
  if ( $notice == '12_days' ) {
111
+ $link = 'https://www.silkypress.com/simple-custom-css-js-pro-offer/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner';
112
  } else {
113
+ $link = 'https://www.silkypress.com/simple-custom-css-js-pro-special-offer/?a=' . $this->convert_numbers_letters( $this->activation_time ) . '&utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner';
114
  }
115
 
116
+ $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 ' . $product_name, 'Dismiss this notice' );
117
 
118
  switch ( $notice ) {
119
  case '1_day' :
120
+ $message = '<div><b>Limited offer ending on '. $expiration_date .'</b>. '.$percentage.'% Off from '.$product_name.' for our WordPress.org users.</div>' . $lower_part;
121
  break;
122
 
123
  case '2_day' :
124
+ $message = '<div><b>Limited offer ending in 1 day (on '. $expiration_date .')</b>. '.$percentage.'% Off from '.$product_name.' for our WordPress.org users. </div>' . $lower_part;
125
  break;
126
 
127
  case '3_day' :
includes/admin-screens.php CHANGED
@@ -576,10 +576,11 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
576
  foreach( $meta as $_key => $a ) {
577
  $close_div = false;
578
 
579
- if ( ($_key == 'preprocessor' && $options['language'] == 'css') ||
580
- ($_key == 'linking' && $options['language'] == 'html') ||
581
- $_key == 'priority' ||
582
- $_key == 'minify' ) {
 
583
  $close_div = true;
584
  $output .= '<div class="ccj_opaque">';
585
  }
@@ -611,7 +612,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
 
@@ -694,25 +695,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
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',
707
- 5 => '5',
708
- 6 => '6',
709
- 7 => '7',
710
- 8 => '8',
711
- 9 => '9',
712
- 10 => '10 (lowest)',
713
- ),
714
- 'disabled' => true,
715
- ),
716
  );
717
 
718
  return $options;
@@ -775,26 +758,6 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
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',
788
- 5 => '5',
789
- 6 => '6',
790
- 7 => '7',
791
- 8 => '8',
792
- 9 => '9',
793
- 10 => '10 (lowest)',
794
- ),
795
- 'disabled' => true,
796
- ),
797
-
798
  );
799
 
800
  return $options;
@@ -1028,21 +991,11 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
1028
  $output .= '<label class="'.$dashicons.'" for="'.$name.'"> '.$a['title'].'</label>';
1029
  $output .= '</div>' . PHP_EOL;
1030
  }
1031
-
1032
-
1033
- // Show select type options
1034
- if ( $a['type'] == 'select' ) {
1035
- $output .= '<div class="radio-group">' . PHP_EOL;
1036
- $output .= '<select name="'.$name.'" id="'.$name.'">' . PHP_EOL;
1037
- foreach( $a['values'] as $__key => $__value ) {
1038
- $selected = ( isset($options[$_key]) && $options[$_key] == $__key) ? ' selected="selected"' : '';
1039
- $output .= '<option value="'.$__key.'"'.$selected.'>' . $__value . '</option>' . PHP_EOL;
1040
- }
1041
- $output .= '</select>' . PHP_EOL;
1042
- $output .= '</div>' . PHP_EOL;
1043
  }
1044
 
1045
-
1046
  return $output;
1047
 
1048
  }
576
  foreach( $meta as $_key => $a ) {
577
  $close_div = false;
578
 
579
+ if ( $_key == 'preprocessor' ) {
580
+ $output .= '<div class="ccj_opaque">';
581
+ }
582
+
583
+ if ( $_key == 'linking' && $options['language'] == 'html' ) {
584
  $close_div = true;
585
  $output .= '<div class="ccj_opaque">';
586
  }
612
 
613
  <div class="ccj_only_premium ccj_only_premium-right">
614
  <div>
615
+ <a href="https://www.silkypress.com/simple-custom-css-js-pro/?utm_source=wordpress&utm_campaign=ccj_free&utm_medium=banner" target="_blank">Only available in Premium version</a>
616
  </div>
617
  </div>
618
 
695
  'dashicon' => 'editor-contract',
696
  'disabled' => true,
697
  ),
698
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  );
700
 
701
  return $options;
758
  ),
759
  'disabled' => true,
760
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761
  );
762
 
763
  return $options;
991
  $output .= '<label class="'.$dashicons.'" for="'.$name.'"> '.$a['title'].'</label>';
992
  $output .= '</div>' . PHP_EOL;
993
  }
994
+
995
+ if ( $_key == 'minify' ) {
996
+ $output .= '</div>';
 
 
 
 
 
 
 
 
 
997
  }
998
 
 
999
  return $output;
1000
 
1001
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ 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
 
@@ -115,11 +115,6 @@ $. 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
-
123
  = 2.9 =
124
  * 12/05/2016
125
  * Compatibility with WP4.7. The "custom HTML code" was not showing up anymore
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.9
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
118
  = 2.9 =
119
  * 12/05/2016
120
  * Compatibility with WP4.7. The "custom HTML code" was not showing up anymore
screenshot-1.jpg DELETED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-3.jpg DELETED
Binary file
screenshot-4.jpg DELETED
Binary file