Elementor Custom Skin - Version 1.3.9

Version Description

  • Solved compatibility issues with Elementor 2.8
  • Fixing issue with Title Widget not showing.
  • Added support for Flip Box Widget background.
Download this release

Release Info

Developer dudaster
Plugin Icon 128x128 Elementor Custom Skin
Version 1.3.9
Comparing to
See all releases

Code changes from version 1.3.7 to 1.3.9

assets/css/ecs-style.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /* Elementor Custom Skin */
2
+ /* https://www.dudaster.com */
3
+ article .elementor-page-title{
4
+ display:block;
5
+ }
ele-custom-skin.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
- * Version: 1.3.7
5
  * Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
6
  * Plugin URI: https://dudaster.com
7
  * Author: Dudaster.com
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
18
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
19
  define( 'ELECS_NAME', plugin_basename( __FILE__ ));
20
  define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
21
- define ('ELECS_VER','1.3.7');
22
 
23
  include_once ELECS_DIR.'includes/ecs-notices.php';
24
  include_once ELECS_DIR.'includes/ecs-dependencies.php';
@@ -46,6 +46,7 @@ if (ecs_dependencies()) {
46
 
47
  // dynamic background fix
48
  require_once ELECS_DIR.'includes/background-fix.php';
 
49
 
50
  add_action('init', 'ecs_check_for_notification');
51
 
1
  <?php
2
  /*
3
  * Plugin Name: Ele Custom Skin
4
+ * Version: 1.3.9
5
  * Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
6
  * Plugin URI: https://dudaster.com
7
  * Author: Dudaster.com
18
  define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
19
  define( 'ELECS_NAME', plugin_basename( __FILE__ ));
20
  define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
21
+ define ('ELECS_VER','1.3.9');
22
 
23
  include_once ELECS_DIR.'includes/ecs-notices.php';
24
  include_once ELECS_DIR.'includes/ecs-dependencies.php';
46
 
47
  // dynamic background fix
48
  require_once ELECS_DIR.'includes/background-fix.php';
49
+ require_once ELECS_DIR.'includes/flip-box-fix.php';
50
 
51
  add_action('init', 'ecs_check_for_notification');
52
 
includes/ecs-dependencies.php CHANGED
@@ -17,8 +17,8 @@ function ecs_clean_plugins($ecs_plugins){
17
  foreach($ecs_plugins as $ecs_plugin){
18
  $folder="";
19
  $file="";
20
- list($folder,$file)=explode('/',$ecs_plugin);
21
- if(!$file) list($folder,$file)=explode('\\',$ecs_plugin); // for windows
22
  $results[]=$file;
23
  }
24
  return $results;
17
  foreach($ecs_plugins as $ecs_plugin){
18
  $folder="";
19
  $file="";
20
+ list($folder,$file)=array_pad(explode('/',$ecs_plugin),2,"");
21
+ if(!$file) list($folder,$file)=array_pad(explode('\\',$ecs_plugin),2,""); // for windows
22
  $results[]=$file;
23
  }
24
  return $results;
includes/ecs-notices.php CHANGED
@@ -86,7 +86,14 @@ function ecs_check_for_notification(){
86
  $i++;
87
  }
88
  }
89
-
 
 
 
 
 
 
 
90
  function ecs_load_notifications(){
91
 
92
  $user_id = get_current_user_id();
@@ -94,17 +101,11 @@ function ecs_load_notifications(){
94
  $ecspro = ecs_is_plugin_active('ele-custom-skin-pro.php') ? true : false;
95
  $nver='ecs_notification_verification';
96
  $ndata='ecs_notification_data';
97
- $nstall="ecs_instalation";
98
- $url='https://www.dropbox.com/s/d1sjvzv4rfkz10u/dudaster-notifications.json?dl=1';
99
-
100
- if ( !get_user_meta( $user_id, $nstall ,true )){
101
- add_user_meta( $user_id, $nstall , time());
102
- }
103
- $days = round((time() - get_user_meta( $user_id, $nstall ,true )) / 86400);
104
-
105
  if ( get_user_meta( $user_id, $nver ,true ) < $current_date){
106
  //get data from url
107
- $content = ecs_file_get($url);
108
  $notifications = json_decode($content,true);
109
  // set the data inside user metadata
110
  if(is_array($notifications)) {
@@ -138,7 +139,8 @@ function ecs_load_notifications(){
138
  return $return_notification;
139
  }
140
 
141
- function ecs_file_get($url){
 
142
  $response = wp_remote_get($url,array( 'timeout' => 2 ));
143
  if( is_array($response) ) {
144
  $header = $response['headers']; // array of http header lines
86
  $i++;
87
  }
88
  }
89
+ function ecs_days_old(){
90
+ $user_id = get_current_user_id();
91
+ $nstall="ecs_instalation";
92
+ if ( !get_user_meta( $user_id, $nstall ,true )){
93
+ add_user_meta( $user_id, $nstall , time());
94
+ }
95
+ return round((time() - get_user_meta( $user_id, $nstall ,true )) / 86400);
96
+ }
97
  function ecs_load_notifications(){
98
 
99
  $user_id = get_current_user_id();
101
  $ecspro = ecs_is_plugin_active('ele-custom-skin-pro.php') ? true : false;
102
  $nver='ecs_notification_verification';
103
  $ndata='ecs_notification_data';
104
+ $url='';
105
+ $days = ecs_days_old();
 
 
 
 
 
 
106
  if ( get_user_meta( $user_id, $nver ,true ) < $current_date){
107
  //get data from url
108
+ $content = ecs_data_get($url);
109
  $notifications = json_decode($content,true);
110
  // set the data inside user metadata
111
  if(is_array($notifications)) {
139
  return $return_notification;
140
  }
141
 
142
+ function ecs_data_get($url){
143
+ if(!$url) return false;
144
  $response = wp_remote_get($url,array( 'timeout' => 2 ));
145
  if( is_array($response) ) {
146
  $header = $response['headers']; // array of http header lines
includes/enqueue-styles.php CHANGED
@@ -24,8 +24,16 @@ class ECS_Enqueue_Style {
24
  return $options;
25
  }
26
  public function frontend_styles() {
 
 
 
 
27
  $styles=$this->get_skin_template();
28
  $upload_dir = wp_upload_dir();
 
 
 
 
29
  if(is_array($styles)) foreach($styles as $id => $ver){
30
  $style_url = $upload_dir['baseurl'].'/elementor/css/post-'.$id.'.css';
31
  $style_file = $upload_dir['basedir'].'/elementor/css/post-'.$id.'.css';
24
  return $options;
25
  }
26
  public function frontend_styles() {
27
+ //adding some css fixes
28
+
29
+ wp_enqueue_style('ecs-styles', plugin_dir_url(__DIR__) . 'assets/css/ecs-style.css');
30
+
31
  $styles=$this->get_skin_template();
32
  $upload_dir = wp_upload_dir();
33
+
34
+ //some people forget to change the http into https and blame the plugin
35
+ $upload_dir['baseurl']=set_url_scheme($upload_dir['baseurl']);
36
+
37
  if(is_array($styles)) foreach($styles as $id => $ver){
38
  $style_url = $upload_dir['baseurl'].'/elementor/css/post-'.$id.'.css';
39
  $style_file = $upload_dir['basedir'].'/elementor/css/post-'.$id.'.css';
includes/flip-box-fix.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ // dynamic background fix
5
+ function ECS_set_bg_element_flip_box( \Elementor\Element_Base $element ) {
6
+ global $ecs_render_loop;
7
+
8
+ if(!$ecs_render_loop || "flip-box" != $element->get_name())
9
+ return; // only act inside loop
10
+ list($PostID,$LoopID)=explode(",",$ecs_render_loop);
11
+ $ElementID = $element->get_ID();
12
+ $dynamic_settings = $element->get_settings( '__dynamic__' );
13
+ $all_controls = $element->get_controls();
14
+ $all_controls = isset($all_controls) ? $all_controls : []; $dynamic_settings = isset($dynamic_settings) ? $dynamic_settings : [];
15
+ $controls = array_intersect_key( $all_controls, $dynamic_settings );
16
+ $settings = $element->parse_dynamic_settings( $dynamic_settings, $controls);
17
+ //print_r($settings);
18
+ /* start custom css */
19
+ $css_rules['flip-box']['normal'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} .elementor-flip-box__front";
20
+ $css_rules['flip-box']['hover'] = "#post-{$PostID} .elementor-{$LoopID} .elementor-element.elementor-element-{$ElementID} .elementor-flip-box__back";
21
+
22
+ $bg['normal']= isset($settings["background_a_image"]["url"]) ? $settings["background_a_image"]["url"] :"";
23
+ $bg['hover']= isset($settings["background_b_image"]["url"]) ? $settings["background_b_image"]["url"] : "";
24
+
25
+ $key_element = 'flip-box';
26
+
27
+ $ECS_css="";
28
+ foreach($css_rules[$key_element] as $key => $value){
29
+ $ECS_css.=$bg[$key] ? $css_rules[$key_element][$key]." {background-image:url(".$bg[$key].");} " : "";
30
+ }
31
+
32
+ echo $ECS_css ? "<style>".$ECS_css."</style>" :"";
33
+ /* end custom css*/
34
+ }
35
+
36
+ add_action( 'elementor/frontend/widget/before_render', 'ECS_set_bg_element_flip_box' );
includes/pro-preview.php CHANGED
@@ -7,9 +7,24 @@
7
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
 
9
  add_action( 'ECS_after_control', function($skin){
 
10
 
11
-
12
- $skin->add_control(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  'alternating_templates',
14
  [
15
  'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( '<b>Alternating templates</b>', 'ele-custom-skin' ),
@@ -21,11 +36,14 @@ add_action( 'ECS_after_control', function($skin){
21
  'default' => '',
22
  'frontend_available' => true,
23
  'selectors' =>[' '=>' '],
 
 
 
24
 
25
  ]
26
  );
27
 
28
- $repeater = new \Elementor\Repeater();
29
 
30
  $repeater->add_control(
31
  'nth',
@@ -69,6 +87,7 @@ add_action( 'ECS_after_control', function($skin){
69
  ],
70
  'condition' => [
71
  $skin->get_id().'_alternating_templates' => 'yes',
 
72
  ],
73
  'title_field' => '<p style="text-align:center;"><i class="fa fa-lock" aria-hidden="true"></i> '.__('Template for every ', 'ele-custom-skin').'{{{nth}}}'.__('th post', 'ele-custom-skin').'</p>',
74
  ]
@@ -81,6 +100,9 @@ add_action( 'ECS_after_control', function($skin){
81
  'label' => __( 'Display Mode', 'ele-custom-skin' ),
82
  'type' => \Elementor\Controls_Manager::HEADING,
83
  'separator' => 'before',
 
 
 
84
  ]
85
  );
86
  if ('2019-09-20' <= date("Y-m-d")) $skin->add_control(
@@ -95,7 +117,8 @@ add_action( 'ECS_after_control', function($skin){
95
  'frontend_available' => true,
96
  'condition' => [
97
  $skin->get_id().'_same_height!' => '100%',
98
- $skin->get_id().'_post_slider!' => 'yes'
 
99
  ],
100
  ]
101
  );
@@ -108,6 +131,9 @@ add_action( 'ECS_after_control', function($skin){
108
  'label_on' => __( 'On', 'ele-custom-skin' ),
109
  'return_value' => '100%',
110
  'default' => 'auto',
 
 
 
111
  ]
112
  );
113
 
@@ -119,7 +145,7 @@ add_action( 'ECS_after_control', function($skin){
119
  *
120
  **/
121
 
122
- if ('2019-09-20' <= date("Y-m-d")) $skin->add_control(
123
  'post_slider',
124
  [
125
  'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( 'Show in Slider', 'ele-custom-skin' ),
@@ -131,6 +157,7 @@ add_action( 'ECS_after_control', function($skin){
131
  'frontend_available' => true,
132
  'condition' => [
133
  $skin->get_id().'_masonrys!' => 'yes',
 
134
  ],
135
  ]
136
  );
@@ -144,6 +171,7 @@ add_action( 'ECS_after_control', function($skin){
144
  'separator' => 'before',
145
  'condition' => [
146
  $skin->get_id().'_post_slider' => 'yes',
 
147
  ],
148
  ]
149
  );
@@ -159,6 +187,7 @@ add_action( 'ECS_after_control', function($skin){
159
  ] + $slides_to_show,
160
  'condition' => [
161
  $skin->get_id().'_post_slider' => 'yes',
 
162
  ],
163
  'frontend_available' => true,
164
  ]
@@ -175,6 +204,7 @@ add_action( 'ECS_after_control', function($skin){
175
  'condition' => [
176
  $skin->get_id().'_slides_to_show!' => '1',
177
  $skin->get_id().'_post_slider' => 'yes',
 
178
  ],
179
  'frontend_available' => true,
180
  ]
@@ -193,6 +223,7 @@ add_action( 'ECS_after_control', function($skin){
193
  ],
194
  'condition' => [
195
  $skin->get_id().'_post_slider' => 'yes',
 
196
  ],
197
  'frontend_available' => true,
198
  ]
@@ -211,6 +242,9 @@ add_action( 'ECS_after_control', function($skin){
211
  'label' => __( 'Dynamic Everywhere', 'ele-custom-skin' ),
212
  'type' => \Elementor\Controls_Manager::HEADING,
213
  'separator' => 'before',
 
 
 
214
  ]
215
  );
216
  $skin->add_control(
@@ -222,6 +256,9 @@ add_action( 'ECS_after_control', function($skin){
222
  'label_off' => __( 'No', 'ele-custom-skin' ),
223
  'return_value' => 'yes',
224
  'default' => 'no',
 
 
 
225
  ]
226
  );
227
 
@@ -230,7 +267,10 @@ add_action( 'ECS_after_control', function($skin){
230
  [
231
  'label' => '',
232
  'type' => \Elementor\Controls_Manager::RAW_HTML,
233
- 'raw' => '<div>Replace all the dynamic {{keywords}} from the Loop Template.</div>',
 
 
 
234
  ]
235
  );
236
 
7
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
 
9
  add_action( 'ECS_after_control', function($skin){
10
+ ecs_days_old();
11
 
12
+ $skin->add_control(
13
+ 'pro_features',
14
+ [
15
+ 'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( 'See <b>Pro</b> features', 'ele-custom-skin' ),
16
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
17
+ 'label_off' => __( 'Hide', 'ele-custom-skin' ),
18
+ 'label_on' => __( 'Show', 'ele-custom-skin' ),
19
+ 'return_value' => 'yes',
20
+ 'separator' => 'before',
21
+ 'default' => ecs_days_old() > 8 ? '' : 'yes',
22
+ 'frontend_available' => true,
23
+ 'selectors' =>[' '=>' '],
24
+ ]
25
+ );
26
+
27
+ $skin->add_control(
28
  'alternating_templates',
29
  [
30
  'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( '<b>Alternating templates</b>', 'ele-custom-skin' ),
36
  'default' => '',
37
  'frontend_available' => true,
38
  'selectors' =>[' '=>' '],
39
+ 'condition' => [
40
+ $skin->get_id().'_pro_features' => 'yes'
41
+ ],
42
 
43
  ]
44
  );
45
 
46
+ $repeater = new \Elementor\Repeater();
47
 
48
  $repeater->add_control(
49
  'nth',
87
  ],
88
  'condition' => [
89
  $skin->get_id().'_alternating_templates' => 'yes',
90
+ $skin->get_id().'_pro_features' => 'yes'
91
  ],
92
  'title_field' => '<p style="text-align:center;"><i class="fa fa-lock" aria-hidden="true"></i> '.__('Template for every ', 'ele-custom-skin').'{{{nth}}}'.__('th post', 'ele-custom-skin').'</p>',
93
  ]
100
  'label' => __( 'Display Mode', 'ele-custom-skin' ),
101
  'type' => \Elementor\Controls_Manager::HEADING,
102
  'separator' => 'before',
103
+ 'condition' => [
104
+ $skin->get_id().'_pro_features' => 'yes'
105
+ ],
106
  ]
107
  );
108
  if ('2019-09-20' <= date("Y-m-d")) $skin->add_control(
117
  'frontend_available' => true,
118
  'condition' => [
119
  $skin->get_id().'_same_height!' => '100%',
120
+ $skin->get_id().'_post_slider!' => 'yes',
121
+ $skin->get_id().'_pro_features' => 'yes'
122
  ],
123
  ]
124
  );
131
  'label_on' => __( 'On', 'ele-custom-skin' ),
132
  'return_value' => '100%',
133
  'default' => 'auto',
134
+ 'condition' => [
135
+ $skin->get_id().'_pro_features' => 'yes'
136
+ ],
137
  ]
138
  );
139
 
145
  *
146
  **/
147
 
148
+ $skin->add_control(
149
  'post_slider',
150
  [
151
  'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( 'Show in Slider', 'ele-custom-skin' ),
157
  'frontend_available' => true,
158
  'condition' => [
159
  $skin->get_id().'_masonrys!' => 'yes',
160
+ $skin->get_id().'_pro_features' => 'yes',
161
  ],
162
  ]
163
  );
171
  'separator' => 'before',
172
  'condition' => [
173
  $skin->get_id().'_post_slider' => 'yes',
174
+ $skin->get_id().'_pro_features' => 'yes',
175
  ],
176
  ]
177
  );
187
  ] + $slides_to_show,
188
  'condition' => [
189
  $skin->get_id().'_post_slider' => 'yes',
190
+ $skin->get_id().'_pro_features' => 'yes',
191
  ],
192
  'frontend_available' => true,
193
  ]
204
  'condition' => [
205
  $skin->get_id().'_slides_to_show!' => '1',
206
  $skin->get_id().'_post_slider' => 'yes',
207
+ $skin->get_id().'_pro_features' => 'yes',
208
  ],
209
  'frontend_available' => true,
210
  ]
223
  ],
224
  'condition' => [
225
  $skin->get_id().'_post_slider' => 'yes',
226
+ $skin->get_id().'_pro_features' => 'yes',
227
  ],
228
  'frontend_available' => true,
229
  ]
242
  'label' => __( 'Dynamic Everywhere', 'ele-custom-skin' ),
243
  'type' => \Elementor\Controls_Manager::HEADING,
244
  'separator' => 'before',
245
+ 'condition' => [
246
+ $skin->get_id().'_pro_features' => 'yes'
247
+ ],
248
  ]
249
  );
250
  $skin->add_control(
256
  'label_off' => __( 'No', 'ele-custom-skin' ),
257
  'return_value' => 'yes',
258
  'default' => 'no',
259
+ 'condition' => [
260
+ $skin->get_id().'_pro_features' => 'yes'
261
+ ],
262
  ]
263
  );
264
 
267
  [
268
  'label' => '',
269
  'type' => \Elementor\Controls_Manager::RAW_HTML,
270
+ 'raw' => '<div>Replace all the dynamic &#123;&#123;keywords&#125;&#125; from the Loop Template.</div>',
271
+ 'condition' => [
272
+ $skin->get_id().'_pro_features' => 'yes'
273
+ ],
274
  ]
275
  );
276
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: page-builder, elementor, loop, archive list, post widget, skin, custom, po
4
  Donate link: https://www.paypal.me/dudaster
5
  Requires at least: 5.0
6
  Tested up to: 5.3.1
7
- Stable tag: 1.3.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,8 +59,17 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
 
 
62
  = 1.3.7 =
63
- * Fixing padding issues with 1.4.6 update.
64
  * Fixing no results issue.
65
  * Added some hooks. Documentation will come later.
66
  * Fixing dependecies issues on some instalations.
4
  Donate link: https://www.paypal.me/dudaster
5
  Requires at least: 5.0
6
  Tested up to: 5.3.1
7
+ Stable tag: 1.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = 1.3.9 =
63
+ * Solved compatibility issues with Elementor 2.8
64
+ * Fixing issue with Title Widget not showing.
65
+ * Added support for Flip Box Widget background.
66
+
67
+ = 1.3.8 =
68
+ * Fixing minor issues.
69
+ * Fixing issue loading css over http.
70
+
71
  = 1.3.7 =
72
+ * Fixing padding issues with 1.3.6 update.
73
  * Fixing no results issue.
74
  * Added some hooks. Documentation will come later.
75
  * Fixing dependecies issues on some instalations.
skins/skin-custom.php CHANGED
@@ -70,7 +70,7 @@ class Skin_Posts_ECS extends Skin_Base {
70
  );
71
 
72
  do_action( 'ECS_after_control', $this );
73
-
74
  $this->add_control(
75
  'hr2',
76
  [
70
  );
71
 
72
  do_action( 'ECS_after_control', $this );
73
+
74
  $this->add_control(
75
  'hr2',
76
  [