Simple Wp Sitemap - Version 1.1.5

Version Description

(Sep 21, 2016) = * Added option to disable html sitemap * Plugin description changed

Download this release

Release Info

Developer Webbjocke
Plugin Icon 128x128 Simple Wp Sitemap
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

css/simple-wp-sitemap-admin.css CHANGED
@@ -142,6 +142,7 @@
142
  }
143
  .simple-wp-sitemap-includes{
144
  padding: 0 20px;
 
145
  list-style-type: disc;
146
  }
147
  @media screen and (max-width: 800px){
142
  }
143
  .simple-wp-sitemap-includes{
144
  padding: 0 20px;
145
+ margin: 0;
146
  list-style-type: disc;
147
  }
148
  @media screen and (max-width: 800px){
readme.txt CHANGED
@@ -3,18 +3,18 @@ Contributors: Webbjocke
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UH6ANJA7M8DNS
4
  License: GPLv3
5
  License URI: http://www.gnu.org/licenses/gpl.html
6
- Tags: sitemap, google sitemap, xml, simple sitemap, html, xml sitemap, html sitemap, seo, seo sitemap, sitemaps, site map, sitemap html, sitemap xml, sitemap plugin, wordpress sitemap
7
  Requires at least: 4.0
8
- Tested up to: 4.6
9
- Stable tag: 1.1.4
10
 
11
- An easy, fast and secure plugin that adds both an xml and an html sitemap to your site, which updates and maintains themselves so you dont have to!
12
 
13
  == Description ==
14
 
15
  = A Wordpress sitemap plugin =
16
 
17
- Simple Wp Sitemap is a plugin that generates both an xml and an html sitemap to your site dynamically. These two are updated automatically everytime someone's visiting them, and makes sure they're easily indexed. What this means you only have to install and activate the plugin once, and it will just work for you without you ever having to worry.
18
 
19
  Reason the sitemaps are generated dynamically instead of being created as actual files as they were in the beginning, is because it's much faster and more solid. No problems with having to access, create and delete files, instead they're just presented when needed to. It's now suddenly as lightweight, simple and fast as one can expect!
20
 
@@ -22,13 +22,13 @@ Also supports the option to add pages to the sitemaps that aren't part of your o
22
 
23
  = What it does =
24
 
25
- So what the plugin actually does is making one sitemap.xml and one sitemap.html available directly on your site. These aren't actually real files that can be found in a folder or anything, instead they get generated when visited and can be found at like yourpage.com/sitemap.xml and yourpage.com/sitemap.html.
26
 
27
  And yes, of course the sitemaps are mobile friendly. They also work well with caching plugins :)
28
 
29
- = Extra info =
30
 
31
- The sitemaps are multisite and multilanguage compatible. Every site gets their own sitemap, and all multilanguage urls are included in the sitemaps!
32
 
33
  == Installation ==
34
 
@@ -82,6 +82,10 @@ When you deactivate the plugin they get removed automatically.
82
 
83
  == Changelog ==
84
 
 
 
 
 
85
  = 1.1.4 (May 16, 2016) =
86
  * Bugfix for old php versions
87
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UH6ANJA7M8DNS
4
  License: GPLv3
5
  License URI: http://www.gnu.org/licenses/gpl.html
6
+ Tags: sitemap, site map, sitemap.xml, xml sitemap, html sitemap, simple sitemap, seo sitemap, google sitemap, sitemap.html, sitemap plugin, wordpress sitemap
7
  Requires at least: 4.0
8
+ Tested up to: 4.6.1
9
+ Stable tag: 1.1.5
10
 
11
+ An easy sitemap plugin that adds both an xml and an html sitemap to your site, which updates and maintains themselves so you don't have to!
12
 
13
  == Description ==
14
 
15
  = A Wordpress sitemap plugin =
16
 
17
+ Simple Wp Sitemap is a sitemap plugin that generates both an xml and an html sitemap to your site dynamically. These two are updated automatically everytime someone's visiting them. Which means they're always up to date and that you only have to install and activate the plugin once, and it will just work for you without you ever having to worry.
18
 
19
  Reason the sitemaps are generated dynamically instead of being created as actual files as they were in the beginning, is because it's much faster and more solid. No problems with having to access, create and delete files, instead they're just presented when needed to. It's now suddenly as lightweight, simple and fast as one can expect!
20
 
22
 
23
  = What it does =
24
 
25
+ So what the plugin actually does is making one xml sitemap and one html sitemap available directly on your site. These aren't actually real files that can be found in a folder or anything, instead they get generated when visited and can be found at like yourpage.com/sitemap.xml and yourpage.com/sitemap.html.
26
 
27
  And yes, of course the sitemaps are mobile friendly. They also work well with caching plugins :)
28
 
29
+ = Multisite and multilanguage compatible =
30
 
31
+ The sitemaps are multisite and multilanguage compatible. Every site gets their own sitemap, and all multilanguage urls are included in them!
32
 
33
  == Installation ==
34
 
82
 
83
  == Changelog ==
84
 
85
+ = 1.1.5 (Sep 21, 2016) =
86
+ * Added option to disable html sitemap
87
+ * Plugin description changed
88
+
89
  = 1.1.4 (May 16, 2016) =
90
  * Bugfix for old php versions
91
 
simple-wp-sitemap.php CHANGED
@@ -3,8 +3,8 @@
3
  /*
4
  * Plugin Name: Simple Wp Sitemap
5
  * Plugin URI: http://www.webbjocke.com/simple-wp-sitemap/
6
- * Description: An easy, fast and secure plugin that adds both an xml and an html sitemap to your site, which updates and maintains themselves so you dont have to!
7
- * Version: 1.1.4
8
  * Author: Webbjocke
9
  * Author URI: http://www.webbjocke.com/
10
  * License: GPLv3
@@ -82,8 +82,8 @@ class SimpleWpSitemap {
82
 
83
  // Registers settings on admin_init and checks for updates
84
  public static function sitemapAdminInit () {
85
- foreach (array('simple_wp_other_urls', 'simple_wp_block_urls', 'simple_wp_attr_link', 'simple_wp_disp_categories', 'simple_wp_disp_tags', 'simple_wp_disp_authors', 'simple_wp_disp_sitemap_order', 'simple_wp_sitemap_version', 'simple_wp_last_updated') as $setting) {
86
- register_setting('simple_wp-sitemap-group', $setting);
87
  }
88
  self::updateCheck();
89
  }
@@ -103,7 +103,8 @@ class SimpleWpSitemap {
103
  // Generates the content
104
  public static function generateSitemapContent () {
105
  global $wp_query;
106
- if (isset($wp_query->query_vars['thesimplewpsitemap']) && in_array(($q = $wp_query->query_vars['thesimplewpsitemap']), array('xml', 'html'))) {
 
107
  $wp_query->is_404 = false;
108
 
109
  require_once 'simpleWpMapBuilder.php';
@@ -137,7 +138,7 @@ class SimpleWpSitemap {
137
  $arr = explode('-|-', $_POST['simple_wp_' . $key . '_n']);
138
  $order[$key] = array('i' => $arr[0], 'title' => isset($arr[1]) ? $arr[1] : $key);
139
  }
140
- $options->setOptions($_POST['simple_wp_other_urls'], $_POST['simple_wp_block_urls'], (isset($_POST['simple_wp_attr_link']) ? 1 : 0), (isset($_POST['simple_wp_disp_categories']) ? 1 : 0), (isset($_POST['simple_wp_disp_tags']) ? 1 : 0), (isset($_POST['simple_wp_disp_authors']) ? 1 : 0), $order, $_POST['simple_wp_active-page'], $_POST['simple_wp_last_updated']);
141
  }
142
  elseif (isset($_POST['upgrade_to_premium'])) {
143
  $options->upgradePlugin($_POST['upgrade_to_premium']);
3
  /*
4
  * Plugin Name: Simple Wp Sitemap
5
  * Plugin URI: http://www.webbjocke.com/simple-wp-sitemap/
6
+ * Description: An easy sitemap plugin that adds both an xml and an html sitemap to your site, which updates and maintains themselves so you don't have to!
7
+ * Version: 1.1.5
8
  * Author: Webbjocke
9
  * Author URI: http://www.webbjocke.com/
10
  * License: GPLv3
82
 
83
  // Registers settings on admin_init and checks for updates
84
  public static function sitemapAdminInit () {
85
+ foreach (array('other_urls', 'block_urls', 'attr_link', 'disp_categories', 'disp_tags', 'disp_authors', 'disp_sitemap_order', 'sitemap_version', 'last_updated', 'block_html') as $setting) {
86
+ register_setting('simple_wp-sitemap-group', 'simple_wp_' . $setting);
87
  }
88
  self::updateCheck();
89
  }
103
  // Generates the content
104
  public static function generateSitemapContent () {
105
  global $wp_query;
106
+
107
+ if (isset($wp_query->query_vars['thesimplewpsitemap']) && (($q = $wp_query->query_vars['thesimplewpsitemap']) === 'xml' || ($q === 'html' && !get_option('simple_wp_block_html')))) {
108
  $wp_query->is_404 = false;
109
 
110
  require_once 'simpleWpMapBuilder.php';
138
  $arr = explode('-|-', $_POST['simple_wp_' . $key . '_n']);
139
  $order[$key] = array('i' => $arr[0], 'title' => isset($arr[1]) ? $arr[1] : $key);
140
  }
141
+ $options->setOptions($_POST['simple_wp_other_urls'], $_POST['simple_wp_block_urls'], (isset($_POST['simple_wp_attr_link']) ? 1 : 0), (isset($_POST['simple_wp_disp_categories']) ? 1 : 0), (isset($_POST['simple_wp_disp_tags']) ? 1 : 0), (isset($_POST['simple_wp_disp_authors']) ? 1 : 0), $order, $_POST['simple_wp_active-page'], $_POST['simple_wp_last_updated'], (isset($_POST['simple_wp_block_html']) ? 1 : 0));
142
  }
143
  elseif (isset($_POST['upgrade_to_premium'])) {
144
  $options->upgradePlugin($_POST['upgrade_to_premium']);
simpleWpMapAdmin.php CHANGED
@@ -12,7 +12,7 @@
12
  <p><strong>Links to your xml and html sitemap:</strong></p>
13
  <ul>
14
  <li>Xml sitemap: <a href="<?php echo $options->sitemapUrl('xml'); ?>"><?php echo $options->sitemapUrl('xml'); ?></a></li>
15
- <li>Html sitemap: <a href="<?php echo $options->sitemapUrl('html'); ?>"><?php echo $options->sitemapUrl('html'); ?></a></li>
16
  </ul>
17
  <noscript>(Please enable javascript to edit options)</noscript>
18
  <form method="post" action="<?php echo $options->getSubmitUrl(); ?>" id="simple-wp-sitemap-form">
@@ -31,16 +31,28 @@
31
  <tr><td>Add pages to the sitemaps in addition to your normal wordpress ones. Just paste "full" urls in the textarea like: <strong>http://www.example.com/a-page/</strong>. Each link on a new row <em>(this will affect both your xml and html sitemap)</em>.</td></tr>
32
  <tr><td><textarea rows="7" name="simple_wp_other_urls" placeholder="http://www.example.com/a-page/" class="large-text code" id="swsp-add-pages-textarea"><?php echo $options->getOptions('simple_wp_other_urls'); ?></textarea></td></tr>
33
 
 
 
34
  <tr><td><strong>Block pages</strong></td></tr>
35
  <tr><td>Add pages you want to block from showing up in the sitemaps. Same as above, just paste every link on a new row. <em>(Hint: copy paste links from one of the sitemaps to get correct urls)</em>.</td></tr>
36
  <tr><td><textarea rows="7" name="simple_wp_block_urls" placeholder="http://www.example.com/block-this-page/" class="large-text code"><?php echo $options->getOptions('simple_wp_block_urls'); ?></textarea></td></tr>
37
 
 
 
38
  <tr><td><strong>Extra sitemap includes</strong></td></tr>
39
  <tr><td>Check if you want to include categories, tags and/or author pages in the sitemaps.</td></tr>
40
  <tr><td><input type="checkbox" name="simple_wp_disp_categories" id="simple_wp_cat" <?php echo $options->getOptions('simple_wp_disp_categories'); ?>><label for="simple_wp_cat"> Include categories</label></td></tr>
41
  <tr><td><input type="checkbox" name="simple_wp_disp_tags" id="simple_wp_tags" <?php echo $options->getOptions('simple_wp_disp_tags'); ?>><label for="simple_wp_tags"> Include tags</label></td></tr>
42
  <tr><td><input type="checkbox" name="simple_wp_disp_authors" id="simple_wp_authors" <?php echo $options->getOptions('simple_wp_disp_authors'); ?>><label for="simple_wp_authors"> Include authors</label></td></tr>
43
 
 
 
 
 
 
 
 
 
44
  <tr><td><strong>Like the plugin?</strong></td></tr>
45
  <tr><td>Show your support by rating the plugin at wordpress.org, and/or by adding an attribution link to the sitemap.html file :)</td></tr>
46
  <tr><td><input type="checkbox" name="simple_wp_attr_link" id="simple_wp_check" <?php echo $options->getOptions('simple_wp_attr_link'); ?>><label for="simple_wp_check"> Add "Generated by Simple Wp Sitemap" link at bottom of sitemap.html.</label></td></tr>
@@ -68,25 +80,27 @@
68
  </table>
69
 
70
  <table class="widefat form-table table-hidden" data-id="sitemap-premium">
71
- <tr><td><strong>Upgrade to Simple Wp Sitemap Premium!</strong></td></tr>
72
- <tr><td>Premium is an enhanced version of Simple Wp Sitemap. It's a one time payment and can be used on multiple sites!</td></tr>
73
- <tr><td><strong>Includes:</strong>
74
  <ul class="simple-wp-sitemap-includes">
75
- <li>Split sitemaps <em>(option to have multiple files instead of having all links in one document)</em></li>
76
- <li>Add a logo to the sitemaps</li>
 
77
  <li>Custom css</li>
78
- <li>Color picker <em>(to change colors if you don't know css)</em></li>
 
79
  <li>Exclude directories</li>
80
  <li>Free updates</li>
81
  </ul>
82
  </td></tr>
83
- <tr><td><strong>If you have a premium code, enter it here to upgrade</strong></td></tr>
84
- <tr><td><input type="text" id="upgradeField" value="<?php echo $options->getPosted(); ?>"><span class="button-secondary" id="upgradeToPremium">Upgrade</span> <span style="color:red;" id="swpErrorText"><?php echo $options->getError(); ?></span></td></tr>
85
- <tr><td><hr><strong>Purchase via</strong>: <a target="_blank" href="https://www.webbjocke.com/downloads/simple-wp-sitemap-premium">webbjocke.com/downloads/simple-wp-sitemap-premium</a>
86
- <ul class="simple-wp-sitemap-includes">
87
- <li>It's: 6.99$ USD (tax included)</li>
88
- <li>A "how to" guide is available on the site!</li>
89
- </ul>
90
  </td></tr>
91
  </table>
92
 
12
  <p><strong>Links to your xml and html sitemap:</strong></p>
13
  <ul>
14
  <li>Xml sitemap: <a href="<?php echo $options->sitemapUrl('xml'); ?>"><?php echo $options->sitemapUrl('xml'); ?></a></li>
15
+ <li>Html sitemap: <a href="<?php echo $options->sitemapUrl('html'); ?>"><?php echo $options->sitemapUrl('html'); ?></a> <?php if (get_option('simple_wp_block_html')) { echo '(disabled)'; } ?></li>
16
  </ul>
17
  <noscript>(Please enable javascript to edit options)</noscript>
18
  <form method="post" action="<?php echo $options->getSubmitUrl(); ?>" id="simple-wp-sitemap-form">
31
  <tr><td>Add pages to the sitemaps in addition to your normal wordpress ones. Just paste "full" urls in the textarea like: <strong>http://www.example.com/a-page/</strong>. Each link on a new row <em>(this will affect both your xml and html sitemap)</em>.</td></tr>
32
  <tr><td><textarea rows="7" name="simple_wp_other_urls" placeholder="http://www.example.com/a-page/" class="large-text code" id="swsp-add-pages-textarea"><?php echo $options->getOptions('simple_wp_other_urls'); ?></textarea></td></tr>
33
 
34
+ <tr><td><hr></td></tr>
35
+
36
  <tr><td><strong>Block pages</strong></td></tr>
37
  <tr><td>Add pages you want to block from showing up in the sitemaps. Same as above, just paste every link on a new row. <em>(Hint: copy paste links from one of the sitemaps to get correct urls)</em>.</td></tr>
38
  <tr><td><textarea rows="7" name="simple_wp_block_urls" placeholder="http://www.example.com/block-this-page/" class="large-text code"><?php echo $options->getOptions('simple_wp_block_urls'); ?></textarea></td></tr>
39
 
40
+ <tr><td><hr></td></tr>
41
+
42
  <tr><td><strong>Extra sitemap includes</strong></td></tr>
43
  <tr><td>Check if you want to include categories, tags and/or author pages in the sitemaps.</td></tr>
44
  <tr><td><input type="checkbox" name="simple_wp_disp_categories" id="simple_wp_cat" <?php echo $options->getOptions('simple_wp_disp_categories'); ?>><label for="simple_wp_cat"> Include categories</label></td></tr>
45
  <tr><td><input type="checkbox" name="simple_wp_disp_tags" id="simple_wp_tags" <?php echo $options->getOptions('simple_wp_disp_tags'); ?>><label for="simple_wp_tags"> Include tags</label></td></tr>
46
  <tr><td><input type="checkbox" name="simple_wp_disp_authors" id="simple_wp_authors" <?php echo $options->getOptions('simple_wp_disp_authors'); ?>><label for="simple_wp_authors"> Include authors</label></td></tr>
47
 
48
+ <tr><td><hr></td></tr>
49
+
50
+ <tr><td><strong>Disable html sitemap</strong></td></tr>
51
+ <tr><td>Check to disable the html sitemap if you only want to use the xml sitemap on your site.</td></tr>
52
+ <tr><td><input type="checkbox" name="simple_wp_block_html" id="simple_wp_block_html" <?php echo $options->getOptions('simple_wp_block_html'); ?>><label for="simple_wp_block_html"> Disable html sitemap</label></td></tr>
53
+
54
+ <tr><td><hr></td></tr>
55
+
56
  <tr><td><strong>Like the plugin?</strong></td></tr>
57
  <tr><td>Show your support by rating the plugin at wordpress.org, and/or by adding an attribution link to the sitemap.html file :)</td></tr>
58
  <tr><td><input type="checkbox" name="simple_wp_attr_link" id="simple_wp_check" <?php echo $options->getOptions('simple_wp_attr_link'); ?>><label for="simple_wp_check"> Add "Generated by Simple Wp Sitemap" link at bottom of sitemap.html.</label></td></tr>
80
  </table>
81
 
82
  <table class="widefat form-table table-hidden" data-id="sitemap-premium">
83
+ <tr><td><strong>Simple Wp Sitemap Premium</strong></td></tr>
84
+ <tr><td>Premium is an enhanced version of Simple Wp Sitemap and includes:</td></tr>
85
+ <tr><td>
86
  <ul class="simple-wp-sitemap-includes">
87
+ <li>Image sitemaps <em>(for better image SEO)</em></li>
88
+ <li>Split sitemaps into multiple files</li>
89
+ <li>Add your logo</li>
90
  <li>Custom css</li>
91
+ <li>Color picker</li>
92
+ <li>Https support</li>
93
  <li>Exclude directories</li>
94
  <li>Free updates</li>
95
  </ul>
96
  </td></tr>
97
+
98
+ <tr><td><hr></td></tr>
99
+
100
+ <tr><td><strong>If you have a premium code, enter it here to upgrade</strong><br><br>
101
+ <input type="text" id="upgradeField" value="<?php echo $options->getPosted(); ?>"><span class="button-secondary" id="upgradeToPremium">Upgrade</span> <span style="color:red;" id="swpErrorText"><?php echo $options->getError(); ?></span></td></tr>
102
+ <tr><td>
103
+ <hr><br><strong>Available at</strong>: <a target="_blank" href="https://www.webbjocke.com/downloads/simple-wp-sitemap-premium">webbjocke.com/downloads/simple-wp-sitemap-premium</a>
104
  </td></tr>
105
  </table>
106
 
simpleWpMapOptions.php CHANGED
@@ -37,7 +37,7 @@ class SimpleWpMapOptions {
37
  }
38
 
39
  // Updates the settings/options
40
- public function setOptions ($otherUrls, $blockUrls, $attrLink, $categories, $tags, $authors, $orderArray, $activePage, $lastUpdated) {
41
  @date_default_timezone_set(get_option('timezone_string'));
42
  update_option('simple_wp_other_urls', $this->addUrls($otherUrls, get_option('simple_wp_other_urls')));
43
  update_option('simple_wp_block_urls', $this->addUrls($blockUrls));
@@ -45,6 +45,7 @@ class SimpleWpMapOptions {
45
  update_option('simple_wp_disp_categories', $categories);
46
  update_option('simple_wp_disp_tags', $tags);
47
  update_option('simple_wp_disp_authors', $authors);
 
48
  update_option('simple_wp_last_updated', $this->sanitHtml($lastUpdated));
49
 
50
  if ($this->checkOrder($orderArray) && uasort($orderArray, array($this, 'sortArr'))) { // sort the array here
@@ -58,7 +59,7 @@ class SimpleWpMapOptions {
58
  public function getOptions ($val) {
59
  if (preg_match("/^simple_wp_(other_urls|block_urls)$/", $val)) {
60
  $val = get_option($val);
61
- } elseif (preg_match("/^simple_wp_(attr_link|disp_categories|disp_tags|disp_authors)$/", $val)) {
62
  return get_option($val) ? 'checked' : ''; // return checkbox checked values right here and dont bother with the loop below
63
  } elseif ($val === 'simple_wp_disp_sitemap_order' && ($orderArray = get_option($val))) {
64
  return $this->checkOrder($orderArray);
37
  }
38
 
39
  // Updates the settings/options
40
+ public function setOptions ($otherUrls, $blockUrls, $attrLink, $categories, $tags, $authors, $orderArray, $activePage, $lastUpdated, $blockHtml) {
41
  @date_default_timezone_set(get_option('timezone_string'));
42
  update_option('simple_wp_other_urls', $this->addUrls($otherUrls, get_option('simple_wp_other_urls')));
43
  update_option('simple_wp_block_urls', $this->addUrls($blockUrls));
45
  update_option('simple_wp_disp_categories', $categories);
46
  update_option('simple_wp_disp_tags', $tags);
47
  update_option('simple_wp_disp_authors', $authors);
48
+ update_option('simple_wp_block_html', $blockHtml);
49
  update_option('simple_wp_last_updated', $this->sanitHtml($lastUpdated));
50
 
51
  if ($this->checkOrder($orderArray) && uasort($orderArray, array($this, 'sortArr'))) { // sort the array here
59
  public function getOptions ($val) {
60
  if (preg_match("/^simple_wp_(other_urls|block_urls)$/", $val)) {
61
  $val = get_option($val);
62
+ } elseif (preg_match("/^simple_wp_(attr_link|disp_categories|disp_tags|disp_authors|block_html)$/", $val)) {
63
  return get_option($val) ? 'checked' : ''; // return checkbox checked values right here and dont bother with the loop below
64
  } elseif ($val === 'simple_wp_disp_sitemap_order' && ($orderArray = get_option($val))) {
65
  return $this->checkOrder($orderArray);