Premium Addons for Elementor - Version 4.5.1

Version Description

  • Tweak: Added new devices added in Elementor Custom Breakpoints to Equal Height feature.
  • Tweak: Code refactored for better performance and security.
Download this release

Release Info

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

Code changes from version 4.5.0 to 4.5.1

admin/assets/js/pa-notice.js CHANGED
@@ -1,64 +1,65 @@
1
- (function ($) {
2
-
3
- var $noticeWrap = $(".pa-notice-wrap"),
4
- notice = $noticeWrap.data('notice');
5
-
6
- var adminNotices = {
7
- 'trustpilot': 'trustpilot_notice',
8
- 'black-friday': 'papro_new_bf_notice'
9
- };
10
-
11
- if (undefined !== notice) {
12
-
13
- $noticeWrap.find('.pa-notice-reset').on(
14
- "click",
15
- function () {
16
-
17
- $noticeWrap.css('display', 'none');
18
-
19
- $.ajax(
20
- {
21
- url: ajaxurl,
22
- type: 'POST',
23
- data: {
24
- action: 'pa_reset_admin_notice',
25
- notice: $noticeWrap.data('notice')
26
- }
27
- }
28
- );
29
-
30
- }
31
- );
32
- }
33
-
34
- $(".pa-notice-close").on(
35
- "click",
36
- function () {
37
-
38
- var noticeID = $(this).data('notice');
39
-
40
- if (noticeID) {
41
- $(this).closest('.pa-new-feature-notice').remove();
42
-
43
- $.ajax(
44
- {
45
- url: ajaxurl,
46
- type: 'POST',
47
- data: {
48
- action: 'pa_dismiss_admin_notice',
49
- notice: adminNotices[noticeID]
50
- },
51
- success: function (res) {
52
- console.log(res);
53
- },
54
- error: function (err) {
55
- console.log(err);
56
- }
57
- }
58
- );
59
- }
60
-
61
- }
62
- );
63
-
64
- })(jQuery);
 
1
+ (function ($) {
2
+
3
+ var $noticeWrap = $(".pa-notice-wrap"),
4
+ notice = $noticeWrap.data('notice');
5
+
6
+ var adminNotices = {
7
+ 'trustpilot': 'trustpilot_notice',
8
+ };
9
+
10
+ if (undefined !== notice) {
11
+
12
+ $noticeWrap.find('.pa-notice-reset').on(
13
+ "click",
14
+ function () {
15
+
16
+ $noticeWrap.css('display', 'none');
17
+
18
+ $.ajax(
19
+ {
20
+ url: ajaxurl,
21
+ type: 'POST',
22
+ data: {
23
+ action: 'pa_reset_admin_notice',
24
+ notice: $noticeWrap.data('notice'),
25
+ nonce: PaNoticeSettings.nonce,
26
+ }
27
+ }
28
+ );
29
+
30
+ }
31
+ );
32
+ }
33
+
34
+ $(".pa-notice-close").on(
35
+ "click",
36
+ function () {
37
+
38
+ var noticeID = $(this).data('notice');
39
+
40
+ if (noticeID) {
41
+ $(this).closest('.pa-new-feature-notice').remove();
42
+
43
+ $.ajax(
44
+ {
45
+ url: ajaxurl,
46
+ type: 'POST',
47
+ data: {
48
+ action: 'pa_dismiss_admin_notice',
49
+ notice: adminNotices[noticeID],
50
+ nonce: PaNoticeSettings.nonce,
51
+ },
52
+ success: function (res) {
53
+ console.log(res);
54
+ },
55
+ error: function (err) {
56
+ console.log(err);
57
+ }
58
+ }
59
+ );
60
+ }
61
+
62
+ }
63
+ );
64
+
65
+ })(jQuery);
admin/includes/admin-notices.php CHANGED
@@ -1,393 +1,418 @@
1
- <?php
2
-
3
- /**
4
- * PA Admin Notices.
5
- */
6
- namespace PremiumAddons\Admin\Includes;
7
-
8
- use PremiumAddons\Includes\Helper_Functions;
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit();
12
- }
13
-
14
- /**
15
- * Class Admin_Notices
16
- */
17
- class Admin_Notices {
18
-
19
- /**
20
- * Class object
21
- *
22
- * @var instance
23
- */
24
- private static $instance = null;
25
-
26
- /**
27
- * Elementor slug
28
- *
29
- * @var elementor
30
- */
31
- private static $elementor = 'elementor';
32
-
33
- /**
34
- * PAPRO Slug
35
- *
36
- * @var papro
37
- */
38
- private static $papro = 'premium-addons-pro';
39
-
40
- /**
41
- * Constructor for the class
42
- */
43
- public function __construct() {
44
-
45
- add_action( 'admin_init', array( $this, 'init' ) );
46
-
47
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
48
-
49
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
50
-
51
- add_action( 'wp_ajax_pa_reset_admin_notice', array( $this, 'reset_admin_notice' ) );
52
-
53
- add_action( 'wp_ajax_pa_dismiss_admin_notice', array( $this, 'dismiss_admin_notice' ) );
54
-
55
- }
56
-
57
- /**
58
- * init required functions
59
- */
60
- public function init() {
61
-
62
- $this->handle_review_notice();
63
-
64
- $this->handle_trustpilot_notice();
65
-
66
- }
67
-
68
- /**
69
- * init notices check functions
70
- */
71
- public function admin_notices() {
72
-
73
- $this->required_plugins_check();
74
-
75
- $cache_key = 'premium_notice_' . PREMIUM_ADDONS_VERSION;
76
-
77
- $response = get_transient( $cache_key );
78
-
79
- $show_review = get_option( 'pa_review_notice' );
80
-
81
- // Make sure Already did was not clicked before.
82
- if ( '1' !== $show_review ) {
83
- if ( false == $response ) {
84
- $this->get_review_notice();
85
- }
86
- }
87
-
88
- $this->get_trustpilot_notice();
89
-
90
- }
91
-
92
- /**
93
- * Handle Review Notice
94
- *
95
- * Checks if review message is dismissed.
96
- *
97
- * @access public
98
- * @return void
99
- */
100
- public function handle_review_notice() {
101
-
102
- if ( ! isset( $_GET['pa_review'] ) ) {
103
- return;
104
- }
105
-
106
- if ( 'opt_out' === $_GET['pa_review'] ) {
107
- check_admin_referer( 'opt_out' );
108
-
109
- update_option( 'pa_review_notice', '1' );
110
- }
111
-
112
- wp_redirect( remove_query_arg( 'pa_review' ) );
113
-
114
- exit;
115
- }
116
-
117
- /**
118
- * Checks if Trustpilot Reviews message is dismissed.
119
- *
120
- * @since 4.3.5
121
- * @access public
122
- *
123
- * @return void
124
- */
125
- public function handle_trustpilot_notice() {
126
-
127
- if ( ! isset( $_GET['trustpilot'] ) ) {
128
- return;
129
- }
130
-
131
- if ( 'opt_out' === $_GET['trustpilot'] ) {
132
- check_admin_referer( 'opt_out' );
133
-
134
- update_option( 'trustpilot_notice', '1' );
135
- }
136
-
137
- wp_redirect( remove_query_arg( 'trustpilot' ) );
138
- exit;
139
- }
140
-
141
- /**
142
- * Required plugin check
143
- *
144
- * Shows an admin notice when Elementor is missing.
145
- *
146
- * @access public
147
- *
148
- * @return boolean
149
- */
150
- public function required_plugins_check() {
151
-
152
- $elementor_path = sprintf( '%1$s/%1$s.php', self::$elementor );
153
-
154
- if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
155
-
156
- if ( ! Helper_Functions::is_plugin_installed( $elementor_path ) ) {
157
-
158
- if ( self::check_user_can( 'install_plugins' ) ) {
159
-
160
- $install_url = wp_nonce_url( self_admin_url( sprintf( 'update.php?action=install-plugin&plugin=%s', self::$elementor ) ), 'install-plugin_elementor' );
161
-
162
- $message = sprintf( '<p>%s</p>', __( 'Premium Addons for Elementor is not working because you need to Install Elementor plugin.', 'premium-addons-for-elementor' ) );
163
-
164
- $message .= sprintf( '<p><a href="%s" class="button-primary">%s</a></p>', $install_url, __( 'Install Now', 'premium-addons-for-elementor' ) );
165
-
166
- }
167
- } else {
168
- if ( self::check_user_can( 'activate_plugins' ) ) {
169
-
170
- $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $elementor_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $elementor_path );
171
-
172
- $message = '<p>' . __( 'Premium Addons for Elementor is not working because you need to activate Elementor plugin.', 'premium-addons-for-elementor' ) . '</p>';
173
-
174
- $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Now', 'premium-addons-for-elementor' ) ) . '</p>';
175
-
176
- }
177
- }
178
- $this->render_admin_notices( $message );
179
- }
180
- }
181
-
182
- /**
183
- * Gets admin review notice HTML
184
- *
185
- * @since 2.8.4
186
- * @return void
187
- */
188
- public function get_review_text( $review_url, $optout_url ) {
189
-
190
- $notice = sprintf(
191
- '<p>' . __( 'Can we take only 2 minutes of your time? We would be really grateful it if you give ', 'premium-addons-for-elementor' ) .
192
- '<b>' . __( 'Premium Addons for Elementor', 'premium-addons-for-elementor' ) . '</b> a 5 Stars Rating on WordPress.org. By speading the love, we can create even greater free stuff in the future!</p>
193
- <div>
194
- <a class="button button-primary" href="%s" target="_blank"><span>' . __( 'Leave a Review', 'premium-addons-for-elementor' ) . '</span></a>
195
- <a class="button" href="%2$s"><span>' . __( 'I Already Did', 'premium-addons-for-elementor' ) . '</span></a>
196
- <a class="button button-secondary pa-notice-reset"><span>' . __( 'Maybe Later', 'premium-addons-for-elementor' ) . '</span></a>
197
- </div>',
198
- $review_url,
199
- $optout_url
200
- );
201
-
202
- return $notice;
203
- }
204
-
205
- /**
206
- * Checks if review admin notice is dismissed
207
- *
208
- * @since 2.6.8
209
- * @return void
210
- */
211
- public function get_review_notice() {
212
-
213
- $review_url = 'https://wordpress.org/support/plugin/premium-addons-for-elementor/reviews/?filter=5';
214
-
215
- $optout_url = wp_nonce_url( add_query_arg( 'pa_review', 'opt_out' ), 'opt_out' );
216
- ?>
217
-
218
- <div class="error pa-notice-wrap pa-review-notice" data-notice="pa-review">
219
- <div class="pa-img-wrap">
220
- <img src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/pa-logo-symbol.png'; ?>">
221
- </div>
222
- <div class="pa-text-wrap">
223
- <?php echo $this->get_review_text( $review_url, $optout_url ); ?>
224
- </div>
225
- <div class="pa-notice-close">
226
- <a href="<?php echo esc_url( $optout_url ); ?>"><span class="dashicons dashicons-dismiss"></span></a>
227
- </div>
228
- </div>
229
-
230
- <?php
231
-
232
- }
233
-
234
-
235
- /**
236
- *
237
- * Shows admin notice for Premium Trustpilot Reviews.
238
- *
239
- * @since 4.3.5
240
- * @access public
241
- *
242
- * @return void
243
- */
244
- public function get_trustpilot_notice() {
245
-
246
- $trust_notice = get_option( 'trustpilot_notice' );
247
-
248
- if ( '1' === $trust_notice ) {
249
- return;
250
- }
251
-
252
- $notice_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-trustpilot-reviews-widget/', 'trustpilot-notification', 'wp-dash', 'trustpilot' );
253
-
254
- ?>
255
-
256
- <div class="error pa-notice-wrap pa-new-feature-notice">
257
- <div class="pa-img-wrap">
258
- <img src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/pa-logo-symbol.png'; ?>">
259
- </div>
260
- <div class="pa-text-wrap">
261
- <p>
262
- <strong><?php echo __( 'Premium Trustpilot Reviews', 'premium-addons-for-elemetor' ); ?></strong>
263
- <?php echo sprintf( __( 'widget in now available in Premium Addons Pro. <a href="%s" target="_blank">Check it out now!</a>', 'premium-addons-for-elementor' ), $notice_url ); ?>
264
- </p>
265
- </div>
266
- <div class="pa-notice-close" data-notice="trustpilot">
267
- <span class="dashicons dashicons-dismiss"></span>
268
- </div>
269
- </div>
270
-
271
- <?php
272
- }
273
-
274
- /**
275
- * Checks user credentials for specific action
276
- *
277
- * @since 2.6.8
278
- *
279
- * @return boolean
280
- */
281
- public static function check_user_can( $action ) {
282
- return current_user_can( $action );
283
- }
284
-
285
- /**
286
- * Renders an admin notice error message
287
- *
288
- * @since 1.0.0
289
- * @access private
290
- *
291
- * @return void
292
- */
293
- private function render_admin_notices( $message, $class = '', $handle = '' ) {
294
- ?>
295
- <div class="error pa-new-feature-notice <?php echo $class; ?>" data-notice="<?php echo $handle; ?>">
296
- <?php echo $message; ?>
297
- </div>
298
- <?php
299
- }
300
-
301
- /*
302
- * Register admin scripts
303
- *
304
- * @since 3.2.8
305
- * @access public
306
- *
307
- */
308
- public function admin_enqueue_scripts() {
309
-
310
- wp_enqueue_script(
311
- 'pa-notice',
312
- PREMIUM_ADDONS_URL . 'admin/assets/js/pa-notice.js',
313
- array( 'jquery' ),
314
- PREMIUM_ADDONS_VERSION,
315
- true
316
- );
317
-
318
- }
319
-
320
- /**
321
- * Set transient for admin notice
322
- *
323
- * @since 3.2.8
324
- * @access public
325
- *
326
- * @return void
327
- */
328
- public function reset_admin_notice() {
329
-
330
- $key = isset( $_POST['notice'] ) ? $_POST['notice'] : '';
331
-
332
- if ( ! empty( $key ) ) {
333
-
334
- $cache_key = 'premium_notice_' . PREMIUM_ADDONS_VERSION;
335
-
336
- set_transient( $cache_key, true, WEEK_IN_SECONDS );
337
-
338
- wp_send_json_success();
339
-
340
- } else {
341
-
342
- wp_send_json_error();
343
-
344
- }
345
-
346
- }
347
-
348
- /**
349
- * Dismiss admin notice
350
- *
351
- * @since 3.11.7
352
- * @access public
353
- *
354
- * @return void
355
- */
356
- public function dismiss_admin_notice() {
357
-
358
- $key = isset( $_POST['notice'] ) ? $_POST['notice'] : '';
359
-
360
- if ( ! empty( $key ) ) {
361
-
362
- update_option( $key, '1' );
363
-
364
- wp_send_json_success();
365
-
366
- } else {
367
-
368
- wp_send_json_error();
369
-
370
- }
371
-
372
- }
373
-
374
- /**
375
- * Creates and returns an instance of the class
376
- *
377
- * @since 2.8.4
378
- * @access public
379
- *
380
- * @return object
381
- */
382
- public static function get_instance() {
383
-
384
- if ( self::$instance == null ) {
385
-
386
- self::$instance = new self();
387
-
388
- }
389
-
390
- return self::$instance;
391
- }
392
-
393
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * PA Admin Notices.
5
+ */
6
+ namespace PremiumAddons\Admin\Includes;
7
+
8
+ use PremiumAddons\Includes\Helper_Functions;
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit();
12
+ }
13
+
14
+ /**
15
+ * Class Admin_Notices
16
+ */
17
+ class Admin_Notices {
18
+
19
+ /**
20
+ * Class object
21
+ *
22
+ * @var instance
23
+ */
24
+ private static $instance = null;
25
+
26
+ /**
27
+ * Elementor slug
28
+ *
29
+ * @var elementor
30
+ */
31
+ private static $elementor = 'elementor';
32
+
33
+ /**
34
+ * PAPRO Slug
35
+ *
36
+ * @var papro
37
+ */
38
+ private static $papro = 'premium-addons-pro';
39
+
40
+ /**
41
+ * Notices Keys
42
+ *
43
+ * @var notices
44
+ */
45
+ private static $notices = null;
46
+
47
+ /**
48
+ * Constructor for the class
49
+ */
50
+ public function __construct() {
51
+
52
+ add_action( 'admin_init', array( $this, 'init' ) );
53
+
54
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
55
+
56
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
57
+
58
+ add_action( 'wp_ajax_pa_reset_admin_notice', array( $this, 'reset_admin_notice' ) );
59
+
60
+ add_action( 'wp_ajax_pa_dismiss_admin_notice', array( $this, 'dismiss_admin_notice' ) );
61
+
62
+ self::$notices = array(
63
+ 'trustpilot_notice',
64
+ 'pa-review',
65
+ );
66
+
67
+ }
68
+
69
+ /**
70
+ * init required functions
71
+ */
72
+ public function init() {
73
+
74
+ $this->handle_review_notice();
75
+
76
+ $this->handle_trustpilot_notice();
77
+
78
+ }
79
+
80
+ /**
81
+ * init notices check functions
82
+ */
83
+ public function admin_notices() {
84
+
85
+ $this->required_plugins_check();
86
+
87
+ $cache_key = 'premium_notice_' . PREMIUM_ADDONS_VERSION;
88
+
89
+ $response = get_transient( $cache_key );
90
+
91
+ $show_review = get_option( 'pa_review_notice' );
92
+
93
+ // Make sure Already did was not clicked before.
94
+ if ( '1' !== $show_review ) {
95
+ if ( false == $response ) {
96
+ $this->get_review_notice();
97
+ }
98
+ }
99
+
100
+ $this->get_trustpilot_notice();
101
+
102
+ }
103
+
104
+ /**
105
+ * Handle Review Notice
106
+ *
107
+ * Checks if review message is dismissed.
108
+ *
109
+ * @access public
110
+ * @return void
111
+ */
112
+ public function handle_review_notice() {
113
+
114
+ if ( ! isset( $_GET['pa_review'] ) ) {
115
+ return;
116
+ }
117
+
118
+ if ( 'opt_out' === $_GET['pa_review'] ) {
119
+ check_admin_referer( 'opt_out' );
120
+
121
+ update_option( 'pa_review_notice', '1' );
122
+ }
123
+
124
+ wp_redirect( remove_query_arg( 'pa_review' ) );
125
+
126
+ exit;
127
+ }
128
+
129
+ /**
130
+ * Checks if Trustpilot Reviews message is dismissed.
131
+ *
132
+ * @since 4.3.5
133
+ * @access public
134
+ *
135
+ * @return void
136
+ */
137
+ public function handle_trustpilot_notice() {
138
+
139
+ if ( ! isset( $_GET['trustpilot'] ) ) {
140
+ return;
141
+ }
142
+
143
+ if ( 'opt_out' === $_GET['trustpilot'] ) {
144
+ check_admin_referer( 'opt_out' );
145
+
146
+ update_option( 'trustpilot_notice', '1' );
147
+ }
148
+
149
+ wp_redirect( remove_query_arg( 'trustpilot' ) );
150
+ exit;
151
+ }
152
+
153
+ /**
154
+ * Required plugin check
155
+ *
156
+ * Shows an admin notice when Elementor is missing.
157
+ *
158
+ * @access public
159
+ *
160
+ * @return boolean
161
+ */
162
+ public function required_plugins_check() {
163
+
164
+ $elementor_path = sprintf( '%1$s/%1$s.php', self::$elementor );
165
+
166
+ if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
167
+
168
+ if ( ! Helper_Functions::is_plugin_installed( $elementor_path ) ) {
169
+
170
+ if ( self::check_user_can( 'install_plugins' ) ) {
171
+
172
+ $install_url = wp_nonce_url( self_admin_url( sprintf( 'update.php?action=install-plugin&plugin=%s', self::$elementor ) ), 'install-plugin_elementor' );
173
+
174
+ $message = sprintf( '<p>%s</p>', __( 'Premium Addons for Elementor is not working because you need to Install Elementor plugin.', 'premium-addons-for-elementor' ) );
175
+
176
+ $message .= sprintf( '<p><a href="%s" class="button-primary">%s</a></p>', $install_url, __( 'Install Now', 'premium-addons-for-elementor' ) );
177
+
178
+ }
179
+ } else {
180
+ if ( self::check_user_can( 'activate_plugins' ) ) {
181
+
182
+ $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $elementor_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $elementor_path );
183
+
184
+ $message = '<p>' . __( 'Premium Addons for Elementor is not working because you need to activate Elementor plugin.', 'premium-addons-for-elementor' ) . '</p>';
185
+
186
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Now', 'premium-addons-for-elementor' ) ) . '</p>';
187
+
188
+ }
189
+ }
190
+ $this->render_admin_notices( $message );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Gets admin review notice HTML
196
+ *
197
+ * @since 2.8.4
198
+ * @return void
199
+ */
200
+ public function get_review_text( $review_url, $optout_url ) {
201
+
202
+ $notice = sprintf(
203
+ '<p>' . __( 'Can we take only 2 minutes of your time? We would be really grateful it if you give ', 'premium-addons-for-elementor' ) .
204
+ '<b>' . __( 'Premium Addons for Elementor', 'premium-addons-for-elementor' ) . '</b> a 5 Stars Rating on WordPress.org. By speading the love, we can create even greater free stuff in the future!</p>
205
+ <div>
206
+ <a class="button button-primary" href="%s" target="_blank"><span>' . __( 'Leave a Review', 'premium-addons-for-elementor' ) . '</span></a>
207
+ <a class="button" href="%2$s"><span>' . __( 'I Already Did', 'premium-addons-for-elementor' ) . '</span></a>
208
+ <a class="button button-secondary pa-notice-reset"><span>' . __( 'Maybe Later', 'premium-addons-for-elementor' ) . '</span></a>
209
+ </div>',
210
+ $review_url,
211
+ $optout_url
212
+ );
213
+
214
+ return $notice;
215
+ }
216
+
217
+ /**
218
+ * Checks if review admin notice is dismissed
219
+ *
220
+ * @since 2.6.8
221
+ * @return void
222
+ */
223
+ public function get_review_notice() {
224
+
225
+ $review_url = 'https://wordpress.org/support/plugin/premium-addons-for-elementor/reviews/?filter=5';
226
+
227
+ $optout_url = wp_nonce_url( add_query_arg( 'pa_review', 'opt_out' ), 'opt_out' );
228
+ ?>
229
+
230
+ <div class="error pa-notice-wrap pa-review-notice" data-notice="pa-review">
231
+ <div class="pa-img-wrap">
232
+ <img src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/pa-logo-symbol.png'; ?>">
233
+ </div>
234
+ <div class="pa-text-wrap">
235
+ <?php echo $this->get_review_text( $review_url, $optout_url ); ?>
236
+ </div>
237
+ <div class="pa-notice-close">
238
+ <a href="<?php echo esc_url( $optout_url ); ?>"><span class="dashicons dashicons-dismiss"></span></a>
239
+ </div>
240
+ </div>
241
+
242
+ <?php
243
+
244
+ }
245
+
246
+
247
+ /**
248
+ *
249
+ * Shows admin notice for Premium Trustpilot Reviews.
250
+ *
251
+ * @since 4.3.5
252
+ * @access public
253
+ *
254
+ * @return void
255
+ */
256
+ public function get_trustpilot_notice() {
257
+
258
+ $trust_notice = get_option( 'trustpilot_notice' );
259
+
260
+ if ( '1' === $trust_notice ) {
261
+ return;
262
+ }
263
+
264
+ $notice_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-trustpilot-reviews-widget/', 'trustpilot-notification', 'wp-dash', 'trustpilot' );
265
+
266
+ ?>
267
+
268
+ <div class="error pa-notice-wrap pa-new-feature-notice">
269
+ <div class="pa-img-wrap">
270
+ <img src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/pa-logo-symbol.png'; ?>">
271
+ </div>
272
+ <div class="pa-text-wrap">
273
+ <p>
274
+ <strong><?php echo __( 'Premium Trustpilot Reviews', 'premium-addons-for-elemetor' ); ?></strong>
275
+ <?php echo sprintf( __( 'widget in now available in Premium Addons Pro. <a href="%s" target="_blank">Check it out now!</a>', 'premium-addons-for-elementor' ), $notice_url ); ?>
276
+ </p>
277
+ </div>
278
+ <div class="pa-notice-close" data-notice="trustpilot">
279
+ <span class="dashicons dashicons-dismiss"></span>
280
+ </div>
281
+ </div>
282
+
283
+ <?php
284
+ }
285
+
286
+ /**
287
+ * Checks user credentials for specific action
288
+ *
289
+ * @since 2.6.8
290
+ *
291
+ * @return boolean
292
+ */
293
+ public static function check_user_can( $action ) {
294
+ return current_user_can( $action );
295
+ }
296
+
297
+ /**
298
+ * Renders an admin notice error message
299
+ *
300
+ * @since 1.0.0
301
+ * @access private
302
+ *
303
+ * @return void
304
+ */
305
+ private function render_admin_notices( $message, $class = '', $handle = '' ) {
306
+ ?>
307
+ <div class="error pa-new-feature-notice <?php echo $class; ?>" data-notice="<?php echo $handle; ?>">
308
+ <?php echo $message; ?>
309
+ </div>
310
+ <?php
311
+ }
312
+
313
+ /*
314
+ * Register admin scripts
315
+ *
316
+ * @since 3.2.8
317
+ * @access public
318
+ *
319
+ */
320
+ public function admin_enqueue_scripts() {
321
+
322
+ wp_enqueue_script(
323
+ 'pa-notice',
324
+ PREMIUM_ADDONS_URL . 'admin/assets/js/pa-notice.js',
325
+ array( 'jquery' ),
326
+ PREMIUM_ADDONS_VERSION,
327
+ true
328
+ );
329
+
330
+ wp_localize_script(
331
+ 'pa-notice',
332
+ 'PaNoticeSettings',
333
+ array(
334
+ 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
335
+ 'nonce' => wp_create_nonce( 'pa-notice-nonce' ),
336
+ )
337
+ );
338
+
339
+ }
340
+
341
+ /**
342
+ * Set transient for admin notice
343
+ *
344
+ * @since 3.2.8
345
+ * @access public
346
+ *
347
+ * @return void
348
+ */
349
+ public function reset_admin_notice() {
350
+
351
+ check_ajax_referer( 'pa-notice-nonce', 'nonce' );
352
+
353
+ $key = isset( $_POST['notice'] ) ? $_POST['notice'] : '';
354
+
355
+ if ( ! empty( $key ) && in_array( $key, self::$notices, true ) ) {
356
+
357
+ $cache_key = 'premium_notice_' . PREMIUM_ADDONS_VERSION;
358
+
359
+ set_transient( $cache_key, true, WEEK_IN_SECONDS );
360
+
361
+ wp_send_json_success();
362
+
363
+ } else {
364
+
365
+ wp_send_json_error();
366
+
367
+ }
368
+
369
+ }
370
+
371
+ /**
372
+ * Dismiss admin notice
373
+ *
374
+ * @since 3.11.7
375
+ * @access public
376
+ *
377
+ * @return void
378
+ */
379
+ public function dismiss_admin_notice() {
380
+
381
+ check_ajax_referer( 'pa-notice-nonce', 'nonce' );
382
+
383
+ $key = isset( $_POST['notice'] ) ? $_POST['notice'] : '';
384
+
385
+ if ( ! empty( $key ) && in_array( $key, self::$notices, true ) ) {
386
+
387
+ update_option( $key, '1' );
388
+
389
+ wp_send_json_success();
390
+
391
+ } else {
392
+
393
+ wp_send_json_error();
394
+
395
+ }
396
+
397
+ }
398
+
399
+ /**
400
+ * Creates and returns an instance of the class
401
+ *
402
+ * @since 2.8.4
403
+ * @access public
404
+ *
405
+ * @return object
406
+ */
407
+ public static function get_instance() {
408
+
409
+ if ( self::$instance == null ) {
410
+
411
+ self::$instance = new self();
412
+
413
+ }
414
+
415
+ return self::$instance;
416
+ }
417
+
418
+ }
modules/premium-equal-height/module.php CHANGED
@@ -1,331 +1,343 @@
1
- <?php
2
- /**
3
- * Class: Module
4
- * Name: Premium Equal Height
5
- * Slug: premium-equal-height
6
- */
7
-
8
- namespace PremiumAddons\Modules\Premium_Equal_Height;
9
-
10
- // Elementor Classes.
11
- use Elementor\Repeater;
12
- use Elementor\Controls_Manager;
13
-
14
- // PremiumAddons Classes.
15
- use PremiumAddons\Includes\Controls\Premium_Select;
16
- use PremiumAddons\Admin\Includes\Admin_Helper;
17
- use PremiumAddons\Includes\Helper_Functions;
18
-
19
-
20
- if ( ! defined( 'ABSPATH' ) ) {
21
- exit;
22
- }
23
-
24
- /**
25
- * Class Module For Premium Equal Height addon.
26
- */
27
- class Module {
28
-
29
- /**
30
- * Class object
31
- *
32
- * @var instance
33
- */
34
- private static $instance = null;
35
-
36
- /**
37
- * Class Constructor Funcion.
38
- */
39
- public function __construct() {
40
-
41
- // Enqueue the required JS file.
42
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
43
-
44
- // Create Premium Equal Height tab at the end of section layout tab.
45
- add_action( 'elementor/element/section/section_advanced/after_section_end', array( $this, 'register_controls' ), 10 );
46
-
47
- add_action( 'elementor/section/print_template', array( $this, '_print_template' ), 10, 2 );
48
-
49
- add_action( 'elementor/frontend/section/before_render', array( $this, 'before_render' ), 10, 1 );
50
-
51
- }
52
-
53
- /**
54
- * Enqueue scripts.
55
- *
56
- * Registers required dependencies for the extension and enqueues them.
57
- *
58
- * @since 1.6.5
59
- * @access public
60
- */
61
- public function enqueue_scripts() {
62
-
63
- if ( ( true === \Elementor\Plugin::$instance->db->is_built_with_elementor( get_the_ID() ) ) || ( function_exists( 'elementor_location_exits' ) && ( elementor_location_exits( 'archive', true ) || elementor_location_exits( 'single', true ) ) ) ) {
64
- wp_add_inline_script(
65
- 'elementor-frontend',
66
- 'window.scopes_array = {};
67
- window.backend = 0;
68
- jQuery( window ).on( "elementor/frontend/init", function() {
69
- elementorFrontend.hooks.addAction( "frontend/element_ready/section", function( $scope, $ ){
70
- if ( "undefined" == typeof $scope ) {
71
- return;
72
- }
73
- if ( $scope.hasClass( "premium-equal-height-yes" ) ) {
74
- var id = $scope.data("id");
75
- window.scopes_array[ id ] = $scope;
76
- }
77
- if(elementorFrontend.isEditMode()){
78
- var url = PaModulesSettings.equalHeight_url;
79
- jQuery.cachedAssets = function( url, options ) {
80
- // Allow user to set any option except for dataType, cache, and url.
81
- options = jQuery.extend( options || {}, {
82
- dataType: "script",
83
- cache: true,
84
- url: url
85
- });
86
- // Return the jqXHR object so we can chain callbacks.
87
- return jQuery.ajax( options );
88
- };
89
- jQuery.cachedAssets( url );
90
- window.backend = 1;
91
- }
92
- });
93
- });
94
- jQuery(document).ready(function(){
95
- if ( jQuery.find( ".premium-equal-height-yes" ).length < 1 ) {
96
- return;
97
- }
98
-
99
- var url = PaModulesSettings.equalHeight_url;
100
-
101
- jQuery.cachedAssets = function( url, options ) {
102
- // Allow user to set any option except for dataType, cache, and url.
103
- options = jQuery.extend( options || {}, {
104
- dataType: "script",
105
- cache: true,
106
- url: url
107
- });
108
-
109
- // Return the jqXHR object so we can chain callbacks.
110
- return jQuery.ajax( options );
111
- };
112
- jQuery.cachedAssets( url );
113
- }); '
114
- );
115
- }
116
- }
117
-
118
- /**
119
- * Register Premium Equal Height controls.
120
- *
121
- * @access public
122
- * @param object $element for current element.
123
- */
124
- public function register_controls( $element ) {
125
-
126
- $element->start_controls_section(
127
- 'section_premium_eq_height',
128
- array(
129
- 'label' => sprintf( '<i class="pa-extension-icon pa-dash-icon"></i> %s', __( 'Equal Height', 'premium-addons-for-elementor' ) ),
130
- 'tab' => Controls_Manager::TAB_ADVANCED,
131
- )
132
- );
133
-
134
- $element->add_control(
135
- 'premium_eq_height_update',
136
- array(
137
- 'label' => '<div class="elementor-update-preview editor-pa-preview-update" style="background-color: #fff;"><div class="elementor-update-preview-title">Update changes to page</div><div class="elementor-update-preview-button-wrapper"><button class="elementor-update-preview-button elementor-button elementor-button-success">Apply</button></div></div>',
138
- 'type' => Controls_Manager::RAW_HTML,
139
- )
140
- );
141
-
142
- $element->add_control(
143
- 'premium_eq_height_switcher',
144
- array(
145
- 'label' => __( 'Enable Equal Height', 'premium-addons-for-elementor' ),
146
- 'type' => Controls_Manager::SWITCHER,
147
- 'return_value' => 'yes',
148
- 'render_type' => 'template',
149
- 'prefix_class' => 'premium-equal-height-',
150
- 'frontend_available' => true,
151
- )
152
- );
153
-
154
- $element->add_control(
155
- 'premium_eq_height_type',
156
- array(
157
- 'label' => __( 'Apply on', 'premium-addons-for-elementor' ),
158
- 'type' => Controls_Manager::SELECT,
159
- 'default' => 'widget',
160
- 'options' => array(
161
- 'widget' => __( 'Widgets', 'premium-addons-for-elementor' ),
162
- 'custom' => __( 'Custom Selector', 'premium-addons-for-elementor' ),
163
- ),
164
- 'condition' => array(
165
- 'premium_eq_height_switcher' => 'yes',
166
- ),
167
- )
168
- );
169
-
170
- $element->add_control(
171
- 'premium_eq_height_target',
172
- array(
173
- 'label' => __( 'Widgets', 'premium-addons-for-elementor' ),
174
- 'type' => Premium_Select::TYPE,
175
- 'render_type' => 'template',
176
- 'label_block' => true,
177
- 'multiple' => true,
178
- 'frontend_available' => true,
179
- 'condition' => array(
180
- 'premium_eq_height_switcher' => 'yes',
181
- 'premium_eq_height_type' => 'widget',
182
- ),
183
- )
184
- );
185
-
186
- $element->add_control(
187
- 'premium_eq_height_custom_target',
188
- array(
189
- 'label' => __( 'Selectors', 'premium-addons-for-elementor' ),
190
- 'type' => Controls_Manager::TEXT,
191
- 'label_block' => true,
192
- 'placeholder' => __( '.class-name, .class-name2 .my-custom-class', 'premium-addons-for-elementor' ),
193
- 'description' => __( 'Enter selectors separated with \' , \' ', 'premium-addons-for-elementor' ),
194
- 'condition' => array(
195
- 'premium_eq_height_switcher' => 'yes',
196
- 'premium_eq_height_type' => 'custom',
197
- ),
198
- )
199
- );
200
-
201
- $element->add_control(
202
- 'premium_eq_height_enable_on',
203
- array(
204
- 'label' => __( 'Enable Equal Height on', 'premium-addons-for-elementor' ),
205
- 'type' => Controls_Manager::SELECT2,
206
- 'multiple' => true,
207
- 'options' => array(
208
- 'desktop' => __( 'Desktop', 'premium-addons-for-elementor' ),
209
- 'tablet' => __( 'Tablet', 'premium-addons-for-elementor' ),
210
- 'mobile' => __( 'Mobile', 'premium-addons-for-elementor' ),
211
- ),
212
- 'label_block' => true,
213
- 'default' => array( 'desktop', 'tablet', 'mobile' ),
214
- 'condition' => array(
215
- 'premium_eq_height_switcher' => 'yes',
216
- ),
217
- )
218
- );
219
-
220
- $url = 'https://premiumaddons.com/docs/elementor-column-equal-height/';
221
- $doc_url = Helper_Functions::get_campaign_link( $url, 'editor-page', 'wp-editor', 'get-support' );
222
-
223
- $element->add_control(
224
- 'equal_height_notice',
225
- array(
226
- 'type' => Controls_Manager::RAW_HTML,
227
- 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, __( 'How to use Premium Equal Height option »', 'premium-addons-for-elementor' ) ),
228
- 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
229
- )
230
- );
231
-
232
- $element->end_controls_section();
233
-
234
- }
235
-
236
- /**
237
- * Render Premium Equal Height output in the editor.
238
- *
239
- * Written as a Backbone JavaScript template and used to generate the live preview.
240
- *
241
- * @since 4.2.5
242
- * @access public
243
- * @param object $template for current template.
244
- * @param object $element for current element.
245
- */
246
- public function _print_template( $template, $element ) {
247
-
248
- if ( $element->get_name() !== 'section' ) {
249
- return $template;
250
- }
251
-
252
- $old_template = $template;
253
- ob_start();
254
-
255
- ?>
256
- <# if( 'yes' === settings.premium_eq_height_switcher ) {
257
-
258
- view.addRenderAttribute( 'eq_height', 'id', 'premium-temp-equal-height-' + view.getID() );
259
- var targetType = settings.premium_eq_height_type,
260
-
261
- target = 'custom' === targetType ? settings.premium_eq_height_custom_target.split(',') : settings.premium_eq_height_target,
262
-
263
- addonSettings = {
264
- 'targetType': targetType,
265
- 'target': target,
266
- 'enableOn':settings.premium_eq_height_enable_on
267
- };
268
-
269
- view.addRenderAttribute( 'equal_height', {
270
- 'id' : 'premium-temp-equal-height-' + view.getID(),
271
- 'data-pa-eq-height': JSON.stringify( addonSettings )
272
- });
273
-
274
- #>
275
- <div {{{ view.getRenderAttributeString( 'equal_height' ) }}}></div>
276
- <# } #>
277
- <?php
278
-
279
- $slider_content = ob_get_contents();
280
-
281
- ob_end_clean();
282
-
283
- $template = $slider_content . $old_template;
284
- return $template;
285
- }
286
-
287
- /**
288
- * Render Premium Equal Height output on the frontend.
289
- *
290
- * Written in PHP and used to generate the final HTML.
291
- *
292
- * @since 4.2.5
293
- * @access public
294
- *
295
- * @param object $element for current element.
296
- */
297
- public function before_render( $element ) {
298
-
299
- $data = $element->get_data();
300
-
301
- $type = $data['elType'];
302
-
303
- $settings = $element->get_settings_for_display();
304
-
305
- if ( ( 'section' === $type ) && 'yes' === $settings['premium_eq_height_switcher'] ) {
306
-
307
- $target_type = $settings['premium_eq_height_type'];
308
-
309
- $target = ( 'custom' === $target_type ) ? explode( ',', $settings['premium_eq_height_custom_target'] ) : $settings['premium_eq_height_target'];
310
-
311
- $addon_settings = array(
312
- 'targetType' => $target_type,
313
- 'target' => $target,
314
- 'enableOn' => $settings['premium_eq_height_enable_on'],
315
- );
316
-
317
- $element->add_render_attribute( '_wrapper', 'data-pa-eq-height', wp_json_encode( $addon_settings ) );
318
- }
319
- }
320
-
321
- public static function get_instance() {
322
-
323
- if ( ! isset( self::$instance ) ) {
324
-
325
- self::$instance = new self();
326
-
327
- }
328
-
329
- return self::$instance;
330
- }
331
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class: Module
4
+ * Name: Premium Equal Height
5
+ * Slug: premium-equal-height
6
+ */
7
+
8
+ namespace PremiumAddons\Modules\Premium_Equal_Height;
9
+
10
+ // Elementor Classes.
11
+ use Elementor\Repeater;
12
+ use Elementor\Controls_Manager;
13
+
14
+ // PremiumAddons Classes.
15
+ use PremiumAddons\Includes\Controls\Premium_Select;
16
+ use PremiumAddons\Admin\Includes\Admin_Helper;
17
+ use PremiumAddons\Includes\Helper_Functions;
18
+
19
+
20
+ if ( ! defined( 'ABSPATH' ) ) {
21
+ exit;
22
+ }
23
+
24
+ /**
25
+ * Class Module For Premium Equal Height addon.
26
+ */
27
+ class Module {
28
+
29
+ /**
30
+ * Class object
31
+ *
32
+ * @var instance
33
+ */
34
+ private static $instance = null;
35
+
36
+ /**
37
+ * Class Constructor Funcion.
38
+ */
39
+ public function __construct() {
40
+
41
+ // Enqueue the required JS file.
42
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
43
+
44
+ // Create Premium Equal Height tab at the end of section layout tab.
45
+ add_action( 'elementor/element/section/section_advanced/after_section_end', array( $this, 'register_controls' ), 10 );
46
+
47
+ add_action( 'elementor/section/print_template', array( $this, '_print_template' ), 10, 2 );
48
+
49
+ add_action( 'elementor/frontend/section/before_render', array( $this, 'before_render' ), 10, 1 );
50
+
51
+ }
52
+
53
+ /**
54
+ * Enqueue scripts.
55
+ *
56
+ * Registers required dependencies for the extension and enqueues them.
57
+ *
58
+ * @since 1.6.5
59
+ * @access public
60
+ */
61
+ public function enqueue_scripts() {
62
+
63
+ if ( ( true === \Elementor\Plugin::$instance->db->is_built_with_elementor( get_the_ID() ) ) || ( function_exists( 'elementor_location_exits' ) && ( elementor_location_exits( 'archive', true ) || elementor_location_exits( 'single', true ) ) ) ) {
64
+ wp_add_inline_script(
65
+ 'elementor-frontend',
66
+ 'window.scopes_array = {};
67
+ window.backend = 0;
68
+ jQuery( window ).on( "elementor/frontend/init", function() {
69
+ elementorFrontend.hooks.addAction( "frontend/element_ready/section", function( $scope, $ ){
70
+ if ( "undefined" == typeof $scope ) {
71
+ return;
72
+ }
73
+ if ( $scope.hasClass( "premium-equal-height-yes" ) ) {
74
+ var id = $scope.data("id");
75
+ window.scopes_array[ id ] = $scope;
76
+ }
77
+ if(elementorFrontend.isEditMode()){
78
+ var url = PaModulesSettings.equalHeight_url;
79
+ jQuery.cachedAssets = function( url, options ) {
80
+ // Allow user to set any option except for dataType, cache, and url.
81
+ options = jQuery.extend( options || {}, {
82
+ dataType: "script",
83
+ cache: true,
84
+ url: url
85
+ });
86
+ // Return the jqXHR object so we can chain callbacks.
87
+ return jQuery.ajax( options );
88
+ };
89
+ jQuery.cachedAssets( url );
90
+ window.backend = 1;
91
+ }
92
+ });
93
+ });
94
+ jQuery(document).ready(function(){
95
+ if ( jQuery.find( ".premium-equal-height-yes" ).length < 1 ) {
96
+ return;
97
+ }
98
+
99
+ var url = PaModulesSettings.equalHeight_url;
100
+
101
+ jQuery.cachedAssets = function( url, options ) {
102
+ // Allow user to set any option except for dataType, cache, and url.
103
+ options = jQuery.extend( options || {}, {
104
+ dataType: "script",
105
+ cache: true,
106
+ url: url
107
+ });
108
+
109
+ // Return the jqXHR object so we can chain callbacks.
110
+ return jQuery.ajax( options );
111
+ };
112
+ jQuery.cachedAssets( url );
113
+ }); '
114
+ );
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Register Premium Equal Height controls.
120
+ *
121
+ * @access public
122
+ * @param object $element for current element.
123
+ */
124
+ public function register_controls( $element ) {
125
+
126
+ $has_custom_breakpoints = \Elementor\Plugin::$instance->breakpoints->has_custom_breakpoints();
127
+
128
+ $extra_devices = ! $has_custom_breakpoints ? array() : array(
129
+ 'widescreen' => __( 'Widescreen', 'premium-addons-pro' ),
130
+ 'laptop' => __( 'Laptop', 'premium-addons-pro' ),
131
+ 'tablet_extra' => __( 'Tablet Extra', 'premium-addons-pro' ),
132
+ 'mobile_extra' => __( 'Mobile Extra', 'premium-addons-pro' ),
133
+ );
134
+
135
+ $element->start_controls_section(
136
+ 'section_premium_eq_height',
137
+ array(
138
+ 'label' => sprintf( '<i class="pa-extension-icon pa-dash-icon"></i> %s', __( 'Equal Height', 'premium-addons-for-elementor' ) ),
139
+ 'tab' => Controls_Manager::TAB_ADVANCED,
140
+ )
141
+ );
142
+
143
+ $element->add_control(
144
+ 'premium_eq_height_update',
145
+ array(
146
+ 'label' => '<div class="elementor-update-preview editor-pa-preview-update" style="background-color: #fff;"><div class="elementor-update-preview-title">Update changes to page</div><div class="elementor-update-preview-button-wrapper"><button class="elementor-update-preview-button elementor-button elementor-button-success">Apply</button></div></div>',
147
+ 'type' => Controls_Manager::RAW_HTML,
148
+ )
149
+ );
150
+
151
+ $element->add_control(
152
+ 'premium_eq_height_switcher',
153
+ array(
154
+ 'label' => __( 'Enable Equal Height', 'premium-addons-for-elementor' ),
155
+ 'type' => Controls_Manager::SWITCHER,
156
+ 'return_value' => 'yes',
157
+ 'render_type' => 'template',
158
+ 'prefix_class' => 'premium-equal-height-',
159
+ 'frontend_available' => true,
160
+ )
161
+ );
162
+
163
+ $element->add_control(
164
+ 'premium_eq_height_type',
165
+ array(
166
+ 'label' => __( 'Apply on', 'premium-addons-for-elementor' ),
167
+ 'type' => Controls_Manager::SELECT,
168
+ 'default' => 'widget',
169
+ 'options' => array(
170
+ 'widget' => __( 'Widgets', 'premium-addons-for-elementor' ),
171
+ 'custom' => __( 'Custom Selector', 'premium-addons-for-elementor' ),
172
+ ),
173
+ 'condition' => array(
174
+ 'premium_eq_height_switcher' => 'yes',
175
+ ),
176
+ )
177
+ );
178
+
179
+ $element->add_control(
180
+ 'premium_eq_height_target',
181
+ array(
182
+ 'label' => __( 'Widgets', 'premium-addons-for-elementor' ),
183
+ 'type' => Premium_Select::TYPE,
184
+ 'render_type' => 'template',
185
+ 'label_block' => true,
186
+ 'multiple' => true,
187
+ 'frontend_available' => true,
188
+ 'condition' => array(
189
+ 'premium_eq_height_switcher' => 'yes',
190
+ 'premium_eq_height_type' => 'widget',
191
+ ),
192
+ )
193
+ );
194
+
195
+ $element->add_control(
196
+ 'premium_eq_height_custom_target',
197
+ array(
198
+ 'label' => __( 'Selectors', 'premium-addons-for-elementor' ),
199
+ 'type' => Controls_Manager::TEXT,
200
+ 'label_block' => true,
201
+ 'placeholder' => __( '.class-name, .class-name2 .my-custom-class', 'premium-addons-for-elementor' ),
202
+ 'description' => __( 'Enter selectors separated with \' , \' ', 'premium-addons-for-elementor' ),
203
+ 'condition' => array(
204
+ 'premium_eq_height_switcher' => 'yes',
205
+ 'premium_eq_height_type' => 'custom',
206
+ ),
207
+ )
208
+ );
209
+
210
+ $element->add_control(
211
+ 'premium_eq_height_enable_on',
212
+ array(
213
+ 'label' => __( 'Enable Equal Height on', 'premium-addons-for-elementor' ),
214
+ 'type' => Controls_Manager::SELECT2,
215
+ 'multiple' => true,
216
+ 'options' => array_merge(
217
+ array(
218
+ 'desktop' => __( 'Desktop', 'premium-addons-pro' ),
219
+ 'tablet' => __( 'Tablet', 'premium-addons-pro' ),
220
+ 'mobile' => __( 'Mobile', 'premium-addons-pro' ),
221
+ ),
222
+ $extra_devices
223
+ ),
224
+ 'label_block' => true,
225
+ 'default' => array( 'desktop', 'tablet', 'mobile' ),
226
+ 'condition' => array(
227
+ 'premium_eq_height_switcher' => 'yes',
228
+ ),
229
+ )
230
+ );
231
+
232
+ $url = 'https://premiumaddons.com/docs/elementor-column-equal-height/';
233
+ $doc_url = Helper_Functions::get_campaign_link( $url, 'editor-page', 'wp-editor', 'get-support' );
234
+
235
+ $element->add_control(
236
+ 'equal_height_notice',
237
+ array(
238
+ 'type' => Controls_Manager::RAW_HTML,
239
+ 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, __( 'How to use Premium Equal Height option »', 'premium-addons-for-elementor' ) ),
240
+ 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
241
+ )
242
+ );
243
+
244
+ $element->end_controls_section();
245
+
246
+ }
247
+
248
+ /**
249
+ * Render Premium Equal Height output in the editor.
250
+ *
251
+ * Written as a Backbone JavaScript template and used to generate the live preview.
252
+ *
253
+ * @since 4.2.5
254
+ * @access public
255
+ * @param object $template for current template.
256
+ * @param object $element for current element.
257
+ */
258
+ public function _print_template( $template, $element ) {
259
+
260
+ if ( $element->get_name() !== 'section' ) {
261
+ return $template;
262
+ }
263
+
264
+ $old_template = $template;
265
+ ob_start();
266
+
267
+ ?>
268
+ <# if( 'yes' === settings.premium_eq_height_switcher ) {
269
+
270
+ view.addRenderAttribute( 'eq_height', 'id', 'premium-temp-equal-height-' + view.getID() );
271
+ var targetType = settings.premium_eq_height_type,
272
+
273
+ target = 'custom' === targetType ? settings.premium_eq_height_custom_target.split(',') : settings.premium_eq_height_target,
274
+
275
+ addonSettings = {
276
+ 'targetType': targetType,
277
+ 'target': target,
278
+ 'enableOn':settings.premium_eq_height_enable_on
279
+ };
280
+
281
+ view.addRenderAttribute( 'equal_height', {
282
+ 'id' : 'premium-temp-equal-height-' + view.getID(),
283
+ 'data-pa-eq-height': JSON.stringify( addonSettings )
284
+ });
285
+
286
+ #>
287
+ <div {{{ view.getRenderAttributeString( 'equal_height' ) }}}></div>
288
+ <# } #>
289
+ <?php
290
+
291
+ $slider_content = ob_get_contents();
292
+
293
+ ob_end_clean();
294
+
295
+ $template = $slider_content . $old_template;
296
+ return $template;
297
+ }
298
+
299
+ /**
300
+ * Render Premium Equal Height output on the frontend.
301
+ *
302
+ * Written in PHP and used to generate the final HTML.
303
+ *
304
+ * @since 4.2.5
305
+ * @access public
306
+ *
307
+ * @param object $element for current element.
308
+ */
309
+ public function before_render( $element ) {
310
+
311
+ $data = $element->get_data();
312
+
313
+ $type = $data['elType'];
314
+
315
+ $settings = $element->get_settings_for_display();
316
+
317
+ if ( ( 'section' === $type ) && 'yes' === $settings['premium_eq_height_switcher'] ) {
318
+
319
+ $target_type = $settings['premium_eq_height_type'];
320
+
321
+ $target = ( 'custom' === $target_type ) ? explode( ',', $settings['premium_eq_height_custom_target'] ) : $settings['premium_eq_height_target'];
322
+
323
+ $addon_settings = array(
324
+ 'targetType' => $target_type,
325
+ 'target' => $target,
326
+ 'enableOn' => $settings['premium_eq_height_enable_on'],
327
+ );
328
+
329
+ $element->add_render_attribute( '_wrapper', 'data-pa-eq-height', wp_json_encode( $addon_settings ) );
330
+ }
331
+ }
332
+
333
+ public static function get_instance() {
334
+
335
+ if ( ! isset( self::$instance ) ) {
336
+
337
+ self::$instance = new self();
338
+
339
+ }
340
+
341
+ return self::$instance;
342
+ }
343
+ }
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 4.5.0
7
  Elementor tested up to: 3.4.0
8
  Elementor Pro tested up to: 3.3.7
9
  Author: Leap13
@@ -18,12 +18,12 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  }
19
 
20
  // Define Constants.
21
- define( 'PREMIUM_ADDONS_VERSION', '4.5.0' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
25
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
26
- define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.4.9' );
27
 
28
  /*
29
  * Load plugin core file
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 4.5.1
7
  Elementor tested up to: 3.4.0
8
  Elementor Pro tested up to: 3.3.7
9
  Author: Leap13
18
  }
19
 
20
  // Define Constants.
21
+ define( 'PREMIUM_ADDONS_VERSION', '4.5.1' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
25
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
26
+ define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.5.0' );
27
 
28
  /*
29
  * Load plugin core file
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate Link: https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_c
5
  Requires at least: 5.0
6
  Tested Up To: 5.8
7
  Requires PHP: 5.4
8
- Stable Tag: 4.5.0
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -195,6 +195,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
195
 
196
  == Changelog ==
197
 
 
 
 
 
 
198
  = 4.5.0 =
199
 
200
  - Tweak: Unnecessary code removed in Media Grid for faster editing speed.
5
  Requires at least: 5.0
6
  Tested Up To: 5.8
7
  Requires PHP: 5.4
8
+ Stable Tag: 4.5.1
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
195
 
196
  == Changelog ==
197
 
198
+ = 4.5.1 =
199
+
200
+ - Tweak: Added new devices added in Elementor Custom Breakpoints to Equal Height feature.
201
+ - Tweak: Code refactored for better performance and security.
202
+
203
  = 4.5.0 =
204
 
205
  - Tweak: Unnecessary code removed in Media Grid for faster editing speed.