Google XML Sitemap Generator - Version 2.0.3

Version Description

Release Date: February 6th, 2022 * New : Tested up to WordPress 5.9 * Fix : security fix - validate sitemap renderer * Fix : multi-site validation

Download this release

Release Info

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

Code changes from version 2.0.2 to 2.0.3

code/core.php CHANGED
@@ -55,8 +55,13 @@ class core {
55
  self::addDatabaseTable();
56
  upgrader::doUpgrade();
57
 
58
- self::add_rewrite_rules();
59
- flush_rewrite_rules();
 
 
 
 
 
60
 
61
  add_option( "wpXSG_MapId", uniqid("",true) );
62
  update_option( "xmsg_LastPing", 0 );
@@ -241,7 +246,7 @@ class core {
241
  return null;
242
  }
243
 
244
-
245
 
246
  public static function templateRedirect() {
247
 
@@ -250,6 +255,8 @@ class core {
250
  $type= self::readQueryVar("xsg-type");
251
  $page= self::readQueryVar("xsg-page");
252
 
 
 
253
  // echo var_dump($format);
254
  // exit;
255
 
55
  self::addDatabaseTable();
56
  upgrader::doUpgrade();
57
 
58
+ if ( is_multisite() && ms_is_switched() ) {
59
+ delete_option( 'rewrite_rules' );
60
+ }
61
+ else {
62
+ self::add_rewrite_rules();
63
+ flush_rewrite_rules();
64
+ }
65
 
66
  add_option( "wpXSG_MapId", uniqid("",true) );
67
  update_option( "xmsg_LastPing", 0 );
246
  return null;
247
  }
248
 
249
+
250
 
251
  public static function templateRedirect() {
252
 
255
  $type= self::readQueryVar("xsg-type");
256
  $page= self::readQueryVar("xsg-page");
257
 
258
+
259
+
260
  // echo var_dump($format);
261
  // exit;
262
 
code/providers/coreProvider.php CHANGED
@@ -36,15 +36,26 @@ namespace xmlSitemapGenerator;
36
  class sitemapProvider
37
  {
38
 
39
- // returns a list of the core provider types
40
  static function getProviderList()
41
  {
42
- return array( "posts", "terms", "archive", "authors");
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
45
  // creates an instance of the correct provider for the given type
46
  static function getInstance($type)
47
  {
 
 
48
  $file = $type . 'Provider.php';
49
  if (@include_once($file))
50
  {
36
  class sitemapProvider
37
  {
38
 
 
39
  static function getProviderList()
40
  {
41
+ return array("index", "posts", "terms", "archive", "authors", "news", "latest");
42
  }
43
 
44
+ static function validate($type) {
45
+ $types = self::getProviderList();
46
+ if (!in_array($type, $types))
47
+ {
48
+ echo 'XML Sitemap Generator Error. <br />Invalid Provider type specified : ' . $type;
49
+ exit;
50
+ }
51
+ }
52
+
53
+
54
  // creates an instance of the correct provider for the given type
55
  static function getInstance($type)
56
  {
57
+ self::validate($type);
58
+
59
  $file = $type . 'Provider.php';
60
  if (@include_once($file))
61
  {
code/renderers/coreRenderer.php CHANGED
@@ -7,12 +7,31 @@ namespace xmlSitemapGenerator;
7
  public function renderIndex($page);
8
  public function renderPages($urls);
9
  }
 
 
10
 
11
  class sitemapRenderer
12
  {
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  static function getInstance($type)
15
  {
 
 
16
  $file = $type . 'Renderer.php';
17
  if (@include_once($file))
18
  {
@@ -21,7 +40,7 @@ namespace xmlSitemapGenerator;
21
  }
22
  else
23
  {
24
- echo 'XML Sitemap Generator Error. <br />Invalid Renderer type specified : ' . $type;
25
  exit;
26
  }
27
  }
7
  public function renderIndex($page);
8
  public function renderPages($urls);
9
  }
10
+
11
+
12
 
13
  class sitemapRenderer
14
  {
15
 
16
+ // returns a list of the core provider types
17
+ static function getRendererList()
18
+ {
19
+ return array( "rss", "xml", "htm", "news");
20
+ }
21
+
22
+ static function validate($type) {
23
+ $types = self::getRendererList();
24
+ if (!in_array($type, $types))
25
+ {
26
+ echo 'XML Sitemap Generator Error. <br />Invalid Renderer type specified : ' . $type;
27
+ exit;
28
+ }
29
+ }
30
+
31
  static function getInstance($type)
32
  {
33
+ self::validate($type);
34
+
35
  $file = $type . 'Renderer.php';
36
  if (@include_once($file))
37
  {
40
  }
41
  else
42
  {
43
+ echo 'XML Sitemap Generator Error. <br />Renderer not found : ' . $type;
44
  exit;
45
  }
46
  }
code/settings.php CHANGED
@@ -325,7 +325,7 @@ class settings
325
 
326
 
327
  <p>
328
- <input type="checkbox" name="register" id="register" value="1" <?php checked($globalSettings->register, '1'); ?> /> Recieve important news and updates about the plugin. <a href="/help/privacy.aspx" target="_blank" rel="nofollow">Privacy Policy</a>.
329
  </p>
330
  <table><tr><td>
331
  <p>
325
 
326
 
327
  <p>
328
+ <input type="checkbox" name="register" id="register" value="1" <?php checked($globalSettings->register, '1'); ?> /> Recieve important news and updates about the plugin. <a href="https://xmlsitemapgenerator.org/help/privacy.aspx" target="_blank" rel="nofollow">Privacy Policy</a>.
329
  </p>
330
  <table><tr><td>
331
  <p>
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Google XML Sitemap Generator ===
2
  Contributors: XmlSitemapGenerator
3
  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.8.0
7
 
8
  Improve your websites SEO with a comprehensive, easy to use RSS and XML sitemap plugin. Compatible with Google, Bing, Baidu, Yandex and more.
9
 
@@ -126,6 +126,11 @@ You should now be up and running, but you may also want to :
126
  8. Sitemap entries in Robots.txt
127
 
128
  == Changelog ==
 
 
 
 
 
129
 
130
  = 2.0.2 =
131
  Release Date: August 19th, 2021
1
+ === XML Sitemap Generator for Google ===
2
  Contributors: XmlSitemapGenerator
3
  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
 
8
  Improve your websites SEO with a comprehensive, easy to use RSS and XML sitemap plugin. Compatible with Google, Bing, Baidu, Yandex and more.
9
 
126
  8. Sitemap entries in Robots.txt
127
 
128
  == Changelog ==
129
+ = 2.0.3 =
130
+ Release Date: February 6th, 2022
131
+ * New : Tested up to WordPress 5.9
132
+ * Fix : security fix - validate sitemap renderer
133
+ * Fix : multi-site validation
134
 
135
  = 2.0.2 =
136
  Release Date: August 19th, 2021
www-xml-sitemap-generator-org.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  namespace xmlSitemapGenerator;
3
  /*
4
- Plugin Name: Google XML Sitemap Generator
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.2
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2
1
  <?php
2
  namespace xmlSitemapGenerator;
3
  /*
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.3
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2