PowerPack Addons for Elementor (Instagram Feed, Pricing Table, Forms Stylers, Display Conditions, Free Elementor Widgets and Elementor Templates) - Version 2.5.4

Version Description

  • August 23, 2021 =
  • Fixed: PHP error in dashboard
  • Fixed: Instagram Access Token option was not saving anything
  • Enhancement: Added separate tab to manage extensions in PowerPack settings
Download this release

Release Info

Developer ideaboxcreations
Plugin Icon 128x128 PowerPack Addons for Elementor (Instagram Feed, Pricing Table, Forms Stylers, Display Conditions, Free Elementor Widgets and Elementor Templates)
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  == 2.5.3 ==
2
  Release date: August 4, 2021
3
  * Added: Posts – Link target option for title and thumbnail
1
+ == 2.5.4 ==
2
+ Release date: August 23, 2021
3
+ * Fixed: PHP error in dashboard
4
+ * Fixed: Instagram Access Token option was not saving anything
5
+ * Enhancement: Added separate tab to manage extensions in PowerPack settings
6
+
7
  == 2.5.3 ==
8
  Release date: August 4, 2021
9
  * Added: Posts – Link target option for title and thumbnail
classes/class-pp-admin-settings.php CHANGED
@@ -47,6 +47,8 @@ final class PP_Admin_Settings {
47
  self::save();
48
  self::reset_settings();
49
  }
 
 
50
  }
51
 
52
  /**
@@ -166,6 +168,13 @@ final class PP_Admin_Settings {
166
  'file' => POWERPACK_ELEMENTS_LITE_PATH . 'includes/admin/admin-settings-modules.php',
167
  'priority' => 150,
168
  ),
 
 
 
 
 
 
 
169
  'integration' => array(
170
  'title' => esc_html__( 'Integration', 'powerpack' ),
171
  'show' => true,
@@ -322,27 +331,48 @@ final class PP_Admin_Settings {
322
  return;
323
  }
324
 
325
- if ( ! isset( $_POST['pp-modules-settings-nonce'] ) || ! wp_verify_nonce( $_POST['pp-modules-settings-nonce'], 'pp-modules-settings' ) ) {
326
- return;
327
- }
328
-
329
  self::save_modules();
 
 
330
  self::save_tracking();
331
 
332
  do_action( 'pp_admin_after_settings_saved' );
333
  }
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  private static function save_modules() {
 
 
 
 
336
  if ( isset( $_POST['pp_enabled_modules'] ) ) {
337
  update_site_option( 'pp_elementor_modules', $_POST['pp_enabled_modules'] );
338
  } else {
339
  update_site_option( 'pp_elementor_modules', 'disabled' );
340
  }
 
 
 
 
 
 
341
 
342
  if ( isset( $_POST['pp_enabled_extensions'] ) ) {
343
- update_site_option( 'pp_elementor_extensions', $_POST['pp_enabled_extensions'] );
344
  } else {
345
- update_site_option( 'pp_elementor_extensions', 'disabled' );
346
  }
347
  }
348
 
@@ -365,6 +395,57 @@ final class PP_Admin_Settings {
365
  self::$errors[] = esc_html__( 'Extension settings updated!', 'powerpack' );
366
  }
367
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  }
369
 
370
  PP_Admin_Settings::init();
47
  self::save();
48
  self::reset_settings();
49
  }
50
+
51
+ add_action( 'admin_init', __CLASS__ . '::refresh_instagram_access_token' );
52
  }
53
 
54
  /**
168
  'file' => POWERPACK_ELEMENTS_LITE_PATH . 'includes/admin/admin-settings-modules.php',
169
  'priority' => 150,
170
  ),
171
+ 'extensions' => array(
172
+ 'title' => esc_html__( 'Extensions', 'powerpack' ),
173
+ 'show' => true,
174
+ 'cap' => 'edit_posts',
175
+ 'file' => POWERPACK_ELEMENTS_LITE_PATH . 'includes/admin/admin-settings-extensions.php',
176
+ 'priority' => 200,
177
+ ),
178
  'integration' => array(
179
  'title' => esc_html__( 'Integration', 'powerpack' ),
180
  'show' => true,
331
  return;
332
  }
333
 
 
 
 
 
334
  self::save_modules();
335
+ self::save_extensions();
336
+ self::save_integration();
337
  self::save_tracking();
338
 
339
  do_action( 'pp_admin_after_settings_saved' );
340
  }
341
 
342
+ /**
343
+ * Saves integrations.
344
+ *
345
+ * @since 2.5.4
346
+ * @access private
347
+ * @return void
348
+ */
349
+ private static function save_integration() {
350
+ if ( isset( $_POST['pp_instagram_access_token'] ) ) {
351
+ self::update_option( 'pp_instagram_access_token', trim( $_POST['pp_instagram_access_token'] ), false );
352
+ }
353
+ }
354
+
355
  private static function save_modules() {
356
+ if ( ! isset( $_POST['pp-modules-settings-nonce'] ) || ! wp_verify_nonce( $_POST['pp-modules-settings-nonce'], 'pp-modules-settings' ) ) {
357
+ return;
358
+ }
359
+
360
  if ( isset( $_POST['pp_enabled_modules'] ) ) {
361
  update_site_option( 'pp_elementor_modules', $_POST['pp_enabled_modules'] );
362
  } else {
363
  update_site_option( 'pp_elementor_modules', 'disabled' );
364
  }
365
+ }
366
+
367
+ public static function save_extensions() {
368
+ if ( ! isset( $_POST['pp-extensions-settings-nonce'] ) || ! wp_verify_nonce( $_POST['pp-extensions-settings-nonce'], 'pp-extensions-settings' ) ) {
369
+ return;
370
+ }
371
 
372
  if ( isset( $_POST['pp_enabled_extensions'] ) ) {
373
+ update_option( 'pp_elementor_extensions', $_POST['pp_enabled_extensions'] );
374
  } else {
375
+ update_option( 'pp_elementor_extensions', 'disabled' );
376
  }
377
  }
378
 
395
  self::$errors[] = esc_html__( 'Extension settings updated!', 'powerpack' );
396
  }
397
  }
398
+
399
+ /**
400
+ * Refresh instagram token after 30 days.
401
+ *
402
+ * @since 2.5.4
403
+ */
404
+ public static function refresh_instagram_access_token() {
405
+ $access_token = trim( \PowerpackElementsLite\Classes\PP_Admin_Settings::get_option( 'instagram_access_token' ) );
406
+ $updated_access_token = 'ppe_updated_instagram_access_token';
407
+
408
+ if ( empty( $access_token ) ) {
409
+ return;
410
+ }
411
+
412
+ $updated = get_transient( $updated_access_token );
413
+
414
+ if ( ! empty( $updated ) ) {
415
+ return;
416
+ }
417
+
418
+ $endpoint_url = add_query_arg(
419
+ [
420
+ 'access_token' => $access_token,
421
+ 'grant_type' => 'ig_refresh_token',
422
+ ],
423
+ 'https://graph.instagram.com/refresh_access_token'
424
+ );
425
+
426
+ $response = wp_remote_get( $endpoint_url );
427
+
428
+ if ( ! $response || 200 !== wp_remote_retrieve_response_code( $response ) || is_wp_error( $response ) ) {
429
+ set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
430
+ return;
431
+ }
432
+
433
+ $body = wp_remote_retrieve_body( $response );
434
+
435
+ if ( ! $body ) {
436
+ set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
437
+ return;
438
+ }
439
+
440
+ $body = json_decode( $body, true );
441
+
442
+ if ( empty( $body['access_token'] ) || empty( $body['expires_in'] ) ) {
443
+ set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
444
+ return;
445
+ }
446
+
447
+ set_transient( $updated_access_token, 'updated', 30 * DAY_IN_SECONDS );
448
+ }
449
  }
450
 
451
  PP_Admin_Settings::init();
includes/admin/admin-settings-extensions.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $extensions = pp_elements_lite_get_extensions();
3
+ $enabled_extensions = pp_elements_lite_get_enabled_extensions();
4
+ ?>
5
+ <div class="pp-settings-section">
6
+ <div class="pp-settings-section-header">
7
+ <h3 class="pp-settings-section-title"><?php _e( 'Extensions', 'powerpack' ); ?></h3>
8
+ </div>
9
+ <div class="pp-settings-section-content">
10
+ <table class="form-table pp-settings-elements-grid">
11
+ <?php
12
+ foreach ( $extensions as $extension_name => $extension_title ) :
13
+ $extension_enabled = false;
14
+
15
+ if ( is_array( $enabled_extensions ) && ( in_array( $extension_name, $enabled_extensions ) ) || isset( $enabled_extensions[ $extension_name ] ) ) {
16
+ $extension_enabled = true;
17
+ }
18
+ if ( ! is_array( $enabled_extensions ) && 'disabled' != $enabled_extensions ) {
19
+ $extension_enabled = true;
20
+ }
21
+ ?>
22
+ <tr valign="top">
23
+ <th>
24
+ <label for="<?php echo $extension_name; ?>">
25
+ <?php echo $extension_title; ?>
26
+ </label>
27
+ </th>
28
+ <td>
29
+ <label class="pp-admin-field-toggle">
30
+ <input
31
+ id="<?php echo $extension_name; ?>"
32
+ name="pp_enabled_extensions[]"
33
+ type="checkbox"
34
+ value="<?php echo $extension_name; ?>"
35
+ <?php echo $extension_enabled ? ' checked="checked"' : ''; ?>
36
+ />
37
+ <span class="pp-admin-field-toggle-slider" aria-hidden="true"></span>
38
+ </label>
39
+ </td>
40
+ </tr>
41
+ <?php endforeach; ?>
42
+ </table>
43
+ </div>
44
+ </div>
45
+
46
+ <?php wp_nonce_field( 'pp-extensions-settings', 'pp-extensions-settings-nonce' ); ?>
includes/admin/admin-settings-integration.php CHANGED
@@ -3,53 +3,6 @@ use PowerpackElementsLite\Classes\PP_Helper;
3
  use PowerpackElementsLite\Classes\PP_Admin_Settings;
4
 
5
  $settings = PP_Admin_Settings::get_settings();
6
-
7
- function refresh_instagram_access_token() {
8
- $access_token = trim( \PowerpackElementsLite\Classes\PP_Admin_Settings::get_option( 'instagram_access_token' ) );
9
- $updated_access_token = 'ppe_updated_instagram_access_token';
10
-
11
- if ( empty( $access_token ) ) {
12
- return;
13
- }
14
-
15
- $updated = get_transient( $updated_access_token );
16
-
17
- if ( ! empty( $updated ) ) {
18
- return;
19
- }
20
-
21
- $endpoint_url = add_query_arg(
22
- [
23
- 'access_token' => $access_token,
24
- 'grant_type' => 'ig_refresh_token',
25
- ],
26
- 'https://graph.instagram.com/refresh_access_token'
27
- );
28
-
29
- $response = wp_remote_get( $endpoint_url );
30
-
31
- if ( ! $response || 200 !== wp_remote_retrieve_response_code( $response ) || is_wp_error( $response ) ) {
32
- set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
33
- return;
34
- }
35
-
36
- $body = wp_remote_retrieve_body( $response );
37
-
38
- if ( ! $body ) {
39
- set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
40
- return;
41
- }
42
-
43
- $body = json_decode( $body, true );
44
-
45
- if ( empty( $body['access_token'] ) || empty( $body['expires_in'] ) ) {
46
- set_transient( $updated_access_token, 'error', DAY_IN_SECONDS );
47
- return;
48
- }
49
-
50
- set_transient( $updated_access_token, 'updated', 30 * DAY_IN_SECONDS );
51
- }
52
- add_action( 'admin_init', 'refresh_instagram_access_token' );
53
  ?>
54
  <h3><?php _e( 'Integration', 'powerpack' ); ?></h3>
55
 
3
  use PowerpackElementsLite\Classes\PP_Admin_Settings;
4
 
5
  $settings = PP_Admin_Settings::get_settings();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ?>
7
  <h3><?php _e( 'Integration', 'powerpack' ); ?></h3>
8
 
includes/admin/admin-settings-modules.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
  $modules = pp_elements_lite_get_modules();
3
- $extensions = pp_elements_lite_get_extensions();
4
  $enabled_modules = pp_elements_lite_get_enabled_modules();
5
- $enabled_extensions = pp_elements_lite_get_enabled_extensions();
6
  $usage_tracking = false;
7
  ?>
8
  <?php if ( $usage_tracking ) { ?>
@@ -33,45 +31,6 @@ $usage_tracking = false;
33
  </div>
34
  <?php } ?>
35
 
36
- <div class="pp-settings-section">
37
- <div class="pp-settings-section-header">
38
- <h3 class="pp-settings-section-title"><?php _e( 'Extensions', 'powerpack' ); ?></h3>
39
- </div>
40
- <div class="pp-settings-section-content">
41
- <table class="form-table pp-settings-elements-grid">
42
- <?php
43
- foreach ( $extensions as $extension_name => $extension_title ) :
44
- if ( ! is_array( $enabled_extensions ) && 'disabled' !== $enabled_extensions ) {
45
- $extension_enabled = true;
46
- } elseif ( ! is_array( $enabled_extensions ) && 'disabled' === $enabled_extensions ) {
47
- $extension_enabled = false;
48
- } else {
49
- $extension_enabled = in_array( $extension_name, $enabled_extensions ) || isset( $enabled_extensions[ $extension_name ] );
50
- }
51
- ?>
52
- <tr valign="top">
53
- <th scope="row" valign="top">
54
- <label for="<?php echo $extension_name; ?>">
55
- <?php echo $extension_title; ?>
56
- </label>
57
- </th>
58
- <td>
59
- <label class="pp-admin-field-toggle">
60
- <input
61
- id="<?php echo $extension_name; ?>"
62
- name="pp_enabled_extensions[]"
63
- type="checkbox"
64
- value="<?php echo $extension_name; ?>"
65
- <?php echo $extension_enabled ? ' checked="checked"' : ''; ?>
66
- />
67
- <span class="pp-admin-field-toggle-slider" aria-hidden="true"></span>
68
- </label>
69
- </td>
70
- </tr>
71
- <?php endforeach; ?>
72
- </table>
73
- </div>
74
- </div>
75
  <div class="pp-settings-section">
76
  <div class="pp-settings-section-header">
77
  <h3 class="pp-settings-section-title"><?php _e( 'Widgets', 'powerpack' ); ?></h3>
1
  <?php
2
  $modules = pp_elements_lite_get_modules();
 
3
  $enabled_modules = pp_elements_lite_get_enabled_modules();
 
4
  $usage_tracking = false;
5
  ?>
6
  <?php if ( $usage_tracking ) { ?>
31
  </div>
32
  <?php } ?>
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  <div class="pp-settings-section">
35
  <div class="pp-settings-section-header">
36
  <h3 class="pp-settings-section-title"><?php _e( 'Widgets', 'powerpack' ); ?></h3>
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "powerpack-lite-for-elementor",
3
- "version": "2.5.3",
4
  "description": "Extend Elementor Page Builder with 50+ Creative Widgets.",
5
  "keywords": [],
6
  "author": "IdeaBox Creations",
@@ -16,7 +16,7 @@
16
  },
17
  "devDependencies": {
18
  "autoprefixer": "^9.7.4",
19
- "grunt": "^1.0.4",
20
  "grunt-bumpup": "^0.6.3",
21
  "grunt-checktextdomain": "^1.0.1",
22
  "grunt-contrib-clean": "^2.0.0",
@@ -31,14 +31,13 @@
31
  "grunt-postcss": "^0.9.0",
32
  "grunt-rtlcss": "^2.0.2",
33
  "grunt-sass": "^3.1.0",
34
- "grunt-stylelint": "^0.13.0",
35
  "grunt-text-replace": "^0.4.0",
36
  "grunt-wp-i18n": "^1.0.3",
37
- "node-sass": "^4.13.1",
38
- "stylelint": "^13.0.0",
39
- "stylelint-config-wordpress": "^16.0.0",
40
  "webpack": "^4.41.6",
41
  "webpack-cli": "^3.3.11"
42
- },
43
- "dependencies": {}
44
  }
1
  {
2
  "name": "powerpack-lite-for-elementor",
3
+ "version": "2.5.4",
4
  "description": "Extend Elementor Page Builder with 50+ Creative Widgets.",
5
  "keywords": [],
6
  "author": "IdeaBox Creations",
16
  },
17
  "devDependencies": {
18
  "autoprefixer": "^9.7.4",
19
+ "grunt": "^1.4.1",
20
  "grunt-bumpup": "^0.6.3",
21
  "grunt-checktextdomain": "^1.0.1",
22
  "grunt-contrib-clean": "^2.0.0",
31
  "grunt-postcss": "^0.9.0",
32
  "grunt-rtlcss": "^2.0.2",
33
  "grunt-sass": "^3.1.0",
34
+ "grunt-stylelint": "^0.16.0",
35
  "grunt-text-replace": "^0.4.0",
36
  "grunt-wp-i18n": "^1.0.3",
37
+ "node-sass": "^6.0.1",
38
+ "stylelint": "^13.13.1",
39
+ "stylelint-config-wordpress": "^17.0.0",
40
  "webpack": "^4.41.6",
41
  "webpack-cli": "^3.3.11"
42
+ }
 
43
  }
powerpack-lite-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: PowerPack Lite for Elementor
4
  * Plugin URI: https://powerpackelements.com
5
  * Description: Extend Elementor Page Builder with 30+ Creative Widgets and exciting extensions.
6
- * Version: 2.5.3
7
  * Author: IdeaBox Creations
8
  * Author URI: http://ideabox.io/
9
  * License: GNU General Public License v2.0
@@ -20,7 +20,7 @@ if ( defined( 'POWERPACK_ELEMENTS_VER' ) ) {
20
  return;
21
  }
22
 
23
- define( 'POWERPACK_ELEMENTS_LITE_VER', '2.5.3' );
24
  define( 'POWERPACK_ELEMENTS_LITE_PATH', plugin_dir_path( __FILE__ ) );
25
  define( 'POWERPACK_ELEMENTS_LITE_BASE', plugin_basename( __FILE__ ) );
26
  define( 'POWERPACK_ELEMENTS_LITE_URL', plugins_url( '/', __FILE__ ) );
3
  * Plugin Name: PowerPack Lite for Elementor
4
  * Plugin URI: https://powerpackelements.com
5
  * Description: Extend Elementor Page Builder with 30+ Creative Widgets and exciting extensions.
6
+ * Version: 2.5.4
7
  * Author: IdeaBox Creations
8
  * Author URI: http://ideabox.io/
9
  * License: GNU General Public License v2.0
20
  return;
21
  }
22
 
23
+ define( 'POWERPACK_ELEMENTS_LITE_VER', '2.5.4' );
24
  define( 'POWERPACK_ELEMENTS_LITE_PATH', plugin_dir_path( __FILE__ ) );
25
  define( 'POWERPACK_ELEMENTS_LITE_BASE', plugin_basename( __FILE__ ) );
26
  define( 'POWERPACK_ELEMENTS_LITE_URL', plugins_url( '/', __FILE__ ) );
readme.txt CHANGED
@@ -227,6 +227,11 @@ Not at all! All the widgets and settings are easy to use with drag & drop interf
227
 
228
  == Changelog ==
229
 
 
 
 
 
 
230
  = 2.5.3 - August 4, 2021 =
231
  * Added: Posts – Link target option for title and thumbnail
232
  * Added: Posts – Center Mode option for Carousel layout
227
 
228
  == Changelog ==
229
 
230
+ = 2.5.4 - August 23, 2021 =
231
+ * Fixed: PHP error in dashboard
232
+ * Fixed: Instagram Access Token option was not saving anything
233
+ * Enhancement: Added separate tab to manage extensions in PowerPack settings
234
+
235
  = 2.5.3 - August 4, 2021 =
236
  * Added: Posts – Link target option for title and thumbnail
237
  * Added: Posts – Center Mode option for Carousel layout