All In One Schema Rich Snippets - Version 1.6.4

Version Description

  • Improvement - Hardened the security of the plugin.
  • Fixed - Reset functionality was not working in the backend settings.
  • Fixed - Console warning jquery-fn-load-is-deprecated.
Download this release

Release Info

Developer brainstormworg
Plugin Icon 128x128 All In One Schema Rich Snippets
Version 1.6.4
Comparing to
See all releases

Code changes from version 1.6.3 to 1.6.4

admin/index.php CHANGED
@@ -936,7 +936,7 @@ if ( isset( $_POST['item_submit'] ) ) {
936
  } else {
937
  foreach ( array( 'review_title', 'item_reviewer', 'review_date', 'item_name', 'item_rating' ) as $option ) {
938
  if ( isset( $_POST[ $option ] ) ) {
939
- $args[ $option ] = esc_attr( $_POST[ $option ] );
940
  }
941
  }
942
  $status = update_option( 'bsf_review', $args );
@@ -951,7 +951,7 @@ if ( isset( $_POST['event_submit'] ) ) {
951
  } else {
952
  foreach ( array( 'snippet_title', 'event_title', 'event_location', 'event_performer', 'start_time', 'end_time', 'event_desc', 'events_price' ) as $option ) {
953
  if ( isset( $_POST[ $option ] ) ) {
954
- $args[ $option ] = esc_attr( $_POST[ $option ] );
955
  }
956
  }
957
  $status = update_option( 'bsf_event', $args );
@@ -966,7 +966,7 @@ if ( isset( $_POST['person_submit'] ) ) {
966
  } else {
967
  foreach ( array( 'snippet_title', 'person_name', 'person_nickname', 'person_job_title', 'person_website', 'person_company', 'person_address' ) as $option ) {
968
  if ( isset( $_POST[ $option ] ) ) {
969
- $args[ $option ] = esc_attr( $_POST[ $option ] );
970
  }
971
  }
972
  $status = update_option( 'bsf_person', $args );
@@ -981,7 +981,7 @@ if ( isset( $_POST['product_submit'] ) ) {
981
  } else {
982
  foreach ( array( 'snippet_title', 'product_rating', 'product_brand', 'product_name', 'product_agr', 'product_price', 'product_avail' ) as $option ) {
983
  if ( isset( $_POST[ $option ] ) ) {
984
- $args[ $option ] = esc_attr( $_POST[ $option ] );
985
  }
986
  }
987
  $status = update_option( 'bsf_product', $args );
@@ -996,7 +996,7 @@ if ( isset( $_POST['recipe_submit'] ) ) {
996
  } else {
997
  foreach ( array( 'snippet_title', 'recipe_name', 'author_name', 'recipe_pub', 'recipe_prep', 'recipe_cook', 'recipe_time', 'recipe_desc', 'recipe_rating' ) as $option ) {
998
  if ( isset( $_POST[ $option ] ) ) {
999
- $args[ $option ] = esc_attr( $_POST[ $option ] );
1000
  }
1001
  }
1002
  $status = update_option( 'bsf_recipe', $args );
@@ -1011,7 +1011,7 @@ if ( isset( $_POST['software_submit'] ) ) {
1011
  } else {
1012
  foreach ( array( 'snippet_title', 'software_rating', 'software_agr', 'software_price', 'software_name', 'software_os', 'software_website' ) as $option ) {
1013
  if ( isset( $_POST[ $option ] ) ) {
1014
- $args[ $option ] = esc_attr( $_POST[ $option ] );
1015
  }
1016
  }
1017
  $status = update_option( 'bsf_software', $args );
@@ -1026,7 +1026,7 @@ if ( isset( $_POST['video_submit'] ) ) {
1026
  } else {
1027
  foreach ( array( 'snippet_title', 'video_title', 'video_desc', 'video_time', 'video_date' ) as $option ) {
1028
  if ( isset( $_POST[ $option ] ) ) {
1029
- $args[ $option ] = esc_attr( $_POST[ $option ] );
1030
  }
1031
  }
1032
  $status = update_option( 'bsf_video', $args );
@@ -1041,7 +1041,7 @@ if ( isset( $_POST['article_submit'] ) ) {
1041
  } else {
1042
  foreach ( array( 'snippet_title', 'article_name', 'article_author', 'article_desc', 'article_image', 'article_publisher', 'article_publisher_logo' ) as $option ) {
1043
  if ( isset( $_POST[ $option ] ) ) {
1044
- $args[ $option ] = esc_attr( $_POST[ $option ] );
1045
  }
1046
  }
1047
  $status = update_option( 'bsf_article', $args );
@@ -1056,7 +1056,7 @@ if ( isset( $_POST['service_submit'] ) ) {
1056
  } else {
1057
  foreach ( array( 'snippet_title', 'service_type', 'service_area', 'service_desc', 'service_provider_name', 'provider_location', 'service_rating', 'service_channel', 'service_url_link' ) as $option ) {
1058
  if ( isset( $_POST[ $option ] ) ) {
1059
- $args[ $option ] = esc_attr( $_POST[ $option ] );
1060
  }
1061
  }
1062
  $status = update_option( 'bsf_service', $args );
@@ -1121,7 +1121,7 @@ if ( isset( $_GET['action'] ) ) {
1121
  * @param string $option_to_reset .
1122
  */
1123
  function bsf_reset_options( $option_to_reset ) {
1124
- require_once dirname( esc_html__FILEesc_html__ ) . '/../settings.php';
1125
  if ( 'review' == $option_to_reset ) {
1126
  add_review_option();
1127
  }
936
  } else {
937
  foreach ( array( 'review_title', 'item_reviewer', 'review_date', 'item_name', 'item_rating' ) as $option ) {
938
  if ( isset( $_POST[ $option ] ) ) {
939
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
940
  }
941
  }
942
  $status = update_option( 'bsf_review', $args );
951
  } else {
952
  foreach ( array( 'snippet_title', 'event_title', 'event_location', 'event_performer', 'start_time', 'end_time', 'event_desc', 'events_price' ) as $option ) {
953
  if ( isset( $_POST[ $option ] ) ) {
954
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
955
  }
956
  }
957
  $status = update_option( 'bsf_event', $args );
966
  } else {
967
  foreach ( array( 'snippet_title', 'person_name', 'person_nickname', 'person_job_title', 'person_website', 'person_company', 'person_address' ) as $option ) {
968
  if ( isset( $_POST[ $option ] ) ) {
969
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
970
  }
971
  }
972
  $status = update_option( 'bsf_person', $args );
981
  } else {
982
  foreach ( array( 'snippet_title', 'product_rating', 'product_brand', 'product_name', 'product_agr', 'product_price', 'product_avail' ) as $option ) {
983
  if ( isset( $_POST[ $option ] ) ) {
984
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
985
  }
986
  }
987
  $status = update_option( 'bsf_product', $args );
996
  } else {
997
  foreach ( array( 'snippet_title', 'recipe_name', 'author_name', 'recipe_pub', 'recipe_prep', 'recipe_cook', 'recipe_time', 'recipe_desc', 'recipe_rating' ) as $option ) {
998
  if ( isset( $_POST[ $option ] ) ) {
999
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
1000
  }
1001
  }
1002
  $status = update_option( 'bsf_recipe', $args );
1011
  } else {
1012
  foreach ( array( 'snippet_title', 'software_rating', 'software_agr', 'software_price', 'software_name', 'software_os', 'software_website' ) as $option ) {
1013
  if ( isset( $_POST[ $option ] ) ) {
1014
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
1015
  }
1016
  }
1017
  $status = update_option( 'bsf_software', $args );
1026
  } else {
1027
  foreach ( array( 'snippet_title', 'video_title', 'video_desc', 'video_time', 'video_date' ) as $option ) {
1028
  if ( isset( $_POST[ $option ] ) ) {
1029
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
1030
  }
1031
  }
1032
  $status = update_option( 'bsf_video', $args );
1041
  } else {
1042
  foreach ( array( 'snippet_title', 'article_name', 'article_author', 'article_desc', 'article_image', 'article_publisher', 'article_publisher_logo' ) as $option ) {
1043
  if ( isset( $_POST[ $option ] ) ) {
1044
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
1045
  }
1046
  }
1047
  $status = update_option( 'bsf_article', $args );
1056
  } else {
1057
  foreach ( array( 'snippet_title', 'service_type', 'service_area', 'service_desc', 'service_provider_name', 'provider_location', 'service_rating', 'service_channel', 'service_url_link' ) as $option ) {
1058
  if ( isset( $_POST[ $option ] ) ) {
1059
+ $args[ $option ] = sanitize_text_field( $_POST[ $option ] );
1060
  }
1061
  }
1062
  $status = update_option( 'bsf_service', $args );
1121
  * @param string $option_to_reset .
1122
  */
1123
  function bsf_reset_options( $option_to_reset ) {
1124
+ require_once AIOSRS_PRO_DIR . '/settings.php';
1125
  if ( 'review' == $option_to_reset ) {
1126
  add_review_option();
1127
  }
index.php CHANGED
@@ -5,7 +5,7 @@
5
  * Author: Brainstorm Force
6
  * Author URI: https://www.brainstormforce.com
7
  * Description: Welcome to the Schema - All In One Schema Rich Snippets! You can now easily add schema markup on various * pages and posts of your website. Implement schema types such as Review, Events, Recipes, Article, Products, Services * *etc.
8
- * Version: 1.6.3
9
  * Text Domain: rich-snippets
10
  * License: GPL2
11
  *
@@ -38,6 +38,7 @@ if ( ! class_exists( 'RichSnippets' ) ) {
38
  register_activation_hook( __FILE__, array( $this, 'register_bsf_settings' ) );
39
  add_action( 'admin_init', array( $this, 'aiosrs_admin_redirect' ) );
40
  add_action( 'admin_head', array( $this, 'star_icons' ) );
 
41
  // Add Admin Menu.
42
  add_action( 'admin_menu', array( $this, 'register_custom_menu_page' ) );
43
  add_action( 'admin_init', array( $this, 'set_styles' ) );
@@ -56,6 +57,17 @@ if ( ! class_exists( 'RichSnippets' ) ) {
56
  add_action( 'admin_bar_menu', array( $this, 'aiosrs_admin_bar' ), 100 );
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Admin bar menu.
61
  */
@@ -316,11 +328,11 @@ if ( ! class_exists( 'RichSnippets' ) ) {
316
  print esc_attr( 'Sorry, your nonce did not verify.' );
317
  exit;
318
  } else {
319
- $snippet_box_bg = esc_attr( $_POST['snippet_box_bg'] );
320
- $snippet_title_bg = esc_attr( $_POST['snippet_title_bg'] );
321
- $border_color = esc_attr( $_POST['snippet_border'] );
322
- $title_color = esc_attr( $_POST['snippet_title_color'] );
323
- $box_color = esc_attr( $_POST['snippet_box_color'] );
324
  $color_opt = array(
325
  'snippet_box_bg' => $snippet_box_bg,
326
  'snippet_title_bg' => $snippet_title_bg,
@@ -375,9 +387,9 @@ if ( is_admin() ) {
375
  require_once plugin_dir_path( __FILE__ ) . '/lib/notices/class-astra-notices.php';
376
  }
377
  // BSF Analytics library.
378
- if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
379
- require_once plugin_dir_path( __FILE__ ) . 'admin/bsf-analytics/class-bsf-analytics-loader.php';
380
- }
381
 
382
  $bsf_analytics = BSF_Analytics_Loader::get_instance();
383
 
@@ -391,9 +403,9 @@ if ( is_admin() ) {
391
  ),
392
  )
393
  );
394
- add_filter( 'bsf_meta_boxes', 'bsf_metaboxes' );
395
- // Instantiating the Class.
396
- if ( class_exists( 'RichSnippets' ) ) {
397
- $richsnippets = new RichSnippets();
398
- }
399
- ?>
5
  * Author: Brainstorm Force
6
  * Author URI: https://www.brainstormforce.com
7
  * Description: Welcome to the Schema - All In One Schema Rich Snippets! You can now easily add schema markup on various * pages and posts of your website. Implement schema types such as Review, Events, Recipes, Article, Products, Services * *etc.
8
+ * Version: 1.6.4
9
  * Text Domain: rich-snippets
10
  * License: GPL2
11
  *
38
  register_activation_hook( __FILE__, array( $this, 'register_bsf_settings' ) );
39
  add_action( 'admin_init', array( $this, 'aiosrs_admin_redirect' ) );
40
  add_action( 'admin_head', array( $this, 'star_icons' ) );
41
+ $this->define_constants();
42
  // Add Admin Menu.
43
  add_action( 'admin_menu', array( $this, 'register_custom_menu_page' ) );
44
  add_action( 'admin_init', array( $this, 'set_styles' ) );
57
  add_action( 'admin_bar_menu', array( $this, 'aiosrs_admin_bar' ), 100 );
58
  }
59
 
60
+ /**
61
+ * Defines all constants
62
+ */
63
+ public function define_constants() {
64
+ define( 'AIOSRS_PRO_FILE', __FILE__ );
65
+ define( 'AIOSRS_PRO_BASE', plugin_basename( AIOSRS_PRO_FILE ) );
66
+ define( 'AIOSRS_PRO_DIR', plugin_dir_path( AIOSRS_PRO_FILE ) );
67
+ define( 'AIOSRS_PRO_URI', plugins_url( '/', AIOSRS_PRO_FILE ) );
68
+ define( 'AIOSRS_PRO_VER', '1.6.4' );
69
+ }
70
+
71
  /**
72
  * Admin bar menu.
73
  */
328
  print esc_attr( 'Sorry, your nonce did not verify.' );
329
  exit;
330
  } else {
331
+ $snippet_box_bg = sanitize_text_field( $_POST['snippet_box_bg'] );
332
+ $snippet_title_bg = sanitize_text_field( $_POST['snippet_title_bg'] );
333
+ $border_color = sanitize_text_field( $_POST['snippet_border'] );
334
+ $title_color = sanitize_text_field( $_POST['snippet_title_color'] );
335
+ $box_color = sanitize_text_field( $_POST['snippet_box_color'] );
336
  $color_opt = array(
337
  'snippet_box_bg' => $snippet_box_bg,
338
  'snippet_title_bg' => $snippet_title_bg,
387
  require_once plugin_dir_path( __FILE__ ) . '/lib/notices/class-astra-notices.php';
388
  }
389
  // BSF Analytics library.
390
+ if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
391
+ require_once plugin_dir_path( __FILE__ ) . 'admin/bsf-analytics/class-bsf-analytics-loader.php';
392
+ }
393
 
394
  $bsf_analytics = BSF_Analytics_Loader::get_instance();
395
 
403
  ),
404
  )
405
  );
406
+ add_filter( 'bsf_meta_boxes', 'bsf_metaboxes' );
407
+ // Instantiating the Class.
408
+ if ( class_exists( 'RichSnippets' ) ) {
409
+ $richsnippets = new RichSnippets();
410
+ }
411
+ ?>
init.php CHANGED
@@ -506,7 +506,7 @@ class Bsf_Meta_Box {
506
  $name = esc_attr( $field['id'] ) . '_id';
507
  $old = get_post_meta( $post_id, $name, ! $field['multiple'] /* If multicheck this can be multiple values */ );
508
  if ( isset( $field['save_id'] ) && $field['save_id'] ) {
509
- $new = isset( $_POST[ $name ] ) ? esc_attr( $_POST[ $name ] ) : null;
510
  } else {
511
  $new = '';
512
  }
506
  $name = esc_attr( $field['id'] ) . '_id';
507
  $old = get_post_meta( $post_id, $name, ! $field['multiple'] /* If multicheck this can be multiple values */ );
508
  if ( isset( $field['save_id'] ) && $field['save_id'] ) {
509
+ $new = isset( $_POST[ $name ] ) ? sanitize_text_field( $_POST[ $name ] ) : null;
510
  } else {
511
  $new = '';
512
  }
js/toggle.js CHANGED
@@ -5,7 +5,7 @@ jQuery(document).ready(function() {
5
  hidden();
6
  else
7
  expand_default(selected);
8
- jQuery( window ).load(function() {
9
  if(item_type == "none")
10
  item_hidden();
11
  else if(selected != "1" && item_type != "none")
5
  hidden();
6
  else
7
  expand_default(selected);
8
+ jQuery(window).on('load',function () {
9
  if(item_type == "none")
10
  item_hidden();
11
  else if(selected != "1" && item_type != "none")
languages/all-in-one-schemaorg-rich-snippets.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the GPL2.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/all-in-one-schemaorg-rich-snippets\n"
8
- "POT-Creation-Date: 2020-08-18 11:37:36+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -632,19 +632,19 @@ msgstr ""
632
  msgid "Ratings updated successfully !"
633
  msgstr ""
634
 
635
- #: index.php:302
636
  msgid "Thank you!"
637
  msgstr ""
638
 
639
- #: index.php:302
640
  msgid "Something went wrong!"
641
  msgstr ""
642
 
643
- #: index.php:331
644
  msgid "Settings saved !"
645
  msgstr ""
646
 
647
- #: index.php:331
648
  msgid "Error occured. Settings were not saved !"
649
  msgstr ""
650
 
2
  # This file is distributed under the GPL2.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.4\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/all-in-one-schemaorg-rich-snippets\n"
8
+ "POT-Creation-Date: 2020-10-14 07:30:50+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
632
  msgid "Ratings updated successfully !"
633
  msgstr ""
634
 
635
+ #: index.php:314
636
  msgid "Thank you!"
637
  msgstr ""
638
 
639
+ #: index.php:314
640
  msgid "Something went wrong!"
641
  msgstr ""
642
 
643
+ #: index.php:343
644
  msgid "Settings saved !"
645
  msgstr ""
646
 
647
+ #: index.php:343
648
  msgid "Error occured. Settings were not saved !"
649
  msgstr ""
650
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: schema markup, structured data, rich snippets, schema.org, Microdata, schema
5
  Requires at least: 3.7
6
- Tested up to: 5.5
7
- Stable tag: 1.6.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
@@ -80,6 +80,11 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
83
  = 1.6.3 =
84
  - Improvement - Compatibility with WordPress 5.5.
85
  - Improvement - Updated the Hashchange jquery.
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: schema markup, structured data, rich snippets, schema.org, Microdata, schema
5
  Requires at least: 3.7
6
+ Tested up to: 5.8
7
+ Stable tag: 1.6.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
80
 
81
  == Changelog ==
82
 
83
+ = 1.6.4 =
84
+ - Improvement - Hardened the security of the plugin.
85
+ - Fixed - Reset functionality was not working in the backend settings.
86
+ - Fixed - Console warning jquery-fn-load-is-deprecated.
87
+
88
  = 1.6.3 =
89
  - Improvement - Compatibility with WordPress 5.5.
90
  - Improvement - Updated the Hashchange jquery.