Accordion - Version 2.2.27

Version Description

  • 2020-10-14 - fix - security issue fixed
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Accordion
Version 2.2.27
Comparing to
See all releases

Code changes from version 2.2.26 to 2.2.27

accordions.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accordions by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
- Version: 2.2.26
7
  Author: PickPlugins
8
  Author URI: http://pickplugins.com
9
  Text Domain: accordions
@@ -21,7 +21,7 @@ class Accordions{
21
 
22
  define('accordions_plugin_url', plugins_url('/', __FILE__) );
23
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
24
- define('accordions_version', '2.2.26' );
25
  define('accordions_plugin_name', 'Accordions' );
26
  define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
27
 
3
  Plugin Name: Accordions by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
5
  Description: Fully responsive and mobile ready accordion grid for wordpress.
6
+ Version: 2.2.27
7
  Author: PickPlugins
8
  Author URI: http://pickplugins.com
9
  Text Domain: accordions
21
 
22
  define('accordions_plugin_url', plugins_url('/', __FILE__) );
23
  define('accordions_plugin_dir', plugin_dir_path( __FILE__ ) );
24
+ define('accordions_version', '2.2.27' );
25
  define('accordions_plugin_name', 'Accordions' );
26
  define('accordions_plugin_basename', plugin_basename( __FILE__ ) );
27
 
includes/class-post-meta-product.php CHANGED
@@ -59,6 +59,7 @@ class class_accordions_post_meta_product{
59
  $('#accordions_id').select2('destroy').val('').select2();
60
  })
61
 
 
62
 
63
  $('#accordions_id').select2({
64
  ajax: {
@@ -68,7 +69,8 @@ class class_accordions_post_meta_product{
68
  data: function (params) {
69
  return {
70
  q: params.term, // search query
71
- action: 'accordions_ajax_wc_get_accordions' // AJAX action for admin-ajax.php
 
72
  };
73
  },
74
  processResults: function( data ) {
59
  $('#accordions_id').select2('destroy').val('').select2();
60
  })
61
 
62
+ console.log(accordions_ajax.nonce);
63
 
64
  $('#accordions_id').select2({
65
  ajax: {
69
  data: function (params) {
70
  return {
71
  q: params.term, // search query
72
+ action: 'accordions_ajax_wc_get_accordions', // AJAX action for admin-ajax.php
73
+ "nonce" : accordions_ajax.nonce,
74
  };
75
  },
76
  processResults: function( data ) {
includes/functions-wc.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
2
-
3
-
4
-
5
  if ( ! defined('ABSPATH')) exit; // if direct access
6
 
7
 
@@ -46,21 +43,30 @@ function accordions_ajax_wc_get_accordions(){
46
 
47
  $return = array();
48
 
49
- // you can use WP_Query, query_posts() or get_posts() here - it doesn't matter
50
- $search_results = new WP_Query( array(
51
- 's'=> $_GET['q'], // the search query
52
- 'post_type' => 'accordions',
53
- 'post_status' => 'publish', // if you don't want drafts to be returned
54
- 'ignore_sticky_posts' => 1,
55
- 'posts_per_page' => -1 // how much to show at once
56
- ) );
57
- if( $search_results->have_posts() ) :
58
- while( $search_results->have_posts() ) : $search_results->the_post();
59
- // shorten the title a little
60
- $title = ( mb_strlen( $search_results->post->post_title ) > 50 ) ? mb_substr( $search_results->post->post_title, 0, 49 ) . '...' : $search_results->post->post_title;
61
- $return[] = array( $search_results->post->ID, $title ); // array( Post ID, Post Title )
62
- endwhile;
63
- endif;
 
 
 
 
 
 
 
 
 
64
  echo json_encode( $return );
65
  die;
66
 
1
  <?php
 
 
 
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
 
43
 
44
  $return = array();
45
 
46
+ $nonce = isset($_GET['nonce']) ? sanitize_text_field($_GET['nonce']) : '';
47
+
48
+ //error_log($nonce);
49
+
50
+ if(wp_verify_nonce( $nonce, 'accordions_nonce' )) {
51
+
52
+ if(current_user_can( 'manage_options' )) {
53
+ // you can use WP_Query, query_posts() or get_posts() here - it doesn't matter
54
+ $search_results = new WP_Query(array(
55
+ 's' => $_GET['q'], // the search query
56
+ 'post_type' => 'accordions',
57
+ 'post_status' => 'publish', // if you don't want drafts to be returned
58
+ 'ignore_sticky_posts' => 1,
59
+ 'posts_per_page' => -1 // how much to show at once
60
+ ));
61
+ if ($search_results->have_posts()) :
62
+ while ($search_results->have_posts()) : $search_results->the_post();
63
+ // shorten the title a little
64
+ $title = (mb_strlen($search_results->post->post_title) > 50) ? mb_substr($search_results->post->post_title, 0, 49) . '...' : $search_results->post->post_title;
65
+ $return[] = array($search_results->post->ID, $title); // array( Post ID, Post Title )
66
+ endwhile;
67
+ endif;
68
+ }
69
+ }
70
  echo json_encode( $return );
71
  die;
72
 
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Donate link: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
4
  Tags: accordion, tabs, FAQ, WooCommerce FAQ Tab, accordion short-code, accordions widget, tab
5
  Requires at least: 3.8
6
- Tested up to: 5.5
7
- Stable tag: 2.2.26
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -139,10 +139,12 @@ then paste this shortcode anywhere in your page to display accordions<br />
139
 
140
  == Changelog ==
141
 
142
- = 2.2.26 =
143
- * 2020-06-26 - add - Who can see edit link
144
 
145
 
 
 
146
 
147
  = 2.2.25 =
148
  * 2020-06-26 - fix - schema header text count text removed.
3
  Donate link: https://www.pickplugins.com/item/accordions-html-css3-responsive-accordion-grid-for-wordpress/?ref=dashboard
4
  Tags: accordion, tabs, FAQ, WooCommerce FAQ Tab, accordion short-code, accordions widget, tab
5
  Requires at least: 3.8
6
+ Tested up to: 5.7
7
+ Stable tag: 2.2.27
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+ = 2.2.27 =
143
+ * 2020-10-14 - fix - security issue fixed
144
 
145
 
146
+ = 2.2.26 =
147
+ * 2020-06-26 - add - Who can see edit link
148
 
149
  = 2.2.25 =
150
  * 2020-06-26 - fix - schema header text count text removed.