Simple Wp Sitemap - Version 1.1.7

Version Description

(Dec 3, 2016) = * Now escapes urls

Download this release

Release Info

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

Code changes from version 1.1.6 to 1.1.7

readme.txt CHANGED
@@ -5,8 +5,8 @@ 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.6
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
 
@@ -82,6 +82,9 @@ When you deactivate the plugin they get removed automatically.
82
 
83
  == Changelog ==
84
 
 
 
 
85
  = 1.1.6 (Sep 27, 2016) =
86
  * 404 fix for disabled html sitemap
87
  * Couple bugfixes and some code cleanup
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.7
9
+ Stable tag: 1.1.7
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
 
82
 
83
  == Changelog ==
84
 
85
+ = 1.1.7 (Dec 3, 2016) =
86
+ * Now escapes urls
87
+
88
  = 1.1.6 (Sep 27, 2016) =
89
  * 404 fix for disabled html sitemap
90
  * Couple bugfixes and some code cleanup
simple-wp-sitemap.php CHANGED
@@ -4,7 +4,7 @@
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.6
8
  * Author: Webbjocke
9
  * Author URI: http://www.webbjocke.com/
10
  * License: GPLv3
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.7
8
  * Author: Webbjocke
9
  * Author URI: http://www.webbjocke.com/
10
  * License: GPLv3
simpleWpMapBuilder.php CHANGED
@@ -22,8 +22,8 @@ class SimpleWpMapBuilder {
22
 
23
  // Constructor
24
  public function __construct () {
25
- $this->homeUrl = home_url('/');
26
- $this->url = plugins_url() . '/simple-wp-sitemap/';
27
  $this->categories = get_option('simple_wp_disp_categories') ? array(0 => 0) : false;
28
  $this->tags = get_option('simple_wp_disp_tags') ? array(0 => 0) : false;
29
  $this->authors = get_option('simple_wp_disp_authors') ? array(0 => 0) : false;
@@ -97,7 +97,7 @@ class SimpleWpMapBuilder {
97
  while ($q->have_posts()) {
98
  $q->the_post();
99
 
100
- $link = get_permalink();
101
  $date = get_the_modified_date($this->pattern);
102
  $this->getCategoriesTagsAndAuthor($date);
103
 
@@ -148,7 +148,8 @@ class SimpleWpMapBuilder {
148
  echo '</urlset>';
149
 
150
  } else {
151
- echo '<!doctype html><html lang="', get_locale(), '"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>', get_bloginfo('name'), ' Html Sitemap</title><link rel="stylesheet" href="', $this->url, 'css/html.css"></head><body><div id="wrapper"><h1><a href="', $this->homeUrl, '">', get_bloginfo('name'), '</a> Html Sitemap</h1>';
 
152
  $this->sortAndPrintSections();
153
  echo '</div></body></html>';
154
  }
@@ -184,9 +185,10 @@ class SimpleWpMapBuilder {
184
  if ($arr['title'] === 'Authors' && count($this->authors) <= 2) {
185
  $arr['title'] = 'Author';
186
  }
187
- $this->$title = '<div class="header"><p class="header-txt">' . esc_html($arr['title']) . '</p><p class="header-date">' . $this->lastUpdated . '</p></div><ul>' . $this->$title . '</ul>';
 
 
188
  }
189
- echo $this->$title;
190
  $this->$title = null;
191
  }
192
  }
@@ -206,9 +208,9 @@ class SimpleWpMapBuilder {
206
  foreach ($this->$title as $id => $date) {
207
  if ($date) {
208
  switch ($title) {
209
- case 'tags': $link = get_tag_link($id); break;
210
- case 'categories': $link = get_category_link($id); break;
211
- default: $link = get_author_posts_url($id); // Authors
212
  }
213
  if (!$this->isBlockedUrl($link)) {
214
  $xml .= $this->getXml($link, $date);
22
 
23
  // Constructor
24
  public function __construct () {
25
+ $this->homeUrl = esc_url(home_url('/'));
26
+ $this->url = esc_url(plugins_url() . '/simple-wp-sitemap/');
27
  $this->categories = get_option('simple_wp_disp_categories') ? array(0 => 0) : false;
28
  $this->tags = get_option('simple_wp_disp_tags') ? array(0 => 0) : false;
29
  $this->authors = get_option('simple_wp_disp_authors') ? array(0 => 0) : false;
97
  while ($q->have_posts()) {
98
  $q->the_post();
99
 
100
+ $link = esc_url(get_permalink());
101
  $date = get_the_modified_date($this->pattern);
102
  $this->getCategoriesTagsAndAuthor($date);
103
 
148
  echo '</urlset>';
149
 
150
  } else {
151
+ $name = esc_html(get_bloginfo('name'));
152
+ echo '<!doctype html><html lang="', get_locale(), '"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>', $name, ' Html Sitemap</title><link rel="stylesheet" href="', $this->url, 'css/html.css"></head><body><div id="wrapper"><h1><a href="', $this->homeUrl, '">', $name, '</a> Html Sitemap</h1>';
153
  $this->sortAndPrintSections();
154
  echo '</div></body></html>';
155
  }
185
  if ($arr['title'] === 'Authors' && count($this->authors) <= 2) {
186
  $arr['title'] = 'Author';
187
  }
188
+ echo '<div class="header"><p class="header-txt">', esc_html($arr['title']), '</p><p class="header-date">', $this->lastUpdated, '</p></div><ul>', $this->$title, '</ul>';
189
+ } else {
190
+ echo $this->$title;
191
  }
 
192
  $this->$title = null;
193
  }
194
  }
208
  foreach ($this->$title as $id => $date) {
209
  if ($date) {
210
  switch ($title) {
211
+ case 'tags': $link = esc_url(get_tag_link($id)); break;
212
+ case 'categories': $link = esc_url(get_category_link($id)); break;
213
+ default: $link = esc_url(get_author_posts_url($id)); // Authors
214
  }
215
  if (!$this->isBlockedUrl($link)) {
216
  $xml .= $this->getXml($link, $date);
simpleWpMapOptions.php CHANGED
@@ -17,7 +17,7 @@ class SimpleWpMapOptions {
17
 
18
  // Returns a sitemap url
19
  public function sitemapUrl ($format) {
20
- return sprintf('%ssitemap.%s', home_url('/'), $format);
21
  }
22
 
23
  // Get the url to the plugin dir
17
 
18
  // Returns a sitemap url
19
  public function sitemapUrl ($format) {
20
+ return sprintf('%ssitemap.%s', $this->esc(home_url('/'), 'url'), $format);
21
  }
22
 
23
  // Get the url to the plugin dir