Google XML Sitemap Generator - Version 1.2.3

Version Description

Release Date: April 5th, 2016

  • Fix : Network / multi-site activation issue
  • Fix : robots.txt bug calling addRobotLinks()
  • Fix : Errors due to conflicts with some plugin's
Download this release

Release Info

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

Code changes from version 1.2.2 to 1.2.3

code/categoryMetaData.php CHANGED
@@ -86,12 +86,12 @@ class categoryMetaData
86
  <p>Immediate child posts/pages inherit these settings.</p>
87
  </div>
88
 
89
- <script type="text/javascript" src="<?php echo myPluginPath(); ?>scripts.js"></script>
90
  <script>
91
- populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
92
- populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
93
- populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
94
- populate("wpXSG-Inherit" ,inheritSelect, <?php echo $settings->inherit ?>);
95
  </script>
96
 
97
  <?php
@@ -146,12 +146,12 @@ class categoryMetaData
146
  </tr>
147
  </tbody></table>
148
 
149
- <script type="text/javascript" src="<?php echo myPluginPath(); ?>scripts.js"></script>
150
  <script>
151
- populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
152
- populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
153
- populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
154
- populate("wpXSG-Inherit" ,inheritSelect, <?php echo $settings->inherit ?>);
155
  </script>
156
 
157
 
86
  <p>Immediate child posts/pages inherit these settings.</p>
87
  </div>
88
 
89
+ <script type="text/javascript" src="<?php echo xsgPluginPath(); ?>scripts.js"></script>
90
  <script>
91
+ xsg_populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
92
+ xsg_populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
93
+ xsg_populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
94
+ xsg_populate("wpXSG-Inherit" ,inheritSelect, <?php echo $settings->inherit ?>);
95
  </script>
96
 
97
  <?php
146
  </tr>
147
  </tbody></table>
148
 
149
+ <script type="text/javascript" src="<?php echo xsgPluginPath(); ?>scripts.js"></script>
150
  <script>
151
+ xsg_populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
152
+ xsg_populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
153
+ xsg_populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
154
+ xsg_populate("wpXSG-Inherit" ,inheritSelect, <?php echo $settings->inherit ?>);
155
  </script>
156
 
157
 
code/core.php CHANGED
@@ -5,9 +5,10 @@ namespace xmlSitemapGenerator;
5
  include_once 'settingsModels.php';
6
  include_once 'upgrader.php';
7
 
8
- define ( "PLUGIN_NAME" , "www-xml-sitemap-generator-org");
9
- define ( "RULES_VERSION" , "0003"); // increment this if the rewrite rules ever change.
10
- define ( "RULES_OPTION_NAME" , "wpXSG_rewrite_done");
 
11
 
12
  // settings for general operation and rendering
13
 
@@ -20,28 +21,8 @@ class core {
20
  }
21
 
22
  public static function pluginVersion() {
23
- if(!isset($GLOBALS["xmsg_version"]))
24
- {
25
- try
26
- {
27
- if(!function_exists('get_plugin_data')) {
28
- if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) {
29
- require_once(ABSPATH . 'wp-admin/includes/plugin.php');
30
- }
31
- else return "0.ERROR";
32
- }
33
- $pluginData = get_plugin_data(myPluginFile(), false, false);
34
- $GLOBALS["xmsg_version"] = $data['Version'];
35
- }
36
- catch (Exception $e)
37
- {
38
- $GLOBALS["xmsg_version"] = "0.ERROR";
39
- }
40
-
41
-
42
-
43
- }
44
- return $GLOBALS["xmsg_version"];
45
  }
46
 
47
 
@@ -79,7 +60,7 @@ class core {
79
  add_action('wp_head', array(__CLASS__, 'addRssLink'),100);
80
 
81
  // only include admin files when necessary.
82
- if (is_admin())
83
  {
84
  include_once 'settings.php';
85
  include_once 'postMetaData.php';
@@ -103,7 +84,7 @@ class core {
103
 
104
  // NB Network activation will not have set up the rules for the site.
105
  // Check if they exist and then reactivate.
106
- if (get_option(RULES_OPTION_NAME, null) != RULES_VERSION)
107
  {
108
  add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1);
109
  }
@@ -156,7 +137,7 @@ class core {
156
  }
157
  }
158
 
159
- public function addRobotLinks()
160
  {
161
  $globalSettings = get_option( "wpXSG_global" , new globalSettings() );
162
  if($globalSettings->addToRobots == true)
@@ -198,7 +179,7 @@ class core {
198
  /** @var $wp_rewrite WP_Rewrite */
199
  global $wp_rewrite;
200
  $wp_rewrite->flush_rules(false);
201
- update_option(RULES_OPTION_NAME, RULES_VERSION);
202
  }
203
 
204
  static function filter_plugin_row_meta($links, $file) {
@@ -206,7 +187,7 @@ class core {
206
  if ($file == $plugin)
207
  {
208
  $new_links = array(
209
- '<a href="options-general.php?page=' . PLUGIN_NAME . '">Settings</a>'
210
  );
211
 
212
  $links = array_merge( $links, $new_links );
5
  include_once 'settingsModels.php';
6
  include_once 'upgrader.php';
7
 
8
+ define ( "XSG_PLUGIN_VERSION" , "1.2.3");
9
+ define ( "XSG_PLUGIN_NAME" , "www-xml-sitemap-generator-org");
10
+ define ( "XSG_RULES_VERSION" , "0003"); // increment this if the rewrite rules ever change.
11
+ define ( "XSG_RULES_OPTION_NAME" , "wpXSG_rewrite_done");
12
 
13
  // settings for general operation and rendering
14
 
21
  }
22
 
23
  public static function pluginVersion() {
24
+ // getting version from file was causing issues.
25
+ return XSG_PLUGIN_VERSION;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
 
60
  add_action('wp_head', array(__CLASS__, 'addRssLink'),100);
61
 
62
  // only include admin files when necessary.
63
+ if (is_admin() && !is_network_admin())
64
  {
65
  include_once 'settings.php';
66
  include_once 'postMetaData.php';
84
 
85
  // NB Network activation will not have set up the rules for the site.
86
  // Check if they exist and then reactivate.
87
+ if (get_option(XSG_RULES_OPTION_NAME, null) != XSG_RULES_VERSION)
88
  {
89
  add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1);
90
  }
137
  }
138
  }
139
 
140
+ public static function addRobotLinks()
141
  {
142
  $globalSettings = get_option( "wpXSG_global" , new globalSettings() );
143
  if($globalSettings->addToRobots == true)
179
  /** @var $wp_rewrite WP_Rewrite */
180
  global $wp_rewrite;
181
  $wp_rewrite->flush_rules(false);
182
+ update_option(XSG_RULES_OPTION_NAME, XSG_RULES_VERSION);
183
  }
184
 
185
  static function filter_plugin_row_meta($links, $file) {
187
  if ($file == $plugin)
188
  {
189
  $new_links = array(
190
+ '<a href="options-general.php?page=' . XSG_PLUGIN_NAME . '">Settings</a>'
191
  );
192
 
193
  $links = array_merge( $links, $new_links );
code/postMetaData.php CHANGED
@@ -86,11 +86,11 @@ class postMetaData
86
 
87
 
88
 
89
- <script type="text/javascript" src="<?php echo myPluginPath(); ?>scripts.js"></script>
90
  <script>
91
- populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
92
- populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
93
- populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
94
 
95
  </script>
96
  <?php
86
 
87
 
88
 
89
+ <script type="text/javascript" src="<?php echo xsgPluginPath(); ?>scripts.js"></script>
90
  <script>
91
+ xsg_populate("wpXSG-Exclude" ,excludeSelect, <?php echo $settings->exclude ?>);
92
+ xsg_populate("wpXSG-Priority" ,prioritySelect, <?php echo $settings->priority ?>);
93
+ xsg_populate("wpXSG-Frequency" ,frequencySelect, <?php echo $settings->frequency ?>);
94
 
95
  </script>
96
  <?php
code/settings.php CHANGED
@@ -16,12 +16,12 @@ class settings
16
 
17
  public static function admin_menu()
18
  {
19
- add_options_page( 'XML Sitemap Settings','XML Sitemap','manage_options', PLUGIN_NAME , array( __CLASS__ , 'render' ) );
20
  }
21
 
22
  public static function register_settings()
23
  {
24
- register_setting( PLUGIN_NAME, PLUGIN_NAME );
25
  }
26
 
27
  static function getDefaults($name){
@@ -93,9 +93,9 @@ class settings
93
  <td scope="col"><select name="<?php echo $name; ?>Frequency" id="<?php echo $name; ?>Frequency" ></select> </td>
94
  </tr>
95
  <script>
96
- populate("<?php echo $name; ?>Exclude" ,excludeDefaults, <?php echo $defaults->exclude ?>);
97
- populate("<?php echo $name; ?>Priority" ,priorityDefaults, <?php echo $defaults->priority ?>);
98
- populate("<?php echo $name; ?>Frequency" ,frequencyDefaults, <?php echo $defaults->frequency ?>);
99
 
100
  </script>
101
 
@@ -220,7 +220,7 @@ class settings
220
 
221
  <div class="meta-box-sortabless">
222
 
223
- <script type="text/javascript" src="<?php echo myPluginPath(); ?>scripts.js"></script>
224
  <div class="postbox">
225
  <h3 class="hndle"><span>General settings</span></h3>
226
  <div class="inside">
16
 
17
  public static function admin_menu()
18
  {
19
+ add_options_page( 'XML Sitemap Settings','XML Sitemap','manage_options', XSG_PLUGIN_NAME , array( __CLASS__ , 'render' ) );
20
  }
21
 
22
  public static function register_settings()
23
  {
24
+ register_setting( XSG_PLUGIN_NAME, XSG_PLUGIN_NAME );
25
  }
26
 
27
  static function getDefaults($name){
93
  <td scope="col"><select name="<?php echo $name; ?>Frequency" id="<?php echo $name; ?>Frequency" ></select> </td>
94
  </tr>
95
  <script>
96
+ xsg_populate("<?php echo $name; ?>Exclude" ,excludeDefaults, <?php echo $defaults->exclude ?>);
97
+ xsg_populate("<?php echo $name; ?>Priority" ,priorityDefaults, <?php echo $defaults->priority ?>);
98
+ xsg_populate("<?php echo $name; ?>Frequency" ,frequencyDefaults, <?php echo $defaults->frequency ?>);
99
 
100
  </script>
101
 
220
 
221
  <div class="meta-box-sortabless">
222
 
223
+ <script type="text/javascript" src="<?php echo xsgPluginPath(); ?>scripts.js"></script>
224
  <div class="postbox">
225
  <h3 class="hndle"><span>General settings</span></h3>
226
  <div class="inside">
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: XmlSitemapGenerator
3
  Tags: title, xml, rss, sitemap, yandex, metaboxes, google, bing, yahoo, baidu
4
  Donate link: https://XmlSitemapGenerator.org/donate.aspx
5
  Requires at least: 4.0
6
- Tested up to: 4.4
7
- Stable tag: 1.2.2
8
 
9
 
10
  Easy to use, highly configurable WordPress RSS and Google XML Sitemap generator plugin. Compatible with Google, Bing, Baidu, Yandex and more.
@@ -39,6 +39,9 @@ Stay in touch via [facebook](https://www.facebook.com/XmlSitemapGenerator) and [
39
  4. Configure tag, category, post and page level settings when adding / editing them.
40
  5. It's that easy!
41
 
 
 
 
42
 
43
  == Screenshots ==
44
 
@@ -51,6 +54,13 @@ Stay in touch via [facebook](https://www.facebook.com/XmlSitemapGenerator) and [
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
 
54
  = 1.2.2 =
55
  Release Date: December 16th, 2015
56
 
3
  Tags: title, xml, rss, sitemap, yandex, metaboxes, google, bing, yahoo, baidu
4
  Donate link: https://XmlSitemapGenerator.org/donate.aspx
5
  Requires at least: 4.0
6
+ Tested up to: 4.6
7
+ Stable tag: 1.2.3
8
 
9
 
10
  Easy to use, highly configurable WordPress RSS and Google XML Sitemap generator plugin. Compatible with Google, Bing, Baidu, Yandex and more.
39
  4. Configure tag, category, post and page level settings when adding / editing them.
40
  5. It's that easy!
41
 
42
+ ** Having problems? **
43
+
44
+ * Check out our [trouble shooting](http://blog.xmlsitemapgenerator.org/2016/06/troubleshooting-your-wordpress-sitemap.html) blog post.
45
 
46
  == Screenshots ==
47
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.2.3 =
58
+ Release Date: April 5th, 2016
59
+
60
+ * Fix : Network / multi-site activation issue
61
+ * Fix : robots.txt bug calling addRobotLinks()
62
+ * Fix : Errors due to conflicts with some plugin's
63
+
64
  = 1.2.2 =
65
  Release Date: December 16th, 2015
66
 
scripts.js CHANGED
@@ -1,4 +1,4 @@
1
- function populate(id, options, selected)
2
  {
3
  var select = document.getElementById(id);
4
 
1
+ function xsg_populate(id, options, selected)
2
  {
3
  var select = document.getElementById(id);
4
 
www-xml-sitemap-generator-org.php CHANGED
@@ -4,7 +4,7 @@ namespace xmlSitemapGenerator;
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: 1.2.2
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2
@@ -17,8 +17,8 @@ function myPluginFile() {
17
 
18
  return __FILE__;
19
  }
20
- function myPluginPath() {
21
- return plugins_url() . "/" . PLUGIN_NAME . "/";
22
 
23
  }
24
 
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: 1.2.3
8
  Author: XmlSitemapGenerator.org
9
  Author URI: https://XmlSitemapGenerator.org
10
  License: GPL2
17
 
18
  return __FILE__;
19
  }
20
+ function xsgPluginPath() {
21
+ return plugins_url() . "/" . XSG_PLUGIN_NAME . "/";
22
 
23
  }
24