Premium Addons for Elementor - Version 3.5.8

Version Description

  • Tweak: Updated Related Videos control due to YouTube API changes in Video Box widget.
  • Tweak: Video URL extraction enhanced in Video Box widget.
Download this release

Release Info

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

Code changes from version 3.5.7 to 3.5.8

admin/includes/version-control.php CHANGED
@@ -91,7 +91,7 @@ class Version_Control {
91
  <tr class="pa-roll-row">
92
  <th><?php echo __('Rollback Version', 'premium-addons-for-elementor'); ?></th>
93
  <td>
94
- <div><?php echo sprintf( '<a target="_blank" href="%1$s" class="button pa-btn pa-rollback-button elementor-button-spinner">%2$s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ), __('Reinstall Version 3.5.6', 'premium-addons-for-elementor') ); ?></div>
95
  <p class="pa-roll-desc">
96
  <span><?php echo __('Warning: Please backup your database before making the rollback.', 'premium-addons-for-elementor'); ?></span>
97
  </p>
91
  <tr class="pa-roll-row">
92
  <th><?php echo __('Rollback Version', 'premium-addons-for-elementor'); ?></th>
93
  <td>
94
+ <div><?php echo sprintf( '<a target="_blank" href="%1$s" class="button pa-btn pa-rollback-button elementor-button-spinner">%2$s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ), __('Reinstall Version 3.5.7', 'premium-addons-for-elementor') ); ?></div>
95
  <p class="pa-roll-desc">
96
  <span><?php echo __('Warning: Please backup your database before making the rollback.', 'premium-addons-for-elementor'); ?></span>
97
  </p>
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.5.7
7
  Author: Leap13
8
  Author URI: https://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.5.7');
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.5.6');
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.5.8
7
  Author: Leap13
8
  Author URI: https://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.5.8');
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.5.7');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
 
readme.txt CHANGED
@@ -5,14 +5,14 @@ Donate link: http://premiumaddons.com
5
  Requires at least: 4.5
6
  Tested up to: 5.2.2
7
  Requires PHP: 5.4
8
- Stable tag: 3.5.7
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
12
  Elementor Widgets and Addons like Grid, Modal Box, Carousel, Google Maps, Pricing Tables, Countdown, Testimonials, Blog, and much more.
13
 
14
  == Description ==
15
- Premium Elementor addons & widgets with numerous customization options that extends Elementor Page Builder capabilities to help you build impressive websites with no coding required. Click [Here](https://premiumaddons.com/) to check addon elements’ demos.
16
 
17
  Premium Addons for elementor plugin’s widgets & addons are cross browser compatible and also fully responsive, Your website will rock on all browsers as well as tables and mobile devices.
18
 
@@ -141,6 +141,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
144
  = 3.5.7 =
145
 
146
  - Tweak: Added `RTL Mode` option in Grid widget.
5
  Requires at least: 4.5
6
  Tested up to: 5.2.2
7
  Requires PHP: 5.4
8
+ Stable tag: 3.5.8
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
12
  Elementor Widgets and Addons like Grid, Modal Box, Carousel, Google Maps, Pricing Tables, Countdown, Testimonials, Blog, and much more.
13
 
14
  == Description ==
15
+ Premium Elementor addons & widgets with numerous customization options that extends Elementor Page Builder capabilities to help you build impressive websites with no coding required. Click [here](https://premiumaddons.com/) to check addon elements’ demos.
16
 
17
  Premium Addons for elementor plugin’s widgets & addons are cross browser compatible and also fully responsive, Your website will rock on all browsers as well as tables and mobile devices.
18
 
141
 
142
  == Changelog ==
143
 
144
+ = 3.5.8 =
145
+
146
+ - Tweak: Updated `Related Videos` control due to YouTube API changes in Video Box widget.
147
+ - Tweak: Video URL extraction enhanced in Video Box widget.
148
+
149
  = 3.5.7 =
150
 
151
  - Tweak: Added `RTL Mode` option in Grid widget.
widgets/premium-videobox.php CHANGED
@@ -6,6 +6,7 @@ use PremiumAddons\Helper_Functions;
6
  use Elementor\Modules\DynamicTags\Module as TagsModule;
7
  use Elementor\Widget_Base;
8
  use Elementor\Utils;
 
9
  use Elementor\Controls_Manager;
10
  use Elementor\Scheme_Color;
11
  use Elementor\Scheme_Typography;
@@ -46,6 +47,10 @@ class Premium_Videobox extends Widget_Base {
46
  'premium-addons-js'
47
  ];
48
  }
 
 
 
 
49
 
50
  // Adding the controls fields for Premium Video Box
51
  // This will controls the animation, colors and background, dimensions etc
@@ -147,19 +152,7 @@ class Premium_Videobox extends Widget_Base {
147
  ]
148
  ]
149
  );
150
-
151
- $this->add_control('premium_video_box_related_video',
152
- [
153
- 'label' => __('Show Related Videos', 'premium-addons-for-elementor'),
154
- 'type' => Controls_Manager::SWITCHER,
155
- 'description' => __('Enable/Disable related videos after the video'),
156
- 'default' => 'yes',
157
- 'condition' => [
158
- 'premium_video_box_video_type' => 'youtube',
159
- ]
160
- ]
161
- );
162
-
163
  $this->add_control('premium_video_box_controls',
164
  [
165
  'label' => __('Player Controls', 'premium-addons-for-elementor'),
@@ -205,6 +198,20 @@ class Premium_Videobox extends Widget_Base {
205
  ]
206
  ]
207
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  $this->add_control('aspect_ratio',
210
  [
@@ -626,7 +633,7 @@ class Premium_Videobox extends Widget_Base {
626
 
627
  $id = $this->get_id();
628
 
629
- $params = $this->get_vidoe_params();
630
 
631
  $image = $this->get_video_thumbnail( $params['id'] );
632
 
@@ -638,7 +645,7 @@ class Premium_Videobox extends Widget_Base {
638
 
639
  $hosted_url = !empty( $settings['premium_video_box_self_hosted']['url'] ) ? $settings['premium_video_box_self_hosted']['url'] : '' ;
640
 
641
- $related = $settings['premium_video_box_related_video'];
642
 
643
  $mute = $settings['premium_video_box_mute'];
644
 
@@ -646,7 +653,7 @@ class Premium_Videobox extends Widget_Base {
646
 
647
  $controls = $settings['premium_video_box_controls'];
648
 
649
- $options = '?rel=';
650
  $options .= 'yes' === $related ? '1' : '0';
651
  $options .= 'youtube' === $video_type ? '&mute=' : '&muted=';
652
  $options .= 'yes' === $mute ? '1' : '0';
@@ -761,9 +768,7 @@ class Premium_Videobox extends Widget_Base {
761
  if ('youtube' === $type ) {
762
  $thumbnail_src = sprintf('https://i.ytimg.com/vi/%s/maxresdefault.jpg', $id );
763
  } elseif ('vimeo' === $type ) {
764
- // $vimeo = unserialize( file_get_contents( "https://vimeo.com/api/v2/video/$id.php" ) );
765
- // $thumbnail_src = str_replace( '_640', '_840', $vimeo[0]['thumbnail_large'] );
766
-
767
  $vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $id ) . '.php' );
768
  if ( isset( $vimeo_data['response']['code'] ) && '200' == $vimeo_data['response']['code'] ) {
769
  $response = unserialize( $vimeo_data['body'] );
@@ -779,7 +784,7 @@ class Premium_Videobox extends Widget_Base {
779
 
780
  }
781
 
782
- private function get_vidoe_params() {
783
 
784
  $settings = $this->get_settings_for_display();
785
 
@@ -794,14 +799,15 @@ class Premium_Videobox extends Widget_Base {
794
  $link = $settings['premium_video_box_link'];
795
 
796
  if ( ! empty( $link ) ) {
797
-
798
  if ( 'youtube' === $type ) {
799
- $video_id = substr($link, strpos( $link, 'v=' ) + 2 );
800
- $link = sprintf('https://www.youtube.com/embed/%s', $video_id );
 
801
  } elseif ( 'vimeo' === $type ) {
802
- $video_id = substr($link, strpos( $link, '.com/' ) + 5 );
803
- $link = sprintf('https://player.vimeo.com/video/%s', $video_id );
804
  }
 
805
  $id = $video_id;
806
  } elseif ( ! empty( $id ) || ! empty ( $embed ) ) {
807
 
@@ -815,7 +821,7 @@ class Premium_Videobox extends Widget_Base {
815
 
816
  return [
817
  'link' => $link,
818
- 'id' => $id
819
  ];
820
 
821
  }
6
  use Elementor\Modules\DynamicTags\Module as TagsModule;
7
  use Elementor\Widget_Base;
8
  use Elementor\Utils;
9
+ use Elementor\Embed;
10
  use Elementor\Controls_Manager;
11
  use Elementor\Scheme_Color;
12
  use Elementor\Scheme_Typography;
47
  'premium-addons-js'
48
  ];
49
  }
50
+
51
+ public function get_keywords() {
52
+ return ['youtube', 'vimeo', 'self', 'hosted', 'media'];
53
+ }
54
 
55
  // Adding the controls fields for Premium Video Box
56
  // This will controls the animation, colors and background, dimensions etc
152
  ]
153
  ]
154
  );
155
+
 
 
 
 
 
 
 
 
 
 
 
 
156
  $this->add_control('premium_video_box_controls',
157
  [
158
  'label' => __('Player Controls', 'premium-addons-for-elementor'),
198
  ]
199
  ]
200
  );
201
+
202
+ $this->add_control('premium_video_box_suggested_videos',
203
+ [
204
+ 'label' => __('Suggested Videos From', 'premium-addons-for-elementor'),
205
+ 'type' => Controls_Manager::SELECT,
206
+ 'options' => [
207
+ '' => __('Current Channel', 'premium-addons-for-elementor'),
208
+ 'yes' => __('Any Channel', 'premium-addons-for-elementor')
209
+ ],
210
+ 'condition' => [
211
+ 'premium_video_box_video_type' => 'youtube',
212
+ ]
213
+ ]
214
+ );
215
 
216
  $this->add_control('aspect_ratio',
217
  [
633
 
634
  $id = $this->get_id();
635
 
636
+ $params = $this->get_video_params();
637
 
638
  $image = $this->get_video_thumbnail( $params['id'] );
639
 
645
 
646
  $hosted_url = !empty( $settings['premium_video_box_self_hosted']['url'] ) ? $settings['premium_video_box_self_hosted']['url'] : '' ;
647
 
648
+ $related = $settings['premium_video_box_suggested_videos'];
649
 
650
  $mute = $settings['premium_video_box_mute'];
651
 
653
 
654
  $controls = $settings['premium_video_box_controls'];
655
 
656
+ $options = '&rel=';
657
  $options .= 'yes' === $related ? '1' : '0';
658
  $options .= 'youtube' === $video_type ? '&mute=' : '&muted=';
659
  $options .= 'yes' === $mute ? '1' : '0';
768
  if ('youtube' === $type ) {
769
  $thumbnail_src = sprintf('https://i.ytimg.com/vi/%s/maxresdefault.jpg', $id );
770
  } elseif ('vimeo' === $type ) {
771
+
 
 
772
  $vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $id ) . '.php' );
773
  if ( isset( $vimeo_data['response']['code'] ) && '200' == $vimeo_data['response']['code'] ) {
774
  $response = unserialize( $vimeo_data['body'] );
784
 
785
  }
786
 
787
+ private function get_video_params() {
788
 
789
  $settings = $this->get_settings_for_display();
790
 
799
  $link = $settings['premium_video_box_link'];
800
 
801
  if ( ! empty( $link ) ) {
 
802
  if ( 'youtube' === $type ) {
803
+ $video_props = Embed::get_video_properties( $link );
804
+ $link = Embed::get_embed_url( $link );
805
+ $video_id = $video_props['video_id'];
806
  } elseif ( 'vimeo' === $type ) {
807
+ $video_id = substr( $link, strpos( $link, '.com/' ) + 5 );
808
+ $link = sprintf( 'https://player.vimeo.com/video/%s', $video_id );
809
  }
810
+
811
  $id = $video_id;
812
  } elseif ( ! empty( $id ) || ! empty ( $embed ) ) {
813
 
821
 
822
  return [
823
  'link' => $link,
824
+ 'id' => $id
825
  ];
826
 
827
  }