Premium Addons for Elementor - Version 3.2.5

Version Description

  • Fixed: Vimeo video thumbnail issue with Overlay option disabled.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 3.2.5
Comparing to
See all releases

Code changes from version 3.2.4 to 3.2.5

admin/settings/version-control.php CHANGED
@@ -79,7 +79,7 @@ class PA_Version_Control {
79
  <tr class="pa-roll-row">
80
  <th>Rollback Version</th>
81
  <td>
82
- <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.2.3</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
  </td>
85
  </tr>
79
  <tr class="pa-roll-row">
80
  <th>Rollback Version</th>
81
  <td>
82
+ <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.2.4</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
  </td>
85
  </tr>
assets/js/lib/scrollify.js CHANGED
@@ -68,6 +68,7 @@ if touchScroll is false - update index
68
  disabled = false,
69
  scrollSamples = [],
70
  scrollTime = new Date().getTime(),
 
71
  firstLoad = true,
72
  initialised = false,
73
  destination = 0,
@@ -81,6 +82,7 @@ if touchScroll is false - update index
81
  scrollSpeed: 1100,
82
  offset: 0,
83
  scrollbars: true,
 
84
  target:"html,body",
85
  standardScrollElements: false,
86
  setHeights: true,
@@ -267,7 +269,14 @@ if touchScroll is false - update index
267
  animateScroll(closest,instant,callbacks,false);
268
  }
269
  },
270
- wheelHandler:function(e) {
 
 
 
 
 
 
 
271
  if(disabled===true) {
272
  return true;
273
  } else if(settings.standardScrollElements) {
@@ -834,6 +843,12 @@ if touchScroll is false - update index
834
  manualScroll.calculateNearest(false,false);
835
  }
836
  };
 
 
 
 
 
 
837
  scrollify.isDisabled = function() {
838
  return disabled;
839
  };
68
  disabled = false,
69
  scrollSamples = [],
70
  scrollTime = new Date().getTime(),
71
+ currentScrollID = null,
72
  firstLoad = true,
73
  initialised = false,
74
  destination = 0,
82
  scrollSpeed: 1100,
83
  offset: 0,
84
  scrollbars: true,
85
+ templates: false,
86
  target:"html,body",
87
  standardScrollElements: false,
88
  setHeights: true,
269
  animateScroll(closest,instant,callbacks,false);
270
  }
271
  },
272
+ wheelHandler:function( e ) {
273
+
274
+ var sectionSelector = settings.templates ? ".premium-vscroll-temp" : ".elementor-top-section",
275
+ $section = $( e.target ).closest( sectionSelector ),
276
+ sectionID = $section.attr("id");
277
+
278
+ currentScrollID = sectionID;
279
+
280
  if(disabled===true) {
281
  return true;
282
  } else if(settings.standardScrollElements) {
843
  manualScroll.calculateNearest(false,false);
844
  }
845
  };
846
+ scrollify.currentScroll = function() {
847
+ return currentScrollID;
848
+ };
849
+ scrollify.isScrollable = function() {
850
+ return scrollable;
851
+ };
852
  scrollify.isDisabled = function() {
853
  return disabled;
854
  };
assets/js/premium-vscroll.js CHANGED
@@ -15,9 +15,9 @@
15
  instance.init();
16
 
17
  // var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
18
- // var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));
19
- //
20
- //
21
  // if( touch ) {
22
  // instance = new premiumVerticalScroll2( vScrollElem, vScrollSettings );
23
  // instance.init();
@@ -31,7 +31,6 @@
31
  // }
32
  // }
33
 
34
-
35
  };
36
 
37
 
@@ -40,17 +39,16 @@
40
  var self = this,
41
  $instance = $selector,
42
  $window = $( window ),
43
- $htmlBody = $("html, body"),
44
  checkTemps = $selector.find( ".premium-vscroll-sections-wrap" ).length,
45
  deviceType = $("body").data("elementor-device-mode"),
46
- $itemsList = $(".premium-vscroll-dot-item", $instance),
47
- $menuItems = $(".premium-vscroll-nav-item", $instance),
48
- animated = 0;
 
49
 
50
 
51
  var $lastItem = $itemsList.last(),
52
- lastSectionId = $lastItem.data("menuanchor"),
53
- lastOffset = Math.round( $( "#" + lastSectionId ).offset().top );
54
 
55
  self.init = function() {
56
 
@@ -66,10 +64,11 @@
66
  $.scrollify({
67
  section: ".premium-vscroll-section",
68
  updateHash: false,
69
- standardScrollElements: "#" + lastSectionId,
70
  scrollSpeed: settings.speed,
71
  overflowScroll: settings.overflow,
72
  setHeights: settings.setHeight,
 
73
  before: function( index ) {
74
 
75
  $menuItems.removeClass("active");
@@ -80,7 +79,7 @@
80
 
81
  },
82
  after: function( index ) {
83
-
84
  if ( index === $lastItem.index() ) {
85
  // $.scrollify.disable();
86
  }
@@ -121,51 +120,162 @@
121
 
122
  };
123
 
124
- self.onWheel = function( event ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
- var $target = $( event.target ),
127
- sectionSelector = checkTemps ? ".premium-vscroll-temp" : ".elementor-top-section",
128
- $section = $target.closest( sectionSelector ),
129
- sectionId = $section.attr( "id" ),
130
- $currentSection = $.scrollify.current();
 
 
 
 
 
131
 
132
- //re-enable Scrollify
133
- if ( sectionId !== lastSectionId && $section.hasClass("premium-vscroll-section") && $.scrollify.isDisabled() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  $(".premium-vscroll-dots, .premium-vscroll-nav-menu").removeClass(
136
  "premium-vscroll-dots-hide"
137
  );
 
 
 
 
 
 
138
 
139
- $.scrollify.enable();
 
140
 
141
- }
142
-
143
- if ( ! $section.hasClass("premium-vscroll-section") && $.scrollify.isDisabled() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
- $(".premium-vscroll-tooltip").hide();
146
 
147
- $(".premium-vscroll-dots, .premium-vscroll-nav-menu").addClass(
148
- "premium-vscroll-dots-hide"
149
- );
150
 
151
- }
152
-
153
-
154
-
155
  };
156
 
 
157
  self.moveSectionDown = function() {
158
  $.scrollify.next();
159
- }
160
 
161
  self.moveSectionUp = function() {
162
  $.scrollify.previous();
163
- }
164
 
165
  self.moveToSection = function( index ) {
166
 
167
  $.scrollify.move( index );
168
- }
169
 
170
  self.setSectionsData = function() {
171
 
@@ -177,6 +287,13 @@
177
 
178
  $section.addClass( "premium-vscroll-section" );
179
 
 
 
 
 
 
 
 
180
  });
181
 
182
  };
@@ -426,7 +543,7 @@
426
  var $this = $(this),
427
  sectionId = $this.data("menuanchor"),
428
  $section = $("#" + sectionId);
429
- if ($section[0]) {
430
  sections[sectionId] = {
431
  selector: $section,
432
  offset: Math.round($section.offset().top),
15
  instance.init();
16
 
17
  // var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
18
+ // var isTouch = ( ( 'ontouchstart' in window ) || ( navigator.msMaxTouchPoints > 0 ) || ( navigator.maxTouchPoints ) );
19
+
20
+
21
  // if( touch ) {
22
  // instance = new premiumVerticalScroll2( vScrollElem, vScrollSettings );
23
  // instance.init();
31
  // }
32
  // }
33
 
 
34
  };
35
 
36
 
39
  var self = this,
40
  $instance = $selector,
41
  $window = $( window ),
 
42
  checkTemps = $selector.find( ".premium-vscroll-sections-wrap" ).length,
43
  deviceType = $("body").data("elementor-device-mode"),
44
+ $itemsList = $(".premium-vscroll-dot-item", $instance ),
45
+ $menuItems = $(".premium-vscroll-nav-item", $instance ),
46
+ sections = {},
47
+ lastScrollTop = 0;
48
 
49
 
50
  var $lastItem = $itemsList.last(),
51
+ lastSectionId = $lastItem.data("menuanchor");
 
52
 
53
  self.init = function() {
54
 
64
  $.scrollify({
65
  section: ".premium-vscroll-section",
66
  updateHash: false,
67
+ // standardScrollElements: "#" + lastSectionId,
68
  scrollSpeed: settings.speed,
69
  overflowScroll: settings.overflow,
70
  setHeights: settings.setHeight,
71
+ templates: checkTemps,
72
  before: function( index ) {
73
 
74
  $menuItems.removeClass("active");
79
 
80
  },
81
  after: function( index ) {
82
+ console.log( index );
83
  if ( index === $lastItem.index() ) {
84
  // $.scrollify.disable();
85
  }
120
 
121
  };
122
 
123
+ self.getDirection = function() {
124
+
125
+ var st = window.pageYOffset || document.documentElement.scrollTop,
126
+ direction = null;
127
+
128
+
129
+ if ( st > lastScrollTop ) {
130
+ direction = "down";
131
+ } else {
132
+ direction = "up";
133
+ }
134
+
135
+ lastScrollTop = st <= 0 ? 0 : st;
136
+
137
+ return direction;
138
 
139
+ };
140
+
141
+ self.checkNextSection = function( object, key ) {
142
+ var keys = Object.keys( object ),
143
+ idIndex = keys.indexOf( key ),
144
+ nextIndex = ( idIndex += 1 );
145
+
146
+ if ( nextIndex >= keys.length ) {
147
+
148
+ return false;
149
 
150
+ }
151
+
152
+ var nextKey = keys[ nextIndex ];
153
+
154
+ return nextKey;
155
+
156
+ };
157
+
158
+ self.checkPrevSection = function( object, key ) {
159
+ var keys = Object.keys( object ),
160
+ idIndex = keys.indexOf( key ),
161
+ prevIndex = ( idIndex -= 1 );
162
+
163
+ if ( 0 > idIndex ) {
164
+
165
+ return false;
166
+
167
+ }
168
+
169
+ var prevKey = keys[ prevIndex ];
170
+
171
+ return prevKey;
172
+
173
+ };
174
+
175
+ self.getSectionId = function( $selector ) {
176
+
177
+ return $selector.attr("id");
178
+
179
+ };
180
+
181
+ self.onWheel = function( event ) {
182
+
183
+ var $target = $( event.target ),
184
+ sectionId = $.scrollify.currentScroll(),
185
+ direction = self.getDirection(),
186
+ isDisabled = $.scrollify.isDisabled(),
187
+ newSectionId = false,
188
+ nextSectionId = false,
189
+ prevSectionId = false,
190
+ currentSectionID = self.getSectionId( $.scrollify.current() ),
191
+ windowScrollTop = $window.scrollTop(),
192
+ $lastselector = $('#' + lastSectionId );
193
+
194
+
195
+ nextSectionId = self.checkNextSection( sections, sectionId );
196
+ prevSectionId = self.checkPrevSection( sections, sectionId );
197
+
198
+ if ( "up" === direction ) {
199
+ if (! nextSectionId && sections[ sectionId ].offset < windowScrollTop ) {
200
+ newSectionId = sectionId;
201
+ } else {
202
+ newSectionId = prevSectionId;
203
+ }
204
+ }
205
+
206
+ if ( "down" === direction ) {
207
+ if (
208
+ !prevSectionId &&
209
+ sections[sectionId].offset > windowScrollTop + 5
210
+ ) {
211
+ newSectionId = sectionId;
212
+ } else {
213
+ newSectionId = nextSectionId;
214
+ }
215
+ }
216
+
217
+ if( newSectionId ) {
218
 
219
  $(".premium-vscroll-dots, .premium-vscroll-nav-menu").removeClass(
220
  "premium-vscroll-dots-hide"
221
  );
222
+
223
+ if( lastSectionId === sectionId && "up" === direction ) {
224
+
225
+ // $.scrollify.enable();
226
+
227
+ }
228
 
229
+
230
+ } else {
231
 
232
+ if ( "down" === direction ) {
233
+
234
+ if ( ! nextSectionId ) {
235
+
236
+ if ( $lastselector.offset().top + $lastselector.innerHeight() - $( document ).scrollTop() > 600 ) {
237
+
238
+ $.scrollify.disable();
239
+
240
+ $(".premium-vscroll-dots, .premium-vscroll-nav-menu").addClass(
241
+ "premium-vscroll-dots-hide"
242
+ );
243
+ }
244
+
245
+ }
246
+ } else if ( "up" === direction ) {
247
+
248
+ // if ( prevSectionId ) {
249
+ //
250
+ // $.scrollify.enable();
251
+ //
252
+ // $(".premium-vscroll-dots, .premium-vscroll-nav-menu").addClass(
253
+ // "premium-vscroll-dots-hide"
254
+ // );
255
+ //
256
+ // }
257
+
258
+ }
259
+
260
+ }
261
 
 
262
 
 
 
 
263
 
 
 
 
 
264
  };
265
 
266
+
267
  self.moveSectionDown = function() {
268
  $.scrollify.next();
269
+ };
270
 
271
  self.moveSectionUp = function() {
272
  $.scrollify.previous();
273
+ };
274
 
275
  self.moveToSection = function( index ) {
276
 
277
  $.scrollify.move( index );
278
+ };
279
 
280
  self.setSectionsData = function() {
281
 
287
 
288
  $section.addClass( "premium-vscroll-section" );
289
 
290
+ if ( $section[0] ) {
291
+ sections[ sectionId ] = {
292
+ selector: $section
293
+ };
294
+ }
295
+
296
+
297
  });
298
 
299
  };
543
  var $this = $(this),
544
  sectionId = $this.data("menuanchor"),
545
  $section = $("#" + sectionId);
546
+ if ( $section[0] ) {
547
  sections[sectionId] = {
548
  selector: $section,
549
  offset: Math.round($section.offset().top),
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 3.2.4
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
@@ -14,12 +14,12 @@ License: GNU General Public License v3.0
14
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
 
16
  // Define Constants
17
- define('PREMIUM_ADDONS_VERSION', '3.2.4');
18
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
  define('PREMIUM_ADDONS_FILE', __FILE__);
21
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(PREMIUM_ADDONS_FILE));
22
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.2.3');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
  /*
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 3.2.5
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
14
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
 
16
  // Define Constants
17
+ define('PREMIUM_ADDONS_VERSION', '3.2.5');
18
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
  define('PREMIUM_ADDONS_FILE', __FILE__);
21
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(PREMIUM_ADDONS_FILE));
22
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.2.4');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
  /*
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://premiumaddons.com
5
  Requires at least: 4.5
6
  Tested up to: 5.1.1
7
  Requires PHP: 5.4
8
- Stable tag: 3.2.4
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -139,6 +139,10 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
  = 3.2.4 =
143
 
144
  - Tweak: Added `Portuguese` translation.
5
  Requires at least: 4.5
6
  Tested up to: 5.1.1
7
  Requires PHP: 5.4
8
+ Stable tag: 3.2.5
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
139
 
140
  == Changelog ==
141
 
142
+ = 3.2.5 =
143
+
144
+ - Fixed: Vimeo video thumbnail issue with `Overlay` option disabled.
145
+
146
  = 3.2.4 =
147
 
148
  - Tweak: Added `Portuguese` translation.
widgets/premium-videobox.php CHANGED
@@ -649,8 +649,15 @@ class Premium_Videobox extends Widget_Base {
649
  if ('youtube' === $type ) {
650
  $thumbnail_src = sprintf('https://i.ytimg.com/vi/%s/maxresdefault.jpg', $id );
651
  } elseif ('vimeo' === $type ) {
652
- $vimeo = unserialize( file_get_contents( "https://vimeo.com/api/v2/video/$id.php" ) );
653
- $thumbnail_src = str_replace( '_640', '_840', $vimeo[0]['thumbnail_large'] );
 
 
 
 
 
 
 
654
  } else {
655
  $thumbnail_src = 'transparent';
656
  }
@@ -661,6 +668,7 @@ class Premium_Videobox extends Widget_Base {
661
  }
662
 
663
  private function get_vidoe_params() {
 
664
  $settings = $this->get_settings_for_display();
665
 
666
  $type = $settings['premium_video_box_video_type'];
649
  if ('youtube' === $type ) {
650
  $thumbnail_src = sprintf('https://i.ytimg.com/vi/%s/maxresdefault.jpg', $id );
651
  } elseif ('vimeo' === $type ) {
652
+ // $vimeo = unserialize( file_get_contents( "https://vimeo.com/api/v2/video/$id.php" ) );
653
+ // $thumbnail_src = str_replace( '_640', '_840', $vimeo[0]['thumbnail_large'] );
654
+
655
+ $vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $id ) . '.php' );
656
+ if ( isset( $vimeo_data['response']['code'] ) && '200' == $vimeo_data['response']['code'] ) {
657
+ $response = unserialize( $vimeo_data['body'] );
658
+ $thumbnail_src = isset( $response[0]['thumbnail_large'] ) ? $response[0]['thumbnail_large'] : false;
659
+ }
660
+
661
  } else {
662
  $thumbnail_src = 'transparent';
663
  }
668
  }
669
 
670
  private function get_vidoe_params() {
671
+
672
  $settings = $this->get_settings_for_display();
673
 
674
  $type = $settings['premium_video_box_video_type'];