Google XML Sitemap Generator - Version 2.0.5

Version Description

Release Date: April 29th, 2022 * To ensure hot fix from 2.0.4 gets pushed to all users. * In hindshight 2.0.4 should have been 2.1.0. * Sorry for any problems.

Download this release

Release Info

Developer XmlSitemapGenerator
Plugin Icon 128x128 Google XML Sitemap Generator
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.4 to 2.0.5

code/categoryMetaData.php CHANGED
@@ -8,9 +8,9 @@ class categoryMetaData
8
 
9
  public static function addHooks()
10
  {
11
- $taxonomy = ( isset( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : '0' );
12
  add_action($taxonomy . '_edit_form', array( __CLASS__, 'renderEdit' ) );
13
- add_action($taxonomy . '_add_form_fields', array( __CLASS__, 'renderAdd' ) );
14
  add_action( 'created_' . $taxonomy, array( __CLASS__, 'save_metaData' ), 10, 2);
15
  add_action( 'edited_' . $taxonomy , array( __CLASS__, 'save_metaData' ), 10, 2);
16
 
@@ -118,9 +118,6 @@ class categoryMetaData
118
 
119
 
120
  <h3>Sitemap settings : </h3>
121
-
122
-
123
-
124
 
125
  <table class="form-table">
126
  <tbody><tr class="form-field form-required term-name-wrap">
8
 
9
  public static function addHooks()
10
  {
11
+ $taxonomy = helpers::getRequestValue('taxonomy', '0' );
12
  add_action($taxonomy . '_edit_form', array( __CLASS__, 'renderEdit' ) );
13
+ add_action($taxonomy . '_add_form_fields', array( __CLASS__, 'renderAdd' ) );
14
  add_action( 'created_' . $taxonomy, array( __CLASS__, 'save_metaData' ), 10, 2);
15
  add_action( 'edited_' . $taxonomy , array( __CLASS__, 'save_metaData' ), 10, 2);
16
 
118
 
119
 
120
  <h3>Sitemap settings : </h3>
 
 
 
121
 
122
  <table class="form-table">
123
  <tbody><tr class="form-field form-required term-name-wrap">
code/core.php CHANGED
@@ -323,8 +323,7 @@ class core {
323
  {
324
  $base = trailingslashit( get_bloginfo( 'url' ) );
325
  $url = $base . "rsslatest.xml";
326
- $link = '<link rel="alternate" type="application/rss+xml" title="RSS" href="' . esc_url($url) . '" />';
327
- echo $link;
328
  }
329
  }
330
 
@@ -342,7 +341,7 @@ class core {
342
  $plugin = self::pluginFilename();
343
  if ($file == $plugin)
344
  {
345
- $url = $_SERVER['REQUEST_URI'];
346
  if (strpos( $url, "network") == false) {
347
  $new_links = array('<a href="options-general.php?page=' . XSG_PLUGIN_NAME . '">settings</a>');
348
  $links = array_merge( $links, $new_links );
323
  {
324
  $base = trailingslashit( get_bloginfo( 'url' ) );
325
  $url = $base . "rsslatest.xml";
326
+ echo '<link rel="alternate" type="application/rss+xml" title="RSS" href="' . esc_url($url) . '" />';
 
327
  }
328
  }
329
 
341
  $plugin = self::pluginFilename();
342
  if ($file == $plugin)
343
  {
344
+ $url = Helpers::getServerValue('REQUEST_URI' ,'');
345
  if (strpos( $url, "network") == false) {
346
  $new_links = array('<a href="options-general.php?page=' . XSG_PLUGIN_NAME . '">settings</a>');
347
  $links = array_merge( $links, $new_links );
code/helpers.php CHANGED
@@ -10,6 +10,17 @@ class helpers {
10
  return $default;
11
  }
12
 
 
 
 
 
 
 
 
 
 
 
 
13
  // read object property without a default
14
  public static function safeRead($object,$property) {
15
  return self::safeRead2($object,$property, "");
10
  return $default;
11
  }
12
 
13
+
14
+ static function getRequestValue($field, $default) {
15
+ if (isset( $_REQUEST[$field])) return sanitize_text_field( $_REQUEST[$field]);
16
+ return $default;
17
+ }
18
+
19
+ static function getServerValue($field, $default) {
20
+ if (isset( $_SERVER[$field])) return sanitize_text_field( $_SERVER[$field]);
21
+ return $default;
22
+ }
23
+
24
  // read object property without a default
25
  public static function safeRead($object,$property) {
26
  return self::safeRead2($object,$property, "");
code/postMetaData.php CHANGED
@@ -7,10 +7,7 @@ include_once 'helpers.php';
7
  class postMetaData
8
  {
9
 
10
- function __construct() {
11
-
12
- }
13
-
14
  public static function addHooks() {
15
 
16
  add_action('save_post', array(__CLASS__, 'handlePostBack' ) , 10, 2 );
7
  class postMetaData
8
  {
9
 
10
+
 
 
 
11
  public static function addHooks() {
12
 
13
  add_action('save_post', array(__CLASS__, 'handlePostBack' ) , 10, 2 );
code/settings.php CHANGED
@@ -61,7 +61,7 @@ class settings
61
 
62
  static function handlePostBack(){
63
 
64
- if (!(strtoupper($_SERVER['REQUEST_METHOD']) == 'POST')){ return; }
65
 
66
  /* Verify the nonce before proceeding. */
67
  if ( !isset( $_POST['wpXSG_meta_nonce'] ) || !wp_verify_nonce( $_POST['wpXSG_meta_nonce'], basename( __FILE__ ) ) )
@@ -190,10 +190,10 @@ class settings
190
  $blogUrl = get_bloginfo( 'url' ) ;
191
  $fileUrl = helpers::safeRead($globalSettings,$property) ;
192
  if (strlen($fileUrl) > 0 ) {
193
- echo '<li><a target="_blank" href="' . esc_url($blogUrl .'/' . $fileUrl) . '">' . $name . '</a></li>';
194
  }
195
  else {
196
- echo '<li>' . $name . ' (disabled)</li>';
197
  }
198
 
199
  }
61
 
62
  static function handlePostBack(){
63
 
64
+ if (strtoupper(helpers::getServerValue('REQUEST_METHOD', '') != 'POST')){ return; }
65
 
66
  /* Verify the nonce before proceeding. */
67
  if ( !isset( $_POST['wpXSG_meta_nonce'] ) || !wp_verify_nonce( $_POST['wpXSG_meta_nonce'], basename( __FILE__ ) ) )
190
  $blogUrl = get_bloginfo( 'url' ) ;
191
  $fileUrl = helpers::safeRead($globalSettings,$property) ;
192
  if (strlen($fileUrl) > 0 ) {
193
+ echo '<li><a target="_blank" href="' . esc_url($blogUrl .'/' . $fileUrl) . '">' . esc_attr($name) . '</a></li>';
194
  }
195
  else {
196
+ echo '<li>' . esc_attr($name) . ' (disabled)</li>';
197
  }
198
 
199
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: google, google sitemaps, seo, xml sitemap
4
  Donate link: https://xmlsitemapgenerator.org/contribute/subscribeother.aspx?service=wordpress
5
  Requires at least: 5.1.0
6
  Tested up to: 5.9
7
- Stable tag: 2.0.4
8
 
9
  Improve your websites SEO with a comprehensive, easy to use RSS and XML sitemap plugin. Compatible with Google, Bing, Baidu, Yandex and more.
10
 
@@ -128,6 +128,13 @@ You should now be up and running, but you may also want to :
128
 
129
 
130
  == Changelog ==
 
 
 
 
 
 
 
131
  = 2.0.4 =
132
  Release Date: April 28th, 2022
133
  * New : Set an empty sitemap file to disable a given map.
4
  Donate link: https://xmlsitemapgenerator.org/contribute/subscribeother.aspx?service=wordpress
5
  Requires at least: 5.1.0
6
  Tested up to: 5.9
7
+ Stable tag: 2.0.5
8
 
9
  Improve your websites SEO with a comprehensive, easy to use RSS and XML sitemap plugin. Compatible with Google, Bing, Baidu, Yandex and more.
10
 
128
 
129
 
130
  == Changelog ==
131
+
132
+ = 2.0.5 =
133
+ Release Date: April 29th, 2022
134
+ * To ensure hot fix from 2.0.4 gets pushed to all users.
135
+ * In hindshight 2.0.4 should have been 2.1.0.
136
+ * Sorry for any problems.
137
+
138
  = 2.0.4 =
139
  Release Date: April 28th, 2022
140
  * New : Set an empty sitemap file to disable a given map.
www-xml-sitemap-generator-org.php CHANGED
@@ -4,7 +4,7 @@ namespace xmlSitemapGenerator;
4
  Plugin Name: XML Sitemap Generator for Google
5
  Plugin URI: https://XmlSitemapGenerator.org
6
  Description: HTML, RSS and Google XML Sitemap generator compatible with Google, Bing, Baidu, Yandex and more.
7
- Version: 2.0.4
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2
4
  Plugin Name: XML Sitemap Generator for Google
5
  Plugin URI: https://XmlSitemapGenerator.org
6
  Description: HTML, RSS and Google XML Sitemap generator compatible with Google, Bing, Baidu, Yandex and more.
7
+ Version: 2.0.5
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2