Jeg Elementor Kit - Version 2.5.8

Version Description

  • 08-11-2022 =
  • Fix: Disabled Elements not fully disabled
  • Tweak: Do check user capabilities in ajax callback instead in router
Download this release

Release Info

Developer fauzanjegstudio
Plugin Icon 128x128 Jeg Elementor Kit
Version 2.5.8
Comparing to
See all releases

Code changes from version 2.5.7 to 2.5.8

class/ajax/class-ajax.php CHANGED
@@ -71,20 +71,18 @@ class Ajax {
71
  add_action( 'parse_request', array( $this, 'element_ajax_parse_request' ) );
72
  add_filter( 'query_vars', array( $this, 'ajax_query_vars' ) );
73
 
74
- if ( current_user_can( 'edit_theme_options' ) ) {
75
- add_action( 'parse_request', array( $this, 'admin_ajax_parse_request' ) );
76
-
77
- add_action( 'wp_ajax_jkit_create_element', array( $this, 'create_element' ) );
78
- add_action( 'wp_ajax_jkit_delete_element', array( $this, 'delete_element' ) );
79
- add_action( 'wp_ajax_jkit_update_sequence', array( $this, 'update_sequence' ) );
80
- add_action( 'wp_ajax_jkit_clone_element', array( $this, 'clone_element' ) );
81
- add_action( 'wp_ajax_jkit_detail_element', array( $this, 'detail_element' ) );
82
- add_action( 'wp_ajax_jkit_update_element', array( $this, 'update_element' ) );
83
-
84
- add_action( 'wp_ajax_jkit_find_taxonomy', array( $this, 'find_taxonomy' ) );
85
- add_action( 'wp_ajax_jkit_find_author', array( $this, 'find_author' ) );
86
- add_action( 'wp_ajax_jkit_find_posts_object', array( $this, 'find_posts' ) );
87
- }
88
  }
89
 
90
  /**
@@ -132,7 +130,7 @@ class Ajax {
132
 
133
  $action = $wp->query_vars['action'];
134
 
135
- if ( isset( $_POST['form_data'], $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), jkit_get_nonce_identifier( 'dashboard' ) ) ) {
136
  if ( 'save_user_data' === $action ) {
137
  // @codingStandardsIgnoreStart sanitize value using jeg_sanitize_array
138
  $this->save_user_data( jeg_sanitize_array( wp_unslash( $_POST['form_data'] ) ) );
@@ -316,7 +314,7 @@ class Ajax {
316
  * Find Taxonomy
317
  */
318
  public function find_taxonomy() {
319
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
320
  $result = array();
321
  $query = sanitize_text_field( wp_unslash( $_POST['query'] ) );
322
  $slug = isset( $_POST['slug'] ) ? sanitize_text_field( wp_unslash( $_POST['slug'] ) ) : '';
@@ -357,7 +355,7 @@ class Ajax {
357
  * Find all post type
358
  */
359
  public function find_posts() {
360
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
361
  $query = sanitize_text_field( wp_unslash( $_REQUEST['query'] ) );
362
 
363
  add_filter(
@@ -409,7 +407,7 @@ class Ajax {
409
  * Find Author
410
  */
411
  public function find_author() {
412
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
413
  $values = '';
414
 
415
  if ( isset( $_POST['value'] ) && $_POST['value'] ) {
@@ -434,7 +432,7 @@ class Ajax {
434
  * Clone
435
  */
436
  public function clone_element() {
437
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
438
  $data = jeg_sanitize_array( $_POST );
439
  $post_id = $this->duplicate_element( $data['id'] );
440
 
@@ -499,7 +497,7 @@ class Ajax {
499
  * Create Element
500
  */
501
  public function create_element() {
502
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
503
  $post_type = sanitize_key( $_POST['type'] );
504
  $published = jkit_get_element_data( $post_type )['publish'];
505
  $keys = jkit_extract_ids( $published );
@@ -541,7 +539,7 @@ class Ajax {
541
  * Detail Element
542
  */
543
  public function detail_element() {
544
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
545
  $data = jeg_sanitize_array( $_POST );
546
  $result = $this->get_fields( $data['id'], $data['page'] );
547
  wp_send_json_success( $result );
@@ -608,7 +606,7 @@ class Ajax {
608
  * Update Element
609
  */
610
  public function update_element() {
611
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
612
  $data = jeg_sanitize_array( $_POST )['data'];
613
  $condition = isset( $data['condition'] ) ? $data['condition'] : '';
614
  $post_id = sanitize_post_field( 'post_id', $_POST['id'], $_POST['id'] );
@@ -629,7 +627,7 @@ class Ajax {
629
  * Delete Element
630
  */
631
  public function delete_element() {
632
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
633
  $data = jeg_sanitize_array( $_POST );
634
  wp_delete_post( $data['id'], true );
635
  wp_send_json_success( $data );
@@ -641,7 +639,7 @@ class Ajax {
641
  * Update Sequence
642
  */
643
  public function update_sequence() {
644
- if ( $this->is_nonce_valid( 'dashboard' ) ) {
645
  $data = jeg_sanitize_array( $_POST );
646
 
647
  if ( isset( $data['publish'] ) && count( $data['publish'] ) ) {
71
  add_action( 'parse_request', array( $this, 'element_ajax_parse_request' ) );
72
  add_filter( 'query_vars', array( $this, 'ajax_query_vars' ) );
73
 
74
+ add_action( 'parse_request', array( $this, 'admin_ajax_parse_request' ) );
75
+
76
+ add_action( 'wp_ajax_jkit_create_element', array( $this, 'create_element' ) );
77
+ add_action( 'wp_ajax_jkit_delete_element', array( $this, 'delete_element' ) );
78
+ add_action( 'wp_ajax_jkit_update_sequence', array( $this, 'update_sequence' ) );
79
+ add_action( 'wp_ajax_jkit_clone_element', array( $this, 'clone_element' ) );
80
+ add_action( 'wp_ajax_jkit_detail_element', array( $this, 'detail_element' ) );
81
+ add_action( 'wp_ajax_jkit_update_element', array( $this, 'update_element' ) );
82
+
83
+ add_action( 'wp_ajax_jkit_find_taxonomy', array( $this, 'find_taxonomy' ) );
84
+ add_action( 'wp_ajax_jkit_find_author', array( $this, 'find_author' ) );
85
+ add_action( 'wp_ajax_jkit_find_posts_object', array( $this, 'find_posts' ) );
 
 
86
  }
87
 
88
  /**
130
 
131
  $action = $wp->query_vars['action'];
132
 
133
+ if ( isset( $_POST['form_data'], $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), jkit_get_nonce_identifier( 'dashboard' ) ) && current_user_can( 'edit_theme_options' ) ) {
134
  if ( 'save_user_data' === $action ) {
135
  // @codingStandardsIgnoreStart sanitize value using jeg_sanitize_array
136
  $this->save_user_data( jeg_sanitize_array( wp_unslash( $_POST['form_data'] ) ) );
314
  * Find Taxonomy
315
  */
316
  public function find_taxonomy() {
317
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
318
  $result = array();
319
  $query = sanitize_text_field( wp_unslash( $_POST['query'] ) );
320
  $slug = isset( $_POST['slug'] ) ? sanitize_text_field( wp_unslash( $_POST['slug'] ) ) : '';
355
  * Find all post type
356
  */
357
  public function find_posts() {
358
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
359
  $query = sanitize_text_field( wp_unslash( $_REQUEST['query'] ) );
360
 
361
  add_filter(
407
  * Find Author
408
  */
409
  public function find_author() {
410
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
411
  $values = '';
412
 
413
  if ( isset( $_POST['value'] ) && $_POST['value'] ) {
432
  * Clone
433
  */
434
  public function clone_element() {
435
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
436
  $data = jeg_sanitize_array( $_POST );
437
  $post_id = $this->duplicate_element( $data['id'] );
438
 
497
  * Create Element
498
  */
499
  public function create_element() {
500
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
501
  $post_type = sanitize_key( $_POST['type'] );
502
  $published = jkit_get_element_data( $post_type )['publish'];
503
  $keys = jkit_extract_ids( $published );
539
  * Detail Element
540
  */
541
  public function detail_element() {
542
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
543
  $data = jeg_sanitize_array( $_POST );
544
  $result = $this->get_fields( $data['id'], $data['page'] );
545
  wp_send_json_success( $result );
606
  * Update Element
607
  */
608
  public function update_element() {
609
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
610
  $data = jeg_sanitize_array( $_POST )['data'];
611
  $condition = isset( $data['condition'] ) ? $data['condition'] : '';
612
  $post_id = sanitize_post_field( 'post_id', $_POST['id'], $_POST['id'] );
627
  * Delete Element
628
  */
629
  public function delete_element() {
630
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
631
  $data = jeg_sanitize_array( $_POST );
632
  wp_delete_post( $data['id'], true );
633
  wp_send_json_success( $data );
639
  * Update Sequence
640
  */
641
  public function update_sequence() {
642
+ if ( $this->is_nonce_valid( 'dashboard' ) && current_user_can( 'edit_theme_options' ) ) {
643
  $data = jeg_sanitize_array( $_POST );
644
 
645
  if ( isset( $data['publish'] ) && count( $data['publish'] ) ) {
class/dashboard/class-dashboard.php CHANGED
@@ -381,9 +381,7 @@ class Dashboard {
381
  }
382
  );
383
 
384
- if ( current_user_can( 'edit_theme_options' ) ) {
385
- $this->add_child_menu_class( $key, $menu );
386
- }
387
  }
388
  }
389
 
381
  }
382
  );
383
 
384
+ $this->add_child_menu_class( $key, $menu );
 
 
385
  }
386
  }
387
 
class/elements/class-element.php CHANGED
@@ -84,7 +84,7 @@ class Element {
84
  foreach ( $this->list_elements() as $item ) {
85
  $item_key = 'jkit_' . strtolower( $item );
86
 
87
- if ( ! isset( $element_config[ $item_key ] ) || $element_config[ $item_key ] ) {
88
  $namespace = '\Jeg\Elementor_Kit\Elements';
89
  $elements[ $item_key ] = array(
90
  'option' => $namespace . '\Options\\' . $item . '_Option',
84
  foreach ( $this->list_elements() as $item ) {
85
  $item_key = 'jkit_' . strtolower( $item );
86
 
87
+ if ( isset( $element_config[ $item_key ] ) && filter_var( $element_config[ $item_key ], FILTER_VALIDATE_BOOLEAN ) ) {
88
  $namespace = '\Jeg\Elementor_Kit\Elements';
89
  $elements[ $item_key ] = array(
90
  'option' => $namespace . '\Options\\' . $item . '_Option',
jeg-elementor-kit.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Jeg Elementor Kit
4
  * Plugin URI: http://jegtheme.com/
5
  * Description: Additional highly customizable widgets for Elementor page builder
6
- * Version: 2.5.7
7
  * Author: Jegstudio
8
  * Author URI: http://jegtheme.com
9
  * License: GPLv3
10
  * Text Domain: jeg-elementor-kit
11
  *
12
  * Elementor tested up to: 3.8.0
13
- * Elementor Pro tested up to: 3.8.0
14
  *
15
  * @author: Jegstudio
16
  * @since 1.0.0
@@ -25,7 +25,7 @@ add_action(
25
  function() {
26
  defined( 'JEG_ELEMENTOR_KIT' ) || define( 'JEG_ELEMENTOR_KIT', 'jeg-elementor-kit' );
27
  defined( 'JEG_ELEMENTOR_KIT_NAME' ) || define( 'JEG_ELEMENTOR_KIT_NAME', 'Jeg Elementor Kit' );
28
- defined( 'JEG_ELEMENTOR_KIT_VERSION' ) || define( 'JEG_ELEMENTOR_KIT_VERSION', '2.5.7' );
29
  defined( 'JEG_ELEMENTOR_KIT_URL' ) || define( 'JEG_ELEMENTOR_KIT_URL', plugins_url( JEG_ELEMENTOR_KIT ) );
30
  defined( 'JEG_ELEMENTOR_KIT_FILE' ) || define( 'JEG_ELEMENTOR_KIT_FILE', __FILE__ );
31
  defined( 'JEG_ELEMENTOR_KIT_BASE' ) || define( 'JEG_ELEMENTOR_KIT_BASE', plugin_basename( __FILE__ ) );
3
  * Plugin Name: Jeg Elementor Kit
4
  * Plugin URI: http://jegtheme.com/
5
  * Description: Additional highly customizable widgets for Elementor page builder
6
+ * Version: 2.5.8
7
  * Author: Jegstudio
8
  * Author URI: http://jegtheme.com
9
  * License: GPLv3
10
  * Text Domain: jeg-elementor-kit
11
  *
12
  * Elementor tested up to: 3.8.0
13
+ * Elementor Pro tested up to: 3.8.1
14
  *
15
  * @author: Jegstudio
16
  * @since 1.0.0
25
  function() {
26
  defined( 'JEG_ELEMENTOR_KIT' ) || define( 'JEG_ELEMENTOR_KIT', 'jeg-elementor-kit' );
27
  defined( 'JEG_ELEMENTOR_KIT_NAME' ) || define( 'JEG_ELEMENTOR_KIT_NAME', 'Jeg Elementor Kit' );
28
+ defined( 'JEG_ELEMENTOR_KIT_VERSION' ) || define( 'JEG_ELEMENTOR_KIT_VERSION', '2.5.8' );
29
  defined( 'JEG_ELEMENTOR_KIT_URL' ) || define( 'JEG_ELEMENTOR_KIT_URL', plugins_url( JEG_ELEMENTOR_KIT ) );
30
  defined( 'JEG_ELEMENTOR_KIT_FILE' ) || define( 'JEG_ELEMENTOR_KIT_FILE', __FILE__ );
31
  defined( 'JEG_ELEMENTOR_KIT_BASE' ) || define( 'JEG_ELEMENTOR_KIT_BASE', plugin_basename( __FILE__ ) );
languages/jeg-elementor-kit.pot CHANGED
@@ -35,15 +35,15 @@ msgstr ""
35
  msgid "It is recommended that you backup your site before updating the plugin so rollback is possible whenever needed."
36
  msgstr ""
37
 
38
- #: jeg-elementor-kit/class/ajax/class-ajax.php:171, jeg-elementor-kit/class/ajax/class-ajax.php:162, jeg-elementor-kit/class/ajax/class-ajax.php:152, jeg-elementor-kit/class/ajax/class-ajax.php:142, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:82
39
  msgid "Success Save Data"
40
  msgstr ""
41
 
42
- #: jeg-elementor-kit/class/ajax/class-ajax.php:259
43
  msgid "API Key is Invalid."
44
  msgstr ""
45
 
46
- #: jeg-elementor-kit/class/ajax/class-ajax.php:478, jeg-elementor-kit/class/dashboard/class-dashboard.php:630, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:497
47
  msgid "Clone"
48
  msgstr ""
49
 
@@ -83,35 +83,35 @@ msgstr ""
83
  msgid "Jeg Elementor Kit"
84
  msgstr ""
85
 
86
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:522, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:47, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:296, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:315
87
  msgid "Something went wrong"
88
  msgstr ""
89
 
90
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:523
91
  msgid "Save Failed"
92
  msgstr ""
93
 
94
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:588, jeg-elementor-kit/class/dashboard/class-dashboard.php:627, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:498
95
  msgid "Delete"
96
  msgstr ""
97
 
98
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:625
99
  msgid "Setup Condition"
100
  msgstr ""
101
 
102
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:633
103
  msgid "Modify"
104
  msgstr ""
105
 
106
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:668
107
  msgid "Hello <b>%1$s</b>, thank you for using <a href=\"%2$s\" target=\"_blank\">Jeg Elementor Kit</a> v%4$s. Please take a second to <a href=\"%3$s\" target=\"_blank\"> leave us a <span>★★★★★</span> rating</a>. We'd really appreciate your support!"
108
  msgstr ""
109
 
110
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:689
111
  msgid "Our Website"
112
  msgstr ""
113
 
114
- #: jeg-elementor-kit/class/dashboard/class-dashboard.php:690
115
  msgid "Support Forum"
116
  msgstr ""
117
 
35
  msgid "It is recommended that you backup your site before updating the plugin so rollback is possible whenever needed."
36
  msgstr ""
37
 
38
+ #: jeg-elementor-kit/class/ajax/class-ajax.php:169, jeg-elementor-kit/class/ajax/class-ajax.php:160, jeg-elementor-kit/class/ajax/class-ajax.php:150, jeg-elementor-kit/class/ajax/class-ajax.php:140, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:82
39
  msgid "Success Save Data"
40
  msgstr ""
41
 
42
+ #: jeg-elementor-kit/class/ajax/class-ajax.php:257
43
  msgid "API Key is Invalid."
44
  msgstr ""
45
 
46
+ #: jeg-elementor-kit/class/ajax/class-ajax.php:476, jeg-elementor-kit/class/dashboard/class-dashboard.php:628, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:497
47
  msgid "Clone"
48
  msgstr ""
49
 
83
  msgid "Jeg Elementor Kit"
84
  msgstr ""
85
 
86
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:520, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:47, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:296, jeg-elementor-kit/class/elements/views/class-mailchimp-view.php:315
87
  msgid "Something went wrong"
88
  msgstr ""
89
 
90
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:521
91
  msgid "Save Failed"
92
  msgstr ""
93
 
94
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:586, jeg-elementor-kit/class/dashboard/class-dashboard.php:625, jeg-elementor-kit/class/dashboard/template/class-template-dashboard-abstract.php:498
95
  msgid "Delete"
96
  msgstr ""
97
 
98
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:623
99
  msgid "Setup Condition"
100
  msgstr ""
101
 
102
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:631
103
  msgid "Modify"
104
  msgstr ""
105
 
106
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:666
107
  msgid "Hello <b>%1$s</b>, thank you for using <a href=\"%2$s\" target=\"_blank\">Jeg Elementor Kit</a> v%4$s. Please take a second to <a href=\"%3$s\" target=\"_blank\"> leave us a <span>★★★★★</span> rating</a>. We'd really appreciate your support!"
108
  msgstr ""
109
 
110
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:687
111
  msgid "Our Website"
112
  msgstr ""
113
 
114
+ #: jeg-elementor-kit/class/dashboard/class-dashboard.php:688
115
  msgid "Support Forum"
116
  msgstr ""
117
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: elementor, element, addon, widget, extension, blog, post, elementor addon,
4
  Requires at least: 5.0
5
  Tested up to: 6.1
6
  Requires PHP: 7.0
7
- Stable tag: 2.5.7
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -91,6 +91,10 @@ https://elementor.com/help/requirements/ Also you can disable some widgets that
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 2.5.7 - 04-11-2022 =
95
  * Improvement: Security issue
96
  * Improvement: Mailchimp API Key Validation on save
4
  Requires at least: 5.0
5
  Tested up to: 6.1
6
  Requires PHP: 7.0
7
+ Stable tag: 2.5.8
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
91
 
92
  == Changelog ==
93
 
94
+ = 2.5.8 - 08-11-2022 =
95
+ * Fix: Disabled Elements not fully disabled
96
+ * Tweak: Do check user capabilities in ajax callback instead in router
97
+
98
  = 2.5.7 - 04-11-2022 =
99
  * Improvement: Security issue
100
  * Improvement: Mailchimp API Key Validation on save