Simple Wp Sitemap - Version 1.2.1

Version Description

(May 18, 2018) = * Fixed multilanguage bug * Reduced memory usage

Download this release

Release Info

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

Code changes from version 1.2.0 to 1.2.1

css/simple-wp-sitemap-admin.css CHANGED
@@ -3,19 +3,20 @@
3
  */
4
 
5
  #sitemap-settings{
6
- background: #fff;
7
- margin: 0;
8
  float: left;
9
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
10
  }
11
  #sitemap-settings li{
12
  float: left;
13
  margin: 0;
14
- border-top: 1px solid #e5e5e5;
15
- border-left: 1px solid #e5e5e5;
 
 
16
  }
17
  #sitemap-settings li:last-child{
18
- border-right: 1px solid #e5e5e5;
19
  }
20
  #sitemap-settings a{
21
  display: inline-block;
@@ -25,26 +26,24 @@
25
  color: inherit;
26
  text-decoration: none;
27
  text-align: center;
28
- transition: all 0.3s;
29
  }
30
  #sitemap-settings li:hover, #sitemap-settings li.ui-state-active{
31
  cursor: pointer;
32
- border-color: #c0c0c0;
33
- }
34
- #sitemap-settings li:hover + li, #sitemap-settings li.ui-state-active + li{
35
- border-left-color: #c0c0c0;
36
  }
37
- #sitemap-settings a:hover, #sitemap-settings .ui-state-active a{
38
- background: #e0f1da;
39
- box-shadow: none;
40
  outline: none;
 
 
 
 
41
  }
42
  .sitemap-table{
43
  background: #fff;
44
  max-width: 1080px;
45
  padding: 15px;
46
- border: 1px solid #e5e5e5;
47
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
48
  box-sizing: border-box;
49
  clear: both;
50
  }
3
  */
4
 
5
  #sitemap-settings{
6
+ background: #e8e8e8;
7
+ margin: 0 0 -1px 0;
8
  float: left;
 
9
  }
10
  #sitemap-settings li{
11
  float: left;
12
  margin: 0;
13
+ border-top: 1px solid #c0c0c0;
14
+ border-left: 1px solid #c0c0c0;
15
+ border-bottom: 1px solid #c0c0c0;
16
+ transition: all 0.3s;
17
  }
18
  #sitemap-settings li:last-child{
19
+ border-right: 1px solid #c0c0c0;
20
  }
21
  #sitemap-settings a{
22
  display: inline-block;
26
  color: inherit;
27
  text-decoration: none;
28
  text-align: center;
 
29
  }
30
  #sitemap-settings li:hover, #sitemap-settings li.ui-state-active{
31
  cursor: pointer;
32
+ border-bottom-color: #fff;
33
+ background: #fff;
 
 
34
  }
35
+ #sitemap-settings a:hover, #sitemap-settings a:focus, #sitemap-settings li:hover, #sitemap-settings li:focus{
 
 
36
  outline: none;
37
+ box-shadow: none;
38
+ }
39
+ #sitemap-links a{
40
+ word-wrap: break-word;
41
  }
42
  .sitemap-table{
43
  background: #fff;
44
  max-width: 1080px;
45
  padding: 15px;
46
+ border: 1px solid #c0c0c0;
 
47
  box-sizing: border-box;
48
  clear: both;
49
  }
languages/simple-wp-sitemap.pot CHANGED
@@ -1,10 +1,10 @@
1
- # Copyright (C) 2017 Simple Wp Sitemap
2
  # This file is distributed under the same license as the Simple Wp Sitemap package.
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Simple Wp Sitemap\n"
7
- "POT-Creation-Date: 2017-11-16 16:48+0100\n"
8
  "PO-Revision-Date: \n"
9
  "Last-Translator: Webbjocke <mail@webbjocke.com>\n"
10
  "Language-Team: Webbjocke <mail@webbjocke.com>\n"
@@ -13,7 +13,7 @@ msgstr ""
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
- "X-Generator: Poedit 2.0.4\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_html__;_n;_n:1,2\n"
19
  "X-Poedit-Basepath: ..\n"
@@ -120,7 +120,7 @@ msgstr ""
120
  msgid "Title in html sitemap"
121
  msgstr ""
122
 
123
- #: simpleWpMapAdmin.php:67 simpleWpMapBuilder.php:154
124
  msgid "Html Sitemap"
125
  msgstr ""
126
 
@@ -204,7 +204,7 @@ msgstr ""
204
  msgid "Restore default order"
205
  msgstr ""
206
 
207
- #: simpleWpMapAdmin.php:124 simpleWpMapAdmin.php:135
208
  msgid "Simple Wp Sitemap Premium"
209
  msgstr ""
210
 
@@ -233,7 +233,7 @@ msgid "And much more!"
233
  msgstr ""
234
 
235
  #: simpleWpMapAdmin.php:135
236
- msgid "Available at:"
237
  msgstr ""
238
 
239
  #: simpleWpMapAdmin.php:139
@@ -244,7 +244,7 @@ msgstr ""
244
  msgid "(If you have a caching plugin, you might have to clear cache before changes will be shown in the sitemaps)"
245
  msgstr ""
246
 
247
- #: simpleWpMapBuilder.php:208
248
  msgid "Generated by: Simple Wp Sitemap"
249
  msgstr ""
250
 
1
+ # Copyright (C) 2018 Simple Wp Sitemap
2
  # This file is distributed under the same license as the Simple Wp Sitemap package.
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Simple Wp Sitemap\n"
7
+ "POT-Creation-Date: 2018-05-18 14:16+0200\n"
8
  "PO-Revision-Date: \n"
9
  "Last-Translator: Webbjocke <mail@webbjocke.com>\n"
10
  "Language-Team: Webbjocke <mail@webbjocke.com>\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
+ "X-Generator: Poedit 2.0.7\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_html__;_n;_n:1,2\n"
19
  "X-Poedit-Basepath: ..\n"
120
  msgid "Title in html sitemap"
121
  msgstr ""
122
 
123
+ #: simpleWpMapAdmin.php:67 simpleWpMapBuilder.php:166
124
  msgid "Html Sitemap"
125
  msgstr ""
126
 
204
  msgid "Restore default order"
205
  msgstr ""
206
 
207
+ #: simpleWpMapAdmin.php:124
208
  msgid "Simple Wp Sitemap Premium"
209
  msgstr ""
210
 
233
  msgstr ""
234
 
235
  #: simpleWpMapAdmin.php:135
236
+ msgid "Get Simple Wp Sitemap Premium!"
237
  msgstr ""
238
 
239
  #: simpleWpMapAdmin.php:139
244
  msgid "(If you have a caching plugin, you might have to clear cache before changes will be shown in the sitemaps)"
245
  msgstr ""
246
 
247
+ #: simpleWpMapBuilder.php:220
248
  msgid "Generated by: Simple Wp Sitemap"
249
  msgstr ""
250
 
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Simple Wp Sitemap ===
2
  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, 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.9
9
- Stable tag: 1.2.0
 
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,10 @@ When you deactivate the plugin they get removed automatically.
82
 
83
  == Changelog ==
84
 
 
 
 
 
85
  = 1.2.0 (Nov 16, 2017) =
86
  * Added option to change title in html sitemap
87
  * Urlfix when no permalink setting is set
1
  === Simple Wp Sitemap ===
2
  Contributors: Webbjocke
 
3
  License: GPLv3
4
  License URI: http://www.gnu.org/licenses/gpl.html
5
  Tags: sitemap, site map, sitemap.xml, xml sitemap, html sitemap, simple sitemap, seo sitemap, google sitemap, sitemap.html, sitemap plugin, wordpress sitemap
6
  Requires at least: 4.0
7
+ Tested up to: 4.9.6
8
+ Stable tag: 1.2.1
9
+ Requires PHP: 5.2.4
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.2.1 (May 18, 2018) =
86
+ * Fixed multilanguage bug
87
+ * Reduced memory usage
88
+
89
  = 1.2.0 (Nov 16, 2017) =
90
  * Added option to change title in html sitemap
91
  * Urlfix when no permalink setting is set
simple-wp-sitemap.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Simple Wp Sitemap
5
  * Plugin URI: https://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.2.0
8
  * Author: Webbjocke
9
  * Author URI: https://www.webbjocke.com/
10
  * License: GPLv3
@@ -14,7 +14,7 @@
14
 
15
  /*
16
  Simple Wp Sitemap - WordPress sitemap plugin
17
- Copyright (C) 2017 Webbjocke
18
 
19
  This program is free software: you can redistribute it and/or modify
20
  it under the terms of the GNU General Public License as published by
4
  * Plugin Name: Simple Wp Sitemap
5
  * Plugin URI: https://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.2.1
8
  * Author: Webbjocke
9
  * Author URI: https://www.webbjocke.com/
10
  * License: GPLv3
14
 
15
  /*
16
  Simple Wp Sitemap - WordPress sitemap plugin
17
+ Copyright (C) 2018 Webbjocke
18
 
19
  This program is free software: you can redistribute it and/or modify
20
  it under the terms of the GNU General Public License as published by
simpleWpMapAdmin.php CHANGED
@@ -15,7 +15,7 @@
15
  <p><?php _e('Your two sitemaps are active! Here you can change and customize them.', 'simple-wp-sitemap'); ?></p>
16
  <p><b><?php _e('Links to your xml and html sitemap:', 'simple-wp-sitemap'); ?></b></p>
17
 
18
- <ul>
19
  <li><?php printf('%1$s <a href="%2$s">%2$s</a>', __('Xml sitemap:', 'simple-wp-sitemap'), $ops->getSitemapUrl('xml')); ?></li>
20
  <li>
21
  <?php _e('Html sitemap:', 'simple-wp-sitemap'); ?>
@@ -132,7 +132,7 @@
132
  <li><?php _e('And much more!', 'simple-wp-sitemap'); ?></li>
133
  </ul>
134
 
135
- <p><?php _e('Available at:', 'simple-wp-sitemap'); ?> <a target="_blank" rel="noopener" href="<?php echo esc_url('https://www.webbjocke.com/downloads/simple-wp-sitemap-premium/'); ?>"><?php _e('Simple Wp Sitemap Premium', 'simple-wp-sitemap'); ?></a></p>
136
 
137
  </div><!-- sitemap-premium -->
138
 
15
  <p><?php _e('Your two sitemaps are active! Here you can change and customize them.', 'simple-wp-sitemap'); ?></p>
16
  <p><b><?php _e('Links to your xml and html sitemap:', 'simple-wp-sitemap'); ?></b></p>
17
 
18
+ <ul id="sitemap-links">
19
  <li><?php printf('%1$s <a href="%2$s">%2$s</a>', __('Xml sitemap:', 'simple-wp-sitemap'), $ops->getSitemapUrl('xml')); ?></li>
20
  <li>
21
  <?php _e('Html sitemap:', 'simple-wp-sitemap'); ?>
132
  <li><?php _e('And much more!', 'simple-wp-sitemap'); ?></li>
133
  </ul>
134
 
135
+ <p><a target="_blank" rel="noopener" class="button-secondary" href="<?php echo esc_url('https://www.webbjocke.com/downloads/simple-wp-sitemap-premium/'); ?>"><?php _e('Get Simple Wp Sitemap Premium!', 'simple-wp-sitemap'); ?></a></p>
136
 
137
  </div><!-- sitemap-premium -->
138
 
simpleWpMapBuilder.php CHANGED
@@ -86,17 +86,29 @@ class SimpleWpMapBuilder {
86
  return $this->xml ? "<url>\n\t<loc>$url</loc>\n\t<lastmod>$date</lastmod>\n</url>\n" : "<li><a href=\"$url\"><span class=\"link\">$url</span><span class=\"date\">$date</span></a></li>";
87
  }
88
 
 
 
 
 
 
 
 
89
  // Generates the sitemaps content
90
  public function generateContent () {
 
 
91
  $q = new WP_Query(array(
92
  'post_type' => 'any',
93
  'post_status' => 'publish',
94
  'posts_per_page' => 50000, // limit 50k posts
95
  'has_password' => false,
96
  'orderby' => $this->orderby ? ($this->orderby === 'parent' ? array('type' => 'DESC', 'parent' => 'DESC') : sanitize_text_field($this->orderby)) : 'date',
97
- 'order' => $this->orderby === 'name' ? 'ASC' : 'DESC'
 
98
  ));
99
 
 
 
100
  while ($q->have_posts()) {
101
  $q->the_post();
102
 
86
  return $this->xml ? "<url>\n\t<loc>$url</loc>\n\t<lastmod>$date</lastmod>\n</url>\n" : "<li><a href=\"$url\"><span class=\"link\">$url</span><span class=\"date\">$date</span></a></li>";
87
  }
88
 
89
+ // Filters out unnecessary fields
90
+ public function filterPostFields () {
91
+ global $wpdb;
92
+ $p = $wpdb->posts;
93
+ return "$p.ID, $p.post_author, $p.post_date, $p.post_date_gmt, $p.post_title, $p.post_status, $p.post_name, $p.post_modified, $p.post_modified_gmt, $p.post_parent, $p.post_type, $p.comment_count";
94
+ }
95
+
96
  // Generates the sitemaps content
97
  public function generateContent () {
98
+ add_filter('posts_fields', array($this, 'filterPostFields'));
99
+
100
  $q = new WP_Query(array(
101
  'post_type' => 'any',
102
  'post_status' => 'publish',
103
  'posts_per_page' => 50000, // limit 50k posts
104
  'has_password' => false,
105
  'orderby' => $this->orderby ? ($this->orderby === 'parent' ? array('type' => 'DESC', 'parent' => 'DESC') : sanitize_text_field($this->orderby)) : 'date',
106
+ 'order' => $this->orderby === 'name' ? 'ASC' : 'DESC',
107
+ 'lang' => ''
108
  ));
109
 
110
+ remove_filter('posts_fields', array($this, 'filterPostFields'));
111
+
112
  while ($q->have_posts()) {
113
  $q->the_post();
114