XML Sitemap & Google News feeds - Version 4.0

Version Description

= 3.9.2 = Basic Google News feed stylesheet and XSS vulnerability improvement.

Download this release

Release Info

Developer RavanH
Plugin Icon 128x128 XML Sitemap & Google News feeds
Version 4.0
Comparing to
See all releases

Code changes from version 5.3.3 to 4.0

Files changed (120) hide show
  1. LICENSE +0 -339
  2. XMLSitemapFeed.class.php +560 -0
  3. assets/admin.css +0 -19
  4. assets/sitemap-author.xsl +0 -44
  5. assets/sitemap-custom.xsl +0 -41
  6. assets/sitemap-news.xsl +0 -50
  7. assets/sitemap-posttype.xsl +0 -46
  8. assets/sitemap-root.xsl +0 -46
  9. assets/sitemap-taxonomy.xsl +0 -43
  10. assets/sitemap.xsl +0 -43
  11. assets/sitemapxml.gif +0 -0
  12. assets/styles/admin.css +0 -19
  13. assets/styles/sitemap-custom.xsl +0 -43
  14. assets/styles/sitemap-index.xsl +0 -45
  15. assets/styles/sitemap-news.xsl +0 -52
  16. assets/styles/sitemap-taxonomy.xsl +0 -45
  17. assets/styles/sitemap.xsl +0 -48
  18. controllers/class.xmlsf-admin-notices.php +0 -58
  19. controllers/class.xmlsf-admin-sitemap-news.php +0 -428
  20. controllers/class.xmlsf-admin-sitemap.php +0 -554
  21. controllers/class.xmlsf-admin.php +0 -449
  22. controllers/class.xmlsf-sitemap-news.php +0 -101
  23. controllers/class.xmlsf-sitemap.php +0 -408
  24. controllers/functions.php +0 -103
  25. controllers/functions.shared.php +0 -187
  26. feed-sitemap-index.php +92 -0
  27. feed-sitemap-news.php +143 -0
  28. feed-sitemap-taxonomy.php +117 -0
  29. feed-sitemap.php +234 -0
  30. hacks.php +326 -0
  31. models/class-xmlsitemapfeed.php +0 -276
  32. models/class.xmlsf-admin-sitemap-news-sanitize.php +0 -34
  33. models/class.xmlsf-admin-sitemap-sanitize.php +0 -171
  34. models/functions.admin.php +0 -125
  35. models/functions.php +0 -111
  36. models/functions.public-shared.php +0 -144
  37. models/functions.public-sitemap-news.php +0 -202
  38. models/functions.public-sitemap.php +0 -558
  39. models/functions.shared.php +0 -190
  40. models/functions.sitemap-news.php +0 -16
  41. models/functions.sitemap.php +0 -455
  42. readme.txt +106 -463
  43. screenshot-1.png +0 -0
  44. screenshot-2.png +0 -0
  45. sitemap-index.xsl.php +54 -0
  46. sitemap-news.xsl.php +52 -0
  47. sitemap.xsl.php +54 -0
  48. assets/images/sitemapxml.gif → sitemapxml.gif +0 -0
  49. uninstall.php +0 -103
  50. upgrade.php +0 -191
  51. views/_generator.php +0 -4
  52. views/_usage.php +0 -4
  53. views/admin/field-news-categories.php +0 -12
  54. views/admin/field-news-hierarchical.php +0 -14
  55. views/admin/field-news-keywords.php +0 -13
  56. views/admin/field-news-labels.php +0 -6
  57. views/admin/field-news-name.php +0 -7
  58. views/admin/field-news-ping-log.php +0 -20
  59. views/admin/field-news-post-type.php +0 -15
  60. views/admin/field-news-stocktickers.php +0 -14
  61. views/admin/field-ping.php +0 -23
  62. views/admin/field-robots.php +0 -7
  63. views/admin/field-sitemap-author-settings.php +0 -34
  64. views/admin/field-sitemap-custom.php +0 -7
  65. views/admin/field-sitemap-domains.php +0 -7
  66. views/admin/field-sitemap-name.php +0 -16
  67. views/admin/field-sitemap-post-type.php +0 -81
  68. views/admin/field-sitemap-taxonomies.php +0 -24
  69. views/admin/field-sitemap-taxonomy-settings.php +0 -34
  70. views/admin/field-sitemap-urls.php +0 -7
  71. views/admin/field-sitemaps.php +0 -45
  72. views/admin/help-tab-advanced.php +0 -17
  73. views/admin/help-tab-allowed-domains.php +0 -4
  74. views/admin/help-tab-authors.php +0 -27
  75. views/admin/help-tab-news-categories.php +0 -3
  76. views/admin/help-tab-news-keywords.php +0 -3
  77. views/admin/help-tab-news-labels.php +0 -7
  78. views/admin/help-tab-news-name.php +0 -4
  79. views/admin/help-tab-news-sidebar.php +0 -31
  80. views/admin/help-tab-news-stocktickers.php +0 -7
  81. views/admin/help-tab-news.php +0 -20
  82. views/admin/help-tab-ping.php +0 -10
  83. views/admin/help-tab-post-types.php +0 -38
  84. views/admin/help-tab-robots.php +0 -13
  85. views/admin/help-tab-sidebar.php +0 -25
  86. views/admin/help-tab-sitemaps.php +0 -11
  87. views/admin/help-tab-support.php +0 -18
  88. views/admin/help-tab-taxonomies.php +0 -26
  89. views/admin/meta-box-news.php +0 -6
  90. views/admin/meta-box.php +0 -19
  91. views/admin/notice-ad-insterter-feed.php +0 -11
  92. views/admin/notice-aioseop-sitemap.php +0 -25
  93. views/admin/notice-catchbox-feed-redirect.php +0 -11
  94. views/admin/notice-rankmath-date-redirect.php +0 -16
  95. views/admin/notice-rankmath-sitemap.php +0 -25
  96. views/admin/notice-seoframework-sitemap.php +0 -25
  97. views/admin/notice-seopress-date-redirect.php +0 -16
  98. views/admin/notice-seopress-sitemap.php +0 -25
  99. views/admin/notice-static-files.php +0 -30
  100. views/admin/notice-wpseo-date-redirect.php +0 -16
  101. views/admin/notice-wpseo-sitemap.php +0 -25
  102. views/admin/notice-xmlsf-advanced-news.php +0 -11
  103. views/admin/page-sitemap-news.php +0 -80
  104. views/admin/page-sitemap.php +0 -77
  105. views/admin/section-advanced-compat-message.php +0 -7
  106. views/admin/section-advanced-intro.php +0 -3
  107. views/admin/sidebar-contribute.php +0 -19
  108. views/admin/sidebar-help.php +0 -8
  109. views/admin/sidebar-links.php +0 -18
  110. views/admin/sidebar-news-links.php +0 -12
  111. views/feed-sitemap-author.php +0 -38
  112. views/feed-sitemap-custom.php +0 -40
  113. views/feed-sitemap-home.php +0 -34
  114. views/feed-sitemap-news.php +0 -77
  115. views/feed-sitemap-post_type.php +0 -99
  116. views/feed-sitemap-posttype.php +0 -95
  117. views/feed-sitemap-root.php +0 -34
  118. views/feed-sitemap-taxonomy.php +0 -41
  119. views/feed-sitemap.php +0 -86
  120. xml-sitemap.php +56 -337
LICENSE DELETED
@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
XMLSitemapFeed.class.php ADDED
@@ -0,0 +1,560 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* ------------------------------
3
+ * XMLSitemapFeed CLASS
4
+ * ------------------------------ */
5
+
6
+ class XMLSitemapFeed {
7
+
8
+ /**
9
+ * Plugin variables
10
+ */
11
+
12
+ public $base_name = 'sitemap';
13
+
14
+ public $news_name = 'sitemap-news';
15
+
16
+ public $extension = 'xml';
17
+
18
+ private $defaults = array(
19
+ 'sitemap_feed' => '1',
20
+ 'news_feed' => '0',
21
+ 'news_tags' => array(),
22
+ 'post_types' => array('page','post'),
23
+ 'taxonomies' => array('category','post_tag'),
24
+ );
25
+
26
+ private $do_news_feed = true;
27
+
28
+ private $do_news_tags = array('post'); // TODO replace by get_option + defaults['news_tags']
29
+
30
+ private $post_types = array();
31
+
32
+ private $taxonomies = array();
33
+
34
+ private $sitemaps = array();
35
+
36
+ private function sitemaps() {
37
+ if ( '1' == get_option('blog_public') ) {
38
+ $blog_url = trailingslashit(get_bloginfo('url'));
39
+ $this->sitemaps[] = $blog_url.$this->base_name.'.'.$this->extension;
40
+
41
+ if ( '1' == get_option('news_feed', $this->defaults['news_feed']) )
42
+ $this->sitemaps[] = $blog_url.$this->news_name.'.'.$this->extension;
43
+ }
44
+ }
45
+
46
+ public function defaults($key) {
47
+ if (!isset($key))
48
+ return $this->defaults;
49
+
50
+ $append = array();
51
+
52
+ if ($key == 'taxonomies')
53
+ $append = get_taxonomies(array('public'=>true,'_builtin'=>false),'names');
54
+ if ($key == 'post_types')
55
+ $append = get_post_types(array('public'=>true,'_builtin'=>false),'names');
56
+
57
+ return $this->defaults[$key] + $append;
58
+ }
59
+
60
+ public function get_sitemaps() {
61
+ // if sitemaps are not set yet, do it first
62
+ if (empty($this->sitemaps))
63
+ $this->sitemaps();
64
+
65
+ return $this->sitemaps;
66
+ }
67
+
68
+ private function post_types() {
69
+ $this->post_types = get_option('XMLSitemapFeed_post_types',$this->defaults('post_types'));
70
+ }
71
+
72
+ public function get_post_types() {
73
+ // if post types are not set yet, do it first
74
+ if (empty($this->post_types))
75
+ $this->post_types();
76
+
77
+ return $this->post_types;
78
+ }
79
+
80
+ /* delete ?
81
+ private function populate_taxonomies() {
82
+ $this->taxonomies = get_option('XMLSitemapFeed_taxonomies',$this->defaults('taxonomies'));
83
+ }
84
+
85
+ public function taxonomies() {
86
+ // if taxonomy types are not set yet, do it first
87
+ if (empty($this->taxonomies))
88
+ $this->populate_taxonomies();
89
+
90
+ return $this->taxonomies;
91
+ }
92
+ */
93
+ public function do_news_feed() {
94
+ return $this->do_news_feed;
95
+ }
96
+
97
+ public function do_news_tags( $post_type = '' ) {
98
+ if ( is_array( $post_type ) )
99
+ foreach ( $post_type as $type )
100
+ if ( in_array( $type, $this->do_news_tags ) )
101
+ return true;
102
+
103
+ if ( in_array( $post_type, $this->do_news_tags ) )
104
+ return true;
105
+
106
+ return false;
107
+ }
108
+
109
+ /**
110
+ * SETTINGS
111
+ */
112
+
113
+ // add our FancyBox Media Settings Section on Settings > Media admin page
114
+ public function privacy_settings_section() {
115
+ echo '<p>...</p>';
116
+ }
117
+
118
+ private $privacy_setting_array = array(
119
+ 'option1' => array(
120
+ 'title' => 'Title',
121
+ 'label' => 'Test',
122
+ 'type' => 'checkbox', // select, function, checkbox, text, number, hidden...
123
+ //'function' => 'functionname',
124
+ //'options' => array(''=>'',''=>''),
125
+ 'default' => '',
126
+ //'class' => '', // used for text fields
127
+ 'description' => '',
128
+ 'sanitize_callback' => ''//'functionname'
129
+ ),
130
+ 'option2' => array(
131
+ 'label' => 'Test 2',
132
+ 'type' => 'function', // select, function, checkbox, text, number, hidden...
133
+ 'function' => 'test',
134
+ 'description' => 'Test 2 description',
135
+ 'sanitize_callback' => ''//'functionname'
136
+ )
137
+
138
+ );
139
+
140
+ public function test($args) {
141
+ error_log('called test function with parameter: ' . print_r($args, true));
142
+ }
143
+
144
+ // add our Settings Fields
145
+ function settings_fields($settings){
146
+ $disabled = ('0' == get_option('blog_public')) ? true : false;
147
+ foreach ( $settings as $name => $args ) {
148
+ switch($args['type']) {
149
+ case 'select' :
150
+ echo '<label>'.$args['label'].' <select name="XMLSitemapFeed_'.$name.'" id="XMLSitemapFeed_'.$name.'">';
151
+ foreach ($args['options'] as $optionkey => $optionvalue) {
152
+ echo '
153
+ <option value="'.esc_attr($optionkey).'"'.selected($optionkey, get_option('XMLSitemapFeed_'.$name, $args['default']), false).' '.disabled($disabled, true, false).' >'.$optionvalue.'</option>';
154
+ }
155
+ echo '
156
+ </select> '.$args['description'];
157
+ break;
158
+ case 'function' :
159
+ call_user_func(array($this,$args['function']),$args);
160
+ echo ' '.$args['description'];
161
+ break;
162
+ case 'checkbox' :
163
+ echo '
164
+ <label><input type="checkbox" name="XMLSitemapFeed_'.$name.'" id="XMLSitemapFeed_'.$name.'" value="1" '.checked('1', get_option('XMLSitemapFeed_'.$name, $args['default']), false).' '.disabled($disabled, true, false).' /> '.$args['label'].'</label> '.$args['description'];
165
+ break;
166
+ case 'text' :
167
+ echo '<label>'.$args['label'].'<input type="text" name="XMLSitemapFeed_'.$name.'" id="XMLSitemapFeed_'.$name.'" value="'.esc_attr( get_option('XMLSitemapFeed_'.$name, $args['default']) ).'" class="'.$args['class'].'"'.disabled($disabled, true, false).' /> '.$args['description'];
168
+ break;
169
+ case 'number' :
170
+ echo '<label>'.$args['label'].' <input type="number" step="0.1" min="0" max="1" name="XMLSitemapFeed_'.$name.'" id="XMLSitemapFeed_'.$name.'" value="'.esc_attr( get_option('XMLSitemapFeed_'.$name, $args['default']) ).'" class="'.$args['class'].'"'.disabled($disabled, true, false).' /> '.$args['description'];
171
+ break;
172
+ case 'hidden' :
173
+ echo '
174
+ <input type="hidden" name="XMLSitemapFeed_'.$name.'" id="XMLSitemapFeed_'.$name.'" value="'.esc_attr( get_option('XMLSitemapFeed_'.$name, $args['default']) ).'" /> ';
175
+ break;
176
+ default :
177
+ echo $args['description'];
178
+ }
179
+ }
180
+ }
181
+
182
+ private function checkboxes($args) {
183
+ if (is_array($optionvalue)) {
184
+ foreach ($args['options'] as $optionkey => $optionvalue) {
185
+ //.TODO
186
+ }
187
+
188
+ }
189
+
190
+ echo '
191
+ <input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.checked('1', get_option($args['id'], $args['default']), false).' '.disabled($disabled, true, false).' /> '.$args['label'].'</label> ';
192
+ }
193
+
194
+ public function register_settings($option_group = 'privacy', $settings) {
195
+ foreach ($settings as $name => $value) {
196
+ //if ( isset($value['id']) ) {
197
+ register_setting( $option_group, 'XMLSitemapFeed_'.$name, $value['sanitize_callback'] );
198
+ add_settings_field( 'XMLSitemapFeed_'.$name, $value['label'], array($this,'settings_fields'), $option_group, 'xml-sitemap-feed_'.$option_group.'_section', array($name => $value));
199
+ //}
200
+ }
201
+ }
202
+
203
+ /**
204
+ * FEED TEMPLATES
205
+ */
206
+
207
+ // set up the sitemap template
208
+ public function load_template() {
209
+ load_template( XMLSF_PLUGIN_DIR . '/feed-sitemap.php' );
210
+ }
211
+
212
+ // set up the news sitemap template
213
+ public function load_template_news() {
214
+ load_template( XMLSF_PLUGIN_DIR . '/feed-sitemap-news.php' );
215
+ }
216
+
217
+ // set up the sitemap index template
218
+ public function load_template_index() {
219
+ load_template( XMLSF_PLUGIN_DIR . '/feed-sitemap-index.php' );
220
+ }
221
+
222
+ // set up the taxonomy sitemap template
223
+ public function load_template_taxonomy() {
224
+ load_template( XMLSF_PLUGIN_DIR . '/feed-sitemap-taxonomy.php' );
225
+ }
226
+
227
+ // override default feed limit
228
+ public function filter_limits( $limits ) {
229
+ return 'LIMIT 0, 50000';
230
+ }
231
+
232
+ // override default feed limit for taxonomy sitemaps
233
+ public function filter_limits_taxonomy( $limits ) {
234
+ return 'LIMIT 0, 1';
235
+ }
236
+
237
+ // override default feed limit for GN
238
+ public function filter_news_limits( $limits ) {
239
+ return 'LIMIT 0, 1000';
240
+ }
241
+
242
+ // Create a new filtering function that will add a where clause to the query,
243
+ // used for the Google News Sitemap
244
+ public function filter_news_where( $where = '' ) {
245
+ // only posts from the last 2 days
246
+ return $where . " AND post_date > '" . date('Y-m-d H:i:s', strtotime('-49 hours')) . "'";
247
+ }
248
+
249
+ public function init() {
250
+
251
+ // TEXT DOMAIN
252
+
253
+ if ( is_admin() ) // text domain must be in init even if it is for admin only
254
+ load_plugin_textdomain('xml-sitemap-feed', false, dirname(plugin_basename( __FILE__ )) . '/languages' );
255
+
256
+ // LANGUAGE PLUGINS
257
+
258
+ // check for Polylang and add filter
259
+ global $polylang;
260
+ if (isset($polylang))
261
+ add_filter('xml_sitemap_url', array($this, 'polylang'), 99);
262
+
263
+ // check for qTranslate and add filter
264
+ elseif (defined('QT_LANGUAGE'))
265
+ add_filter('xml_sitemap_url', array($this, 'qtranslate'), 99);
266
+
267
+ // check for xLanguage and add filter
268
+ elseif (defined('xLanguageTagQuery'))
269
+ add_filter('xml_sitemap_url', array($this, 'xlanguage'), 99);
270
+
271
+ }
272
+
273
+ public function admin_init() {
274
+
275
+ // UPGRADE RULES after (site wide) plugin upgrade
276
+ // do it only on admin_init since flush rules on init gives
277
+ // strange results with Polylang.
278
+
279
+ if (get_option('xml-sitemap-feed-version') != XMLSF_VERSION) {
280
+ flush_rewrite_rules(false);
281
+ update_option('xml-sitemap-feed-version', XMLSF_VERSION);
282
+ }
283
+
284
+ // SETTINGS
285
+
286
+ add_settings_section('xml-sitemap-feed_privacy_section', __('XML Sitemaps','xml-sitemap-feed'), array($this,'privacy_settings_section'), 'privacy');
287
+
288
+ $this->register_settings('privacy',$this->privacy_setting_array);
289
+
290
+ //add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'easy_fancybox_add_action_link');
291
+
292
+ }
293
+
294
+ /**
295
+ * ROBOTSTXT
296
+ */
297
+
298
+ // add sitemap location in robots.txt generated by WP
299
+ // available filter : xml_sitemap_url
300
+ public function robots() {
301
+
302
+ if (empty($this->sitemaps))
303
+ $this->sitemaps();
304
+
305
+ // hook for filter 'xml_sitemap_url' provides an array here and MUST get an array returned
306
+ //$sitemap_array = apply_filters('xml_sitemap_url',$this->sitemaps);
307
+
308
+ echo "\n# XML & Google News Sitemap Feeds - version ".XMLSF_VERSION." (http://status301.net/wordpress-plugins/xml-sitemap-feed/)";
309
+
310
+ if ( !empty($this->sitemaps) )
311
+ foreach ( $this->sitemaps as $url )
312
+ echo "\nSitemap: " . $url;
313
+ else
314
+ echo "\n# Warning: XML Sitemaps are disabled. Please see your Privacy settings.";
315
+
316
+ echo "\n\n";
317
+ }
318
+
319
+ /**
320
+ * DE-ACTIVATION
321
+ */
322
+
323
+ public function deactivate() {
324
+ global $wp_rewrite;
325
+ remove_action('generate_rewrite_rules', array($this, 'rewrite_rules') );
326
+ $wp_rewrite->flush_rules();
327
+ delete_option('xml-sitemap-feed-version');
328
+ }
329
+
330
+ /**
331
+ * REWRITES
332
+ */
333
+
334
+ /**
335
+ * Remove the trailing slash from permalinks that have an extension,
336
+ * such as /sitemap.xml (thanks to Permalink Editor plugin for WordPress)
337
+ *
338
+ * @param string $request
339
+ */
340
+
341
+ public function trailingslash($request) {
342
+ if (pathinfo($request, PATHINFO_EXTENSION)) {
343
+ return untrailingslashit($request);
344
+ }
345
+ return $request; // trailingslashit($request);
346
+ }
347
+
348
+ /**
349
+ * Add sitemap rewrite rules
350
+ *
351
+ * @param string $wp_rewrite
352
+ */
353
+
354
+ public function rewrite_rules($wp_rewrite) {
355
+
356
+ $feed_rules = array(
357
+ $this->base_name . '\.xml$' => $wp_rewrite->index . '?feed=sitemap-index',
358
+ $this->base_name . '-any\.xml$' => $wp_rewrite->index . '?feed=sitemap', //
359
+ $this->base_name . '\.([a-z0-9_-]+)?\.xml$' => $wp_rewrite->index . '?feed=sitemap_post&category_name=$matches[1]',
360
+ );
361
+
362
+ // add rules for custom public post types
363
+ if (empty($this->post_types))
364
+ $this->post_types();
365
+
366
+ foreach ( $this->post_types as $post_type ) {
367
+ //$feed_rules[XMLSF_NAME.'-'.$post_type.'\.xml$'] = $wp_rewrite->index.'?feed=sitemap-'.$post_type;
368
+ $feed_rules[ $this->base_name . '-posttype-' .$post_type . '\.([0-9]+)?\.?' . $this->extension . '$' ] = $wp_rewrite->index . '?feed=sitemap_' . $post_type . '&m=$matches[1]';
369
+ }
370
+
371
+ // add rules for custom public post taxonomies
372
+ $taxonomies = get_option('XMLSitemapFeed_taxonomies',$this->defaults('taxonomies'));
373
+
374
+ foreach ( $taxonomies as $taxonomy ) {
375
+ $feed_rules[ $this->base_name . '-taxonomy-' . $taxonomy . '\.' . $this->extension . '$' ] = $wp_rewrite->index . '?feed=sitemap-taxonomy&taxonomy=' . $taxonomy;
376
+ //$feed_rules[XMLSF_NAME.'_'.$taxonomy_type.'\.([a-z0-9_-]+)?\.xml$'] = $wp_rewrite->index.'?feed=sitemap-taxonomy&taxonomy='.$taxonomy_type.'&'.$taxonomy_type.'=$matches[1]';
377
+ }
378
+
379
+ if ( $this->do_news_feed )
380
+ $feed_rules[ $this->news_name . '\.' . $this->extension . '$' ] = $wp_rewrite->index . '?feed=' . $this->news_name;
381
+
382
+ $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
383
+ }
384
+
385
+ /**
386
+ * REQUEST FILTER
387
+ */
388
+
389
+ public function filter_request( $request ) {
390
+ if ( isset($request['feed']) && strpos($request['feed'],'sitemap') == 0 ) {
391
+
392
+ if (empty($this->post_types))
393
+ $this->post_types();
394
+
395
+ if ( $request['feed'] == 'sitemap' ) {
396
+
397
+ // setup actions and filters
398
+ add_action('do_feed_sitemap', array($this, 'load_template'), 10, 1);
399
+ add_filter( 'post_limits', array($this, 'filter_limits') );
400
+
401
+ // modify request parameters
402
+ $request['post_type'] = $this->post_types;
403
+ $request['orderby'] = 'modified';
404
+
405
+ $request['no_found_rows'] = true;
406
+ $request['update_post_meta_cache'] = false;
407
+ $request['update_post_term_cache'] = false;
408
+
409
+ return $request;
410
+ }
411
+
412
+ if ( $request['feed'] == 'sitemap-index' ) {
413
+ // setup actions and filters
414
+ add_action('do_feed_sitemap-index', array($this, 'load_template_index'), 10, 1);
415
+
416
+ return $request;
417
+ }
418
+
419
+ if ( $request['feed'] == 'sitemap-taxonomy' ) {
420
+ // setup actions and filters
421
+ add_action('do_feed_sitemap-taxonomy', array($this, 'load_template_taxonomy'), 10, 1);
422
+ // add_filter( 'post_limits', array( $this, 'filter_limits_taxonomy' ) );
423
+
424
+ $request['no_found_rows'] = true;
425
+ $request['update_post_meta_cache'] = false;
426
+ $request['update_post_term_cache'] = false;
427
+ $request['post_status'] = 'publish';
428
+
429
+ return $request;
430
+ }
431
+
432
+ if ( $request['feed'] == $this->news_name ) {
433
+ // disable caching
434
+ define( 'DONOTCACHEPAGE', 1 ); // wp super cache -- or does super cache always clear feeds after new posts??
435
+ // TODO w3tc
436
+
437
+ // setup actions and filters
438
+ add_action('do_feed_'.$this->news_name, array($this, 'load_template_news'), 10, 1);
439
+ add_filter( 'post_limits', array($this, 'filter_news_limits') );
440
+ add_filter( 'posts_where', array($this, 'filter_news_where'), 10, 1 );
441
+
442
+ // modify request parameters
443
+ $types_arr = explode(',',XMLSF_NEWS_POST_TYPE);
444
+ $request['post_type'] = (in_array('any',$types_arr)) ? 'any' : $types_arr;
445
+
446
+ $request['no_found_rows'] = true;
447
+ $request['update_post_meta_cache'] = false;
448
+ //$request['update_post_term_cache'] = false; // << TODO test: can we disable or do we need this for terms?
449
+
450
+ return $request;
451
+ }
452
+
453
+ foreach ($this->post_types as $post_type ) {
454
+ if ( $request['feed'] == 'sitemap_'.$post_type ) {
455
+ // setup actions and filters
456
+ add_action('do_feed_sitemap_'.$post_type, array($this, 'load_template'), 10, 1);
457
+ add_filter( 'post_limits', array($this, 'filter_limits') );
458
+
459
+ // modify request parameters
460
+ $request['post_type'] = $post_type;
461
+ $request['orderby'] = 'modified';
462
+
463
+ $request['no_found_rows'] = true;
464
+ $request['update_post_meta_cache'] = false;
465
+ $request['update_post_term_cache'] = false;
466
+
467
+ return $request;
468
+ }
469
+ }
470
+
471
+ }
472
+
473
+ return $request;
474
+ }
475
+
476
+ /**
477
+ * MULTI-LANGUAGE PLUGIN FILTERS
478
+ */
479
+
480
+ // Polylang
481
+ public function polylang($input) {
482
+ global $polylang;
483
+ $options = get_option('polylang');
484
+
485
+ if (is_array($input)) { // got an array? return one!
486
+ if ('1' == $options['force_lang'] )
487
+ foreach ( $input as $url )
488
+ foreach($polylang->get_languages_list() as $language)
489
+ $return[] = $polylang->add_language_to_link($url,$language);
490
+ else
491
+ foreach ( $input as $url )
492
+ foreach($polylang->get_languages_list() as $language)
493
+ $return[] = add_query_arg('lang', $language->slug, $url);
494
+ } else { // not an array? do nothing, Polylang does all the work :)
495
+ $return = $input;
496
+ }
497
+
498
+ return $return;
499
+ }
500
+
501
+ // qTranslate
502
+ public function qtranslate($input) {
503
+ global $q_config;
504
+
505
+ if (is_array($input)) // got an array? return one!
506
+ foreach ( $input as $url )
507
+ foreach($q_config['enabled_languages'] as $language)
508
+ $return[] = qtrans_convertURL($url,$language);
509
+ else // not an array? just convert the string.
510
+ $return = qtrans_convertURL($input);
511
+
512
+ return $return;
513
+ }
514
+
515
+ // xLanguage
516
+ public function xlanguage($input) {
517
+ global $xlanguage;
518
+
519
+ if (is_array($input)) // got an array? return one!
520
+ foreach ( $input as $url )
521
+ foreach($xlanguage->options['language'] as $language)
522
+ $return[] = $xlanguage->filter_link_in_lang($url,$language['code']);
523
+ else // not an array? just convert the string.
524
+ $return = $xlanguage->filter_link($input);
525
+
526
+ return $return;
527
+ }
528
+
529
+ /**
530
+ * CONSTRUCTOR
531
+ */
532
+
533
+ function XMLSitemapFeed() {
534
+ //constructor in php4
535
+ $this->__construct(); // just call the php5 one.
536
+ }
537
+
538
+ function __construct() {
539
+
540
+ // REQUEST main filtering function
541
+ add_filter('request', array($this, 'filter_request'), 1 );
542
+
543
+ // TEXT DOMAIN, LANGUAGE PLUGIN FILTERS ...
544
+ add_action('init', array($this,'init'));
545
+
546
+ // REWRITES
547
+ add_action('generate_rewrite_rules', array($this, 'rewrite_rules') );
548
+ add_filter('user_trailingslashit', array($this, 'trailingslash') );
549
+
550
+ // REGISTER SETTINGS, SETTINGS FIELDS, UPGRADE checks...
551
+ add_action('admin_init', array($this,'admin_init'));
552
+
553
+ // ROBOTSTXT
554
+ add_action('do_robotstxt', array($this, 'robots') );
555
+
556
+ // DE-ACTIVATION
557
+ register_deactivation_hook( XMLSF_PLUGIN_DIR . '/xml-sitemap.php', array($this, 'deactivate') );
558
+ }
559
+
560
+ }
assets/admin.css DELETED
@@ -1,19 +0,0 @@
1
- div.main {
2
- width: 68%;
3
- float: left;
4
- }
5
- div.sidebar {
6
- width: 29%;
7
- padding: .9em 0 2em 2%;
8
- border-left: 1px solid #ccc;
9
- float: right;
10
- background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
11
- }
12
- @media screen and (max-width: 600px) {
13
- div.main, div.sidebar {
14
- width: 100%;
15
- float: none;
16
- border: none;
17
- padding: 0
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-author.xsl DELETED
@@ -1,44 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
- <xsl:template match="/">
7
- <html xmlns="http://www.w3.org/1999/xhtml">
8
- <head>
9
- <title>XML Sitemap — Authors</title>
10
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
12
- </head>
13
- <body>
14
- <h1>XML Sitemap — Authors</h1>
15
- <div id="header">
16
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
17
- </div>
18
- <div id="content">
19
- <table cellpadding="5">
20
- <tr class="high">
21
- <th>#</th>
22
- <th>URL</th>
23
- <th>Priority</th>
24
- <th>Last Modified</th>
25
- </tr>
26
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
27
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
28
- <xsl:for-each select="sitemap:urlset/sitemap:url">
29
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
30
- <td><xsl:value-of select="position()"/></td>
31
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
32
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
33
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
34
- </tr>
35
- </xsl:for-each>
36
- </table>
37
- </div>
38
- <div id="footer">
39
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
40
- </div>
41
- </body>
42
- </html>
43
- </xsl:template>
44
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-custom.xsl DELETED
@@ -1,41 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
5
- <xsl:template match="/">
6
- <html xmlns="http://www.w3.org/1999/xhtml">
7
- <head>
8
- <title>XML Sitemap — Additional URLs</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
11
- </head>
12
- <body>
13
- <h1>XML Sitemap — Additional URLs</h1>
14
- <div id="header">
15
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
16
- </div>
17
- <div id="content">
18
- <table cellpadding="5">
19
- <tr class="high">
20
- <th>#</th>
21
- <th>URL</th>
22
- <th>Priority</th>
23
- </tr>
24
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
25
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
26
- <xsl:for-each select="sitemap:urlset/sitemap:url">
27
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
28
- <td><xsl:value-of select="position()"/></td>
29
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
30
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
31
- </tr>
32
- </xsl:for-each>
33
- </table>
34
- </div>
35
- <div id="footer">
36
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
37
- </div>
38
- </body>
39
- </html>
40
- </xsl:template>
41
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-news.xsl DELETED
@@ -1,50 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
4
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
- <xsl:template match="/">
7
- <html xmlns="http://www.w3.org/1999/xhtml">
8
- <head>
9
- <title>Google News Sitemap</title>
10
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
12
- </head>
13
- <body>
14
- <h1>Google News Sitemap</h1>
15
- <div id="header">
16
- <p>This is a <a href="https://support.google.com/news/publisher/answer/75717" target="_blank">Google News Sitemap</a> to aid <a href="https://news.google.com" target="_blank">Google News</a> finding news on your website. Please note that <strong><em>only posts from the last 48 hours</em></strong> will be processed by Google News.</p>
17
- </div>
18
- <div id="content">
19
- <table cellpadding="5">
20
- <tr class="high">
21
- <th>#</th>
22
- <th>Title</th>
23
- <th>Language</th>
24
- <th>Keyword(s)</th>
25
- <th>Stock(s)</th>
26
- <th>Publication Date</th>
27
- </tr>
28
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
29
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
30
- <xsl:for-each select="sitemap:urlset/sitemap:url">
31
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
32
- <td><xsl:value-of select="position()"/></td>
33
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
34
- <a href="{$itemURL}"><xsl:value-of select="news:news/news:title"/></a>
35
- </td>
36
- <td><xsl:value-of select="news:news/news:publication/news:language"/></td>
37
- <td><xsl:value-of select="news:news/news:keywords"/></td>
38
- <td><xsl:value-of select="news:news/news:stock_tickers"/></td>
39
- <td><xsl:value-of select="concat(substring(news:news/news:publication_date,0,11),concat(' ', substring(news:news/news:publication_date,12,8)))"/> (<xsl:value-of select="substring(news:news/news:publication_date,20,6)"/>)</td>
40
- </tr>
41
- </xsl:for-each>
42
- </table>
43
- </div>
44
- <div id="footer">
45
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
46
- </div>
47
- </body>
48
- </html>
49
- </xsl:template>
50
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-posttype.xsl DELETED
@@ -1,46 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
- <xsl:template match="/">
7
- <html xmlns="http://www.w3.org/1999/xhtml">
8
- <head>
9
- <title>XML Sitemap — Post Type</title>
10
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
12
- </head>
13
- <body>
14
- <h1>XML Sitemap — Post Type</h1>
15
- <div id="header">
16
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
17
- </div>
18
- <div id="content">
19
- <table cellpadding="5">
20
- <tr class="high">
21
- <th>#</th>
22
- <th>URL</th>
23
- <th># Images</th>
24
- <th>Priority</th>
25
- <th>Last Modified</th>
26
- </tr>
27
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
28
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
29
- <xsl:for-each select="sitemap:urlset/sitemap:url">
30
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
31
- <td><xsl:value-of select="position()"/></td>
32
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
33
- <td><xsl:if test="image:image"><xsl:value-of select="count(image:image)"/></xsl:if></td>
34
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
35
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
36
- </tr>
37
- </xsl:for-each>
38
- </table>
39
- </div>
40
- <div id="footer">
41
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
42
- </div>
43
- </body>
44
- </html>
45
- </xsl:template>
46
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-root.xsl DELETED
@@ -1,46 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
- <xsl:template match="/">
7
- <html xmlns="http://www.w3.org/1999/xhtml">
8
- <head>
9
- <title>XML Sitemap — Root pages</title>
10
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
12
- </head>
13
- <body>
14
- <h1>XML Sitemap — Root pages</h1>
15
- <div id="header">
16
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
17
- </div>
18
- <div id="content">
19
- <table cellpadding="5">
20
- <tr class="high">
21
- <th>#</th>
22
- <th>URL</th>
23
- <th># Images</th>
24
- <th>Priority</th>
25
- <th>Last Modified</th>
26
- </tr>
27
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
28
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
29
- <xsl:for-each select="sitemap:urlset/sitemap:url">
30
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
31
- <td><xsl:value-of select="position()"/></td>
32
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
33
- <td><xsl:if test="image:image"><xsl:value-of select="count(image:image)"/></xsl:if></td>
34
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
35
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
36
- </tr>
37
- </xsl:for-each>
38
- </table>
39
- </div>
40
- <div id="footer">
41
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
42
- </div>
43
- </body>
44
- </html>
45
- </xsl:template>
46
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap-taxonomy.xsl DELETED
@@ -1,43 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
5
- <xsl:template match="/">
6
- <html xmlns="http://www.w3.org/1999/xhtml">
7
- <head>
8
- <title>XML Sitemap — Taxonomy</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
11
- </head>
12
- <body>
13
- <h1>XML Sitemap — Taxonomy</h1>
14
- <div id="header">
15
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
16
- </div>
17
- <div id="content">
18
- <table cellpadding="5">
19
- <tr class="high">
20
- <th>#</th>
21
- <th>URL</th>
22
- <th>Priority</th>
23
- <th>Last Modified</th>
24
- </tr>
25
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
26
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
27
- <xsl:for-each select="sitemap:urlset/sitemap:url">
28
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
29
- <td><xsl:value-of select="position()"/></td>
30
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
31
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
32
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
33
- </tr>
34
- </xsl:for-each>
35
- </table>
36
- </div>
37
- <div id="footer">
38
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
39
- </div>
40
- </body>
41
- </html>
42
- </xsl:template>
43
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemap.xsl DELETED
@@ -1,43 +0,0 @@
1
- <xsl:stylesheet version="1.1"
2
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
3
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
5
- <xsl:template match="/">
6
- <html xmlns="http://www.w3.org/1999/xhtml">
7
- <head>
8
- <title>XML Sitemap — Index</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
11
- </head>
12
- <body>
13
- <h1>XML Sitemap — Index</h1>
14
- <div id="header">
15
- <p>This is the XML Sitemap Index to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a></p>
16
- </div>
17
- <div id="content">
18
- <table cellpadding="5">
19
- <tr class="high">
20
- <th>#</th>
21
- <th>XML Sitemap</th>
22
- <th>Last Modified</th>
23
- </tr>
24
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
25
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
26
- <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
27
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
28
- <td><xsl:value-of select="position()"/></td>
29
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
30
- <a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
31
- </td>
32
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
33
- </tr>
34
- </xsl:for-each>
35
- </table>
36
- </div>
37
- <div id="footer">
38
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
39
- </div>
40
- </body>
41
- </html>
42
- </xsl:template>
43
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/sitemapxml.gif DELETED
Binary file
assets/styles/admin.css DELETED
@@ -1,19 +0,0 @@
1
- div.main {
2
- width: 68%;
3
- float: left;
4
- }
5
- div.sidebar {
6
- width: 29%;
7
- padding: .9em 0 2em 2%;
8
- border-left: 1px solid #ccc;
9
- float: right;
10
- background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
11
- }
12
- @media screen and (max-width: 600px) {
13
- div.main, div.sidebar {
14
- width: 100%;
15
- float: none;
16
- border: none;
17
- padding: 0
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/styles/sitemap-custom.xsl DELETED
@@ -1,43 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
- <xsl:template match="/">
8
- <html xmlns="http://www.w3.org/1999/xhtml">
9
- <head>
10
- <title>XML Sitemap Feed</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
13
- </head>
14
- <body>
15
- <h1>XML Sitemap Feed</h1>
16
- <div id="header">
17
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
18
- </div>
19
- <div id="content">
20
- <table cellpadding="5">
21
- <tr class="high">
22
- <th>#</th>
23
- <th>URL</th>
24
- <th>Priority</th>
25
- </tr>
26
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
27
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
28
- <xsl:for-each select="sitemap:urlset/sitemap:url">
29
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
30
- <td><xsl:value-of select="position()"/></td>
31
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
32
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
33
- </tr>
34
- </xsl:for-each>
35
- </table>
36
- </div>
37
- <div id="footer">
38
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
39
- </div>
40
- </body>
41
- </html>
42
- </xsl:template>
43
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/styles/sitemap-index.xsl DELETED
@@ -1,45 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
- <xsl:template match="/">
8
- <html xmlns="http://www.w3.org/1999/xhtml">
9
- <head>
10
- <title>XML Sitemap Feed - Index</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
13
- </head>
14
- <body>
15
- <h1>XML Sitemap Feed - Index</h1>
16
- <div id="header">
17
- <p>This is the XML Sitemap Index to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a></p>
18
- </div>
19
- <div id="content">
20
- <table cellpadding="5">
21
- <tr class="high">
22
- <th>#</th>
23
- <th>XML Sitemap</th>
24
- <th>Last Modified</th>
25
- </tr>
26
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
27
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
28
- <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
29
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
30
- <td><xsl:value-of select="position()"/></td>
31
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
32
- <a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
33
- </td>
34
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
35
- </tr>
36
- </xsl:for-each>
37
- </table>
38
- </div>
39
- <div id="footer">
40
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
41
- </div>
42
- </body>
43
- </html>
44
- </xsl:template>
45
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/styles/sitemap-news.xsl DELETED
@@ -1,52 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
6
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8
- <xsl:template match="/">
9
- <html xmlns="http://www.w3.org/1999/xhtml">
10
- <head>
11
- <title>Google News Sitemap Feed</title>
12
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
14
- </head>
15
- <body>
16
- <h1>Google News Sitemap Feed</h1>
17
- <div id="header">
18
- <p>This is a <a href="https://support.google.com/news/publisher/answer/75717" target="_blank">Google News Sitemap</a> to aid <a href="https://news.google.com" target="_blank">Google News</a> finding news on your website. Please note that <strong><em>only posts from the last 48 hours</em></strong> will be processed by Google News.</p>
19
- </div>
20
- <div id="content">
21
- <table cellpadding="5">
22
- <tr class="high">
23
- <th>#</th>
24
- <th>Title</th>
25
- <th>Language</th>
26
- <th>Keyword(s)</th>
27
- <th>Stock(s)</th>
28
- <th>Publication Date</th>
29
- </tr>
30
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
31
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
32
- <xsl:for-each select="sitemap:urlset/sitemap:url">
33
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
34
- <td><xsl:value-of select="position()"/></td>
35
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
36
- <a href="{$itemURL}"><xsl:value-of select="news:news/news:title"/></a>
37
- </td>
38
- <td><xsl:value-of select="news:news/news:publication/news:language"/></td>
39
- <td><xsl:value-of select="news:news/news:keywords"/></td>
40
- <td><xsl:value-of select="news:news/news:stock_tickers"/></td>
41
- <td><xsl:value-of select="concat(substring(news:news/news:publication_date,0,11),concat(' ', substring(news:news/news:publication_date,12,8)))"/> (<xsl:value-of select="substring(news:news/news:publication_date,20,6)"/>)</td>
42
- </tr>
43
- </xsl:for-each>
44
- </table>
45
- </div>
46
- <div id="footer">
47
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
48
- </div>
49
- </body>
50
- </html>
51
- </xsl:template>
52
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/styles/sitemap-taxonomy.xsl DELETED
@@ -1,45 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
- <xsl:template match="/">
8
- <html xmlns="http://www.w3.org/1999/xhtml">
9
- <head>
10
- <title>XML Sitemap Feed</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
13
- </head>
14
- <body>
15
- <h1>XML Sitemap Feed</h1>
16
- <div id="header">
17
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
18
- </div>
19
- <div id="content">
20
- <table cellpadding="5">
21
- <tr class="high">
22
- <th>#</th>
23
- <th>URL</th>
24
- <th>Priority</th>
25
- <th>Last Modified</th>
26
- </tr>
27
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
28
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
29
- <xsl:for-each select="sitemap:urlset/sitemap:url">
30
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
31
- <td><xsl:value-of select="position()"/></td>
32
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
33
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
34
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
35
- </tr>
36
- </xsl:for-each>
37
- </table>
38
- </div>
39
- <div id="footer">
40
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
41
- </div>
42
- </body>
43
- </html>
44
- </xsl:template>
45
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/styles/sitemap.xsl DELETED
@@ -1,48 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
- xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
6
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8
- <xsl:template match="/">
9
- <html xmlns="http://www.w3.org/1999/xhtml">
10
- <head>
11
- <title>XML Sitemap Feed</title>
12
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13
- <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:middle}</style>
14
- </head>
15
- <body>
16
- <h1>XML Sitemap Feed</h1>
17
- <div id="header">
18
- <p>This is an XML Sitemap to aid search engines like <a href="https://www.google.com">Google</a>, <a href="https://www.bing.com/">Bing</a>, <a href="https://www.yahoo.com">Yahoo!</a> and <a href="https://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="https://www.sitemaps.org/">Sitemaps.org</a>.</p>
19
- </div>
20
- <div id="content">
21
- <table cellpadding="5">
22
- <tr class="high">
23
- <th>#</th>
24
- <th>URL</th>
25
- <th># Images</th>
26
- <th>Priority</th>
27
- <th>Last Modified</th>
28
- </tr>
29
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
30
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
31
- <xsl:for-each select="sitemap:urlset/sitemap:url">
32
- <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
33
- <td><xsl:value-of select="position()"/></td>
34
- <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
35
- <td><xsl:if test="image:image"><xsl:value-of select="count(image:image)"/></xsl:if></td>
36
- <td><xsl:if test="sitemap:priority"><xsl:value-of select="concat(sitemap:priority*100,'%')"/></xsl:if></td>
37
- <td><xsl:if test="sitemap:lastmod"><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,8)))"/> (<xsl:value-of select="substring(sitemap:lastmod,20,6)"/>)</xsl:if></td>
38
- </tr>
39
- </xsl:for-each>
40
- </table>
41
- </div>
42
- <div id="footer">
43
- <p><img src="data:image/gif;base64,R0lGODlhUAAPAJEAAGZmZv////9mAImOeSwAAAAAUAAPAAACoISPqcvtD0+YtNqLs968myCE4kiW5jkGw8q27gvDwYfWdq3G+i7T9w/M8Ya7GQAUoiSTEyYSKYA2nSKhdXUdCIlaXzRVDVdB0+dS2lJZ1bkt0Sgti6NysvM5jbq2ai2WywJHYrZUaEhIWJXm99foNiRI9XUoV4g4GJjJyEgBGAkEivIIyPUZeppCqorlheo6ulr00UFba3uLEaG7y9urUAAAOw%3D%3D" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="https://status301.net/wordpress-plugins/xml-sitemap-feed/">XML Sitemap &amp; Google News</a> for <a href="https://wordpress.org/">WordPress</a>.</p>
44
- </div>
45
- </body>
46
- </html>
47
- </xsl:template>
48
- </xsl:stylesheet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-admin-notices.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- /***
4
- * Dismissable or interactive admin notices
5
- */
6
-
7
- class XMLSF_Admin_Notices extends XMLSF_Admin
8
- {
9
- function __construct() {}
10
-
11
- public static function notice_static_files()
12
- {
13
- $number = count( parent::$static_files );
14
- if ( ! $number ) return;
15
-
16
- include XMLSF_DIR . '/views/admin/notice-static-files.php';
17
- }
18
-
19
- public static function notice_ad_inserter_feed()
20
- {
21
- include XMLSF_DIR . '/views/admin/notice-ad-insterter-feed.php';
22
- }
23
-
24
- public static function notice_catchbox_feed_redirect()
25
- {
26
- include XMLSF_DIR . '/views/admin/notice-catchbox-feed-redirect.php';
27
- }
28
-
29
- public static function notice_wpseo_date_redirect()
30
- {
31
- include XMLSF_DIR . '/views/admin/notice-wpseo-date-redirect.php';
32
- }
33
-
34
- public static function notice_wpseo_sitemap()
35
- {
36
- include XMLSF_DIR . '/views/admin/notice-wpseo-sitemap.php';
37
- }
38
-
39
- public static function notice_seopress_date_redirect()
40
- {
41
- include XMLSF_DIR . '/views/admin/notice-seopress-date-redirect.php';
42
- }
43
-
44
- public static function notice_seopress_sitemap()
45
- {
46
- include XMLSF_DIR . '/views/admin/notice-seopress-sitemap.php';
47
- }
48
-
49
- public static function notice_rankmath_date_redirect()
50
- {
51
- include XMLSF_DIR . '/views/admin/notice-rankmath-date-redirect.php';
52
- }
53
-
54
- public static function notice_rankmath_sitemap()
55
- {
56
- include XMLSF_DIR . '/views/admin/notice-rankmath-sitemap.php';
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-admin-sitemap-news.php DELETED
@@ -1,428 +0,0 @@
1
- <?php
2
-
3
- class XMLSF_Admin_Sitemap_News extends XMLSF_Admin
4
- {
5
- /**
6
- * Holds the values to be used in the fields callbacks
7
- */
8
- private $options;
9
-
10
- /**
11
- * Start up
12
- */
13
- public function __construct()
14
- {
15
- // META
16
- add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
17
- add_action( 'save_post', array( $this, 'save_metadata' ) );
18
-
19
- // SETTINGS
20
- add_action( 'admin_init', array( $this, 'register_settings' ) );
21
- add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
22
- // advanced tab options
23
- add_action( 'xmlsf_news_settings_before', 'xmlsf_news_section_advanced_intro' );
24
- add_action( 'xmlsf_news_add_settings', array( $this, 'add_settings' ) );
25
-
26
- // TOOLS ACTIONS
27
- add_action( 'admin_init', array( $this, 'ping_sitemap' ) );
28
- }
29
-
30
- /**
31
- * TOOLS ACTIONS
32
- */
33
-
34
- public function ping_sitemap()
35
- {
36
- if ( ! isset( $_POST['xmlsf-ping-sitemap-news'] ) || ! xmlsf_verify_nonce('help') )
37
- return;
38
-
39
- $sitemaps = get_option( 'xmlsf_sitemaps' );
40
- $result = xmlsf_ping( 'google', $sitemaps['sitemap-news'], 5 * MINUTE_IN_SECONDS );
41
-
42
- switch( $result ) {
43
- case 200:
44
- $msg = sprintf( /* Translators: Search engine / Service name */ __( 'Pinged %s with success.', 'xml-sitemap-feed' ), __( 'Google News', 'xml-sitemap-feed' ) );
45
- $type = 'updated';
46
- break;
47
-
48
- case 999:
49
- $msg = sprintf( /* Translators: Search engine / Service name, interval number */ __( 'Ping %s skipped: Sitemap already sent within the last %d minutes.', 'xml-sitemap-feed' ), __( 'Google News', 'xml-sitemap-feed' ), 5 );
50
- $type = 'notice-warning';
51
- break;
52
-
53
- case '':
54
- $msg = sprintf( translate('Oops: %s'), translate('Something went wrong.') );
55
- $type = 'error';
56
- break;
57
-
58
- default:
59
- $msg = sprintf( /* Translators: Search engine / Service name, response code number */ __( 'Ping %s failed with response code: %d', 'xml-sitemap-feed' ), __( 'Google News', 'xml-sitemap-feed' ), $result );
60
- $type = 'error';
61
- }
62
-
63
- add_settings_error( 'ping_sitemap', 'ping_sitemap', $msg, $type );
64
-
65
- }
66
-
67
- /**
68
- * META BOXES
69
- */
70
-
71
- /* Adds a News Sitemap box to the side column */
72
- public function add_meta_box()
73
- {
74
- $news_tags = get_option( 'xmlsf_news_tags' );
75
- $news_post_types = !empty($news_tags['post_type']) && is_array($news_tags['post_type']) ? $news_tags['post_type'] : array('post');
76
-
77
- // Only include metabox on post types that are included
78
- foreach ( $news_post_types as $post_type ) {
79
- add_meta_box(
80
- 'xmlsf_news_section',
81
- __( 'Google News', 'xml-sitemap-feed' ),
82
- array( $this, 'meta_box' ),
83
- $post_type,
84
- 'side'
85
- );
86
- }
87
- }
88
-
89
- public function meta_box( $post )
90
- {
91
- // Use nonce for verification
92
- wp_nonce_field( XMLSF_BASENAME, '_xmlsf_news_nonce' );
93
-
94
- // Use get_post_meta to retrieve an existing value from the database and use the value for the form
95
- $exclude = 'private' == $post->post_status || get_post_meta( $post->ID, '_xmlsf_news_exclude', true );
96
- $disabled = 'private' == $post->post_status;
97
-
98
- // The actual fields for data entry
99
- include XMLSF_DIR . '/views/admin/meta-box-news.php';
100
- }
101
-
102
- /* When the post is saved, save our meta data */
103
- public function save_metadata( $post_id )
104
- {
105
- if (
106
- // verify nonce
107
- ! isset($_POST['_xmlsf_news_nonce']) || ! wp_verify_nonce($_POST['_xmlsf_news_nonce'], XMLSF_BASENAME) ||
108
- // user not allowed
109
- ! current_user_can( 'edit_post', $post_id )
110
- ) return;
111
-
112
- // _xmlsf_news_exclude
113
- if ( empty($_POST['xmlsf_news_exclude']) )
114
- delete_post_meta( $post_id, '_xmlsf_news_exclude' );
115
- else
116
- update_post_meta( $post_id, '_xmlsf_news_exclude', '1' );
117
- }
118
-
119
- /**
120
- * SETTINGS
121
- */
122
-
123
- /**
124
- * Add options page
125
- */
126
- public function add_settings_page()
127
- {
128
- // This page will be under "Settings"
129
- $screen_id = add_options_page(
130
- __('Google News Sitemap','xml-sitemap-feed'),
131
- __('Google News','xml-sitemap-feed'),
132
- 'manage_options',
133
- 'xmlsf_news',
134
- array( $this, 'settings_page' )
135
- );
136
-
137
- // Help tab
138
- add_action( 'load-'.$screen_id, array( $this, 'help_tab' ) );
139
- }
140
-
141
- /**
142
- * Options page callback
143
- */
144
- public function settings_page()
145
- {
146
- $this->options = (array) get_option( 'xmlsf_news_tags', array() );
147
-
148
- $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
149
-
150
- do_action( 'xmlsf_news_add_settings', $active_tab );
151
-
152
- // prepare sitemap link url
153
- $sitemaps = (array) get_option( 'xmlsf_sitemaps', array() );
154
-
155
- $sitemap = xmlsf()->plain_permalinks() ? '?feed=sitemap-news' : $sitemaps['sitemap-news'];
156
-
157
- // remove WPML home url filter
158
- global $wpml_url_filters;
159
- if ( is_object($wpml_url_filters) )
160
- remove_filter( 'home_url', array( $wpml_url_filters, 'home_url_filter' ), - 10 );
161
-
162
- include XMLSF_DIR . '/views/admin/page-sitemap-news.php';
163
- }
164
-
165
- /**
166
- * Add advanced settings
167
- */
168
- public function add_settings( $active_tab = '' )
169
- {
170
- if ( 'advanced' == $active_tab ) {
171
- // ADVANCED SECTION
172
- add_settings_section(
173
- 'news_sitemap_advanced_section',
174
- /* '<a name="xmlnf"></a>'.__('Google News Sitemap','xml-sitemap-feed') */
175
- '',
176
- '',
177
- 'xmlsf_news_advanced'
178
- );
179
-
180
- // Hierarchical post types
181
- add_settings_field(
182
- 'xmlsf_news_hierarchical',
183
- __( 'Hierarchical post types', 'xml-sitemap-feed' ),
184
- function() { include XMLSF_DIR . '/views/admin/field-news-hierarchical.php'; },
185
- 'xmlsf_news_advanced',
186
- 'news_sitemap_advanced_section'
187
- );
188
-
189
- // Keywords
190
- add_settings_field(
191
- 'xmlsf_news_keywords',
192
- __( 'Keywords', 'xml-sitemap-feed' ),
193
- function() { include XMLSF_DIR . '/views/admin/field-news-keywords.php'; },
194
- 'xmlsf_news_advanced',
195
- 'news_sitemap_advanced_section'
196
- );
197
-
198
- // Stock tickers
199
- add_settings_field(
200
- 'xmlsf_news_stock_tickers',
201
- __( 'Stock tickers', 'xml-sitemap-feed' ),
202
- function() { include XMLSF_DIR . '/views/admin/field-news-stocktickers.php'; },
203
- 'xmlsf_news_advanced',
204
- 'news_sitemap_advanced_section'
205
- );
206
-
207
- // Ping log
208
- add_settings_field(
209
- 'xmlsf_news_ping_log',
210
- __( 'Ping log', 'xml-sitemap-feed' ),
211
- function() { include XMLSF_DIR . '/views/admin/field-news-ping-log.php'; },
212
- 'xmlsf_news_advanced',
213
- 'news_sitemap_advanced_section'
214
- );
215
- } else {
216
- // GENERAL SECTION
217
- add_settings_section(
218
- 'news_sitemap_general_section',
219
- /* '<a name="xmlnf"></a>'.__('Google News Sitemap','xml-sitemap-feed') */
220
- '',
221
- '',
222
- 'xmlsf_news_general'
223
- );
224
-
225
- // SETTINGS
226
- add_settings_field(
227
- 'xmlsf_news_name',
228
- '<label for="xmlsf_news_name">'.__('Publication name','xml-sitemap-feed').'</label>',
229
- array( $this, 'name_field' ),
230
- 'xmlsf_news_general',
231
- 'news_sitemap_general_section'
232
- );
233
- add_settings_field(
234
- 'xmlsf_news_post_type',
235
- __( 'Post type', 'xml-sitemap-feed' ),
236
- array( $this, 'post_type_field' ),
237
- 'xmlsf_news_general',
238
- 'news_sitemap_general_section'
239
- );
240
-
241
- global $wp_taxonomies;
242
- $news_post_type = isset( $this->options['post_type'] ) && !empty( $this->options['post_type'] ) ? (array) $this->options['post_type'] : array('post');
243
- $post_types = ( isset( $wp_taxonomies['category'] ) ) ? $wp_taxonomies['category']->object_type : array();
244
-
245
- foreach ( $news_post_type as $post_type ) {
246
- if ( in_array( $post_type, $post_types ) ) {
247
- add_settings_field( 'xmlsf_news_categories', translate('Categories'), array($this,'categories_field'), 'xmlsf_news_general', 'news_sitemap_general_section' );
248
- break;
249
- }
250
- }
251
-
252
- // Source labels - deprecated
253
- add_settings_field(
254
- 'xmlsf_news_labels',
255
- __('Source labels', 'xml-sitemap-feed' ),
256
- function() { include XMLSF_DIR . '/views/admin/field-news-labels.php'; },
257
- 'xmlsf_news_general',
258
- 'news_sitemap_general_section'
259
- );
260
- }
261
- }
262
-
263
- /**
264
- * Register settings
265
- */
266
- public function register_settings()
267
- {
268
- register_setting(
269
- 'xmlsf_news_general',
270
- 'xmlsf_news_tags',
271
- array( 'XMLSF_Admin_Sitemap_News_Sanitize', 'news_tags_settings' )
272
- );
273
- }
274
-
275
- /**
276
- * GOOGLE NEWS SITEMAP SECTION
277
- */
278
-
279
- public function help_tab() {
280
- $screen = get_current_screen();
281
-
282
- ob_start();
283
- include XMLSF_DIR . '/views/admin/help-tab-news.php';
284
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
285
- $content = ob_get_clean();
286
-
287
- $screen->add_help_tab( array(
288
- 'id' => 'sitemap-news-settings',
289
- 'title' => __( 'Google News Sitemap', 'xml-sitemap-feed' ),
290
- 'content' => $content
291
- ) );
292
-
293
- ob_start();
294
- include XMLSF_DIR . '/views/admin/help-tab-news-name.php';
295
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
296
- $content = ob_get_clean();
297
-
298
- $screen->add_help_tab( array(
299
- 'id' => 'sitemap-news-name',
300
- 'title' => __( 'Publication name', 'xml-sitemap-feed' ),
301
- 'content' => $content
302
- ) );
303
-
304
- ob_start();
305
- include XMLSF_DIR . '/views/admin/help-tab-news-categories.php';
306
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
307
- $content = ob_get_clean();
308
-
309
- $screen->add_help_tab( array(
310
- 'id' => 'sitemap-news-categories',
311
- 'title' => translate('Categories'),
312
- 'content' => $content
313
- ) );
314
-
315
- ob_start();
316
- include XMLSF_DIR . '/views/admin/help-tab-news-keywords.php';
317
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
318
- $content = ob_get_clean();
319
-
320
- $screen->add_help_tab( array(
321
- 'id' => 'sitemap-news-keywords',
322
- 'title' => __( 'Keywords', 'xml-sitemap-feed' ),
323
- 'content' => $content
324
- ) );
325
-
326
- ob_start();
327
- include XMLSF_DIR . '/views/admin/help-tab-news-stocktickers.php';
328
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
329
- $content = ob_get_clean();
330
-
331
- $screen->add_help_tab( array(
332
- 'id' => 'sitemap-news-stocktickers',
333
- 'title' => __( 'Stock tickers', 'xml-sitemap-feed' ),
334
- 'content' => $content
335
- ) );
336
-
337
- ob_start();
338
- include XMLSF_DIR . '/views/admin/help-tab-news-labels.php';
339
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
340
- $content = ob_get_clean();
341
-
342
- $screen->add_help_tab( array(
343
- 'id' => 'sitemap-news-labels',
344
- 'title' => __( 'Source labels', 'xml-sitemap-feed' ),
345
- 'content' => $content
346
- ) );
347
-
348
- ob_start();
349
- include XMLSF_DIR . '/views/admin/help-tab-news-sidebar.php';
350
- $content = ob_get_clean();
351
-
352
- $screen->set_help_sidebar( $content );
353
- }
354
-
355
- public function name_field()
356
- {
357
- $name = !empty($this->options['name']) ? $this->options['name'] : '';
358
-
359
- // The actual fields for data entry
360
- include XMLSF_DIR . '/views/admin/field-news-name.php';
361
- }
362
-
363
- public function post_type_field()
364
- {
365
- global $wp_taxonomies;
366
-
367
- $post_types = apply_filters( 'xmlsf_news_post_types', get_post_types( array( 'public' => true, 'hierarchical' => false ) /*,'objects'*/) );
368
-
369
- if ( is_array($post_types) && !empty($post_types) ) :
370
-
371
- $news_post_type = isset($this->options['post_type']) && !empty( $this->options['post_type'] ) ? (array) $this->options['post_type'] : array('post');
372
-
373
- $type = apply_filters( 'xmlsf_news_post_type_field_type', 1 == count( $news_post_type ) ? 'radio' : 'checkbox' );
374
-
375
- $allowed = ( !empty( $this->options['categories'] ) && isset( $wp_taxonomies['category'] ) ) ? $wp_taxonomies['category']->object_type : $post_types;
376
-
377
- $do_warning = !empty( $this->options['categories'] ) && count($post_types) > 1 ? true : false;
378
-
379
- // The actual fields for data entry
380
- include XMLSF_DIR . '/views/admin/field-news-post-type.php';
381
-
382
- else :
383
-
384
- echo '<p class="description warning">'.__('There appear to be no post types available.','xml-sitemap-feed').'</p>';
385
-
386
- endif;
387
- }
388
-
389
- public function terms_checklist_language_filter( $args )
390
- {
391
- if ( function_exists('pll_languages_list') ) {
392
- $args['lang'] = implode( ',', pll_languages_list() );
393
- } else {
394
- $args['lang'] = '';
395
- }
396
-
397
- return $args;
398
- }
399
-
400
- public function categories_field()
401
- {
402
- $selected_categories = isset( $this->options['categories'] ) && is_array( $this->options['categories'] ) ? $this->options['categories'] : array();
403
-
404
- if ( function_exists('pll_languages_list') ) {
405
- add_filter( 'get_terms_args', function( $args ){ $args['lang'] = implode( ',', pll_languages_list() ); return $args; }/*array( $this, 'terms_checklist_language_filter' )*/ );
406
- }
407
-
408
- global $sitepress;
409
- if ( $sitepress ) {
410
- remove_filter( 'get_terms_args', array( $sitepress, 'get_terms_args_filter' ) );
411
- remove_filter( 'get_term', array( $sitepress, 'get_term_adjust_id' ), 1 );
412
- remove_filter( 'terms_clauses', array( $sitepress, 'terms_clauses' ) );
413
- }
414
-
415
- $cat_list = str_replace('name="post_category[]"','name="'.'xmlsf_news_tags[categories][]"', wp_terms_checklist( null, array( 'taxonomy' => 'category', 'selected_cats' => $selected_categories, 'echo' => false ) ) );
416
-
417
- // The actual fields for data entry
418
- include XMLSF_DIR . '/views/admin/field-news-categories.php';
419
- }
420
-
421
- }
422
-
423
- new XMLSF_Admin_Sitemap_News();
424
-
425
- function xmlsf_news_section_advanced_intro( $active_tab = '' ) {
426
- if ( 'advanced' == $active_tab )
427
- include XMLSF_DIR . '/views/admin/section-advanced-intro.php';
428
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-admin-sitemap.php DELETED
@@ -1,554 +0,0 @@
1
- <?php
2
-
3
- class XMLSF_Admin_Sitemap extends XMLSF_Admin
4
- {
5
- /**
6
- * Holds the values to be used in the fields callbacks
7
- */
8
- private $screen_id;
9
-
10
- /**
11
- * Holds the public taxonomies array
12
- */
13
- private $public_taxonomies;
14
-
15
- /**
16
- * Start up
17
- */
18
- public function __construct()
19
- {
20
- add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
21
- add_action( 'admin_init', array( $this, 'ping_sitemap' ) );
22
- add_action( 'admin_init', array( $this, 'check_conflicts' ), 11 );
23
- add_action( 'admin_init', array( $this, 'register_settings' ) );
24
- add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
25
- add_action( 'save_post', array( $this, 'save_metadata' ) );
26
-
27
- // placeholders for advanced options
28
- add_action( 'xmlsf_posttype_archive_field_options', array( $this, 'advanced_archive_field_options' ) );
29
- }
30
-
31
- /**
32
- * Ping sitemaps
33
- */
34
- public function ping_sitemap()
35
- {
36
- if ( ! isset( $_POST['xmlsf-ping-sitemap'] ) || ! xmlsf_verify_nonce('help') )
37
- return;
38
-
39
- $sitemaps = get_option( 'xmlsf_sitemaps' );
40
-
41
- foreach ( array('google','bing') as $se ) {
42
- $result = xmlsf_ping( $se, $sitemaps['sitemap'], HOUR_IN_SECONDS );
43
-
44
- $se_name = 'google' == $se ? __('Google','xml-sitemap-feed') : __('Bing & Yahoo','xml-sitemap-feed');
45
-
46
- switch( $result ) {
47
- case 200:
48
- $msg = sprintf( /* Translators: Search engine / Service name */ __( 'Pinged %s with success.', 'xml-sitemap-feed' ), $se_name );
49
- $type = 'updated';
50
- break;
51
-
52
- case 999:
53
- $msg = sprintf( /* Translators: Search engine / Service name, interval number */ __( 'Ping %s skipped: Sitemap already sent within the last %d minutes.', 'xml-sitemap-feed' ), $se_name, 60 );
54
- $type = 'notice-warning';
55
- break;
56
-
57
- case '':
58
- $msg = sprintf( translate('Oops: %s'), translate('Something went wrong.') );
59
- $type = 'error';
60
- break;
61
-
62
- default:
63
- $msg = sprintf( /* Translators: Search engine / Service name, response code number */ __( 'Ping %s failed with response code: %d', 'xml-sitemap-feed' ), $se_name, $result );
64
- $type = 'error';
65
- }
66
-
67
- add_settings_error( 'ping_sitemap', 'ping_sitemap', $msg, $type );
68
- }
69
-
70
- }
71
-
72
- /**
73
- * Check for conflicting plugins and their settings
74
- */
75
- public function check_conflicts()
76
- {
77
- if ( wp_doing_ajax() || ! current_user_can( 'manage_options' ) ) return;
78
-
79
- // TODO:
80
- // Google (XML) Sitemaps Generator Plugin for WordPress and Google News Sitemap incompatibility
81
-
82
- // WP SEO conflict notices
83
- if ( is_plugin_active('wordpress-seo/wp-seo.php') ) {
84
- // check date archive redirection
85
- $wpseo_titles = get_option( 'wpseo_titles' );
86
- if ( !empty( $wpseo_titles['disable-date'] ) ) {
87
- // check if Split by option is set anywhere
88
- foreach ( (array) get_option( 'xmlsf_post_types', array() ) as $type => $settings ) {
89
- if ( !empty( $settings['active'] ) && !empty( $settings['archive'] ) ) {
90
- add_action(
91
- 'admin_notices',
92
- function() { include XMLSF_DIR . '/views/admin/notice-wpseo-date-redirect.php'; }
93
- );
94
- break;
95
- }
96
- }
97
- }
98
-
99
- // check wpseo sitemap option
100
- if ( !in_array( 'wpseo_sitemap', parent::$dismissed ) ) {
101
- $wpseo = get_option( 'wpseo' );
102
- if ( !empty( $wpseo['enable_xml_sitemap'] ) ) {
103
- add_action(
104
- 'admin_notices',
105
- function() { include XMLSF_DIR . '/views/admin/notice-wpseo-sitemap.php'; }
106
- );
107
- }
108
- }
109
- }
110
-
111
- // SEOPress conflict notices
112
- if ( is_plugin_active('wp-seopress/seopress.php') ) {
113
-
114
- // check date archive redirection
115
- $seopress_toggle = get_option( 'seopress_toggle' );
116
-
117
- $seopress_titles = get_option( 'seopress_titles_option_name' );
118
- if ( ! empty( $seopress_toggle['toggle-titles'] ) && ! empty( $seopress_titles['seopress_titles_archives_date_disable'] ) ) {
119
- // check if Split by option is set anywhere
120
- foreach ( (array) get_option( 'xmlsf_post_types', array() ) as $type => $settings ) {
121
- if ( !empty( $settings['active'] ) && !empty( $settings['archive'] ) ) {
122
- add_action(
123
- 'admin_notices',
124
- function() { include XMLSF_DIR . '/views/admin/notice-seopress-date-redirect.php'; }
125
- );
126
- break;
127
- }
128
- }
129
- }
130
-
131
-
132
- // check seopress sitemap option
133
- if ( !in_array( 'seopress_sitemap', parent::$dismissed ) ) {
134
- $seopress_xml_sitemap = get_option( 'seopress_xml_sitemap_option_name' );
135
- if ( ! empty( $seopress_toggle['toggle-xml-sitemap'] ) && !empty( $seopress_xml_sitemap['seopress_xml_sitemap_general_enable'] ) ) {
136
- add_action(
137
- 'admin_notices',
138
- function() { include XMLSF_DIR . '/views/admin/notice-seopress-sitemap.php'; }
139
- );
140
- }
141
- }
142
- }
143
-
144
- // Rank Math conflict notices
145
- if ( is_plugin_active('seo-by-rank-math/rank-math.php') ) {
146
-
147
- // check date archive redirection
148
- $rankmath_titles = get_option( 'rank-math-options-titles' );
149
- if ( ! empty( $rankmath_titles['disable_date_archives'] ) && $rankmath_titles['disable_date_archives'] == 'on' ) {
150
- // check if Split by option is set anywhere
151
- foreach ( (array) get_option( 'xmlsf_post_types', array() ) as $type => $settings ) {
152
- if ( !empty( $settings['active'] ) && !empty( $settings['archive'] ) ) {
153
- add_action(
154
- 'admin_notices',
155
- function() { include XMLSF_DIR . '/views/admin/notice-rankmath-date-redirect.php'; }
156
- );
157
- break;
158
- }
159
- }
160
- }
161
-
162
- // check rank math sitemap option
163
- if ( !in_array( 'rankmath_sitemap', parent::$dismissed ) ) {
164
- $rankmath_modules = (array) get_option( 'rank_math_modules' );
165
- if ( in_array( 'sitemap', $rankmath_modules ) ) {
166
- add_action(
167
- 'admin_notices',
168
- function() { include XMLSF_DIR . '/views/admin/notice-rankmath-sitemap.php'; }
169
- );
170
- }
171
- }
172
- }
173
-
174
- // All in One SEO Pack conflict notices
175
- if ( is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') ) {
176
- // check aioseop sitemap module
177
- if ( !in_array( 'aioseop_sitemap', parent::$dismissed ) ) {
178
- $aioseop_options = (array) get_option( 'aioseop_options' );
179
-
180
- if ( isset( $aioseop_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) && "on" === $aioseop_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) {
181
- // sitemap module on
182
- add_action(
183
- 'admin_notices',
184
- function() { include XMLSF_DIR . '/views/admin/notice-aioseop-sitemap.php'; }
185
- );
186
- }
187
- }
188
- }
189
-
190
- // SEO Framework conflict notices
191
- //autodescription-site-settings[sitemaps_output]
192
- //
193
- if ( is_plugin_active('autodescription/autodescription.php') ) {
194
- // check sfw sitemap module
195
- if ( !in_array( 'seoframework_sitemap', parent::$dismissed ) ) {
196
- $sfw_options = (array) get_option( 'autodescription-site-settings' );
197
-
198
- if ( ! empty( $sfw_options['sitemaps_output'] ) ) {
199
- // sitemap module on
200
- add_action(
201
- 'admin_notices',
202
- function() { include XMLSF_DIR . '/views/admin/notice-seoframework-sitemap.php'; }
203
- );
204
- }
205
- }
206
- }
207
-
208
- }
209
-
210
- /**
211
- * META BOXES
212
- */
213
-
214
- /* Adds a XML Sitemap box to the side column */
215
- public function add_meta_box()
216
- {
217
- $post_types = get_option( 'xmlsf_post_types' );
218
- if ( !is_array( $post_types ) ) return;
219
-
220
- foreach ( $post_types as $post_type => $settings ) {
221
- // Only include metaboxes on post types that are included
222
- if ( isset( $settings["active"] ) )
223
- add_meta_box(
224
- 'xmlsf_section',
225
- __( 'XML Sitemap', 'xml-sitemap-feed' ),
226
- array( $this, 'meta_box' ),
227
- $post_type,
228
- 'side',
229
- 'low'
230
- );
231
- }
232
- }
233
-
234
- public function meta_box( $post )
235
- {
236
- // Use nonce for verification
237
- wp_nonce_field( XMLSF_BASENAME, '_xmlsf_nonce' );
238
-
239
- // Use get_post_meta to retrieve an existing value from the database and use the value for the form
240
- $exclude = get_post_meta( $post->ID, '_xmlsf_exclude', true );
241
- $priority = get_post_meta( $post->ID, '_xmlsf_priority', true );
242
- $disabled = false;
243
-
244
- // value prechecks to prevent "invalid form control not focusable" when meta box is hidden
245
- $priority = is_numeric($priority) ? xmlsf_sanitize_priority( $priority ): '';
246
-
247
- // disable options and (visibly) set excluded to true for private posts
248
- if ( 'private' == $post->post_status ) {
249
- $disabled = true;
250
- $exclude = true;
251
- }
252
-
253
- // disable options and (visibly) set priority to 1 for front page
254
- if ( $post->ID == get_option('page_on_front') ) {
255
- $disabled = true;
256
- $exclude = false;
257
- $priority = '1'; // force priority to 1 for front page
258
- }
259
-
260
- $description = sprintf(
261
- __('Leave empty for automatic Priority as configured on %1$s > %2$s.','xml-sitemap-feed'),
262
- translate('Settings'),
263
- '<a href="' . admin_url('options-general.php') . '?page=xmlsf">' . __('XML Sitemap','xml-sitemap-feed') . '</a>'
264
- );
265
-
266
- // The actual fields for data entry
267
- include XMLSF_DIR . '/views/admin/meta-box.php';
268
- }
269
-
270
- /* When the post is saved, save our meta data */
271
- public function save_metadata( $post_id )
272
- {
273
- if (
274
- // verify nonce
275
- ! isset($_POST['_xmlsf_nonce']) || ! wp_verify_nonce($_POST['_xmlsf_nonce'], XMLSF_BASENAME) ||
276
- // user not allowed
277
- ! current_user_can( 'edit_post', $post_id )
278
- ) return;
279
-
280
- // _xmlsf_priority
281
- if ( empty($_POST['xmlsf_priority']) || ! is_numeric($_POST['xmlsf_priority']) )
282
- delete_post_meta($post_id, '_xmlsf_priority');
283
- else
284
- update_post_meta($post_id, '_xmlsf_priority', xmlsf_sanitize_priority( $_POST['xmlsf_priority'] ) );
285
-
286
- // _xmlsf_exclude
287
- if ( empty($_POST['xmlsf_exclude']) )
288
- delete_post_meta($post_id, '_xmlsf_exclude');
289
- else
290
- update_post_meta($post_id, '_xmlsf_exclude', $_POST['xmlsf_exclude']);
291
- }
292
-
293
- /**
294
- * Gets public taxonomies
295
- */
296
- public function public_taxonomies()
297
- {
298
- if ( !isset( $this->public_taxonomies ) ) {
299
- $this->public_taxonomies = xmlsf_public_taxonomies();
300
- }
301
-
302
- return $this->public_taxonomies;
303
- }
304
-
305
- /**
306
- * Add options page
307
- */
308
- public function add_settings_page()
309
- {
310
- // This page will be under "Settings"
311
- $this->screen_id = add_options_page(
312
- __('XML Sitemap','xml-sitemap-feed'),
313
- __('XML Sitemap','xml-sitemap-feed'),
314
- 'manage_options',
315
- 'xmlsf',
316
- array( $this, 'settings_page' )
317
- );
318
- }
319
-
320
- /**
321
- * Options page callback
322
- */
323
- public function settings_page()
324
- {
325
- /**
326
- * SECTIONS & SETTINGS
327
- */
328
-
329
- /** POST TYPES */
330
- add_settings_section( 'xml_sitemap_post_types_section', /*'<a name="xmlsf"></a>'.__('XML Sitemap','xml-sitemap-feed')*/ '', '', 'xmlsf_post_types' );
331
- $post_types = apply_filters( 'xmlsf_post_types', get_post_types( array( 'public' => true ) /*,'objects'*/) );
332
-
333
- if ( is_array($post_types) && !empty($post_types) ) :
334
- foreach ( $post_types as $post_type ) {
335
- $obj = get_post_type_object( $post_type );
336
- if ( !is_object( $obj ) )
337
- continue;
338
- add_settings_field( 'xmlsf_post_type_'.$obj->name, $obj->label, array($this,'post_types_settings_field'), 'xmlsf_post_types', 'xml_sitemap_post_types_section', $post_type );
339
- // Note: (ab)using section name parameter to pass post type name
340
- }
341
- endif;
342
-
343
- /** TAXONOMIES */
344
- add_settings_section( 'xml_sitemap_taxonomies_section', /*'<a name="xmlsf"></a>'.__('XML Sitemap','xml-sitemap-feed')*/ '', '', 'xmlsf_taxonomies' );
345
- add_settings_field( 'xmlsf_taxonomy_settings', translate('General'), array($this,'taxonomy_settings_field'), 'xmlsf_taxonomies', 'xml_sitemap_taxonomies_section' );
346
- add_settings_field( 'xmlsf_taxonomies', __('Taxonomies','xml-sitemap-feed'), array($this,'taxonomies_field'), 'xmlsf_taxonomies', 'xml_sitemap_taxonomies_section' );
347
-
348
- /** AUTHORS */
349
- add_settings_section( 'xml_sitemap_authors_section', /*'<a name="xmlsf"></a>'.__('XML Sitemap','xml-sitemap-feed')*/ '', '', 'xmlsf_authors' );
350
- add_settings_field( 'xmlsf_author_settings', translate('General'), array($this,'author_settings_field'), 'xmlsf_authors', 'xml_sitemap_authors_section' );
351
-
352
- /** ADVANCED */
353
- add_settings_section( 'xml_sitemap_advanced_section', /*'<a name="xmlsf"></a>'.__('XML Sitemap','xml-sitemap-feed')*/ '', '', 'xmlsf_advanced' );
354
- // custom name
355
- add_settings_field( 'xmlsf_sitemap_name', '<label for="xmlsf_sitemap_name">' . __('XML Sitemap URL','xml-sitemap-feed') . '</label>', array($this,'xmlsf_sitemap_name_field'), 'xmlsf_advanced', 'xml_sitemap_advanced_section' );
356
- // custom urls
357
- add_settings_field( 'xmlsf_urls', __('External web pages','xml-sitemap-feed'), array($this,'urls_settings_field'), 'xmlsf_advanced', 'xml_sitemap_advanced_section' );
358
- // custom sitemaps
359
- add_settings_field( 'xmlsf_custom_sitemaps', __('External XML Sitemaps','xml-sitemap-feed'), array($this,'custom_sitemaps_settings_field'), 'xmlsf_advanced', 'xml_sitemap_advanced_section' );
360
-
361
- $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'post_types';
362
-
363
- do_action( 'xmlsf_add_settings', $active_tab );
364
-
365
- // prepare sitemap link url
366
- $sitemaps = (array) get_option( 'xmlsf_sitemaps', array() );
367
-
368
- $sitemap = xmlsf()->plain_permalinks() ? '?feed=sitemap' : $sitemaps['sitemap'];
369
-
370
- // remove WPML home url filter
371
- global $wpml_url_filters;
372
- if ( is_object($wpml_url_filters) )
373
- remove_filter( 'home_url', array( $wpml_url_filters, 'home_url_filter' ), - 10 );
374
-
375
- include XMLSF_DIR . '/views/admin/page-sitemap.php';
376
- }
377
-
378
- /**
379
- * Register and add settings
380
- */
381
- public function register_settings()
382
- {
383
- // Help tab
384
- add_action( 'load-'.$this->screen_id, array($this,'help_tab') );
385
-
386
- // post_types
387
- register_setting( 'xmlsf_post_types', 'xmlsf_post_types', array('XMLSF_Admin_Sitemap_Sanitize','post_types_settings') );
388
- // taxonomies
389
- register_setting( 'xmlsf_taxonomies', 'xmlsf_taxonomy_settings', array('XMLSF_Admin_Sitemap_Sanitize','taxonomy_settings') );
390
- register_setting( 'xmlsf_taxonomies', 'xmlsf_taxonomies', array('XMLSF_Admin_Sitemap_Sanitize','taxonomies') );
391
- // authors
392
- register_setting( 'xmlsf_authors', 'xmlsf_author_settings', array('XMLSF_Admin_Sitemap_Sanitize','author_settings') );
393
- // custom urls
394
- register_setting( 'xmlsf_advanced', 'xmlsf_urls', array('XMLSF_Admin_Sitemap_Sanitize','custom_urls_settings') );
395
- // custom sitemaps
396
- register_setting( 'xmlsf_advanced', 'xmlsf_custom_sitemaps', array('XMLSF_Admin_Sitemap_Sanitize','custom_sitemaps_settings') );
397
- }
398
-
399
- /**
400
- * XML SITEMAP SECTION
401
- */
402
-
403
- public function help_tab()
404
- {
405
- $screen = get_current_screen();
406
-
407
- ob_start();
408
- include XMLSF_DIR . '/views/admin/help-tab-sitemaps.php';
409
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
410
- $content = ob_get_clean();
411
-
412
- $screen->add_help_tab( array(
413
- 'id' => 'sitemap-settings',
414
- 'title' => __( 'XML Sitemap', 'xml-sitemap-feed' ),
415
- 'content' => $content
416
- ) );
417
-
418
- ob_start();
419
- include XMLSF_DIR . '/views/admin/help-tab-post-types.php';
420
- $content = ob_get_clean();
421
-
422
- $screen->add_help_tab( array(
423
- 'id' => 'sitemap-settings-post-types',
424
- 'title' => __( 'Post types', 'xml-sitemap-feed' ),
425
- 'content' => $content
426
- ) );
427
-
428
- ob_start();
429
- include XMLSF_DIR . '/views/admin/help-tab-taxonomies.php';
430
- $content = ob_get_clean();
431
-
432
- $screen->add_help_tab( array(
433
- 'id' => 'sitemap-settings-taxonomies',
434
- 'title' => __( 'Taxonomies', 'xml-sitemap-feed' ),
435
- 'content' => $content,
436
- ) );
437
-
438
- ob_start();
439
- include XMLSF_DIR . '/views/admin/help-tab-authors.php';
440
- $content = ob_get_clean();
441
-
442
- $screen->add_help_tab( array(
443
- 'id' => 'sitemap-settings-authors',
444
- 'title' => __( 'Authors', 'xml-sitemap-feed' ),
445
- 'content' => $content,
446
- ) );
447
-
448
- ob_start();
449
- include XMLSF_DIR . '/views/admin/help-tab-advanced.php';
450
- $content = ob_get_clean();
451
-
452
- $screen->add_help_tab( array(
453
- 'id' => 'sitemap-settings-advanced',
454
- 'title' => translate( 'Advanced' ),
455
- 'content' => $content
456
- ) );
457
-
458
- ob_start();
459
- include XMLSF_DIR . '/views/admin/help-tab-sidebar.php';
460
- $content = ob_get_clean();
461
-
462
- $screen->set_help_sidebar( $content );
463
- }
464
-
465
- public function post_types_settings_field( $post_type )
466
- {
467
- // post type slug passed as section name
468
- $obj = get_post_type_object( $post_type );
469
-
470
- $count = wp_count_posts( $obj->name );
471
-
472
- $options = get_option( 'xmlsf_post_types' );
473
-
474
- // The actual fields for data entry
475
- include XMLSF_DIR . '/views/admin/field-sitemap-post-type.php';
476
- }
477
-
478
- public function taxonomy_settings_field()
479
- {
480
- $taxonomy_settings = get_option( 'xmlsf_taxonomy_settings' );
481
-
482
- // The actual fields for data entry
483
- include XMLSF_DIR . '/views/admin/field-sitemap-taxonomy-settings.php';
484
- }
485
-
486
- public function taxonomies_field()
487
- {
488
- $taxonomies = get_option( 'xmlsf_taxonomies' );
489
-
490
- // The actual fields for data entry
491
- include XMLSF_DIR . '/views/admin/field-sitemap-taxonomies.php';
492
- }
493
-
494
- public function author_settings_field()
495
- {
496
- $author_settings = get_option( 'xmlsf_author_settings' );
497
-
498
- // The actual fields for data entry
499
- include XMLSF_DIR . '/views/admin/field-sitemap-author-settings.php';
500
- }
501
-
502
- public function authors_field()
503
- {
504
- include XMLSF_DIR . '/views/admin/field-sitemap-authors.php';
505
- }
506
-
507
- // Advanced tab fields
508
- public function xmlsf_sitemap_name_field()
509
- {
510
- $sitemaps = (array) get_option( 'xmlsf_sitemaps' );
511
- $default = apply_filters( 'xmlsf_sitemap_filename', 'sitemap.xml' );
512
-
513
- $name = !empty( $sitemaps['sitemap'] ) && $sitemaps['sitemap'] != $default ? $sitemaps['sitemap'] : '';
514
-
515
- // The actual fields for data entry
516
- include XMLSF_DIR . '/views/admin/field-sitemap-name.php';
517
- }
518
-
519
- public function custom_sitemaps_settings_field()
520
- {
521
- $custom_sitemaps = get_option( 'xmlsf_custom_sitemaps' );
522
- $lines = is_array($custom_sitemaps) ? implode( PHP_EOL, $custom_sitemaps ) : $custom_sitemaps;
523
-
524
- // The actual fields for data entry
525
- include XMLSF_DIR . '/views/admin/field-sitemap-custom.php';
526
- }
527
-
528
- public function urls_settings_field()
529
- {
530
- $urls = get_option( 'xmlsf_urls' );
531
- $lines = array();
532
-
533
- if( is_array($urls) && !empty($urls) ) {
534
- foreach( $urls as $arr ) {
535
- if( is_array($arr) )
536
- $lines[] = implode( " ", $arr );
537
- }
538
- }
539
-
540
- // The actual fields for data entry
541
- include XMLSF_DIR . '/views/admin/field-sitemap-urls.php';
542
- }
543
-
544
- public function advanced_archive_field_options()
545
- {
546
- ?>
547
- <option value=""<?php echo disabled( true ); ?>>
548
- <?php echo __('Week','xml-sitemap-feed'); ?>
549
- </option>
550
- <?php
551
- }
552
- }
553
-
554
- new XMLSF_Admin_Sitemap();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-admin.php DELETED
@@ -1,449 +0,0 @@
1
- <?php
2
- /* ------------------------------
3
- * XMLSF Admin CLASS
4
- * ------------------------------ */
5
-
6
- class XMLSF_Admin
7
- {
8
- /**
9
- * Sitemaps settings
10
- * @var array
11
- */
12
- private $sitemaps = array();
13
-
14
- /**
15
- * Static files conflicting with this plugin
16
- * @var array
17
- */
18
- public static $static_files = null;
19
-
20
- /**
21
- * Dismissed notices array
22
- * @var array
23
- */
24
- public static $dismissed = array();
25
-
26
- /**
27
- * Minimal compatible pro version
28
- * @var float
29
- */
30
- public static $compat_pro_min = '1.2';
31
-
32
- /**
33
- * CONSTRUCTOR
34
- */
35
- function __construct()
36
- {
37
- require XMLSF_DIR . '/models/functions.admin.php';
38
-
39
- $this->sitemaps = (array) get_option( 'xmlsf_sitemaps', array() );
40
-
41
- if ( isset($this->sitemaps['sitemap']) ) {
42
- require XMLSF_DIR . '/models/class.xmlsf-admin-sitemap-sanitize.php';
43
- require XMLSF_DIR . '/controllers/class.xmlsf-admin-sitemap.php';
44
- }
45
-
46
- if ( isset($this->sitemaps['sitemap-news']) ) {
47
- require XMLSF_DIR . '/models/class.xmlsf-admin-sitemap-news-sanitize.php';
48
- require XMLSF_DIR . '/controllers/class.xmlsf-admin-sitemap-news.php';
49
- }
50
-
51
- // ACTION LINK
52
- add_filter( 'plugin_action_links_' . XMLSF_BASENAME, 'xmlsf_add_action_link' );
53
- add_filter( 'plugin_row_meta', 'xmlsf_plugin_meta_links', 10, 2);
54
-
55
- // REGISTER SETTINGS
56
- add_action( 'admin_init', array( $this, 'register_settings' ), 0 );
57
-
58
- // ACTIONS & CHECKS
59
- add_action( 'admin_init', array( $this, 'notices_actions' ) );
60
- add_action( 'admin_init', array( $this, 'transients_actions' ) );
61
- add_action( 'admin_init', array( $this, 'tools_actions' ) );
62
- add_action( 'admin_init', array( $this, 'static_files' ) );
63
- add_action( 'admin_init', array( $this, 'check_conflicts' ), 11 );
64
- }
65
-
66
- /**
67
- * SETTINGS
68
- */
69
-
70
- /**
71
- * Register settings and add settings fields
72
- */
73
-
74
- public function register_settings()
75
- {
76
- // sitemaps
77
- register_setting( 'reading', 'xmlsf_sitemaps', array('XMLSF_Admin_Sanitize','sitemaps_settings') );
78
- add_settings_field( 'xmlsf_sitemaps', __('Enable XML sitemaps','xml-sitemap-feed'), array($this,'sitemaps_settings_field'), 'reading' );
79
-
80
- // custom domains, only when any sitemap is active
81
- if ( isset($this->sitemaps['sitemap']) || isset($this->sitemaps['sitemap-news']) ) {
82
- register_setting( 'reading', 'xmlsf_domains', array('XMLSF_Admin_Sanitize','domains_settings') );
83
- add_settings_field( 'xmlsf_domains', __('Allowed domains','xml-sitemap-feed'), array($this,'domains_settings_field'), 'reading' );
84
- }
85
-
86
- // help tab
87
- add_action( 'load-options-reading.php', array($this,'xml_sitemaps_help') );
88
-
89
- // robots rules, only when permalinks are set
90
- $rules = get_option( 'rewrite_rules' );
91
- if( ! xmlsf()->plain_permalinks() && isset( $rules['robots\.txt$'] ) ) {
92
- register_setting( 'reading', 'xmlsf_robots', array('XMLSF_Admin_Sanitize','robots_settings') );
93
- add_settings_field( 'xmlsf_robots', __('Additional robots.txt rules','xml-sitemap-feed'), array($this,'robots_settings_field'), 'reading' );
94
- }
95
-
96
- // ping, only when any sitemap is active
97
- if ( isset($this->sitemaps['sitemap']) || isset($this->sitemaps['sitemap-news']) ) {
98
- register_setting( 'writing', 'xmlsf_ping', array('XMLSF_Admin_Sanitize','ping_settings') );
99
- add_settings_field( 'xmlsf_ping', __('Ping Services','xml-sitemap-feed'), array($this,'ping_settings_field'), 'writing' );
100
- add_action( 'load-options-writing.php', array($this,'ping_settings_help') );
101
- }
102
- }
103
-
104
- /**
105
- * SITEMAPS
106
- */
107
-
108
- public function xml_sitemaps_help()
109
- {
110
- ob_start();
111
- include XMLSF_DIR . '/views/admin/help-tab-sitemaps.php';
112
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
113
- $content = ob_get_clean();
114
-
115
- get_current_screen()->add_help_tab( array(
116
- 'id' => 'sitemap-settings',
117
- 'title' => __( 'Enable XML sitemaps', 'xml-sitemap-feed' ),
118
- 'content' => $content,
119
- 'priority' => 11
120
- ) );
121
-
122
- ob_start();
123
- include XMLSF_DIR . '/views/admin/help-tab-allowed-domains.php';
124
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
125
- $content = ob_get_clean();
126
-
127
- get_current_screen()->add_help_tab( array(
128
- 'id' => 'allowed-domains',
129
- 'title' =>__( 'Allowed domains', 'xml-sitemap-feed' ),
130
- 'content' => $content,
131
- 'priority' => 11
132
- ) );
133
-
134
- ob_start();
135
- include XMLSF_DIR . '/views/admin/help-tab-robots.php';
136
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
137
- $content = ob_get_clean();
138
-
139
- get_current_screen()->add_help_tab( array(
140
- 'id' => 'robots',
141
- 'title' => __( 'Additional robots.txt rules', 'xml-sitemap-feed' ),
142
- 'content' => $content,
143
- 'priority' => 11
144
- ) );
145
- }
146
-
147
- /**
148
- * Sitemap settings fields
149
- */
150
-
151
- public function sitemaps_settings_field()
152
- {
153
- if ( 1 == get_option('blog_public') ) :
154
-
155
- // The actual fields for data entry
156
- include XMLSF_DIR . '/views/admin/field-sitemaps.php';
157
-
158
- else :
159
-
160
- _e( 'XML Sitemaps are not available because of your site&#8217;s visibility settings (above).', 'xml-sitemap-feed' );
161
-
162
- endif;
163
- }
164
-
165
- /**
166
- * Domain settings field
167
- */
168
-
169
- public function domains_settings_field()
170
- {
171
- $domains = get_option( 'xmlsf_domains' );
172
- if ( !is_array($domains) ) $domains = array();
173
-
174
- // The actual fields for data entry
175
- include XMLSF_DIR . '/views/admin/field-sitemap-domains.php';
176
- }
177
-
178
- /**
179
- * ROBOTS
180
- */
181
-
182
- public function robots_settings_field()
183
- {
184
- // The actual fields for data entry
185
- include XMLSF_DIR . '/views/admin/field-robots.php';
186
- }
187
-
188
- /**
189
- * PING SETTINGS
190
- */
191
-
192
- public function ping_settings_help()
193
- {
194
- ob_start();
195
- include XMLSF_DIR . '/views/admin/help-tab-ping.php';
196
- include XMLSF_DIR . '/views/admin/help-tab-support.php';
197
- $content = ob_get_clean();
198
-
199
- get_current_screen()->add_help_tab( array(
200
- 'id' => 'ping-services',
201
- 'title' => __( 'Ping Services', 'xml-sitemap-feed' ),
202
- 'content' => $content,
203
- 'priority' => 11
204
- ) );
205
- }
206
-
207
- public function ping_settings_field()
208
- {
209
- $options = get_option( 'xmlsf_ping' );
210
-
211
- // The actual fields for data entry
212
- include XMLSF_DIR . '/views/admin/field-ping.php';
213
- }
214
-
215
- /**
216
- * Clear settings
217
- */
218
- public function clear_settings( $sitemap = '' )
219
- {
220
- $defaults = 'sitemap-news' == $sitemap ? array(
221
- 'news_tags' => xmlsf()->default_news_tags
222
- ) : xmlsf()->defaults();
223
-
224
- unset( $defaults['sitemaps'] );
225
-
226
- foreach ( $defaults as $option => $settings ) {
227
- update_option( 'xmlsf_' . $option, $settings );
228
- }
229
-
230
- delete_transient( 'xmlsf_static_files' );
231
-
232
- add_settings_error( 'notice_clear_settings', 'notice_clear_settings', __('Settings reset to the plugin defaults.','xml-sitemap-feed'), 'updated' );
233
- }
234
-
235
- /**
236
- * Delete static sitemap files
237
- */
238
- public function delete_static_files()
239
- {
240
- if ( empty($_POST['xmlsf-delete']) ) {
241
- add_settings_error( 'static_files', 'none_selected', __('No files selected for deletion!','xml-sitemap-feed'), 'notice-warning' );
242
- return;
243
- }
244
-
245
- $allowed_files = array('sitemap.xml','sitemap-news.xml','robots.txt');
246
-
247
- if ( null === self::$static_files ) {
248
- self::$static_files = get_transient( 'xmlsf_static_files' );
249
- delete_transient( 'xmlsf_static_files' );
250
- }
251
-
252
- foreach ( $_POST['xmlsf-delete'] as $name ) {
253
- if ( !in_array($name,$allowed_files) ) {
254
- unset(self::$static_files[$name]);
255
- add_settings_error( 'static_files', 'file_not_allowed', sprintf( /* Translators: static file name */ __('File %s not in the list of allowed files!','xml-sitemap-feed'), '<em>' . $name . '</em>' ) );
256
- continue;
257
- }
258
- if ( !isset(self::$static_files[$name]) ) {
259
- // do nothing and be quiet about it...
260
- continue;
261
- }
262
- if ( unlink(self::$static_files[$name]) ) {
263
- unset(self::$static_files[$name]);
264
- add_settings_error( 'static_files', 'file_deleted_'.$name, sprintf( /* Translators: static file name */ __('Static file %s succesfully deleted.','xml-sitemap-feed'), '<em>' . $name . '</em>' ), 'updated' );
265
- } else {
266
- add_settings_error( 'static_files', 'file_failed_'.$name,
267
- sprintf( /* Translators: static file name */ __('Static file %s deletion failed.','xml-sitemap-feed'), '<em>' . $name . '</em>' ) . ' ' . sprintf( /* Translators: static file full path and name */ __('This is probably due to insufficient rights. Please try to remove %s manually via FTP or your hosting provider control panel.','xml-sitemap-feed'), self::$static_files[$name] )
268
- );
269
- }
270
- }
271
-
272
- $this->check_static_files();
273
- }
274
-
275
- /**
276
- * Check for static sitemap files
277
- */
278
- public function static_files()
279
- {
280
- if ( ( is_multisite() && ! is_super_admin() ) || ! current_user_can( 'manage_options' ) ) return;
281
-
282
- if ( null === self::$static_files )
283
- self::$static_files = get_transient( 'xmlsf_static_files' );
284
-
285
- if ( !empty(self::$static_files) && !in_array( 'static_files', self::$dismissed ) ) {
286
- add_action(
287
- 'admin_notices',
288
- function() { include XMLSF_DIR . '/views/admin/notice-static-files.php'; }
289
- );
290
- }
291
- }
292
-
293
- /**
294
- * Check for static sitemap files
295
- */
296
- public function check_static_files()
297
- {
298
- $home_path = trailingslashit( get_home_path() );
299
- self::$static_files = array();
300
- $check_for = $this->sitemaps;
301
- if ( get_option('xmlsf_robots') ) {
302
- $check_for['robots'] = 'robots.txt';
303
- }
304
-
305
- foreach ( $check_for as $name => $pretty ) {
306
- if ( ! empty( $pretty ) && file_exists( $home_path . $pretty ) ) {
307
- self::$static_files[$pretty] = $home_path . $pretty;
308
- }
309
- }
310
-
311
- if ( !empty( self::$static_files ) ) {
312
- set_transient( 'xmlsf_static_files', self::$static_files );
313
- } else {
314
- delete_transient( 'xmlsf_static_files' );
315
- }
316
- }
317
-
318
- /**
319
- * Check for conflicting themes and their settings
320
- */
321
-
322
- public function check_conflicts()
323
- {
324
- // Google News Advanced incompatibility notice
325
- if ( is_plugin_active('xml-sitemap-feed-advanced-news/xml-sitemap-advanced-news.php') ) {
326
- // check version
327
- if ( !in_array( 'xmlsf_advanced_news', self::$dismissed ) ) {
328
- if (
329
- ! defined( 'XMLSF_NEWS_ADV_VERSION' ) ||
330
- version_compare( XMLSF_NEWS_ADV_VERSION, self::$compat_pro_min, '<' )
331
- ) {
332
- add_action(
333
- 'admin_notices',
334
- function() { include XMLSF_DIR . '/views/admin/notice-xmlsf-advanced-news.php'; }
335
- );
336
- }
337
- }
338
- }
339
-
340
- // Catch Box Pro feed redirect
341
- if ( /*!in_array( 'catchbox_feed_redirect', self::$dismissed ) &&*/ function_exists( 'catchbox_is_feed_url_present' ) && catchbox_is_feed_url_present(null) ) {
342
- add_action(
343
- 'admin_notices',
344
- function() { include XMLSF_DIR . '/views/admin/notice-catchbox-feed-redirect.php'; }
345
- );
346
- }
347
-
348
- // Ad Inserter XML setting incompatibility warning
349
- if ( /*!in_array( 'ad_inserter_feed', parent::$dismissed ) &&*/ is_plugin_active('ad-inserter/ad-inserter.php') ) {
350
- $adsettings = get_option( 'ad_inserter' );
351
- if ( is_array($adsettings) && !empty($adsettings) ) {
352
- foreach ( $adsettings as $ad => $settings ) {
353
- // check rss feed setting
354
- if ( !empty( $settings['code'] ) && empty( $settings['disable_insertion'] ) && !empty( $settings['enable_feed'] ) ) {
355
- add_action(
356
- 'admin_notices',
357
- function() { include XMLSF_DIR . '/views/admin/notice-ad-insterter-feed.php'; }
358
- );
359
- break;
360
- }
361
- }
362
- }
363
- }
364
- }
365
-
366
- public function tools_actions()
367
- {
368
- if ( isset( $_POST['xmlsf-clear-settings-submit'] ) && isset( $_POST['xmlsf-clear-settings'] ) ) {
369
- if ( xmlsf_verify_nonce('help') ) {
370
- $this->clear_settings( $_POST['xmlsf-clear-settings'] );
371
- }
372
- }
373
-
374
- if ( isset( $_POST['xmlsf-check-conflicts'] ) ) {
375
- if ( xmlsf_verify_nonce('help') ) {
376
- // reset ignored warnings
377
- delete_user_meta( get_current_user_id(), 'xmlsf_dismissed' );
378
- self::$dismissed = array();
379
-
380
- $this->check_static_files();
381
- if ( empty( self::$static_files ) )
382
- add_settings_error( 'static_files_notice', 'static_files', __('No conflicting static files found.','xml-sitemap-feed'), 'notice-info');
383
- }
384
- }
385
-
386
- if ( isset( $_POST['xmlsf-flush-rewrite-rules'] ) ) {
387
- if ( xmlsf_verify_nonce('help') ) {
388
- // flush rewrite rules
389
- flush_rewrite_rules();
390
- add_settings_error( 'flush_admin_notice', 'flush_admin_notice', __('WordPress rewrite rules have been flushed.','xml-sitemap-feed'), 'updated' );
391
- }
392
- }
393
-
394
- if ( isset( $_POST['xmlsf-clear-term-meta'] ) ) {
395
- if ( xmlsf_verify_nonce('help') ) {
396
- // remove metadata
397
- global $wpdb;
398
- // terms meta
399
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
400
- add_settings_error( 'clear_meta_notice', 'clear_meta_notice', __('Sitemap term meta cache has been cleared.','xml-sitemap-feed'), 'updated' );
401
- }
402
- }
403
-
404
- if ( isset( $_POST['xmlsf-clear-post-meta'] ) ) {
405
- if ( xmlsf_verify_nonce('help') ) {
406
- // remove metadata
407
- global $wpdb;
408
- // images meta
409
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_attached' ) );
410
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_featured' ) );
411
- update_option( 'xmlsf_images_meta_primed', array() );
412
- // comments meta
413
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date_gmt' ) );
414
- update_option( 'xmlsf_comments_meta_primed', array() );
415
-
416
- add_settings_error( 'clear_meta_notice', 'clear_meta_notice', __('Sitemap post meta caches have been cleared.','xml-sitemap-feed'), 'updated' );
417
- }
418
- }
419
-
420
- }
421
-
422
- public function notices_actions()
423
- {
424
- self::$dismissed = (array) get_user_meta( get_current_user_id(), 'xmlsf_dismissed' );
425
-
426
- if ( isset( $_POST['xmlsf-delete-submit'] ) ) {
427
- if ( xmlsf_verify_nonce('notice') ) {
428
- $this->delete_static_files();
429
- }
430
- }
431
-
432
- if ( isset( $_POST['xmlsf-dismiss-submit'] ) && isset( $_POST['xmlsf-dismiss'] ) ) {
433
- if ( xmlsf_verify_nonce('notice') ) {
434
- add_user_meta( get_current_user_id(), 'xmlsf_dismissed', $_POST['xmlsf-dismiss'], false );
435
- self::$dismissed[] = $_POST['xmlsf-dismiss'];
436
- }
437
- }
438
- }
439
-
440
- public function transients_actions()
441
- {
442
- // CATCH TRANSIENT for flushing rewrite rules after the sitemaps setting has changed
443
- delete_transient('xmlsf_flush_rewrite_rules') && flush_rewrite_rules();
444
-
445
- // CATCH TRANSIENT for static file check
446
- delete_transient('xmlsf_check_static_files') && $this->check_static_files();
447
- }
448
-
449
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-sitemap-news.php DELETED
@@ -1,101 +0,0 @@
1
- <?php
2
- /* ------------------------------
3
- * XMLSF Controller CLASS
4
- * ------------------------------ */
5
-
6
- class XMLSF_Sitemap_News
7
- {
8
- /**
9
- * Sitemap index name
10
- * @var string
11
- */
12
- private $sitemap = 'sitemap-news.xml';
13
-
14
- /**
15
- * Post types included in sitemap index
16
- * @var array
17
- */
18
- private $post_types;
19
-
20
- /**
21
- * Rewrite rules
22
- * @var array
23
- */
24
- public $rewrite_rules = array(
25
- 'regex' => 'sitemap-news\.xml(\.gz)?$',
26
- 'query' => '?feed=sitemap-news$matches[1]'
27
- );
28
-
29
- /**
30
- * CONSTRUCTOR
31
- * Runs on init
32
- */
33
-
34
- function __construct( $sitemap )
35
- {
36
- if ( $sitemap ) $this->sitemap = $sitemap;
37
-
38
- // Rewrite rules filter.
39
- add_filter( 'rewrite_rules_array', array( $this, 'rewrite_rules' ), 99, 1 );
40
-
41
- // PINGING
42
- add_action( 'transition_post_status', array( $this, 'do_ping' ), 999, 3 );
43
- }
44
-
45
- /**
46
- * Add sitemap rewrite rules
47
- *
48
- * Hooked into rewrite_rules_array filter
49
- *
50
- * @param array $rewrite_rules
51
- * @return array $rewrite_rules
52
- */
53
- public function rewrite_rules( $rewrite_rules ) {
54
- global $wp_rewrite;
55
-
56
- $rewrite_rules = array_merge( array( $this->rewrite_rules['regex'] => $wp_rewrite->index . $this->rewrite_rules['query'] ), $rewrite_rules );
57
-
58
- return $rewrite_rules;
59
- }
60
-
61
- /**
62
- * Do pings, hooked to transition post status
63
- *
64
- * @param $new_status
65
- * @param $old_status
66
- * @param $post
67
- */
68
- public function do_ping( $new_status, $old_status, $post )
69
- {
70
- // bail out when already published or not publishing
71
- if ( $old_status == 'publish' || $new_status != 'publish' ) return;
72
-
73
- // bail out when Google ping not checked
74
- if ( ! in_array( 'google', (array) get_option( 'xmlsf_ping' ) ) ) return;
75
-
76
- // we're saving from post edit screen
77
- if ( ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'editpost' == $_POST['action'] ) {
78
- // bail out when exclude field is checked
79
- if ( ! empty( $_POST['_xmlsf_news_exclude'] ) ) return;
80
- } else {
81
- // fall back on exclude meta data from DB which may be outdated (see bug)
82
- if ( get_post_meta( $post->ID, '_xmlsf_news_exclude' ) ) return;
83
- }
84
-
85
- $news_tags = (array) get_option('xmlsf_news_tags');
86
-
87
- // is this an active post type?
88
- if ( empty( $news_tags['post_type'] ) || ! in_array( $post->post_type, (array) $news_tags['post_type'] ) ) return;
89
-
90
- // are categories limited and is not in correct category?
91
- if ( ! empty( $news_tags['categories'] ) ) {
92
- $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'ids' ) );
93
- $intersect = array_intersect( (array) $cats, (array) $news_tags['categories'] );
94
- if ( empty( $intersect ) ) return;
95
- }
96
-
97
- // PING
98
- xmlsf_ping( 'google', $this->sitemap, 5 * MINUTE_IN_SECONDS );
99
- }
100
-
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/class.xmlsf-sitemap.php DELETED
@@ -1,408 +0,0 @@
1
- <?php
2
-
3
- /* ------------------------------
4
- * XMLSF Controller CLASS
5
- * ------------------------------ */
6
-
7
- class XMLSF_Sitemap
8
- {
9
- /**
10
- * Sitemap index name
11
- * @var string
12
- */
13
- private $sitemap = 'sitemap.xml';
14
-
15
- /**
16
- * Post types included in sitemap index
17
- * @var array
18
- */
19
- private $post_types = array();
20
-
21
- /**
22
- * Rewrite rules
23
- * @var array
24
- */
25
- public $rewrite_rules = array(
26
- 'regex' => 'sitemap(?:_index)?(-[a-z0-9\-_]+)?(?:\.([0-9]{4,8}))?(?:\.([0-9]{1,2}))?\.xml(\.gz)?$',
27
- 'query' => '?feed=sitemap$matches[1]$matches[4]&m=$matches[2]&w=$matches[3]'
28
- );
29
-
30
- /**
31
- * CONSTRUCTOR
32
- * Runs on init
33
- */
34
-
35
- function __construct( $sitemap )
36
- {
37
- if ( $sitemap ) $this->sitemap = $sitemap;
38
-
39
- $this->post_types = (array) get_option( 'xmlsf_post_types', array() );
40
-
41
- // Rewrite rules filter.
42
- add_filter( 'rewrite_rules_array', array( $this, 'rewrite_rules' ), 99, 1 );
43
-
44
- // Redirect wp-sitemap requests.
45
- add_action( 'template_redirect', array( $this, 'redirect'), 0 );
46
-
47
- // Cache clearance.
48
- add_action( 'clean_post_cache', array( $this, 'clean_post_cache'), 99, 2 );
49
-
50
- // Update term meta lastmod date.
51
- add_action( 'transition_post_status', array( $this, 'update_term_modified_meta' ), 10, 3 );
52
-
53
- // Update images post meta.
54
- add_action( 'transition_post_status', array( $this, 'update_post_images_meta' ), 10, 3 );
55
-
56
- // Update last comment date post meta.
57
- add_action( 'transition_comment_status', array( $this, 'update_post_comment_meta' ), 10, 3 );
58
- add_action( 'comment_post', array( $this, 'update_post_comment_meta_cp' ), 10, 3 ); // when comment is not held for moderation
59
-
60
- // PINGING
61
- add_action( 'transition_post_status', array( $this, 'do_pings' ), 10, 3 );
62
-
63
- }
64
-
65
- /**
66
- * Add sitemap rewrite rules
67
- *
68
- * Hooked into rewrite_rules_array filter
69
- *
70
- * @param array $rewrite_rules
71
- * @return array $rewrite_rules
72
- */
73
- public function rewrite_rules( $rewrite_rules ) {
74
- global $wp_rewrite;
75
-
76
- $rewrite_rules = array_merge( array( $this->rewrite_rules['regex'] => $wp_rewrite->index . $this->rewrite_rules['query'] ), $rewrite_rules );
77
-
78
- return $rewrite_rules;
79
- }
80
-
81
- /**
82
- * Do WP core sitemap index redirect
83
- *
84
- * @uses wp_redirect()
85
- */
86
- public function redirect() {
87
- if ( ! empty( $_SERVER['REQUEST_URI'] ) && substr( $_SERVER['REQUEST_URI'], 0, 15) === '/wp-sitemap.xml' ) {
88
- wp_redirect( home_url( $this->sitemap ), 301, 'XML Sitemap & Google News for WordPress' );
89
- exit();
90
- }
91
- }
92
-
93
- /**
94
- * Do pings, hooked to transition post status
95
- *
96
- * @param $new_status
97
- * @param $old_status
98
- * @param $post
99
- */
100
- public function do_pings( $new_status, $old_status, $post )
101
- {
102
- // bail out when already published or not publishing
103
- if ( $old_status == 'publish' || $new_status != 'publish' ) return;
104
-
105
- // bail out when REST API call without new post data, see Gutenberg issue https://github.com/WordPress/gutenberg/issues/15094
106
- // NO ! Don't bail out now because there will be no other chance as long as bug is not fixed...
107
- // ... we'll have to make do without $_POST data so potentially incorrect get_post_meta() information.
108
- //if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) return;
109
-
110
- // bail out when inactive post type
111
- if ( ! array_key_exists( $post->post_type, $this->post_types ) ) return;
112
-
113
- // we're saving from post edit screen (f.e. 'inline-save' would be from quick edit)
114
- if ( ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'editpost' == $_POST['action'] ) {
115
- // bail out when exclude field is checked
116
- if ( ! empty( $_POST['_xmlsf_exclude'] ) ) return;
117
- } else {
118
- // fall back on exclude meta data from DB whic may be outdated (see bug)
119
- if ( get_post_meta( $post->ID, '_xmlsf_exclude' ) ) return;
120
- }
121
-
122
- $ping = (array) get_option( 'xmlsf_ping', array() );
123
- // PING !
124
- foreach ( $ping as $se ) {
125
- xmlsf_ping( $se, $this->sitemap, HOUR_IN_SECONDS );
126
- }
127
- }
128
-
129
- /**
130
- * Cache delete on clean_post_cache
131
- *
132
- * @param $post_ID
133
- * @param $post
134
- */
135
- public function clean_post_cache( $post_ID, $post )
136
- {
137
- // are we moving the post in or out of published status?
138
- wp_cache_delete( 'xmlsf_get_archives', 'general' );
139
-
140
- // TODO get year / month here to delete specific keys too !!!!
141
- $m = get_date_from_gmt( $post->post_date_gmt, 'Ym' );
142
- $y = substr( $m, 0, 4 );
143
-
144
- // clear possible last post modified cache keys
145
- wp_cache_delete( 'lastpostmodified:gmt', 'timeinfo' ); // should be handled by WP core?
146
- wp_cache_delete( 'lastpostmodified'.$y.':gmt', 'timeinfo' );
147
- wp_cache_delete( 'lastpostmodified'.$m.':gmt', 'timeinfo' );
148
- wp_cache_delete( 'lastpostmodified'.$y.':gmt:'.$post->post_type, 'timeinfo' );
149
- wp_cache_delete( 'lastpostmodified'.$m.':gmt:'.$post->post_type, 'timeinfo' );
150
-
151
- // clear possible last post date cache keys
152
- wp_cache_delete( 'lastpostdate:gmt', 'timeinfo' );
153
- wp_cache_delete( 'lastpostdate:gmt:'.$post->post_type, 'timeinfo' );
154
-
155
- // clear possible fist post date cache keys
156
- wp_cache_delete( 'firstpostdate:gmt', 'timeinfo' );
157
- wp_cache_delete( 'firstpostdate:gmt:'.$post->post_type, 'timeinfo' );
158
- }
159
-
160
- /**
161
- * Update term modified meta, hooked to transition post status
162
- *
163
- * @param $new_status
164
- * @param $old_status
165
- * @param $post
166
- */
167
- public function update_term_modified_meta( $new_status, $old_status, $post )
168
- {
169
- // bail when...
170
- if (
171
- // no status transition or not moving in or out of 'publish' status
172
- $old_status == $new_status || ( 'publish' != $new_status && 'publish' != $old_status ) ||
173
- // inactive post type
174
- ! array_key_exists($post->post_type, $this->post_types) || empty( $this->post_types[$post->post_type]['active'] )
175
- ) return;
176
-
177
- $taxonomy_settings = get_option( 'xmlsf_taxonomy_settings' );
178
-
179
- // bail if no taxonomies activated
180
- if ( ! is_array($taxonomy_settings) || empty( $taxonomy_settings['active'] ) )
181
- return;
182
-
183
- $taxonomies = get_option( 'xmlsf_taxonomies' );
184
- if ( empty( $taxonomies ) )
185
- $taxonomies = xmlsf_public_taxonomies();
186
-
187
- $term_ids = array();
188
- foreach ( (array) $taxonomies as $slug => $name ) {
189
- $terms = wp_get_post_terms( $post->ID, $slug, array( 'fields' => 'ids' ));
190
- if ( !is_wp_error($terms) ) {
191
- $term_ids = array_merge( $term_ids, $terms );
192
- }
193
- }
194
-
195
- $time = date('Y-m-d H:i:s');
196
-
197
- foreach( $term_ids as $id ) {
198
- update_term_meta( $id, 'term_modified', $time );
199
- }
200
- }
201
-
202
- /**
203
- * Update post images meta, hooked to transition post status
204
- *
205
- * @since 5.2
206
- *
207
- * @param $new_status
208
- * @param $old_status
209
- * @param $post
210
- */
211
- public function update_post_images_meta( $new_status, $old_status, $post )
212
- {
213
- // bail when...
214
- if (
215
- // not publishing or updating
216
- $new_status != 'publish' ||
217
- // inactive post type
218
- ! array_key_exists($post->post_type, $this->post_types) || empty( $this->post_types[$post->post_type]['active'] ) ||
219
- // no image tags active
220
- empty( $this->post_types[$post->post_type]['tags']['image'] )
221
- ) return;
222
-
223
- $which = $this->post_types[$post->post_type]['tags']['image'];
224
-
225
- // delete old image meta data
226
- delete_post_meta( $post->ID, '_xmlsf_image_'.$which );
227
-
228
- $this->_add_images_meta( $post, $which );
229
-
230
- }
231
-
232
- /**
233
- * Update post comment meta, hooked to transition comment status
234
- *
235
- * @since 5.2
236
- *
237
- * @param string $new_status
238
- * @param string $old_status
239
- * @param object $comment
240
- */
241
- public function update_post_comment_meta( $new_status, $old_status, $comment )
242
- {
243
- // bail when not publishing or unpublishing
244
- if ( $old_status == $new_status || ( $new_status != 'approved' && $old_status != 'approved' ) ) return;
245
-
246
- $post_type = get_post_type( $comment->comment_post_ID );
247
-
248
- // bail when...
249
- if ( ! array_key_exists($post_type, $this->post_types) // inactive post type
250
- || empty( $this->post_types[$post_type]['update_lastmod_on_comments'] ) // comments date irrelevant
251
- ) return;
252
-
253
- $tz = date_default_timezone_get();
254
- date_default_timezone_set('UTC');
255
- update_post_meta( $comment->comment_post_ID, '_xmlsf_comment_date_gmt', date('Y-m-d H:i:s') );
256
- date_default_timezone_set($tz);
257
-
258
- // update comment meta data
259
- }
260
-
261
- /**
262
- * Update post comment meta, hooked to comment post
263
- *
264
- * @since 5.2
265
- *
266
- * @param int $comment_ID
267
- * @param int $comment_approved
268
- * @param array $commentdata
269
- */
270
- public function update_post_comment_meta_cp( $comment_ID, $comment_approved, $commentdata )
271
- {
272
- // bail when not published
273
- if ( $comment_approved !== 1 ) return;
274
-
275
- $post_type = get_post_type( $commentdata['comment_post_ID'] );
276
-
277
- // bail when...
278
- if ( ! array_key_exists($post_type, $this->post_types) // inactive post type
279
- || empty( $this->post_types[$post_type]['update_lastmod_on_comments'] ) // comments date irrelevant
280
- ) return;
281
-
282
- // update comment meta data
283
- update_post_meta( $commentdata['comment_post_ID'], '_xmlsf_comment_date_gmt', $commentdata['comment_date_gmt'] );
284
- }
285
-
286
- /**
287
- * Prefetch all queried posts image and comment meta data
288
- *
289
- * @since 5.2
290
- * @uses global $wp_query
291
- */
292
- public function prefetch_posts_meta()
293
- {
294
- global $wp_query;
295
-
296
- $post_type = $wp_query->get( 'post_type' );
297
-
298
- if ( empty($post_type) || ! is_string($post_type) ) {
299
- set_transient( 'xmlsf_prefetch_post_meta_failed', 'Unexpected post type in WP_Query: '.print_r($post_type, true) );
300
- };
301
-
302
- // bail if post type not set
303
- if ( ! isset($this->post_types[$post_type]) ) return;
304
-
305
- $y = $wp_query->get( 'year' );
306
- $m = $wp_query->get( 'm' );
307
- if ( empty($m) ) $m = 'all';
308
-
309
- // if image tag active then prefetch images
310
- if (
311
- isset($this->post_types[$post_type]['tags']) &&
312
- is_array( $this->post_types[$post_type]['tags'] ) &&
313
- !empty( $this->post_types[$post_type]['tags']['image'] )
314
- ) {
315
- $primed = (array) get_option( 'xmlsf_images_meta_primed', array() );
316
-
317
- if (
318
- ! isset( $primed[$post_type] ) ||
319
- ! is_array( $primed[$post_type] ) ||
320
- (
321
- ! in_array( $m, $primed[$post_type] ) &&
322
- ! in_array( $y, $primed[$post_type] ) &&
323
- ! in_array( 'all', $primed[$post_type] )
324
- )
325
- ) {
326
- // prime images meta data
327
- foreach ( $wp_query->posts as $post ) {
328
- $this->_add_images_meta( $post, $this->post_types[$post_type]['tags']['image'] );
329
- }
330
-
331
- // add query to primed array
332
- $primed[$post_type][] = $m;
333
-
334
- // update
335
- update_option( 'xmlsf_images_meta_primed', $primed );
336
- }
337
- }
338
-
339
- // if update_lastmod_on_comments active then prefetch comments
340
- if ( !empty($this->post_types[$post_type]['update_lastmod_on_comments']) ) {
341
- $primed = (array) get_option( 'xmlsf_comments_meta_primed', array() );
342
-
343
- if (
344
- ! isset( $primed[$post_type] ) ||
345
- ! is_array( $primed[$post_type] ) ||
346
- (
347
- ! in_array( $m, $primed[$post_type] ) &&
348
- ! in_array( $y, $primed[$post_type] ) &&
349
- ! in_array( 'all', $primed[$post_type] )
350
- )
351
- ) {
352
- // prime comment meta data
353
- foreach ( $wp_query->posts as $post ) {
354
- $this->_add_comment_meta( $post );
355
- }
356
-
357
- // add query to primed array
358
- $primed[$post_type][] = $m;
359
-
360
- // update
361
- update_option( 'xmlsf_comments_meta_primed', $primed );
362
- }
363
- }
364
-
365
- }
366
-
367
- /**
368
- * Set posts images meta data
369
- *
370
- * @since 5.2
371
- * @param array $post Post object
372
- * @param string $which
373
- */
374
- private function _add_images_meta( $post, $which )
375
- {
376
- if ( ! is_object($post) || ! isset( $post->ID ) ) return;
377
-
378
- $stored = (array) get_post_meta( $post->ID, '_xmlsf_image_'.$which );
379
-
380
- // populate images and add as meta data
381
- foreach ( xmlsf_images_data( $post, $which ) as $data ) {
382
- if ( ! in_array( $data, $stored ) )
383
- add_post_meta( $post->ID, '_xmlsf_image_'.$which, $data );
384
- }
385
- }
386
-
387
- /**
388
- * Set post comment meta data
389
- *
390
- * @since 5.2
391
- * @param array $post Post object
392
- */
393
- private function _add_comment_meta( $post )
394
- {
395
- if ( ! is_object( $post ) || ! isset( $post->ID ) ) return;
396
-
397
- // get latest post comment
398
- $comments = get_comments( array(
399
- 'status' => 'approve',
400
- 'number' => 1,
401
- 'post_id' => $post->ID,
402
- ) );
403
-
404
- if ( isset( $comments[0]->comment_date_gmt ) )
405
- update_post_meta( $post->ID, '_xmlsf_comment_date_gmt', $comments[0]->comment_date_gmt );
406
- }
407
-
408
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/functions.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
-
3
- /* --------------------------
4
- * INITIALIZE
5
- * -------------------------- */
6
-
7
- function xmlsf_init() {
8
-
9
- // Upgrade/install, maybe...
10
- $db_version = get_option( 'xmlsf_version', 0 );
11
- if ( ! version_compare( XMLSF_VERSION, $db_version, '=' ) ) {
12
- require_once XMLSF_DIR . '/upgrade.php';
13
- new XMLSitemapFeed_Upgrade( $db_version );
14
- }
15
-
16
- $sitemaps = get_option( 'xmlsf_sitemaps' );
17
- // include sitemaps if any enabled
18
- if ( $sitemaps ) {
19
- // main model functions
20
- require XMLSF_DIR . '/models/functions.shared.php';
21
-
22
- // force remove url trailing slash
23
- add_filter( 'user_trailingslashit', 'xmlsf_untrailingslash' );
24
-
25
- // MAIN REQUEST filter
26
- add_filter( 'request', 'xmlsf_filter_request', 1 );
27
-
28
- // NGINX HELPER PURGE URLS
29
- add_filter( 'rt_nginx_helper_purge_urls', 'xmlsf_nginx_helper_purge_urls', 10, 2 );
30
-
31
- // main controller functions
32
- require XMLSF_DIR . '/controllers/functions.shared.php';
33
-
34
- add_action( 'xmlsf_ping', 'xmlsf_debug_ping', 9, 4 );
35
-
36
- // include and instantiate class
37
- xmlsf();
38
-
39
- if ( ! empty( $sitemaps['sitemap-news'] ) ) {
40
- require XMLSF_DIR . '/models/functions.sitemap-news.php';
41
- add_filter( 'xmlsf_news_post_types', 'xmlsf_news_filter_post_types' );
42
-
43
- require XMLSF_DIR . '/controllers/class.xmlsf-sitemap-news.php';
44
- new XMLSF_Sitemap_News( $sitemaps['sitemap-news'] );
45
-
46
- // add feed type, news can now be accessed via /feed/sitemap-news too
47
- add_feed( 'sitemap-news', 'xmlsf_news_load_template' );
48
- }
49
-
50
- if ( ! empty( $sitemaps['sitemap'] ) ) {
51
- require XMLSF_DIR . '/models/functions.sitemap.php';
52
- add_filter( 'xmlsf_post_types', 'xmlsf_filter_post_types' );
53
-
54
- xmlsf_sitemap( $sitemaps['sitemap'] );
55
- }
56
-
57
- // common sitemap element filters
58
- add_filter( 'the_title_xmlsitemap', 'strip_tags' );
59
- add_filter( 'the_title_xmlsitemap', 'ent2ncr', 8 );
60
- add_filter( 'the_title_xmlsitemap', 'esc_html' );
61
- }
62
-
63
- // add robots.txt filter
64
- add_filter( 'robots_txt', 'xmlsf_robots_txt', 9 );
65
- }
66
-
67
- /**
68
- * Plugin activation
69
- *
70
- * @since 5.0
71
- * @return void
72
- */
73
-
74
- function xmlsf_activate() {
75
- set_transient( 'xmlsf_flush_rewrite_rules', '' );
76
- set_transient( 'xmlsf_check_static_files', '' );
77
- }
78
-
79
- /**
80
- * Plugin de-activation
81
- *
82
- * @since 5.0
83
- * @return void
84
- */
85
-
86
- function xmlsf_deactivate() {
87
- delete_transient( 'xmlsf_flush_rewrite_rules' );
88
- delete_transient( 'xmlsf_check_static_files' );
89
-
90
- // remove metadata
91
- global $wpdb;
92
- // posts meta
93
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_attached' ) );
94
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_featured' ) );
95
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date' ) );
96
- // terms meta
97
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
98
-
99
- // remove filter and flush rules
100
- remove_filter( 'rewrite_rules_array', 'xmlsf_rewrite_rules', 99 );
101
- // how to unset add_feed() ?
102
- flush_rewrite_rules();
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/functions.shared.php DELETED
@@ -1,187 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * WPML: switch language
5
- * @see https://wpml.org/wpml-hook/wpml_post_language_details/
6
- */
7
- function xmlsf_wpml_language_switcher() {
8
- global $sitepress, $post;
9
-
10
- $language = apply_filters( 'wpml_element_language_code', NULL, array( 'element_id' => $post->ID, 'element_type' => $post->post_type ) );
11
- $sitepress->switch_lang( $language );
12
- }
13
- global $sitepress;
14
- if ( is_object( $sitepress ) ) {
15
- add_action( 'xmlsf_url', 'xmlsf_wpml_language_switcher' );
16
- add_action( 'xmlsf_news_url', 'xmlsf_wpml_language_switcher' );
17
- }
18
-
19
- /**
20
- * XML Stylesheet
21
- */
22
- function xmlsf_xml_stylesheet( $sitemap = false ) {
23
-
24
- /**
25
- * GET STYLESHEET URL
26
- *
27
- * DEVELOPERS: a custom stylesheet file in the active (parent or child) theme /assets subdirectory, will be used when found there
28
- *
29
- * Must start with 'sitemap', optionally followed by another designator, serparated by a hyphen.
30
- * It should always end with the xsl extension.
31
- *
32
- * Examples:
33
- * assets/sitemap.xsl
34
- * assets/sitemap-root.xsl
35
- * assets/sitemap-posttype.xsl
36
- * assets/sitemap-taxonomy.xsl
37
- * assets/sitemap-authors.xsl
38
- * assets/sitemap-custom.xsl
39
- * assets/sitemap-news.xsl
40
- * assets/sitemap-[custom_sitemap_name].xsl
41
- **/
42
-
43
- $file = $sitemap ? 'assets/sitemap-'.$sitemap.'.xsl' : 'assets/sitemap.xsl';
44
-
45
- // find theme stylesheet file
46
- if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
47
- $url = get_stylesheet_directory_uri() . '/' . $file;
48
- } elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
49
- $url = get_template_directory_uri() . '/' . $file;
50
- } else {
51
- $url = plugins_url( $file, XMLSF_BASENAME );
52
- }
53
-
54
- echo '<?xml-stylesheet type="text/xsl" href="' . wp_make_link_relative( $url ) . '?ver=' . XMLSF_VERSION . '"?>' . PHP_EOL;
55
- }
56
-
57
- /**
58
- * Generator info
59
- */
60
- function xmlsf_generator() {
61
- $date = date( 'c' );
62
-
63
- require XMLSF_DIR . '/views/_generator.php';
64
- }
65
-
66
- /**
67
- * Usage info for debugging
68
- */
69
- function xmlsf_usage() {
70
- if ( defined('WP_DEBUG') && WP_DEBUG ) {
71
- global $wpdb, $EZSQL_ERROR;
72
- $num = get_num_queries();
73
- $mem = function_exists('memory_get_peak_usage') ? round( memory_get_peak_usage()/1024/1024, 2 ) . 'M' : false;
74
- $limit = ini_get('memory_limit');
75
- // query errors
76
- $errors = '';
77
- if ( is_array($EZSQL_ERROR) && count($EZSQL_ERROR) ) {
78
- $i = 1;
79
- foreach ( $EZSQL_ERROR AS $e ) {
80
- $errors .= PHP_EOL . $i . ': ' . implode(PHP_EOL, $e) . PHP_EOL;
81
- $i += 1;
82
- }
83
- }
84
- // saved queries
85
- $saved = '';
86
- if ( defined('SAVEQUERIES') && SAVEQUERIES ) {
87
- $saved .= PHP_EOL . print_r($wpdb->queries, true);
88
- }
89
-
90
- require XMLSF_DIR . '/views/_usage.php';
91
- }
92
- }
93
-
94
- /**
95
- * Try to turn on ob_gzhandler output compression
96
- */
97
- function xmlsf_output_compression() {
98
- // try to enable zlib.output_compression or fall back to output buffering with ob_gzhandler
99
- if ( false !== ini_set( 'zlib.output_compression', 'On' ) )
100
- // if zlib.output_compression turned on, then make sure to remove wp_ob_end_flush_all
101
- remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
102
- else {
103
- ob_get_length()
104
- || in_array('ob_gzhandler', ob_list_handlers())
105
- || ob_start('ob_gzhandler');
106
- }
107
-
108
- if ( defined('WP_DEBUG') && WP_DEBUG == true ) {
109
- // zlib
110
- $zlib = ini_get( 'zlib.output_compression' ) ? 'ENABLED' : 'DISABLED';
111
- error_log('Zlib output compression '.$zlib);
112
-
113
- // ob_gzhandler
114
- $gz = in_array('ob_gzhandler', ob_list_handlers()) ? 'ENABLED' : 'DISABLED';
115
- error_log('GZhandler output buffer compression '.$gz);
116
- }
117
- }
118
-
119
- /**
120
- * Error messages for ping
121
- */
122
- function xmlsf_debug_ping( $se, $sitemap, $ping_url, $response_code ) {
123
- if ( defined('WP_DEBUG') && WP_DEBUG == true ) {
124
- if ( $response_code == 999 ) {
125
- error_log( 'Ping '. $se .' skipped.' );
126
- } else {
127
- error_log( 'Pinged '. $ping_url .' with response code: ' . $response_code );
128
- }
129
- }
130
- }
131
-
132
- /**
133
- * Load feed template
134
- *
135
- * Hooked into do_feed_{sitemap...}. First checks for a child/parent theme template file, then falls back to plugin template
136
- *
137
- * @since 5.3
138
- *
139
- * @param bool $is_comment_feed unused
140
- * @param string $feed feed type
141
- */
142
- function xmlsf_load_template( $is_comment_feed, $feed ) {
143
-
144
- /**
145
- * GET TEMPLATE FILE
146
- *
147
- * DEVELOPERS: a custom template file in the active (parent or child) theme directory will be used when found there
148
- *
149
- * Must start with 'sitemap', optionally folowed by other designators, serperated by hyphens.
150
- * It should always end with the php extension.
151
- *
152
- * Examples:
153
- * sitemap.php
154
- * sitemap-root.php
155
- * sitemap-posttype.php
156
- * * sitemap-posttype-post.php
157
- * * sitemap-posttype-page.php
158
- * * sitemap-posttype-[custom_post_type].php
159
- * sitemap-taxonomy.php
160
- * * sitemap-taxonomy-category.php
161
- * * sitemap-taxonomy-post_tag.php
162
- * * sitemap-taxonomy-[custom_taxonomy].php
163
- * sitemap-authors.php
164
- * sitemap-custom.php
165
- * sitemap-news.php
166
- * sitemap-[custom_sitemap_name].php
167
- **/
168
-
169
- $parts = explode( '-' , $feed, 3 );
170
-
171
- // possible theme template file names
172
- $templates = array();
173
- if ( ! empty( $parts[1] ) ) {
174
- if ( ! empty( $parts[2] ) ) {
175
- $templates[] = "{$parts[0]}-{$parts[1]}-{$parts[2]}.php";
176
- }
177
- $templates[] = "{$parts[0]}-{$parts[1]}.php";
178
- } else {
179
- $templates[] = "{$parts[0]}.php";
180
- }
181
-
182
- // find theme template file and load that
183
- locate_template( $templates, true );
184
-
185
- // still here, then fall back on plugin template file
186
- load_template( XMLSF_DIR . '/views/feed-' . implode( '-', array_slice( $parts, 0, 2 ) ) . '.php' );
187
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
feed-sitemap-index.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Google News Sitemap Feed Template
4
+ *
5
+ * @package XML Sitemap Feed plugin for WordPress
6
+ */
7
+
8
+ status_header('200'); // force header('HTTP/1.1 200 OK') for sites without posts
9
+ header('Content-Type: text/xml; charset=' . get_bloginfo('charset'), true);
10
+
11
+ echo '<?xml version="1.0" encoding="'.get_bloginfo('charset').'"?><?xml-stylesheet type="text/xsl" href="' . plugins_url('',__FILE__) . '/sitemap-index.xsl.php?ver=' . XMLSF_VERSION . '"?>
12
+ <!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
13
+ <!-- generator="XML & Google News Sitemap Feed plugin for WordPress" -->
14
+ <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
15
+ <!-- generator-version="'.XMLSF_VERSION.'" -->
16
+ <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
17
+ ';
18
+
19
+ global $xmlsitemapfeed;
20
+
21
+ // GN Sitemap goes in robots.txt only or not !?
22
+ /*if ( $xmlsitemapfeed->do_news_feed() ) {
23
+ ?>
24
+ <!-- news -->
25
+ <sitemap>
26
+ <loc><?php
27
+ // hook for filter 'xml_sitemap_url' provides a string here and MUST get a string returned
28
+ $url = apply_filters( 'xml_sitemap_url', trailingslashit(home_url()) );
29
+ if ( is_string($url) )
30
+ echo esc_url( $url );
31
+ else
32
+ echo esc_url( trailingslashit(home_url()) );
33
+ echo $xmlsitemapfeed->news_name.'.'.$xmlsitemapfeed->extension; ?></loc>
34
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', get_lastdate('gmt'), false); ?></lastmod>
35
+ </sitemap>
36
+ <?php
37
+ }*/
38
+ ?>
39
+ <!-- post types -->
40
+ <?php
41
+
42
+ // add rules for custom public post types
43
+ $post_types = $xmlsitemapfeed->get_post_types();
44
+ foreach ( $post_types as $post_type ) {
45
+ $count = wp_count_posts( $post_type );
46
+ if ( $count->publish > 0 ) {
47
+ ?>
48
+ <sitemap>
49
+ <loc><?php
50
+ // hook for filter 'xml_sitemap_url' provides a string here and MUST get a string returned
51
+ $url = apply_filters( 'xml_sitemap_url', trailingslashit(home_url()) );
52
+ if ( is_string($url) )
53
+ echo esc_url( $url );
54
+ else
55
+ echo esc_url( trailingslashit(home_url()) );
56
+ if (''==get_option('permalink_structure'))
57
+ echo '?feed='.$xmlsitemapfeed->base_name.'_'.$post_type;
58
+ else
59
+ echo $xmlsitemapfeed->base_name.'-posttype-'.$post_type.'.'.$xmlsitemapfeed->extension; ?></loc>
60
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', get_lastdate( 'gmt', $post_type ), false); ?></lastmod>
61
+ </sitemap>
62
+ <?php
63
+ }
64
+ }
65
+ ?>
66
+ <!-- taxonomy types -->
67
+ <?php
68
+
69
+ // add rules for custom public post taxonomies
70
+ $taxonomies = get_option('XMLSitemapFeed_taxonomies',$xmlsitemapfeed->defaults('taxonomies'));
71
+ foreach ( $taxonomies as $taxonomy ) {
72
+ if ( wp_count_terms( $taxonomy ) > 0 ) {
73
+ ?>
74
+ <sitemap>
75
+ <loc><?php
76
+ // hook for filter 'xml_sitemap_url' provides a string here and MUST get a string returned
77
+ $url = apply_filters( 'xml_sitemap_url', trailingslashit(home_url()) );
78
+ if ( is_string($url) )
79
+ echo esc_url( $url );
80
+ else
81
+ echo esc_url( trailingslashit(home_url()) );
82
+ if (''==get_option('permalink_structure'))
83
+ echo '?feed='.$xmlsitemapfeed->base_name.'-taxonomy&amp;taxonomy='.$taxonomy;
84
+ else
85
+ echo $xmlsitemapfeed->base_name.'-taxonomy-'.$taxonomy.'.'.$xmlsitemapfeed->extension; ?></loc>
86
+ </sitemap>
87
+ <?php
88
+ // TODO add lastmod ?
89
+ }
90
+ }
91
+
92
+ ?></sitemapindex>
feed-sitemap-news.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Google News Sitemap Feed Template
4
+ *
5
+ * @package XML Sitemap Feed plugin for WordPress
6
+ */
7
+
8
+ status_header('200'); // force header('HTTP/1.1 200 OK') for sites without posts
9
+ header('Content-Type: text/xml; charset=' . get_bloginfo('charset'), true);
10
+
11
+ echo '<?xml version="1.0" encoding="'.get_bloginfo('charset').'"?>
12
+ <?xml-stylesheet type="text/xsl" href="' . plugins_url('/sitemap.xsl.php',XMLSF_PLUGIN_DIR . '/feed-sitemap.php') . '?ver=' . XMLSF_VERSION . '"?>
13
+ <!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
14
+ <!-- generator="XML & Google News Sitemap Feed plugin for WordPress" -->
15
+ <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
16
+ <!-- generator-version="'.XMLSF_VERSION.'" -->
17
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
18
+ xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
19
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
21
+ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
22
+ http://www.google.com/schemas/sitemap-news/0.9
23
+ http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">
24
+ ';
25
+
26
+ // get site language for default language
27
+ // bloginfo_rss('language') returns improper format so
28
+ // we explode on hyphen and use only first part.
29
+ // TODO this workaround breaks (simplified) chinese :(
30
+ $language = reset(explode('-', get_bloginfo_rss('language')));
31
+ if ( empty($language) )
32
+ $language = 'en';
33
+
34
+ // loop away!
35
+ if ( have_posts() ) :
36
+ while ( have_posts() ) :
37
+ the_post();
38
+
39
+ // check if we are not dealing with an external URL :: Thanks, Francois Deschenes :)
40
+ if(!preg_match('/^' . preg_quote(home_url(), '/') . '/i', get_permalink())) continue;
41
+
42
+ $thispostmodified_gmt = $post->post_modified_gmt; // post GMT timestamp
43
+ $thispostmodified = mysql2date('U',$thispostmodified_gmt); // post Unix timestamp
44
+ $lastcomment = array();
45
+
46
+ if ($post->comment_count && $post->comment_count > 0) {
47
+ $lastcomment = get_comments( array(
48
+ 'status' => 'approve',
49
+ '$number' => 1,
50
+ 'post_id' => $post->ID,
51
+ ) );
52
+ $lastcommentsdate = mysql2date('U',$lastcomment[0]->comment_date_gmt); // last comment timestamp
53
+ if ( $lastcommentsdate > $thispostmodified ) {
54
+ $thispostmodified = $lastcommentsdate; // replace post with comment Unix timestamp
55
+ $thispostmodified_gmt = $lastcomment[0]->comment_date_gmt; // and replace modified GMT timestamp
56
+ }
57
+ }
58
+ $lastactivityage = (gmdate('U') - $thispostmodified); // post age
59
+
60
+ // get the article keywords from categories and tags
61
+ $keys_arr = get_the_category();
62
+ if (get_the_tags())
63
+ $keys_arr = array_merge($keys_arr,get_the_tags());
64
+
65
+ ?>
66
+ <url>
67
+ <loc><?php the_permalink_rss() ?></loc>
68
+ <news:news>
69
+ <news:publication>
70
+ <news:name><?php
71
+ if(defined('XMLSF_GOOGLE_NEWS_NAME'))
72
+ echo apply_filters('the_title_rss', XMLSF_GOOGLE_NEWS_NAME);
73
+ else
74
+ echo bloginfo_rss('name'); ?></news:name>
75
+ <news:language><?php
76
+ $lang = reset(get_the_terms($post->ID,'language'));
77
+ echo (is_object($lang)) ? $lang->slug : $language; ?></news:language>
78
+ </news:publication>
79
+ <news:publication_date><?php
80
+ echo mysql2date('Y-m-d\TH:i:s+00:00', $post->post_date_gmt, false); ?></news:publication_date>
81
+ <news:title><?php the_title_rss() ?></news:title>
82
+ <news:keywords><?php
83
+ $do_comma = false;
84
+ $keys_arr = get_the_category();
85
+ foreach($keys_arr as $key) {
86
+ echo ( $do_comma ) ? ', ' : '' ;
87
+ echo apply_filters('the_title_rss', $key->name);
88
+ $do_comma = true;
89
+ } ?></news:keywords>
90
+ <?php
91
+ // TODO: create the new taxonomy "Google News Genre" with some genres preset
92
+ if ( taxonomy_exists('gn_genre') && get_the_terms($post->ID,'gn_genre') ) {
93
+ ?>
94
+ <news:genres><?php
95
+ $do_comma = false;
96
+ foreach(get_the_terms($post->ID,'gn_genre') as $key) {
97
+ echo ( $do_comma ) ? ', ' : '' ;
98
+ echo apply_filters('the_title_rss', $key->name);
99
+ $do_comma = true;
100
+ } ?></news:genres>
101
+ <?php
102
+ }
103
+ ?>
104
+ </news:news>
105
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $thispostmodified_gmt, false); ?></lastmod>
106
+ <changefreq><?php
107
+ if(($lastactivityage/86400) < 1) { // last activity less than 1 day old
108
+ echo 'hourly';
109
+ } else {
110
+ echo 'daily';
111
+ } ?></changefreq>
112
+ <priority>1.0</priority>
113
+ </url>
114
+ <?php
115
+ endwhile;
116
+ else :
117
+ $lastmodified_gmt = get_lastmodified('GMT'); // last posts or page modified date
118
+ ?>
119
+ <url>
120
+ <loc><?php
121
+ // hook for filter 'xml_sitemap_url' provides a string here and MUST get a string returned
122
+ $url = apply_filters( 'xml_sitemap_url', trailingslashit(home_url()) );
123
+ if ( is_string($url) )
124
+ echo esc_url( $url );
125
+ else
126
+ echo esc_url( trailingslashit(home_url()) ); ?></loc>
127
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $lastmodified_gmt, false); ?></lastmod>
128
+ <changefreq>daily</changefreq>
129
+ <priority>1.0</priority>
130
+ </url>
131
+ <?php
132
+ endif;
133
+
134
+ // TODO see what we can do for :
135
+ //<news:access>Subscription</news:access> (for now always leave off)
136
+ // and
137
+ //<news:genres>Blog</news:genres> (for now leave up to external taxonomy plugin to set up 'gn_genre')
138
+ // http://www.google.com/support/news_pub/bin/answer.py?answer=93992
139
+
140
+ // Submit:
141
+ // http://www.google.com/support/news_pub/bin/answer.py?hl=nl&answer=74289
142
+
143
+ ?></urlset>
feed-sitemap-taxonomy.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Google News Sitemap Feed Template
4
+ *
5
+ * @package XML Sitemap Feed plugin for WordPress
6
+ */
7
+
8
+ status_header('200'); // force header('HTTP/1.1 200 OK') for sites without posts
9
+ // TODO test if we can do without it
10
+ header('Content-Type: text/xml; charset=' . get_bloginfo('charset'), true);
11
+
12
+ echo '<?xml version="1.0" encoding="'.get_bloginfo('charset').'"?>
13
+ <?xml-stylesheet type="text/xsl" href="' . plugins_url('/sitemap.xsl.php',XMLSF_PLUGIN_DIR . '/feed-sitemap.php') . '?ver=' . XMLSF_VERSION . '"?>
14
+ <!-- generated-on="'.date('Y-m-d\TH:i:s+00:00').'" -->
15
+ <!-- generator="XML & Google News Sitemap Feed plugin for WordPress" -->
16
+ <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
17
+ <!-- generator-version="'.XMLSF_VERSION.'" -->
18
+
19
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
20
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
22
+ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
23
+ ';
24
+
25
+ // PRESETS are changable -- please read comments:
26
+
27
+ $max_priority = 0.7; // Maximum priority value for any URL in the sitemap; set to any other value between 0 and 1.
28
+ $min_priority = 0.2; // Minimum priority value for any URL in the sitemap; set to any other value between 0 and 1.
29
+ // NOTE: Changing these values will influence each URL's priority. Priority values are taken by
30
+ // search engines to represent RELATIVE priority within the site domain. Forcing all URLs
31
+ // to a priority of above 0.5 or even fixing them all to 1.0 - for example - is useless.
32
+
33
+ $level_weight = 0.1; // TODO Makes a sub-term gain or loose priority for each level; set to any other value between 0 and 1.
34
+
35
+ $tax_obj = get_taxonomy(get_query_var('taxonomy'));
36
+ foreach ( $tax_obj->object_type as $post_type) {
37
+ echo "<!-- $post_type -->
38
+ ";
39
+ $_post_count = wp_count_posts($post_type);
40
+ $postcount += $_post_count->publish;
41
+ }
42
+
43
+ //$_terms_count = wp_count_terms(get_query_var('taxonomy'));
44
+ //$average_count = $_post_count->publish / $_terms_count;
45
+
46
+ $terms = get_terms( get_query_var('taxonomy'), array(
47
+ 'orderby' => 'count',
48
+ 'order' => 'DESC',
49
+ 'hierachical' => 0,
50
+ 'number' => 50000 ) );
51
+
52
+ if ( $terms ) :
53
+
54
+ foreach ( $terms as $term ) :
55
+
56
+ // calculate priority based on number of posts
57
+ // or maybe take child taxonomy terms into account.?
58
+ //pad_counts
59
+ // (boolean) If true, count all of the children along with the $terms.
60
+ // 1 (true)
61
+ // 0 (false) - Default
62
+
63
+ $priority = $min_priority + ( $term->count / ( $postcount / 2 ) );
64
+ $priority = ($priority > $max_priority) ? $max_priority : $priority;
65
+
66
+ // get the latest post in this taxonomy item, to use its post_date as lastmod
67
+ $posts = get_posts ( array(
68
+ 'numberposts' => 1,
69
+ 'no_found_rows' => true,
70
+ 'update_post_meta_cache' => false,
71
+ 'update_post_term_cache' => false,
72
+ 'update_cache' => false,
73
+ 'tax_query' => array(
74
+ array(
75
+ 'taxonomy' => $term->taxonomy,
76
+ 'field' => 'slug',
77
+ 'terms' => $term->slug
78
+ )
79
+ )
80
+ )
81
+ );
82
+ ?>
83
+ <url>
84
+ <loc><?php echo get_term_link( $term ); ?></loc>
85
+ <priority><?php echo number_format($priority,1) ?></priority>
86
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $posts[0]->post_date_gmt, false); ?></lastmod>
87
+ <changefreq><?php
88
+ $lastactivityage = (gmdate('U') - mysql2date('U', $posts[0]->post_date_gmt));
89
+ if(($lastactivityage/86400) < 1) { // last activity less than 1 day old
90
+ echo 'hourly';
91
+ } else if(($lastactivityage/86400) < 7) { // last activity less than 1 week old
92
+ echo 'daily';
93
+ } else if(($lastactivityage/86400) < 30) { // last activity between 1 week and one month old
94
+ echo 'weekly';
95
+ } else if(($lastactivityage/86400) < 365) { // last activity between 1 month and 1 year old
96
+ echo 'monthly';
97
+ } else {
98
+ echo 'yearly';
99
+ } ?></changefreq>
100
+ </url>
101
+ <?php
102
+ endforeach;
103
+ else :
104
+ ?>
105
+ <url>
106
+ <loc><?php echo esc_url( trailingslashit(home_url()) ); ?></loc>
107
+ </url>
108
+ <?php
109
+ endif;
110
+
111
+ ?></urlset>
112
+ <?php
113
+ echo '<!-- Queries executed '.get_num_queries().' | Posts total '.($_post_count->publish + $_page_count->publish);
114
+ if(function_exists('memory_get_usage'))
115
+ echo ' | Peak memory usage '.round(memory_get_peak_usage()/1024/1024,2).'M';
116
+ echo ' -->';
117
+ ?>
feed-sitemap.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
+ *
5
+ * @package XML Sitemap Feed plugin for WordPress
6
+ */
7
+
8
+ status_header('200'); // force header('HTTP/1.1 200 OK') even for sites without posts
9
+ header('Content-Type: text/xml; charset=' . get_bloginfo('charset'), true);
10
+
11
+ global $xmlsitemapfeed;
12
+ $post_type = get_query_var('post_type');
13
+
14
+ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
15
+ <?xml-stylesheet type="text/xsl" href="' . plugins_url('/sitemap.xsl.php',XMLSF_PLUGIN_DIR . '/feed-sitemap.php') . '?ver=' . XMLSF_VERSION . '"?>
16
+ <!-- generated-on="' . date('Y-m-d\TH:i:s+00:00') . '" -->
17
+ <!-- generator="XML & Google News Sitemap Feed plugin for WordPress" -->
18
+ <!-- generator-url="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" -->
19
+ <!-- generator-version="' . XMLSF_VERSION . '" -->
20
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ';
21
+ if ( $xmlsitemapfeed->do_news_tags($post_type) )
22
+ echo '
23
+ xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" ';
24
+ echo '
25
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
27
+ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd ';
28
+ if ( $xmlsitemapfeed->do_news_tags($post_type) )
29
+ echo '
30
+ http://www.google.com/schemas/sitemap-news/0.9
31
+ http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd';
32
+ echo '">
33
+ ';
34
+
35
+ // PRESETS are changable -- please read comments:
36
+
37
+ $max_priority = 0.9; // Maximum priority value for any URL in the sitemap; set to any other value between 0 and 1.
38
+ $min_priority = 0; // Minimum priority value for any URL in the sitemap; set to any other value between 0 and 1.
39
+ // NOTE: Changing these values will influence each URL's priority. Priority values are taken by
40
+ // search engines to represent RELATIVE priority within the site domain. Forcing all URLs
41
+ // to a priority of above 0.5 or even fixing them all to 1.0 - for example - is useless.
42
+ $frontpage_priority = 1.0; // Your front page priority, usually the same as max priority but if you have any reason
43
+ // to change it, please be my guest; set to any other value between 0 and 1.
44
+
45
+ $level_weight = 0.1; // Makes a sub-page gain or loose priority for each level; set to any other value between 0 and 1.
46
+ $month_weight = -0.1; // Fall-back value normally ignored by automatic priority calculation, which
47
+ // makes a post loose 10% of priority monthly; set to any other value between 0 and 1.
48
+ $firstcomment_bonus = 0.1;
49
+
50
+ // EDITING below here is NOT ADVISED!
51
+
52
+ // setup site variables
53
+ $_post_count = wp_count_posts('post');
54
+ $_page_count = wp_count_posts('page');
55
+ $_totalcommentcount = wp_count_comments();
56
+
57
+ $lastmodified_gmt = get_lastmodified('GMT'); // last posts or page modified date
58
+ $lastmodified = mysql2date('U',$lastmodified_gmt); // last posts or page modified date in Unix seconds
59
+ $firstdate = mysql2date('U',get_firstdate('GMT')); // uses new get_firstdate() function defined in xml-sitemap/hacks.php !
60
+
61
+ // calculated presets
62
+ if ($_totalcommentcount->approved > 0) {
63
+ $average_commentcount = $_totalcommentcount->approved/($_post_count->publish + $_page_count->publish);
64
+ //$comment_weight = $average_commentcount / $_totalcommentcount->approved;
65
+ } else {
66
+ //$comment_weight = 0;
67
+ $average_commentcount = 0;
68
+ }
69
+
70
+ if ( $_post_count->publish > $_page_count->publish ) { // emphasis on posts (blog)
71
+ $blogbonus = 0.4;
72
+ $sitebonus = 0;
73
+ } elseif ( $_post_count->publish==0 ) { // only pages (you're kidding... really?? old style site)
74
+ $blogbonus = 0;
75
+ $sitebonus = 0.4;
76
+ } else { // emphasis on pages (site)
77
+ $blogbonus = 0;
78
+ $sitebonus = 0.2;
79
+ }
80
+
81
+ if ( $lastmodified > $firstdate ) // valid blog age found ?
82
+ $age_weight = ($blogbonus - $min_priority) / ($firstdate - $lastmodified); // calculate relative age weight
83
+ else
84
+ $age_weight = $month_weight / 2629744 ; // if not ? malus per month (that's a month in seconds)
85
+
86
+ if ( !have_posts() || $post_type == 'page' || $post_type == 'any' || ( is_array($post_type) && in_array('page',$post_type) ) ) {
87
+ ?>
88
+ <url>
89
+ <loc><?php
90
+ // hook for filter 'xml_sitemap_url' provides a string here and MUST get a string returned
91
+ $url = apply_filters( 'xml_sitemap_url', trailingslashit(home_url()) );
92
+ if ( is_string($url) )
93
+ echo esc_url( $url );
94
+ else
95
+ echo esc_url( trailingslashit(home_url()) ); ?></loc>
96
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $lastmodified_gmt, false); ?></lastmod>
97
+ <changefreq>hourly</changefreq>
98
+ <priority>1.0</priority>
99
+ </url>
100
+ <?php
101
+ }
102
+
103
+ // loop away!
104
+ if ( have_posts() ) :
105
+ while ( have_posts() ) :
106
+ the_post();
107
+
108
+ // check if we are not dealing with an external URL :: Thanks to Francois Deschenes :)
109
+ // or if page is frontpage
110
+ if ( !preg_match('/^' . preg_quote(home_url(), '/') . '/i', get_permalink())
111
+ || $post->ID == get_option('page_on_front'))
112
+ continue;
113
+
114
+ $thispostmodified_gmt = $post->post_modified_gmt; // post GMT timestamp
115
+ $thispostmodified = mysql2date('U',$thispostmodified_gmt); // post Unix timestamp
116
+ $lastcomment = array();
117
+ $priority = 0;
118
+
119
+ if ($post->comment_count && $post->comment_count > 0) {
120
+ $lastcomment = get_comments( array(
121
+ 'status' => 'approve',
122
+ '$number' => 1,
123
+ 'post_id' => $post->ID,
124
+ ) );
125
+ $lastcommentsdate = mysql2date('U',$lastcomment[0]->comment_date_gmt); // last comment timestamp
126
+ if ( $lastcommentsdate > $thispostmodified ) {
127
+ $thispostmodified = $lastcommentsdate; // replace post with comment Unix timestamp
128
+ $thispostmodified_gmt = $lastcomment[0]->comment_date_gmt; // and replace modified GMT timestamp
129
+ }
130
+
131
+ $priority = ( $post->comment_count / ( ( $_totalcommentcount->approved / 2 ) - $average_commentcount ) ) + $firstcomment_bonus;
132
+
133
+ }
134
+
135
+ if($post->post_type == "page") {
136
+
137
+ if (!isset($post->ancestors)) {
138
+ // could use get_post_ancestors($post) but that creates an
139
+ // extra db query per sub-page so better do it ourselves...
140
+ $page_obj = $post;
141
+ $ancestors = array();
142
+ while($page_obj->post_parent!=0) {
143
+ $page_obj = get_page($page_obj->post_parent);
144
+ $ancestors[] = $page_obj->ID;
145
+ }
146
+ } else {
147
+ $ancestors = $post->ancestors;
148
+ }
149
+
150
+ $priority += (count($ancestors) * $level_weight) + $sitebonus;
151
+ } else {
152
+ if(is_sticky($post->ID))
153
+ $priority = $max_priority;
154
+ else
155
+ $priority += (($lastmodified - $thispostmodified) * $age_weight) + $blogbonus;
156
+ }
157
+
158
+
159
+ $lastactivityage = (gmdate('U') - $thispostmodified); // post age
160
+
161
+ // trim priority
162
+ $priority = ($priority > $max_priority) ? $max_priority : $priority;
163
+ $priority = ($priority < $min_priority) ? $min_priority : $priority;
164
+ ?>
165
+ <url>
166
+ <loc><?php the_permalink_rss(); ?></loc>
167
+ <?php
168
+ // Google News tags
169
+ if ( $xmlsitemapfeed->do_news_tags($post->post_type) && $post->post_date > date('Y-m-d H:i:s', strtotime('-49 hours') ) ) { ?>
170
+ <news:news>
171
+ <news:publication>
172
+ <news:name><?php
173
+ echo ( defined('XMLSF_GOOGLE_NEWS_TITLE') ) ? apply_filters('the_title_rss', XMLSF_GOOGLE_NEWS_TITLE) : bloginfo_rss('name'); ?></news:name>
174
+ <news:language><?php
175
+ $lang = reset(get_the_terms($post->ID,'language'));
176
+ // bloginfo_rss('language') returns improper format
177
+ // so using explode but that breaks chinese :°(
178
+ echo ( is_object($lang) ) ? $lang->slug : reset(explode('-', get_bloginfo_rss('language'))); ?></news:language>
179
+ </news:publication>
180
+ <news:publication_date><?php
181
+ echo mysql2date('Y-m-d\TH:i:s+00:00', $post->post_date_gmt, false); ?></news:publication_date>
182
+ <news:title><?php the_title_rss() ?></news:title>
183
+ <news:keywords><?php
184
+ $do_comma = false;
185
+ $keys_arr = get_the_category();
186
+ foreach($keys_arr as $key) {
187
+ echo ( $do_comma ) ? ', ' : '' ;
188
+ echo apply_filters('the_title_rss', $key->name);
189
+ $do_comma = true;
190
+ } ?></news:keywords>
191
+ <?php
192
+ // TODO: create the new taxonomy "Google News Genre" with some genres preset
193
+ if ( taxonomy_exists('gn_genre') && get_the_terms($post->ID,'gn_genre') ) {
194
+ ?>
195
+ <news:genres><?php
196
+ $do_comma = false;
197
+ foreach(get_the_terms($post->ID,'gn_genre') as $key) {
198
+ echo ( $do_comma ) ? ', ' : '' ;
199
+ echo apply_filters('the_title_rss', $key->name);
200
+ $do_comma = true;
201
+ } ?></news:genres>
202
+ <?php
203
+ }
204
+ ?>
205
+ </news:news>
206
+ <?php
207
+ // and lastly, set the priority to news priority level
208
+ $priority = $max_priority;
209
+ } ?>
210
+ <lastmod><?php echo mysql2date('Y-m-d\TH:i:s+00:00', $thispostmodified_gmt, false); ?></lastmod>
211
+ <changefreq><?php
212
+ if(($lastactivityage/86400) < 1) { // last activity less than 1 day old
213
+ echo 'hourly';
214
+ } else if(($lastactivityage/86400) < 7) { // last activity less than 1 week old
215
+ echo 'daily';
216
+ } else if(($lastactivityage/86400) < 30) { // last activity between 1 week and one month old
217
+ echo 'weekly';
218
+ } else if(($lastactivityage/86400) < 365) { // last activity between 1 month and 1 year old
219
+ echo 'monthly';
220
+ } else {
221
+ echo 'yearly'; // never
222
+ } ?></changefreq>
223
+ <priority><?php echo number_format($priority,1) ?></priority>
224
+ </url>
225
+ <?php
226
+ endwhile;
227
+ endif;
228
+ ?></urlset>
229
+ <?php
230
+ echo '<!-- Queries executed '.get_num_queries().' | Posts total '.($_post_count->publish + $_page_count->publish);
231
+ if(function_exists('memory_get_usage'))
232
+ echo ' | Peak memory usage '.round(memory_get_peak_usage()/1024/1024,2).'M';
233
+ echo ' -->';
234
+ ?>
hacks.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* -------------------------------------
3
+ * MISSING WORDPRESS FUNCTIONS
4
+ * ------------------------------------- */
5
+
6
+ /**
7
+ * Retrieve the date that the last page was published.
8
+ *
9
+ * The server timezone is the default and is the difference between GMT and
10
+ * server time. The 'blog' value is the date when the last post was posted. The
11
+ * 'gmt' is when the last post was posted in GMT formatted date.
12
+ *
13
+ * Variation of get_lastpostdate defined in wp-includes/post.php since 0.71
14
+ *
15
+ * @uses apply_filters() Calls 'get_lastpagedate' filter
16
+ *
17
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
18
+ * @return string The date of the last post.
19
+
20
+ if( !function_exists('get_lastpagedate') ) {
21
+ function get_lastpagedate($timezone = 'server') {
22
+ return apply_filters( 'get_lastpagedate', _get_time( $timezone, 'date', 'page' ), $timezone );
23
+ }
24
+ } */
25
+
26
+ /**
27
+ * Retrieve last page modified date depending on timezone.
28
+ *
29
+ * The server timezone is the default and is the difference between GMT and
30
+ * server time. The 'blog' value is just when the last post was modified. The
31
+ * 'gmt' is when the last post was modified in GMT time.
32
+ *
33
+ * Variation of get_lastpostmodified defined in wp-includes/post.php since 1.2.0
34
+ *
35
+ * @uses apply_filters() Calls 'get_lastpagemodified' filter
36
+ *
37
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
38
+ * @return string The date the post was last modified.
39
+
40
+ if( !function_exists('get_lastpagemodified') ) {
41
+ function get_lastpagemodified($timezone = 'server') {
42
+ $lastpagemodified = _get_time( $timezone, 'modified', 'page' );
43
+
44
+ $lastpagedate = get_lastpagedate($timezone);
45
+ if ( $lastpagedate > $lastpagemodified )
46
+ $lastpagemodified = $lastpagedate;
47
+
48
+ return apply_filters( 'get_lastpagemodified', $lastpagemodified, $timezone );
49
+ }
50
+ } */
51
+
52
+ /**
53
+ * Retrieve the date that the first post was published.
54
+ *
55
+ * The server timezone is the default and is the difference between GMT and
56
+ * server time. The 'blog' value is the date when the last post was posted. The
57
+ * 'gmt' is when the last post was posted in GMT formatted date.
58
+ *
59
+ * Reverse of get_lastpostdate defined in wp-includes/post.php since 0.71
60
+ *
61
+ * @uses apply_filters() Calls 'get_firstpostdate' filter
62
+ *
63
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
64
+ * @return string The date of the last post.
65
+
66
+ if( !function_exists('get_firstpostdate') ) {
67
+ function get_firstpostdate($timezone = 'server') {
68
+ return apply_filters( 'get_firstpostdate', _get_time( $timezone, 'date', 'post', 'first' ), $timezone );
69
+ }
70
+ } */
71
+
72
+ /**
73
+ * Retrieve the date that the first page was published.
74
+ *
75
+ * The server timezone is the default and is the difference between GMT and
76
+ * server time. The 'blog' value is the date when the last post was posted. The
77
+ * 'gmt' is when the last post was posted in GMT formatted date.
78
+ *
79
+ * Adaptation of get_firstpostdate defined in this file
80
+ *
81
+ * @uses apply_filters() Calls 'get_firstpagedate' filter
82
+ *
83
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
84
+ * @return string The date of the last post.
85
+
86
+ if( !function_exists('get_firstpagedate') ) {
87
+ function get_firstpagedate($timezone = 'server') {
88
+ return apply_filters( 'get_firstpagedate', _get_time( $timezone, 'date', 'page', 'first' ), $timezone );
89
+ }
90
+ } */
91
+
92
+ /**
93
+ * Retrieve first post modified date depending on timezone.
94
+ *
95
+ * The server timezone is the default and is the difference between GMT and
96
+ * server time. The 'blog' value is the date when the last post was posted. The
97
+ * 'gmt' is when the last post was posted in GMT formatted date.
98
+ *
99
+ * Reverse of get_lastpostmodified defined in wp-includes/post.php since WP 1.2.0
100
+ *
101
+ * @uses apply_filters() Calls 'get_firstpostmodified' filter
102
+ *
103
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
104
+ * @return string The date of the oldest modified post.
105
+
106
+ if( !function_exists('get_firstpostmodified') ) {
107
+ function get_firstpostmodified($timezone = 'server') {
108
+ $firstpostmodified = _get_time( $timezone, 'modified', 'post', 'first' );
109
+
110
+ $firstpostdate = get_firstpostdate($timezone);
111
+ if ( $firstpostdate > $firstpostmodified )
112
+ $firstpostmodified = $firstpostdate;
113
+
114
+ return apply_filters( 'get_firstpostmodified', $firstpostmodified, $timezone );
115
+ }
116
+ } */
117
+
118
+ /**
119
+ * Retrieve first page modified date depending on timezone.
120
+ *
121
+ * The server timezone is the default and is the difference between GMT and
122
+ * server time. The 'blog' value is the date when the last post was posted. The
123
+ * 'gmt' is when the last post was posted in GMT formatted date.
124
+ *
125
+ * Variation of get_firstpostmodified defined in this file
126
+ *
127
+ * @uses apply_filters() Calls 'get_firstpagemodified' filter
128
+ *
129
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
130
+ * @return string The date of the oldest modified page.
131
+
132
+ if( !function_exists('get_firstpagemodified') ) {
133
+ function get_firstpagemodified($timezone = 'server') {
134
+ $firstpagemodified = _get_time( $timezone, 'modified', 'page', 'first' );
135
+
136
+ $firstpagedate = get_firstpagedate($timezone);
137
+ if ( $firstpagedate > $firstpagemodified )
138
+ $firstpagemodified = $firstpagedate;
139
+
140
+ return apply_filters( 'get_firstpagemodified', $firstpagemodified, $timezone );
141
+ }
142
+ } */
143
+
144
+ /**
145
+ * Retrieve the date that the first post/page was published.
146
+ *
147
+ * The server timezone is the default and is the difference between GMT and
148
+ * server time. The 'blog' value is the date when the last post was posted. The
149
+ * 'gmt' is when the last post was posted in GMT formatted date.
150
+ *
151
+ * @uses apply_filters() Calls 'get_firstdate' filter
152
+ *
153
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
154
+ * @param string $post_type Post type to check.
155
+ * @return string The date of the last post.
156
+ */
157
+ if( !function_exists('get_firstdate') ) {
158
+ function get_firstdate($timezone = 'server', $post_type = 'any') {
159
+ return apply_filters( 'get_firstdate', _get_time( $timezone, 'date', $post_type, 'first' ), $timezone );
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Retrieve first post/page modified date depending on timezone.
165
+ *
166
+ * The server timezone is the default and is the difference between GMT and
167
+ * server time. The 'blog' value is the date when the last post was posted. The
168
+ * 'gmt' is when the last post was posted in GMT formatted date.
169
+ *
170
+ * @uses apply_filters() Calls 'get_firstmodified' filter
171
+ *
172
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
173
+ * @return string The date of the oldest modified post or page.
174
+
175
+ if( !function_exists('get_firstmodified') ) {
176
+ function get_firstmodified($timezone = 'server') {
177
+ $firstmodified = _get_time( $timezone, 'modified', 'any', 'first' );
178
+
179
+ $firstdate = get_firstdate($timezone);
180
+ if ( $firstdate > $firstmodified )
181
+ $firstmodified = $firstdate;
182
+
183
+ return apply_filters( 'get_firstmodified', $firstmodified, $timezone );
184
+ }
185
+ } */
186
+
187
+ /**
188
+ * Retrieve the date that the last post/page was published.
189
+ *
190
+ * The server timezone is the default and is the difference between GMT and
191
+ * server time. The 'blog' value is the date when the last post was posted. The
192
+ * 'gmt' is when the last post was posted in GMT formatted date.
193
+ *
194
+ * @uses apply_filters() Calls 'get_lastdate' filter
195
+ *
196
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
197
+ * @return string The date of the last post.
198
+ */
199
+ if( !function_exists('get_lastdate') ) {
200
+ function get_lastdate($timezone = 'server', $post_type = 'any') {
201
+ return apply_filters( 'get_lastdate', _get_time( $timezone, 'date', $post_type ), $timezone );
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Retrieve last post/page modified date depending on timezone.
207
+ *
208
+ * The server timezone is the default and is the difference between GMT and
209
+ * server time. The 'blog' value is the date when the last post was posted. The
210
+ * 'gmt' is when the last post was posted in GMT formatted date.
211
+ *
212
+ * @uses apply_filters() Calls 'get_lastmodified' filter
213
+ *
214
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
215
+ * @return string The date of the oldest modified post.
216
+ */
217
+ if( !function_exists('get_lastmodified') ) {
218
+ function get_lastmodified($timezone = 'server', $post_type = 'any') {
219
+ $lastmodified = _get_time( $timezone, 'modified', $post_type );
220
+
221
+ $lastdate = get_lastdate($timezone, $post_type);
222
+ if ( $lastdate > $lastmodified )
223
+ $lastmodified = $lastdate;
224
+
225
+ return apply_filters( 'get_lastmodified', $lastmodified, $timezone );
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Retrieve first or last post type date data based on timezone.
231
+ * Variation of function _get_last_post_time
232
+ *
233
+ * @access private
234
+ *
235
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
236
+ * @param string $field Field to check. Can be 'date' or 'modified'.
237
+ * @param string $post_type Post type to check. Defaults to 'any'.
238
+ * @param string $which Which to check. Can be 'first' or 'last'. Defaults to 'last'.
239
+ * @return string The date.
240
+ */
241
+ if( !function_exists('_get_time') ) {
242
+ function _get_time( $timezone, $field, $post_type = 'any', $which = 'last' ) {
243
+ global $wpdb;
244
+
245
+ if ( !in_array( $field, array( 'date', 'modified' ) ) )
246
+ return false;
247
+
248
+ $timezone = strtolower( $timezone );
249
+
250
+ $order = ( $which == 'last' ) ? 'DESC' : 'ASC';
251
+
252
+ $key = ( $post_type == 'any' ) ? "{$which}post{$field}:$timezone" : "{$which}posttype{$post_type}{$field}:$timezone";
253
+
254
+ $date = wp_cache_get( $key, 'timeinfo' );
255
+
256
+ if ( !$date ) {
257
+ $add_seconds_server = date('Z');
258
+
259
+ if ( $post_type == 'any' ) {
260
+ $post_types = get_post_types( array( 'public' => true ) );
261
+ array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) );
262
+ $post_types = "'" . implode( "', '", $post_types ) . "'";
263
+ } elseif ( is_array($post_type) ) {
264
+ $types = get_post_types( array( 'public' => true ) );
265
+ foreach ( $post_type as $type )
266
+ if ( !in_array( $type, $types ) )
267
+ return false;
268
+ array_walk( $post_type, array( &$wpdb, 'escape_by_ref' ) );
269
+ $post_types = "'" . implode( "', '", $post_type ) . "'";
270
+ } else {
271
+ if ( !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) )
272
+ return false;
273
+ $post_types = "'" . addslashes($post_type) . "'";
274
+ }
275
+
276
+ switch ( $timezone ) {
277
+ case 'gmt':
278
+ $date = $wpdb->get_var("SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt {$order} LIMIT 1");
279
+ break;
280
+ case 'blog':
281
+ $date = $wpdb->get_var("SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt {$order} LIMIT 1");
282
+ break;
283
+ case 'server':
284
+ $date = $wpdb->get_var("SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt {$order} LIMIT 1");
285
+ break;
286
+ }
287
+
288
+ if ( $date )
289
+ wp_cache_set( $key, $date, 'timeinfo' );
290
+ }
291
+
292
+ return $date;
293
+ }
294
+ }
295
+
296
+ /* By gunter [dot] sammet [at] gmail [dot] com http://www.php.net/manual/en/function.htmlentities.php#88169 */
297
+ $entity_custom_from = false;
298
+ $entity_custom_to = false;
299
+ function html_entity_decode_encode_rss($data) {
300
+ global $entity_custom_from, $entity_custom_to;
301
+
302
+ if(!is_array($entity_custom_from) || !is_array($entity_custom_to)) {
303
+ $array_position = 0;
304
+ foreach (get_html_translation_table(HTML_ENTITIES) as $key => $value) {
305
+ switch ($value) {
306
+ case '&nbsp;':
307
+ break;
308
+ case '&gt;':
309
+ case '&lt;':
310
+ case '&quot;':
311
+ case '&apos;':
312
+ case '&amp;':
313
+ $entity_custom_from[$array_position] = $key;
314
+ $entity_custom_to[$array_position] = $value;
315
+ $array_position++;
316
+ break;
317
+ default:
318
+ $entity_custom_from[$array_position] = $value;
319
+ $entity_custom_to[$array_position] = $key;
320
+ $array_position++;
321
+ }
322
+ }
323
+ }
324
+ return str_replace($entity_custom_from, $entity_custom_to, $data);
325
+ }
326
+
models/class-xmlsitemapfeed.php DELETED
@@ -1,276 +0,0 @@
1
- <?php
2
-
3
- class XMLSitemapFeed {
4
-
5
- /**
6
- * Defaults
7
- * @var array
8
- */
9
- private $defaults = array();
10
-
11
- /**
12
- * News defaults
13
- * @var array
14
- */
15
- public $default_news_tags = array(
16
- 'name' => '',
17
- 'post_type' => array('post'),
18
- 'categories' => ''
19
- );
20
-
21
- /**
22
- * Front pages
23
- *
24
- * @var null/array $frontpages
25
- */
26
- public $frontpages = null;
27
-
28
- /**
29
- * Signifies whether the request has been filtered.
30
- * @var bool
31
- */
32
- public $request_filtered = false;
33
-
34
- /**
35
- * Signifies whether the current query is for a sitemap feed.
36
- * @var bool
37
- */
38
- public $is_sitemap = false;
39
-
40
- /**
41
- * Signifies whether the current query is for a news feed.
42
- * @var bool
43
- */
44
- public $is_news = false;
45
-
46
- /**
47
- * Default language
48
- * @var null/string $blog_language
49
- */
50
- public $blog_language = null;
51
-
52
- /**
53
- * Allowed domain names
54
- *
55
- * @var null|array $domains
56
- */
57
- private $domains = null;
58
-
59
- /**
60
- * Site public scheme
61
- *
62
- * @var string $domain
63
- */
64
- private $scheme;
65
-
66
- /**
67
- * Are we using plain permalinks
68
- *
69
- * @var bool $plain_permalinks
70
- */
71
- private $plain_permalinks = null;
72
-
73
- /**
74
- * Excluded taxonomies
75
- *
76
- * post format taxonomy is disabled
77
- * @var array
78
- */
79
- private $disabled_taxonomies = array(
80
- 'post_format',
81
- 'product_shipping_class'
82
- );
83
-
84
- /**
85
- * Maximum number of posts in any taxonomy term
86
- *
87
- * @var null/int $taxonomy_termmaxposts
88
- */
89
- public $taxonomy_termmaxposts = null;
90
-
91
- /**
92
- * Unix last modified date
93
- *
94
- * @var int $lastmodified
95
- */
96
- public $lastmodified;
97
-
98
- /**
99
- * Unix time spanning first post date and last modified date
100
- *
101
- * @var int $timespan
102
- */
103
- public $timespan = 0;
104
-
105
- /**
106
- * Post type total approved comment count
107
- *
108
- * @var int $comment_count
109
- */
110
- public $comment_count = 0;
111
-
112
- /**
113
- * Blog pages
114
- *
115
- * @var null/array $blogpages
116
- */
117
- public $blogpages = null;
118
-
119
- /**
120
- * METHODS
121
- */
122
-
123
- /**
124
- * Constructor
125
- * @return void
126
- */
127
- function __construct() {}
128
-
129
- /**
130
- * Default options
131
- *
132
- * @param $key
133
- * @return array
134
- */
135
- public function defaults( $key = false )
136
- {
137
- if ( empty($this->defaults) ) :
138
-
139
- // sitemaps
140
- $sitemaps = ( '1' !== get_option('blog_public') ) ? '' : array(
141
- 'sitemap' => 'sitemap.xml'
142
- );
143
-
144
- $this->defaults = array(
145
- 'sitemaps' => $sitemaps,
146
- 'post_types' => array(
147
- 'post' => array(
148
- 'active' => '1',
149
- 'archive' => 'yearly',
150
- 'priority' => '0.7',
151
- 'dynamic_priority' => '',
152
- 'tags' => array(
153
- 'image' => 'featured'
154
- /*'video' => ''*/
155
- )
156
- ),
157
- 'page' => array(
158
- 'active' => '1',
159
- 'priority' => '0.5',
160
- 'dynamic_priority' => '',
161
- 'tags' => array(
162
- 'image' => 'attached'
163
- /*'video' => ''*/
164
- )
165
- )
166
- ),
167
- 'taxonomies' => '',
168
- 'taxonomy_settings' => array(
169
- 'active' => '',
170
- 'priority' => '0.3',
171
- 'dynamic_priority' => '',
172
- 'term_limit' => '3000'
173
- ),
174
- 'authors' => '',
175
- 'author_settings' => array(
176
- 'active' => '1',
177
- 'priority' => '0.3',
178
- 'term_limit' => '1000'
179
- ),
180
- 'ping' => array(
181
- 'google',
182
- 'bing'
183
- ),
184
- 'robots' => '',
185
- 'urls' => '',
186
- 'custom_sitemaps' => '',
187
- 'domains' => ''
188
- );
189
-
190
- endif;
191
-
192
- if ( $key ) {
193
- $return = ( isset($this->defaults[$key]) ) ? $this->defaults[$key] : '';
194
- } else {
195
- $return = $this->defaults;
196
- }
197
-
198
- return apply_filters( 'xmlsf_defaults', $return, $key );
199
- }
200
-
201
- /**
202
- * Get domain
203
- * @return string
204
- */
205
- public function get_allowed_domains()
206
- {
207
- // allowed domain
208
- if ( null === $this->domains ) {
209
-
210
- $host = parse_url( home_url(), PHP_URL_HOST );
211
-
212
- $this->domains = ( !empty($host) ) ? (array) $host : array();
213
-
214
- $domains = get_option('xmlsf_domains');
215
-
216
- if ( !empty( $domains ) )
217
- $this->domains = array_merge( $this->domains, (array) $domains );
218
- }
219
-
220
- return $this->domains;
221
- }
222
-
223
- /**
224
- * Whether or not to use plain permalinks
225
- * Used for sitemap index and admin page
226
- *
227
- * @return bool
228
- */
229
- public function plain_permalinks()
230
- {
231
- if ( null === $this->plain_permalinks ) {
232
- $permalink_structure = get_option('permalink_structure');
233
- $this->plain_permalinks = ('' == $permalink_structure || 0 === strpos($permalink_structure,'/index.php') ) ? true : false;
234
- }
235
- return $this->plain_permalinks;
236
- }
237
-
238
- /**
239
- * Get scheme
240
- * @return string
241
- */
242
- public function blog_language()
243
- {
244
- if ( $this->blog_language === null ) {
245
- // get site language for default language
246
- $this->blog_language = xmlsf_parse_language_string( get_bloginfo('language') );
247
- }
248
-
249
- return $this->blog_language;
250
- }
251
-
252
- /**
253
- * Get scheme
254
- * @return string
255
- */
256
- public function scheme()
257
- {
258
- // scheme to use
259
- if ( empty($this->scheme) ) {
260
- $scheme = parse_url( home_url(), PHP_URL_SCHEME );
261
- $this->scheme = $scheme ? $scheme : 'http';
262
- }
263
-
264
- return $this->scheme;
265
- }
266
-
267
- /**
268
- * Get disabled taxonomies
269
- * @return array
270
- */
271
- public function disabled_taxonomies()
272
- {
273
- return apply_filters( 'xmlsf_disabled_taxonomies', $this->disabled_taxonomies );
274
- }
275
-
276
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/class.xmlsf-admin-sitemap-news-sanitize.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- class XMLSF_Admin_Sitemap_News_Sanitize
4
- {
5
- public static function news_tags_settings( $new )
6
- {
7
- $sanitized = is_array( $new ) ? $new : array();
8
-
9
- // at least one, default post type
10
- if ( empty( $sanitized['post_type'] ) || !is_array( $sanitized['post_type'] ) ) {
11
- $sanitized['post_type'] = array('post');
12
- }
13
-
14
- // if there are categories selected, then test
15
- // if we have post types selected that do not use the post category taxonomy
16
- if ( !empty( $sanitized['categories'] ) ) {
17
- global $wp_taxonomies;
18
- $post_types = ( isset( $wp_taxonomies['category'] ) ) ? $wp_taxonomies['category']->object_type : array();
19
-
20
- $disabled = false;
21
- foreach ( $sanitized['post_type'] as $post_type ) {
22
- if ( !in_array( $post_type, $post_types ) ) {
23
- $disabled = true;
24
- break;
25
- }
26
- }
27
- // suppress category selection
28
- if ( $disabled )
29
- unset( $sanitized['categories'] );
30
- }
31
-
32
- return $sanitized;
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/class.xmlsf-admin-sitemap-sanitize.php DELETED
@@ -1,171 +0,0 @@
1
- <?php
2
-
3
- class XMLSF_Admin_Sitemap_Sanitize
4
- {
5
- public static function taxonomies( $new )
6
- {
7
- $old = get_option( 'xmlsf_taxonomies' );
8
- if ( empty( $old ) ) $old = array();
9
- $diff = array_diff( (array) $old, (array) $new );
10
- if ( ! empty( $diff ) ) {
11
- global $wpdb;
12
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
13
- }
14
-
15
- return $new;
16
- }
17
-
18
- public static function taxonomy_settings( $new )
19
- {
20
- setlocale( LC_NUMERIC, 'C' );
21
-
22
- $sanitized = array();
23
-
24
- $sanitized['active'] = !empty($new['active']) ? '1' : '';
25
- $sanitized['priority'] = isset($new['priority']) ? xmlsf_sanitize_priority( str_replace( ',', '.', $new['priority'] ), .1, .9 ) : '0.3';
26
- $sanitized['dynamic_priority'] = !empty($new['dynamic_priority']) ? '1' : '';
27
- $sanitized['term_limit'] = isset($new['term_limit']) ? intval($new['term_limit']) : 5000;
28
- if ( $sanitized['term_limit'] < 1 || $sanitized['term_limit'] > 50000 ) $sanitized['term_limit'] = 50000;
29
-
30
- // clear term meta cache if deactivating...
31
- if ( empty($sanitized['active']) ) {
32
- $old = (array) get_option( 'xmlsf_taxonomy_settings', array() );
33
- if ( ! empty($old['active']) ) {
34
- global $wpdb;
35
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
36
- }
37
- }
38
-
39
- return $sanitized;
40
- }
41
-
42
- public static function author_settings( $new )
43
- {
44
- setlocale( LC_NUMERIC, 'C' );
45
-
46
- $sanitized = array();
47
-
48
- $sanitized['active'] = !empty($new['active']) ? '1' : '';
49
- $sanitized['priority'] = isset($new['priority']) ? xmlsf_sanitize_priority( str_replace( ',', '.', $new['priority'] ), .1, .9 ) : '0.3';
50
- $sanitized['dynamic_priority'] = !empty($new['dynamic_priority']) ? '1' : '';
51
- $sanitized['term_limit'] = isset($new['term_limit']) ? intval($new['term_limit']) : 5000;
52
- if ( $sanitized['term_limit'] < 1 || $sanitized['term_limit'] > 50000 ) $sanitized['term_limit'] = 50000;
53
-
54
- // clear user meta cache if deactivating...
55
- /* if ( empty($sanitized['active']) ) {
56
- $old = (array) get_option( 'xmlsf_taxonomy_settings', array() );
57
- if ( ! empty($old['active']) ) {
58
- global $wpdb;
59
- $wpdb->delete( $wpdb->prefix.'usermeta', array( 'meta_key' => 'last_published_date_gmt' ) );
60
- }
61
- }
62
- */
63
- return $sanitized;
64
- }
65
-
66
- public static function post_types_settings( $new = array() )
67
- {
68
- $sanitized = is_array($new) ? $new : array();
69
-
70
- $old = (array) get_option( 'xmlsf_post_types', array() );
71
- $clear_images = false;
72
- $clear_comments = false;
73
-
74
- foreach ( $sanitized as $post_type => $settings ) {
75
- setlocale( LC_NUMERIC, 'C' );
76
- $sanitized[$post_type]['priority'] = isset($settings['priority']) ? xmlsf_sanitize_priority( str_replace( ',', '.', $settings['priority'] ), .1, .9 ) : '0.5';
77
-
78
- // poll for changes that warrant clearing meta data
79
- if ( isset($old[$post_type]) && is_array($old[$post_type]) ) {
80
-
81
- if ( empty($settings['active']) ) {
82
- if ( !empty($old[$post_type]['active']) ) {
83
- $clear_images = true;
84
- $clear_comments = true;
85
- }
86
- } else {
87
- if ( isset($old[$post_type]['tags']) && is_array($old[$post_type]['tags']) && isset($old[$post_type]['tags']['image']) && $old[$post_type]['tags']['image'] != $settings['tags']['image'] ) {
88
- $clear_images = true;
89
- }
90
- if ( ! empty($old[$post_type]['update_lastmod_on_comments']) && empty($settings['update_lastmod_on_comments']) ) {
91
- $clear_comments = true;
92
- }
93
- }
94
-
95
- }
96
- }
97
-
98
- global $wpdb;
99
-
100
- // clear images meta caches...
101
- if ( $clear_images ) {
102
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_attached' ) );
103
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_featured' ) );
104
- update_option( 'xmlsf_images_meta_primed', array() );
105
- }
106
-
107
- // clear comments meta caches...
108
- if ( $clear_comments ) {
109
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date_gmt' ) );
110
- update_option( 'xmlsf_comments_meta_primed', array() );
111
- }
112
-
113
- return $sanitized;
114
- }
115
-
116
- public static function custom_sitemaps_settings( $new )
117
- {
118
- // clean up input
119
- if ( is_array( $new ) ) {
120
- $new = array_filter($new);
121
- $new = reset($new);
122
- }
123
-
124
- if ( empty($new) )
125
- return '';
126
-
127
- // build sanitized output
128
- $input = explode( PHP_EOL, sanitize_textarea_field( $new ) );
129
- $sanitized = array();
130
- foreach ( $input as $line ) {
131
- $line = filter_var( esc_url( trim( $line ) ), FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED );
132
- if ( ! empty( $line ) )
133
- $sanitized[] = $line;
134
- }
135
-
136
- return !empty($sanitized) ? $sanitized : '';
137
- }
138
-
139
- public static function custom_urls_settings( $new )
140
- {
141
- // clean up input
142
- if ( is_array( $new ) ) {
143
- $new = array_filter($new);
144
- $new = reset($new);
145
- }
146
-
147
- if ( empty($new) )
148
- return '';
149
-
150
- $input = explode( PHP_EOL, strip_tags( $new ) );
151
-
152
- // build sanitized output
153
- $sanitized = array();
154
- foreach ( $input as $line ) {
155
- if ( empty( $line ) )
156
- continue;
157
-
158
- $arr = explode( " ", trim( $line ) );
159
-
160
- $url = filter_var( esc_url( trim( $arr[0] ) ), FILTER_VALIDATE_URL );
161
-
162
- if ( !empty( $url ) ) {
163
- setlocale( LC_NUMERIC, 'C' );
164
- $priority = isset( $arr[1] ) ? xmlsf_sanitize_priority( str_replace( ',', '.', $arr[1] ) ) : '0.5';
165
- $sanitized[] = array( $url, $priority );
166
- }
167
- }
168
-
169
- return !empty($sanitized) ? $sanitized : '';
170
- }
171
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.admin.php DELETED
@@ -1,125 +0,0 @@
1
- <?php
2
-
3
- // plugin action links
4
-
5
- function xmlsf_add_action_link( $links ) {
6
- $settings_link = '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Settings') . '</a>';
7
- array_unshift( $links, $settings_link );
8
- return $links;
9
- }
10
-
11
- function xmlsf_plugin_meta_links( $links, $file ) {
12
- if ( $file == XMLSF_BASENAME ) {
13
- $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/xml-sitemap-feed/">' . __('Support','xml-sitemap-feed') . '</a>';
14
- $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/xml-sitemap-feed/reviews/?filter=5#new-post">' . __('Rate ★★★★★','xml-sitemap-feed') . '</a>';
15
- }
16
- return $links;
17
- }
18
-
19
- // verification
20
-
21
- function xmlsf_verify_nonce( $context ) {
22
-
23
- if ( isset( $_POST['_xmlsf_'.$context.'_nonce'] ) && wp_verify_nonce( $_POST['_xmlsf_'.$context.'_nonce'], XMLSF_BASENAME.'-'.$context ) )
24
- return true;
25
-
26
- // Still here? Then add security check failed error message and return false.
27
- add_settings_error( 'security_check_failed', 'security_check_failed', translate('Security check failed.') /* . ' Context: '. $context */ );
28
-
29
- return false;
30
- }
31
-
32
- // sanitization
33
-
34
- class XMLSF_Admin_Sanitize
35
- {
36
-
37
- public static function sitemaps_settings( $new )
38
- {
39
- if ( '1' !== get_option('blog_public') ) {
40
- return '';
41
- }
42
-
43
- $old = get_option( 'xmlsf_sitemaps' );
44
- $sanitized = array();
45
-
46
- if ( $old !== $new ) {
47
- // when sitemaps are added or removed, set transients
48
- set_transient('xmlsf_flush_rewrite_rules','');
49
- set_transient('xmlsf_check_static_files','');
50
-
51
- // switched on news sitemap
52
- if ( !empty($new['sitemap-news']) && empty($old['sitemap-news'] ) ) {
53
- // check news tag settings
54
- if ( !get_option( 'xmlsf_news_tags' ) ) {
55
- add_option( 'xmlsf_news_tags', xmlsf()->default_news_tags );
56
- }
57
- }
58
- }
59
-
60
- if ( !empty($new['sitemap']) ) {
61
- $sanitized['sitemap'] = apply_filters( 'xmlsf_sitemap_filename', $new['sitemap'] );
62
- }
63
-
64
- if ( !empty($new['sitemap-news']) ) {
65
- $sanitized['sitemap-news'] = apply_filters( 'xmlsf_sitemap_news_filename', $new['sitemap-news'] );
66
- }
67
-
68
- return $sanitized;
69
- }
70
-
71
- public static function domains_settings( $new )
72
- {
73
- $default = parse_url( home_url(), PHP_URL_HOST );
74
-
75
- // clean up input
76
- if(is_array($new)) {
77
- $new = array_filter($new);
78
- $new = reset($new);
79
- }
80
- $input = $new ? explode( PHP_EOL, strip_tags( $new ) ) : array();
81
-
82
- // build sanitized output
83
- $sanitized = array();
84
- foreach ($input as $line) {
85
- $line = trim($line);
86
- $parsed_url = parse_url( trim( filter_var( $line, FILTER_SANITIZE_URL ) ) );
87
- // Before PHP version 5.4.7, parse_url will return the domain as path when scheme is omitted so we do:
88
- if ( !empty($parsed_url['host']) ) {
89
- $domain = trim( $parsed_url['host'] );
90
- } else {
91
- $domain_arr = explode('/', $parsed_url['path']);
92
- $domain_arr = array_filter($domain_arr);
93
- $domain = array_shift( $domain_arr );
94
- $domain = trim( $domain );
95
- }
96
-
97
- // filter out empties and default domain
98
- if(!empty($domain) && $domain !== $default && strpos($domain,".".$default) === false)
99
- $sanitized[] = $domain;
100
- }
101
-
102
- return (!empty($sanitized)) ? $sanitized : '';
103
- }
104
-
105
- public static function ping_settings( $new )
106
- {
107
- return is_array($new) ? $new : array();
108
- }
109
-
110
- public static function robots_settings( $new )
111
- {
112
- $old = get_option('xmlsf_robots');
113
-
114
- // clean up input
115
- if ( is_array( $new ) ) {
116
- $new = array_filter( $new );
117
- $new = reset( $new );
118
- }
119
-
120
- if ( empty($old) && !empty($new) )
121
- set_transient('xmlsf_check_static_files','');
122
-
123
- return strip_tags( $new );
124
- }
125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Get instantiated sitemap class
5
- *
6
- * @since 5.0
7
- * @global XMLSitemapFeed $xmlsf
8
- * @return XMLSitemapFeed object
9
- */
10
- function xmlsf() {
11
- global $xmlsf;
12
-
13
- if ( ! isset( $xmlsf ) ) {
14
- if ( ! class_exists( 'XMLSitemapFeed' ) )
15
- require XMLSF_DIR . '/models/class-xmlsitemapfeed.php';
16
-
17
- $xmlsf = new XMLSitemapFeed();
18
- }
19
-
20
- return $xmlsf;
21
- }
22
-
23
- /**
24
- * Add sitemap rewrite rules
25
- *
26
- * @global object $wp_rewrite
27
- * @param array $rewrite_rules
28
- * @return array $rewrite_rules
29
- */
30
- function xmlsf_rewrite_rules( $rewrite_rules ) {
31
- global $wp_rewrite;
32
-
33
- $sitemaps = get_option( 'xmlsf_sitemaps' );
34
-
35
- if ( isset($sitemaps['sitemap']) ) {
36
- /* One rule to ring them all */
37
- //add_rewrite_rule('sitemap(-[a-z0-9_\-]+)?\.([0-9]+\.)?xml$', $wp_rewrite->index . '?feed=sitemap$matches[1]&m=$matches[2]', 'top');
38
- return array_merge( array( 'sitemap(?:_index)?(\-[a-z0-9\-_]+)?(\.[0-9]+)?\.xml(\.gz)?$' => $wp_rewrite->index . '?feed=sitemap$matches[1]$matches[3]&m=$matches[2]' ), $rewrite_rules );
39
- } elseif ( isset($sitemaps['sitemap-news']) ) {
40
- //add_rewrite_rule('sitemap-news\.xml$', $wp_rewrite->index . '?feed=sitemap-news', 'top');
41
- return array_merge( array( 'sitemap-news\.xml(\.gz)?$' => $wp_rewrite->index . '?feed=sitemap-news$matches[1]' ), $rewrite_rules );
42
- }
43
-
44
- return $rewrite_rules;
45
- }
46
-
47
- /**
48
- * Filter robots.txt rules
49
- *
50
- * @param $output
51
- * @return string
52
- */
53
- function xmlsf_robots_txt( $output ) {
54
- $url = trailingslashit( get_bloginfo('url') );
55
-
56
- $sitemaps = get_option( 'xmlsf_sitemaps' );
57
-
58
- // PRE
59
- $pre = '# XML Sitemap & Google News version ' . XMLSF_VERSION . ' - https://status301.net/wordpress-plugins/xml-sitemap-feed/' . PHP_EOL;
60
- if ( '1' != get_option('blog_public') )
61
- $pre .= '# XML Sitemaps are disabled because of this site\'s privacy settings.' . PHP_EOL;
62
- elseif( !is_array($sitemaps) || empty( $sitemaps ) )
63
- $pre .= '# No XML Sitemaps are enabled on this site.' . PHP_EOL;
64
- else
65
- foreach ( $sitemaps as $pretty )
66
- $pre .= 'Sitemap: ' . $url . $pretty . PHP_EOL;
67
- $pre .= PHP_EOL;
68
-
69
- // DEFAULT
70
- if ( substr($output, -1) !== PHP_EOL ) $output .= PHP_EOL;
71
-
72
- // POST
73
- $post = get_option('xmlsf_robots');
74
- if ( $post !== '' ) $post .= PHP_EOL;
75
-
76
- return $pre . $output . $post;
77
- }
78
-
79
- /* -------------------------------------
80
- * CONDITIONAL FUNCTIONS
81
- * ------------------------------------- */
82
-
83
- /**
84
- * Is the query for a sitemap?
85
- *
86
- * @since 4.8
87
- * @return bool
88
- */
89
- function is_sitemap() {
90
- global $xmlsf;
91
- if ( ! is_object( $xmlsf ) || $xmlsf->request_filtered === false ) {
92
- _doing_it_wrong( __FUNCTION__, __( 'Conditional sitemap tags do not work before the sitemap request filter is run. Before then, they always return false.', 'xml-sitemap-feed' ), '4.8' );
93
- return false;
94
- }
95
- return $xmlsf->is_sitemap;
96
- }
97
-
98
- /**
99
- * Is the query for a news sitemap?
100
- *
101
- * @since 4.8
102
- * @return bool
103
- */
104
- function is_news() {
105
- global $xmlsf;
106
- if ( ! is_object( $xmlsf ) || $xmlsf->request_filtered === false ) {
107
- _doing_it_wrong( __FUNCTION__, __( 'Conditional sitemap tags do not work before the sitemap request filter is run. Before then, they always return false.', 'xml-sitemap-feed' ), '4.8' );
108
- return false;
109
- }
110
- return $xmlsf->is_news;
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.public-shared.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Response headers filter
5
- * Does not check if we are really in a sitemap feed.
6
- *
7
- * @param $headers
8
- *
9
- * @return array
10
- */
11
- function xmlsf_headers( $headers ) {
12
- // Force status 200.
13
- $headers['Status'] = '200';
14
-
15
- // Set noindex.
16
- $headers['X-Robots-Tag'] = 'noindex, follow';
17
-
18
- // Force content type
19
- $headers['Content-Type'] = 'application/xml; charset=' . get_bloginfo('charset');
20
-
21
- // And return, merged with nocache headers
22
- return array_merge( $headers, wp_get_nocache_headers() );
23
- }
24
-
25
- /**
26
- * Get absolute URL
27
- * Converts path or protocol relative URLs to absolute ones.
28
- *
29
- * @param string $url
30
- *
31
- * @return string|bool
32
- */
33
- function xmlsf_get_absolute_url( $url = false ) {
34
- // have a string or return false
35
- if ( empty( $url ) || ! is_string( $url ) ) {
36
- return false;
37
- }
38
-
39
- // check for scheme
40
- if ( strpos( $url, 'http' ) !== 0 ) {
41
- // check for relative url path
42
- if ( strpos( $url, '//' ) !== 0 ) {
43
- return ( strpos( $url, '/' ) === 0 ) ? untrailingslashit( home_url() ) . $url : trailingslashit( home_url() ) . $url;
44
- }
45
- return xmlsf()->scheme() . ':' . $url;
46
- }
47
-
48
- return $url;
49
- }
50
-
51
- /**
52
- * Is allowed domain
53
- *
54
- * @param $url
55
- *
56
- * @return mixed|void
57
- */
58
- function xmlsf_is_allowed_domain( $url ) {
59
-
60
- $domains = xmlsf()->get_allowed_domains();
61
-
62
- $return = false;
63
- $parsed_url = parse_url($url);
64
-
65
- if (isset($parsed_url['host'])) {
66
- foreach ( $domains as $domain ) {
67
- if ( $parsed_url['host'] == $domain || strpos($parsed_url['host'],'.'.$domain) !== false ) {
68
- $return = true;
69
- break;
70
- }
71
- }
72
- }
73
-
74
- return apply_filters( 'xmlsf_allowed_domain', $return, $url );
75
- }
76
-
77
-
78
- /**
79
- * Polylang compatibility hooked into xml request filter
80
- *
81
- * @param array $request
82
- *
83
- * @return array
84
- */
85
- function xmlsf_polylang_request( $request ) {
86
-
87
- if ( function_exists('pll_languages_list') ) {
88
- $request['lang'] = 'all'; // | 'all' | implode( ',', pll_languages_list() );
89
- // prevent language redirections
90
- add_filter( 'pll_check_canonical_url', '__return_false' );
91
- }
92
-
93
- return $request;
94
- }
95
- add_filter( 'xmlsf_request', 'xmlsf_polylang_request' );
96
- add_filter( 'xmlsf_news_request', 'xmlsf_polylang_request' );
97
-
98
- /**
99
- * WPML compatibility hooked into xml request filter
100
- *
101
- * @param array $request
102
- *
103
- * @return array
104
- */
105
- function xmlsf_wpml_request( $request ) {
106
- global $sitepress, $wpml_query_filter;
107
-
108
- if ( is_object($sitepress) ) {
109
- // remove filters for tax queries
110
- remove_filter( 'get_terms_args', array($sitepress,'get_terms_args_filter') );
111
- remove_filter( 'get_term', array($sitepress,'get_term_adjust_id'), 1 );
112
- remove_filter( 'terms_clauses', array($sitepress,'terms_clauses') );
113
- // set language to all
114
- $sitepress->switch_lang('all');
115
- }
116
-
117
- if ( $wpml_query_filter ) {
118
- // remove query filters
119
- remove_filter( 'posts_join', array( $wpml_query_filter, 'posts_join_filter' ), 10, 2 );
120
- remove_filter( 'posts_where', array( $wpml_query_filter, 'posts_where_filter' ), 10, 2 );
121
- }
122
-
123
- $request['lang'] = ''; // strip off potential lang url parameter
124
-
125
- return $request;
126
- }
127
- add_filter( 'xmlsf_request', 'xmlsf_wpml_request' );
128
- add_filter( 'xmlsf_news_request', 'xmlsf_wpml_request' );
129
-
130
- /**
131
- * BBPress compatibility hooked into xml request filter
132
- *
133
- * @param array $request
134
- *
135
- * @return array
136
- */
137
- function xmlsf_bbpress_request( $request ) {
138
-
139
- remove_filter( 'bbp_request', 'bbp_request_feed_trap' );
140
-
141
- return $request;
142
- }
143
- add_filter( 'xmlsf_request', 'xmlsf_bbpress_request' );
144
- add_filter( 'xmlsf_news_request', 'xmlsf_bbpress_request' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.public-sitemap-news.php DELETED
@@ -1,202 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Response headers filter
5
- * Does not check if we are really in a sitemap feed.
6
- *
7
- * @param $headers
8
- *
9
- * @return array
10
- */
11
- function xmlsf_news_nocache_headers( $headers ) {
12
- // prevent proxy caches serving a cached news sitemap
13
- $headers['Cache-Control'] .= ', no-store';
14
-
15
- return $headers;
16
- }
17
-
18
- /**
19
- * Filter news WHERE
20
- * only posts from the last 48 hours
21
- *
22
- * @param string $where
23
- *
24
- * @return string
25
- */
26
- function xmlsf_news_filter_where( $where = '' ) {
27
- return $where . ' AND post_date_gmt > \'' . gmdate( 'Y-m-d H:i:s', strtotime('-48 hours') ) . '\'';
28
- }
29
-
30
- /**
31
- * Filter request for news sitemap
32
- *
33
- * @param $request
34
- *
35
- * @return mixed
36
- */
37
- function xmlsf_sitemap_news_filter_request( $request ) {
38
-
39
- // REPSONSE HEADERS filtering
40
- add_filter( 'nocache_headers', 'xmlsf_news_nocache_headers' );
41
-
42
- /** FILTER HOOK FOR PLUGIN COMPATIBILITIES */
43
- $request = apply_filters( 'xmlsf_news_request', $request );
44
- /**
45
- * Developers: add your actions that should run when a news sitemap request is found with:
46
- *
47
- * add_filter( 'xmlsf_news_request', 'your_filter_function' );
48
- *
49
- * Filters hooked here already:
50
- * xmlsf_polylang_request - Polylang compatibility
51
- * xmlsf_wpml_request - WPML compatibility
52
- * xmlsf_bbpress_request - bbPress compatibility
53
- */
54
-
55
- // prepare for news and return modified request
56
- $options = get_option( 'xmlsf_news_tags' );
57
- $post_types = is_array($options) && !empty($options['post_type']) ? $options['post_type'] : array('post');
58
- $post_types = apply_filters( 'xmlsf_news_post_types', $post_types);
59
-
60
- // disable caching
61
- $request['cache_results'] = false;
62
- if ( ! defined('DONOTCACHEPAGE') ) define('DONOTCACHEPAGE', true);
63
- if ( ! defined('DONOTCACHEDB') ) define('DONOTCACHEDB', true);
64
-
65
- // set up query filters
66
- $live = false;
67
- foreach ( $post_types as $post_type ) {
68
- if ( strtotime( get_lastpostdate( 'gmt', $post_type ) ) > strtotime( gmdate( 'Y-m-d H:i:s', strtotime('-48 hours') ) ) ) {
69
- $live = true;
70
- break;
71
- }
72
- }
73
-
74
- if ( $live ) {
75
- add_filter( 'post_limits', function() { return 'LIMIT 0, 1000'; } );
76
- add_filter( 'posts_where', 'xmlsf_news_filter_where', 10, 1 );
77
- } else {
78
- add_filter( 'post_limits', function() { return 'LIMIT 0, 1'; } );
79
- }
80
-
81
- // post type
82
- $request['post_type'] = $post_types;
83
-
84
- // categories
85
- if ( is_array($options) && isset($options['categories']) && is_array($options['categories']) ) {
86
- $request['cat'] = implode( ',', $options['categories'] );
87
- }
88
-
89
- return $request;
90
- }
91
-
92
- /**
93
- * Get images
94
- *
95
- * @param string $which
96
- *
97
- * @return array
98
- */
99
- /*
100
- function xmlsf_news_get_images( $which ) {
101
- global $post;
102
- $images = array();
103
-
104
- if ( 'attached' == $which ) {
105
- $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => 1, 'post_status' =>'inherit', 'post_parent' => $post->ID );
106
- $attachments = get_posts($args);
107
- if ( ! empty( $attachments[0] ) ) {
108
- $url = wp_get_attachment_image_url( $attachments[0]->ID, 'full' );
109
- $url = xmlsf_get_absolute_url( $url );
110
- if ( !empty($url) ) {
111
- $images[] = array(
112
- 'loc' => esc_attr( esc_url_raw( $url ) ),
113
- 'title' => apply_filters( 'the_title_xmlsitemap', $attachments[0]->post_title ),
114
- 'caption' => apply_filters( 'the_title_xmlsitemap', $attachments[0]->post_excerpt )
115
- // 'caption' => apply_filters( 'the_title_xmlsitemap', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) )
116
- );
117
- }
118
- }
119
- } elseif ( 'featured' == $which ) {
120
- if ( has_post_thumbnail( $post->ID ) ) {
121
- $attachment = get_post( get_post_thumbnail_id( $post->ID ) );
122
- $url = wp_get_attachment_image_url( get_post_thumbnail_id( $post->ID ), 'full' );
123
- $url = xmlsf_get_absolute_url( $url );
124
- if ( !empty($url) ) {
125
- $images[] = array(
126
- 'loc' => esc_attr( esc_url_raw( $url ) ),
127
- 'title' => apply_filters( 'the_title_xmlsitemap', $attachment->post_title ),
128
- 'caption' => apply_filters( 'the_title_xmlsitemap', $attachment->post_excerpt )
129
- // 'caption' => apply_filters( 'the_title_xmlsitemap', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) )
130
- );
131
- }
132
- }
133
- }
134
-
135
- return $images;
136
- }
137
- */
138
-
139
- /**
140
- * Post language filter for Polylang
141
- *
142
- * @param $language
143
- * @param $post_id
144
- *
145
- * @return string
146
- */
147
- function xmlsf_polylang_post_language_filter( $language, $post_id ) {
148
-
149
- if ( function_exists('pll_get_post_language') ) {
150
- $language = pll_get_post_language( $post_id, 'slug' );
151
- }
152
-
153
- return $language;
154
- }
155
- add_filter( 'xmlsf_news_language', 'xmlsf_polylang_post_language_filter', 10, 2 );
156
-
157
- /**
158
- * Post language filter for WPML
159
- *
160
- * @param $language
161
- * @param $post_id
162
- * @param $post_type
163
- *
164
- * @return string
165
- */
166
- function xmlsf_wpml_post_language_filter( $language, $post_id, $post_type = 'post' ) {
167
-
168
- global $sitepress;
169
-
170
- if ( $sitepress )
171
- $language = apply_filters( 'wpml_element_language_code', $language, array( 'element_id' => $post_id, 'element_type' => $post_type ) );
172
-
173
- return $language;
174
- }
175
- add_filter( 'xmlsf_news_language', 'xmlsf_wpml_post_language_filter', 10, 3 );
176
-
177
- /**
178
- * Parse language string
179
- *
180
- * @param string $lang unformatted language string
181
- *
182
- * @return string
183
- */
184
- function xmlsf_parse_language_string( $lang ) {
185
-
186
- $lang = convert_chars( strtolower( strip_tags( $lang ) ) );
187
-
188
- // no underscores
189
- $lang = str_replace( '_', '-', $lang );
190
-
191
- // no hyphens except...
192
- if ( 0 === strpos( $lang, 'zh' ) ) {
193
- $lang = strpos( $lang, 'hant' ) || strpos( $lang, 'hk' ) || strpos( $lang, 'tw' ) ? 'zh-tw' : 'zh-cn';
194
- } else {
195
- // explode on hyphen and use only first part
196
- $expl = explode('-', $lang);
197
- $lang = $expl[0];
198
- }
199
-
200
- return !empty($lang) ? $lang : 'en';
201
- }
202
- add_filter( 'xmlsf_news_language', 'xmlsf_parse_language_string', 99 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.public-sitemap.php DELETED
@@ -1,558 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Get root pages data
5
- * @return array
6
- */
7
- function xmlsf_get_root_data() {
8
-
9
- // language roots
10
- global $sitepress;
11
-
12
- // Polylang and WPML compat
13
- if ( function_exists('pll_the_languages') && function_exists('pll_home_url') ) {
14
- $languages = pll_languages_list();
15
- if ( is_array($languages) ) {
16
- foreach ( $languages as $language ) {
17
- $url = pll_home_url( $language );
18
- $data[$url] = array(
19
- 'priority' => '1.0',
20
- 'lastmod' => get_date_from_gmt( get_lastpostdate('GMT'), DATE_W3C )
21
- // TODO make lastmod date language specific
22
- );
23
- }
24
- }
25
- } elseif ( is_object($sitepress) && method_exists($sitepress, 'get_languages') && method_exists($sitepress, 'language_url') ) {
26
- foreach ( array_keys ( $sitepress->get_languages(false,true) ) as $term ) {
27
- $url = $sitepress->language_url($term);
28
- $data[$url] = array(
29
- 'priority' => '1.0',
30
- 'lastmod' => get_date_from_gmt( get_lastpostdate('GMT'), DATE_W3C )
31
- // TODO make lastmod date language specific
32
- );
33
- }
34
- } else {
35
- // single site root
36
- $data = array(
37
- trailingslashit( home_url() ) => array(
38
- 'priority' => '1.0',
39
- 'lastmod' => get_date_from_gmt( get_lastpostdate('GMT'), DATE_W3C )
40
- )
41
- );
42
- }
43
-
44
- return apply_filters( 'xmlsf_root_data', $data );
45
-
46
- }
47
-
48
- /**
49
- * Author data
50
- *
51
- * @return array
52
- */
53
- function xmlsf_get_author_data() {
54
-
55
- $author_settings = get_option( 'xmlsf_author_settings' );
56
-
57
- $args = (array) apply_filters(
58
- 'xmlsf_get_author_args',
59
- array(
60
- 'orderby' => 'post_count',
61
- 'order' => 'DESC',
62
- 'number' => ! empty( $author_settings['term_limit'] ) && is_numeric( $author_settings['term_limit'] ) ? $author_settings['term_limit'] : '1000',
63
- 'fields' => array( 'ID' ), // must be an array
64
- 'has_published_posts' => true, // means all post types
65
- 'who' => 'authors'
66
- )
67
- );
68
- // make sure 'fields' is an array and includes 'ID'
69
- $args['fields'] = array_merge( (array) $args['fields'], array( 'ID' ) );
70
-
71
- $users = get_users( $args );
72
-
73
- $priority = ! empty( $author_settings['priority'] ) ? $author_settings['priority'] : '';
74
-
75
- $post_type = ( empty( $args['has_published_posts'] ) || true === $args['has_published_posts'] ) ? 'any' : $args['has_published_posts'];
76
-
77
- $data = array();
78
- foreach ( $users as $user ) {
79
- $url = get_author_posts_url( $user->ID );
80
-
81
- // allow filtering of users
82
- if ( apply_filters( 'xmlsf_skip_user', false, $user ) ) continue;
83
-
84
- // last publication date
85
- $posts = get_posts(
86
- array(
87
- 'author' => $user->ID,
88
- 'post_type' => $post_type,
89
- 'post_status' => 'publish',
90
- 'posts_per_page' => 1,
91
- 'order' => 'DESC',
92
- 'orderby ' => 'post_date',
93
- 'update_post_meta_cache' => false,
94
- 'update_post_term_cache' => false,
95
- 'update_cache' => false,
96
- 'lang' => '', // TODO make multilanguage compatible
97
- )
98
- );
99
-
100
- $lastmod = '';
101
- if ( $posts ) {
102
- $lastmod = get_the_date( DATE_W3C, $posts[0] );
103
- }
104
-
105
- $data[$url] = array( 'priority' => $priority, 'lastmod' => $lastmod );
106
- }
107
-
108
- return apply_filters( 'xmlsf_author_data', $data );
109
-
110
- }
111
-
112
- /**
113
- * Do tags
114
- *
115
- * @param string $type
116
- *
117
- * @return array
118
- */
119
- function xmlsf_do_tags( $type = 'post' ) {
120
-
121
- $post_types = get_option( 'xmlsf_post_types' );
122
-
123
- // make sure it's an array we are returning
124
- return (
125
- is_string($type) &&
126
- is_array($post_types) &&
127
- !empty($post_types[$type]['tags'])
128
- ) ? (array) $post_types[$type]['tags'] : array();
129
-
130
- }
131
-
132
- /**
133
- * Do authors
134
- *
135
- * @return bool
136
- */
137
- function xmlsf_do_authors() {
138
-
139
- $settings = get_option( 'xmlsf_author_settings', xmlsf()->defaults('author_settings') );
140
-
141
- return is_array( $settings ) && ! empty( $settings['active'] );
142
- }
143
-
144
- /**
145
- * Get front pages
146
- * @return array
147
- */
148
- function xmlsf_get_frontpages() {
149
-
150
- if ( null === xmlsf()->frontpages ) :
151
-
152
- $frontpages = array();
153
- if ( 'page' == get_option('show_on_front') ) {
154
- $frontpage = (int) get_option('page_on_front');
155
- $frontpages = array_merge( (array) $frontpage, xmlsf_get_translations($frontpage) );
156
- }
157
- xmlsf()->frontpages = $frontpages;
158
-
159
- endif;
160
-
161
- return xmlsf()->frontpages;
162
-
163
- }
164
-
165
- /**
166
- * Get blog_pages
167
- * @return array
168
- */
169
- function xmlsf_get_blogpages() {
170
-
171
- if ( null === xmlsf()->blogpages ) :
172
- $blogpages = array();
173
- if ( 'page' == get_option('show_on_front') ) {
174
- $blogpage = (int) get_option('page_for_posts');
175
- if ( !empty($blogpage) ) {
176
- $blogpages = array_merge( (array) $blogpage, xmlsf_get_translations($blogpage) );
177
- }
178
- }
179
- xmlsf()->blogpages = $blogpages;
180
- endif;
181
-
182
- return xmlsf()->blogpages;
183
-
184
- }
185
-
186
- /**
187
- * Get translations
188
- *
189
- * @param $post_id
190
- *
191
- * @return array
192
- */
193
- function xmlsf_get_translations( $post_id ) {
194
-
195
- global $sitepress;
196
- $translation_ids = array();
197
-
198
- // Polylang compat
199
- if ( function_exists('pll_get_post_translations') ) {
200
-
201
- $translations = pll_get_post_translations($post_id);
202
-
203
- foreach ( $translations as $slug => $id ) {
204
- if ( $post_id != $id ) $translation_ids[] = $id;
205
- }
206
-
207
- // WPML compat
208
- } elseif ( is_object($sitepress) && method_exists($sitepress, 'get_languages') && method_exists($sitepress, 'get_object_id') ) {
209
-
210
- foreach ( array_keys ( $sitepress->get_languages(false,true) ) as $term ) {
211
- $id = $sitepress->get_object_id($post_id,'page',false,$term);
212
- if ( $post_id != $id ) $translation_ids[] = $id;
213
- }
214
-
215
- }
216
-
217
- return $translation_ids;
218
-
219
- }
220
-
221
- /**
222
- * Post Modified
223
- *
224
- * @return string GMT date
225
- */
226
- function xmlsf_get_post_modified() {
227
-
228
- global $post;
229
-
230
- // if blog or home page then simply look for last post date
231
- if ( $post->post_type == 'page' && ( in_array( $post->ID, xmlsf_get_blogpages() ) || in_array( $post->ID, xmlsf_get_frontpages() ) ) ) {
232
-
233
- $lastmod = get_lastpostdate( 'GMT' );
234
-
235
- } else {
236
-
237
- $lastmod = $post->post_modified_gmt;
238
-
239
- // make sure lastmod is not older than publication date (happens on scheduled posts)
240
- if ( isset( $post->post_date_gmt ) && strtotime( $post->post_date_gmt ) > strtotime( $lastmod ) ) {
241
- $lastmod = $post->post_date_gmt;
242
- };
243
-
244
- // maybe update lastmod to latest comment
245
- $options = (array) get_option( 'xmlsf_post_types', array() );
246
-
247
- if ( !empty($options[$post->post_type]['update_lastmod_on_comments']) ) {
248
- // assuming post meta data has been primed here
249
- $lastcomment = get_post_meta( $post->ID, '_xmlsf_comment_date_gmt', true ); // only get one
250
-
251
- if ( ! empty( $lastcomment ) && strtotime( $lastcomment ) > strtotime( $lastmod ) )
252
- $lastmod = $lastcomment;
253
- }
254
-
255
- }
256
-
257
- return ! empty( $lastmod ) ? get_date_from_gmt( $lastmod, DATE_W3C ) : false;
258
-
259
- }
260
-
261
- /**
262
- * Term Modified
263
- *
264
- * @param object $term
265
- *
266
- * @return string
267
- */
268
- function xmlsf_get_term_modified( $term ) {
269
-
270
- /*
271
- * Getting ALL meta here because if checking for single key, we cannot
272
- * distiguish between empty value or non-exisiting key as both return ''.
273
- */
274
- $meta = get_term_meta( $term->term_id );
275
-
276
- if ( ! array_key_exists( 'term_modified', $meta ) ) {
277
-
278
- // get the latest post in this taxonomy item, to use its post_date as lastmod
279
- $posts = get_posts (
280
- array(
281
- 'post_type' => 'any',
282
- 'post_status' => 'publish',
283
- 'posts_per_page' => 1,
284
- 'update_post_meta_cache' => false,
285
- 'update_post_term_cache' => false,
286
- 'update_cache' => false,
287
- 'lang' => '',
288
- 'has_password' => false,
289
- 'tax_query' => array(
290
- array(
291
- 'taxonomy' => $term->taxonomy,
292
- 'field' => 'slug',
293
- 'terms' => $term->slug
294
- )
295
- )
296
- )
297
- );
298
-
299
- $lastmod = isset($posts[0]->post_date) ? $posts[0]->post_date : '';
300
- // get post date here, not modified date because we're only
301
- // concerned about new entries on the (first) taxonomy page
302
-
303
- add_term_meta( $term->term_id, 'term_modified', $lastmod );
304
-
305
- } else {
306
-
307
- $lastmod = get_term_meta( $term->term_id, 'term_modified', true ); // only get one
308
-
309
- }
310
-
311
- return ! empty( $lastmod ) ? mysql2date( DATE_W3C, $lastmod, false ) : false;
312
-
313
- }
314
-
315
- /**
316
- * Taxonmy Modified
317
- *
318
- * @param string $taxonomy
319
- *
320
- * @return string
321
- */
322
- function xmlsf_get_taxonomy_modified( $taxonomy ) {
323
-
324
- $obj = get_taxonomy( $taxonomy );
325
-
326
- $lastmodified = array();
327
- foreach ( (array)$obj->object_type as $object_type ) {
328
- $lastmodified[] = get_lastpostdate( 'GMT', $object_type );
329
- // get last post date here, not modified date because we're only
330
- // concerned about new entries on the (first) taxonomy page
331
- }
332
-
333
- sort( $lastmodified );
334
- $lastmodified = array_filter( $lastmodified );
335
- $lastmod = end( $lastmodified );
336
-
337
- return get_date_from_gmt( $lastmod, DATE_W3C );
338
-
339
- }
340
-
341
- /**
342
- * Get post priority
343
- *
344
- * @return float
345
- */
346
- function xmlsf_get_post_priority() {
347
- // locale LC_NUMERIC should be set to C for these calculations
348
- // it is assumed to be done once at the request filter
349
- //setlocale( LC_NUMERIC, 'C' );
350
-
351
- global $post;
352
- $options = get_option( 'xmlsf_post_types' );
353
- $priority = isset($options[$post->post_type]['priority']) && is_numeric($options[$post->post_type]['priority']) ? floatval($options[$post->post_type]['priority']) : 0.5;
354
-
355
- if ( in_array( $post->ID, xmlsf_get_frontpages() ) ) {
356
-
357
- $priority = 1;
358
-
359
- } elseif ( $priority_meta = get_post_meta( $post->ID, '_xmlsf_priority', true ) ) {
360
-
361
- $priority = floatval(str_replace(',','.',$priority_meta));
362
-
363
- } elseif ( !empty($options[$post->post_type]['dynamic_priority']) ) {
364
-
365
- $post_modified = mysql2date('U',$post->post_modified);
366
-
367
- // reduce by age
368
- // NOTE : home/blog page gets same treatment as sticky post, i.e. no reduction by age
369
- if ( xmlsf()->timespan > 0 && ! is_sticky( $post->ID ) && ! in_array( $post->ID, xmlsf_get_blogpages() ) ) {
370
- $priority -= $priority * ( xmlsf()->lastmodified - $post_modified ) / xmlsf()->timespan;
371
- }
372
-
373
- // increase by relative comment count
374
- if ( $post->comment_count > 0 && $priority < 1 && xmlsf()->comment_count > 0 ) {
375
- $priority += 0.1 + ( 1 - $priority ) * $post->comment_count / xmlsf()->comment_count;
376
- }
377
-
378
- }
379
-
380
- $priority = apply_filters( 'xmlsf_post_priority', $priority, $post->ID );
381
-
382
- // a final check for limits and round it
383
- return xmlsf_sanitize_priority( $priority );
384
-
385
- }
386
-
387
- /**
388
- * Get taxonomy priority
389
- *
390
- * @param WP_Term|string $term
391
- *
392
- * @return float
393
- */
394
- function xmlsf_get_term_priority( $term = '' ) {
395
-
396
- // locale LC_NUMERIC should be set to C for these calculations
397
- // it is assumed to be done at the request filter
398
- //setlocale( LC_NUMERIC, 'C' );
399
-
400
- $options = get_option( 'xmlsf_taxonomy_settings' );
401
-
402
- $priority = isset( $options['priority'] ) && is_numeric( $options['priority'] ) ? floatval( $options['priority'] ) : 0.5 ;
403
-
404
- if ( !empty($options['dynamic_priority']) && $priority > 0.1 && is_object($term) ) {
405
- // set first and highest term post count as maximum
406
- if ( null == xmlsf()->taxonomy_termmaxposts ) {
407
- xmlsf()->taxonomy_termmaxposts = $term->count;
408
- }
409
-
410
- $priority -= ( xmlsf()->taxonomy_termmaxposts - $term->count ) * ( $priority - 0.1 ) / xmlsf()->taxonomy_termmaxposts;
411
- }
412
-
413
- $priority = apply_filters( 'xmlsf_term_priority', $priority, $term->slug );
414
-
415
- // a final check for limits and round it
416
- return xmlsf_sanitize_priority( $priority );
417
-
418
- }
419
-
420
- /**
421
- * Get post images
422
- *
423
- * @param string $which
424
- *
425
- * @return array
426
- */
427
- function xmlsf_get_post_images( $which ) {
428
- global $post;
429
-
430
- // assuming images post meta has been primed here
431
- $images = get_post_meta( $post->ID, '_xmlsf_image_'.$which );
432
-
433
- return (array) apply_filters( 'xmlsf_post_images_'.$which, $images );
434
- }
435
-
436
- /**
437
- * Terms arguments filter
438
- * Does not check if we are really in a sitemap feed.
439
- *
440
- * @param $args
441
- *
442
- * @return array
443
- */
444
- function xmlsf_set_terms_args( $args ) {
445
- // https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
446
-
447
- $options = get_option('xmlsf_taxonomy_settings');
448
- $args['number'] = isset($options['term_limit']) ? intval($options['term_limit']) : 5000;
449
- if ( $args['number'] < 1 || $args['number'] > 50000 ) $args['number'] = 50000;
450
-
451
- $args['order'] = 'DESC';
452
- $args['orderby'] = 'count';
453
- $args['pad_counts'] = true;
454
- $args['lang'] = '';
455
- $args['hierarchical'] = 0;
456
- $args['suppress_filter'] = true;
457
-
458
- return $args;
459
- }
460
-
461
- /**
462
- * Filter request for sitemaps
463
- *
464
- * @param array $request
465
- * @param array $feed
466
- *
467
- * @return array $request filtered
468
- */
469
- function xmlsf_sitemap_filter_request( $request ) {
470
-
471
- /** FILTER HOOK FOR PLUGIN COMPATIBILITIES */
472
- $request = apply_filters( 'xmlsf_request', $request );
473
- /**
474
- * Developers: add your actions that should run when a sitemap request is with:
475
- *
476
- * add_filter( 'xmlsf_request', 'your_filter_function' );
477
- *
478
- * Filters hooked here already:
479
- * xmlsf_polylang_request - Polylang compatibility
480
- * xmlsf_wpml_request - WPML compatibility
481
- * xmlsf_bbpress_request - bbPress compatibility
482
- */
483
-
484
- $feed = explode( '-' , $request['feed'], 3 );
485
-
486
- switch( isset( $feed[1] ) ? $feed[1] : '' ) {
487
-
488
- case 'posttype':
489
-
490
- if ( ! isset( $feed[2] ) ) break;
491
-
492
- // try to raise memory limit, context added for filters
493
- wp_raise_memory_limit( 'sitemap-posttype-'.$feed[2] );
494
-
495
- $options = (array) get_option( 'xmlsf_post_types', array() );
496
-
497
- // prepare priority calculation
498
- if ( ! empty($options[$feed[2]]['dynamic_priority']) ) {
499
-
500
- // last of this post type modified date in Unix seconds
501
- xmlsf()->lastmodified = get_date_from_gmt( get_lastpostmodified( 'GMT', $feed[2] ), 'U' );
502
-
503
- // calculate time span, uses get_firstpostdate() function defined in xml-sitemap/inc/functions.php !
504
- xmlsf()->timespan = xmlsf()->lastmodified - get_date_from_gmt( get_firstpostdate( 'GMT', $feed[2]), 'U' );
505
-
506
- // total post type comment count
507
- xmlsf()->comment_count = wp_count_comments()->approved;
508
-
509
- // TODO count comments per post type https://wordpress.stackexchange.com/questions/134338/count-all-comments-of-a-custom-post-type
510
- // TODO cache this more persistently than wp_cache_set does in https://developer.wordpress.org/reference/functions/wp_count_comments/
511
- };
512
-
513
- // setup filters
514
- add_filter( 'post_limits', function() { return 'LIMIT 0, 50000'; } );
515
-
516
- // modify request
517
- $request['post_type'] = $feed[2];
518
- $request['orderby'] = 'modified';
519
- $request['order'] = 'DESC';
520
-
521
- // prevent term cache update query unless needed for permalinks
522
- if ( strpos( get_option( 'permalink_structure' ), '%category%' ) === false )
523
- $request['update_post_term_cache'] = false;
524
-
525
- // make sure to update meta cache for:
526
- // 1. excluded posts
527
- // 2. image data (if activated)
528
- // 3. lasmod on comments (if activated)
529
- $request['update_post_meta_cache'] = true;
530
-
531
- break;
532
-
533
- case 'taxonomy':
534
-
535
- if ( !isset( $feed[2] ) ) break;
536
-
537
- // try to raise memory limit, context added for filters
538
- wp_raise_memory_limit( 'sitemap-taxonomy-'.$feed[2] );
539
-
540
- // pass on taxonomy name via request
541
- $request['taxonomy'] = $feed[2];
542
-
543
- // set terms args
544
- add_filter( 'get_terms_args', 'xmlsf_set_terms_args' );
545
-
546
- // disable default feed query
547
- add_filter( 'posts_request', '__return_false' );
548
-
549
- break;
550
-
551
- default:
552
-
553
- add_filter( 'posts_request', '__return_false' );
554
-
555
- }
556
-
557
- return $request;
558
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.shared.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Filter request
5
- *
6
- * @param array $request
7
- *
8
- * @return array $request filtered
9
- */
10
- function xmlsf_filter_request( $request ) {
11
-
12
- global $xmlsf;
13
- $xmlsf->request_filtered = true;
14
-
15
- // short-circuit if request is not a feed or it does not start with 'sitemap'
16
- if ( empty( $request['feed'] ) || strpos( $request['feed'], 'sitemap' ) !== 0 ) {
17
- return $request;
18
- }
19
-
20
- /** IT'S A SITEMAP */
21
-
22
- // set the sitemap conditional flag
23
- xmlsf()->is_sitemap = true;
24
-
25
- // save a few db queries
26
- add_filter( 'split_the_query', '__return_false' );
27
-
28
- // include shared public functions
29
- require_once XMLSF_DIR . '/models/functions.public-shared.php';
30
-
31
- /** COMPRESSION */
32
-
33
- // check for gz request
34
- if ( substr($request['feed'], -3) == '.gz' ) {
35
- // pop that .gz
36
- $request['feed'] = substr($request['feed'], 0, -3);
37
- // verify/apply compression settings
38
- xmlsf_output_compression();
39
- }
40
-
41
- /** PREPARE TO LOAD TEMPLATE */
42
-
43
- add_action (
44
- 'do_feed_' . $request['feed'],
45
- 'xmlsf_load_template',
46
- 10,
47
- 2
48
- );
49
-
50
- /** MODIFY REQUEST PARAMETERS */
51
-
52
- $request['post_status'] = 'publish';
53
- $request['no_found_rows'] = true; // found rows calc is slow and only needed for pagination
54
-
55
- // SPECIFIC REQUEST FILTERING AND PREPARATIONS
56
- if ( strpos( $request['feed'], 'news' ) === 8 ) {
57
- // set the news sitemap conditional flag
58
- xmlsf()->is_news = true;
59
- // include public news functions
60
- require_once XMLSF_DIR . '/models/functions.public-sitemap-news.php';
61
- // filter news request
62
- $request = xmlsf_sitemap_news_filter_request( $request );
63
- } else {
64
- // include public sitemap functions
65
- require_once XMLSF_DIR . '/models/functions.public-sitemap.php';
66
- // filter sitemap request
67
- $request = xmlsf_sitemap_filter_request( $request );
68
- }
69
-
70
- /** GENERAL MISC. PREPARATIONS */
71
-
72
- // prevent public errors breaking xml
73
- @ini_set( 'display_errors', 0 );
74
-
75
- // make sure we have the proper locale setting for calculations
76
- setlocale( LC_NUMERIC, 'C' );
77
-
78
- // REPSONSE HEADERS filtering
79
- add_filter( 'wp_headers', 'xmlsf_headers' );
80
-
81
- // Remove filters to prevent stuff like cdn urls for xml stylesheet and images
82
- remove_all_filters( 'plugins_url' );
83
- remove_all_filters( 'wp_get_attachment_url' );
84
- remove_all_filters( 'image_downsize' );
85
-
86
- return $request;
87
- }
88
-
89
- /**
90
- * Remove the trailing slash from permalinks that have an extension,
91
- * such as /sitemap.xml (thanks to Permalink Editor plugin for WordPress)
92
- *
93
- * @param string $request
94
- *
95
- * @return mixed
96
- */
97
- function xmlsf_untrailingslash( $request ) {
98
- return pathinfo($request, PATHINFO_EXTENSION) ? untrailingslashit($request) : $request;
99
- }
100
-
101
- /**
102
- * Ping
103
- *
104
- * @since 5.1
105
- *
106
- * @param $se google|bing
107
- * @param $sitemap sitemap
108
- * @param $interval seconds
109
- *
110
- * @return string ping response|999 (skipped)
111
- */
112
- function xmlsf_ping( $se, $sitemap, $interval ) {
113
- if ( 'google' == $se ) {
114
- $url = 'https://www.google.com/ping';
115
- } elseif ( 'bing' == $se ) {
116
- $url = 'https://www.bing.com/webmaster/ping.aspx';
117
- } else {
118
- return '';
119
- }
120
- $url = add_query_arg( 'sitemap', urlencode( trailingslashit( get_bloginfo( 'url' ) ) . $sitemap ), $url );
121
-
122
- // check if we did not ping already within the interval
123
- if ( false === get_transient( 'xmlsf_ping_'.$se.'_'.$sitemap ) ) {
124
- // Ping !
125
- $response = wp_remote_request( $url );
126
- $code = wp_remote_retrieve_response_code( $response );
127
- if ( 200 === $code ) {
128
- set_transient( 'xmlsf_ping_'.$se.'_'.$sitemap, '', $interval );
129
- }
130
- } else {
131
- // Skip !
132
- $code = 999;
133
- }
134
-
135
- do_action( 'xmlsf_ping', $se, $sitemap, $url, $code );
136
-
137
- return $code;
138
- }
139
-
140
- /**
141
- * Nginx helper purge urls
142
- * adds sitemap urls to the purge array.
143
- *
144
- * @param $urls array
145
- * @param $redis bool|false
146
- *
147
- * @return $urls array
148
- */
149
- function xmlsf_nginx_helper_purge_urls( $urls = array(), $redis = false ) {
150
-
151
- if ( $redis ) {
152
- // wildcard allowed, this makes everything simple
153
- $urls[] = '/sitemap*.xml';
154
- } else {
155
- // no wildcard, go through the motions
156
- $sitemaps = get_option( 'xmlsf_sitemaps' );
157
-
158
- if ( !empty( $sitemaps['sitemap-news'] ) ) {
159
- $urls[] = '/sitemap-news.xml';
160
- }
161
-
162
- if ( !empty( $sitemaps['sitemap'] ) ) {
163
- $urls[] = '/sitemap.xml';
164
- $urls[] = '/sitemap-root.xml';
165
- $urls[] = '/sitemap-author.xml';
166
- $urls[] = '/sitemap-custom.xml';
167
-
168
- // add public post types sitemaps
169
- $post_types = get_option( 'xmlsf_post_types' );
170
- if ( is_array($post_types) ) {
171
- foreach ( $post_types as $post_type => $settings ) {
172
- $archive = !empty($settings['archive']) ? $settings['archive'] : '';
173
- foreach ( xmlsf_get_index_archive_data( $post_type, $archive ) as $url ) {
174
- $urls[] = parse_url( $url, PHP_URL_PATH);
175
- }
176
- }
177
- }
178
-
179
- // add public post taxonomies sitemaps
180
- $taxonomies = get_option('xmlsf_taxonomies');
181
- if ( is_array($taxonomies) ) {
182
- foreach ( $taxonomies as $taxonomy ) {
183
- $urls[] = parse_url( xmlsf_get_index_url( 'taxonomy', array( 'type' => $taxonomy ) ), PHP_URL_PATH );
184
- }
185
- }
186
- }
187
- }
188
-
189
- return $urls;
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.sitemap-news.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Filter news post types
5
- *
6
- * @since 5.0
7
- * @param $post_types array
8
- * @return array
9
- */
10
- function xmlsf_news_filter_post_types( $post_types ) {
11
- $post_types = (array) $post_types;
12
-
13
- unset( $post_types['attachment'], $post_types['reply'] );
14
-
15
- return array_filter( $post_types );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/functions.sitemap.php DELETED
@@ -1,455 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Filter sitemap post types
5
- *
6
- * @since 5.0
7
- * @param $post_types array
8
- * @return array
9
- */
10
- function xmlsf_filter_post_types( $post_types ) {
11
- $post_types = (array) $post_types;
12
-
13
- // Always exclude attachment and reply post types (bbpress)
14
- unset( $post_types['attachment'], $post_types['reply'] );
15
-
16
- return array_filter( $post_types );
17
- }
18
-
19
- /**
20
- * Get index url
21
- *
22
- * @param string $sitemap
23
- * @param array $args arguments:
24
- * $type - post_type or taxonomy, default false
25
- * $m - YYYY, YYYYMM, YYYYMMDD
26
- * $w - week of the year ($m must be YYYY format)
27
- * $gz - bool for GZ extension (triggers compression verification)
28
- *
29
- * @return string
30
- */
31
- function xmlsf_get_index_url( $sitemap = 'root', $args = array() ) {
32
-
33
- // get our arguments
34
- $args = apply_filters( 'xmlsf_index_url_args', wp_parse_args( $args, array( 'type' => false, 'm' => false, 'w' => false, 'gz' => false) ) );
35
- extract( $args );
36
-
37
- if ( xmlsf()->plain_permalinks() ) {
38
- $name = '?feed=sitemap-'.$sitemap;
39
- $name .= $gz ? '.gz' : '';
40
- $name .= $type ? '-'.$type : '';
41
- $name .= $m ? '&m='.$m : '';
42
- $name .= $w ? '&w='.$w : '';
43
- } else {
44
- $name = 'sitemap-'.$sitemap;
45
- $name .= $type ? '-'.$type : '';
46
- $name .= $m ? '.'.$m : '';
47
- $name .= $w ? '.'.$w : '';
48
- $name .= '.xml';
49
- $name .= $gz ? '.gz' : '';
50
- }
51
-
52
- return esc_url( trailingslashit( home_url() ) . $name );
53
-
54
- }
55
-
56
- /**
57
- * Get post archives data
58
- *
59
- * @param string $post_type
60
- * @param string $archive_type
61
- *
62
- * @return array
63
- */
64
- function xmlsf_get_index_archive_data( $post_type = 'post', $archive_type = '' ) {
65
-
66
- global $wpdb;
67
-
68
- $return = array();
69
-
70
- if ( 'weekly' == $archive_type ) :
71
-
72
- $week = _wp_mysql_week( '`post_date`' );
73
- $query = "SELECT DISTINCT LPAD($week,2,'0') AS `week`, YEAR(`post_date`) AS `year`, COUNT(`ID`) AS `posts` FROM {$wpdb->posts} WHERE `post_type` = '{$post_type}' AND `post_status` = 'publish' GROUP BY YEAR(`post_date`), LPAD($week,2,'0') ORDER BY `year` DESC, `week` DESC";
74
- $arcresults = xmlsf_cache_get_archives( $query );
75
-
76
- foreach ( (array) $arcresults as $arcresult ) {
77
- $url = xmlsf_get_index_url( 'posttype', array( 'type' => $post_type, 'm' => $arcresult->year, 'w' => $arcresult->week ) );
78
- $return[$url] = get_date_from_gmt( get_lastmodified( 'GMT', $post_type, $arcresult->year, $arcresult->week ), DATE_W3C );
79
- };
80
-
81
- elseif ( 'monthly' == $archive_type ) :
82
-
83
- $query = "SELECT YEAR(`post_date`) AS `year`, LPAD(MONTH(`post_date`),2,'0') AS `month`, COUNT(`ID`) AS `posts` FROM {$wpdb->posts} WHERE `post_type` = '{$post_type}' AND `post_status` = 'publish' GROUP BY YEAR(`post_date`), LPAD(MONTH(`post_date`),2,'0') ORDER BY `year` DESC, `month` DESC";
84
- $arcresults = xmlsf_cache_get_archives( $query );
85
-
86
- foreach ( (array) $arcresults as $arcresult ) {
87
- $url = xmlsf_get_index_url( 'posttype', array( 'type' => $post_type, 'm' => $arcresult->year . $arcresult->month ) );
88
- $return[$url] = get_date_from_gmt( get_lastmodified( 'GMT', $post_type, $arcresult->year . $arcresult->month ), DATE_W3C );
89
- };
90
-
91
- elseif ( 'yearly' == $archive_type ) :
92
-
93
- $query = "SELECT YEAR(`post_date`) AS `year`, COUNT(`ID`) AS `posts` FROM {$wpdb->posts} WHERE `post_type` = '{$post_type}' AND `post_status` = 'publish' GROUP BY YEAR(`post_date`) ORDER BY `year` DESC";
94
- $arcresults = xmlsf_cache_get_archives( $query );
95
-
96
- foreach ( (array) $arcresults as $arcresult ) {
97
- $url = xmlsf_get_index_url( 'posttype', array( 'type' => $post_type, 'm' => $arcresult->year ) );
98
- $return[$url] = get_date_from_gmt( get_lastmodified( 'GMT', $post_type, $arcresult->year ), DATE_W3C );
99
- };
100
-
101
- else :
102
-
103
- $query = "SELECT COUNT(ID) AS `posts` FROM {$wpdb->posts} WHERE `post_type` = '{$post_type}' AND `post_status` = 'publish' ORDER BY `post_date` DESC";
104
- $arcresults = xmlsf_cache_get_archives( $query );
105
-
106
- if ( is_object($arcresults[0]) && $arcresults[0]->posts > 0 ) {
107
- $url = xmlsf_get_index_url( 'posttype', array( 'type' => $post_type ) );
108
- $return[$url] = get_date_from_gmt( get_lastmodified( 'GMT', $post_type ), DATE_W3C );
109
- };
110
-
111
- endif;
112
-
113
- return $return;
114
-
115
- }
116
-
117
- /**
118
- * Get archives from wp_cache
119
- *
120
- * @param string $query
121
- *
122
- * @return array
123
- */
124
- function xmlsf_cache_get_archives( $query ) {
125
-
126
- global $wpdb;
127
-
128
- $key = md5($query);
129
- $cache = wp_cache_get( 'xmlsf_get_archives' , 'general');
130
-
131
- if ( !isset( $cache[ $key ] ) ) {
132
- $arcresults = $wpdb->get_results($query);
133
- $cache[ $key ] = $arcresults;
134
- wp_cache_set( 'xmlsf_get_archives', $cache, 'general' );
135
- } else {
136
- $arcresults = $cache[ $key ];
137
- }
138
-
139
- return $arcresults;
140
-
141
- }
142
-
143
- /**
144
- * Get taxonomies
145
- * Returns an array of taxonomy names to be included in the index
146
- *
147
- * @since 5.0
148
- * @param void
149
- * @return array
150
- */
151
- function xmlsf_get_taxonomies() {
152
-
153
- $taxonomy_settings = get_option('xmlsf_taxonomy_settings');
154
-
155
- $tax_array = array();
156
-
157
- if ( !empty( $taxonomy_settings['active'] ) ) {
158
-
159
- $taxonomies = get_option('xmlsf_taxonomies');
160
-
161
- if ( is_array($taxonomies) ) {
162
- foreach ( $taxonomies as $taxonomy ) {
163
- $count = wp_count_terms( $taxonomy, array('hide_empty'=>true) );
164
- if ( !is_wp_error($count) && $count > 0 )
165
- $tax_array[] = $taxonomy;
166
- }
167
- } else {
168
- foreach ( xmlsf_public_taxonomies() as $name => $label )
169
- if ( 0 < wp_count_terms( $name, array('hide_empty'=>true) ) )
170
- $tax_array[] = $name;
171
- }
172
-
173
- }
174
-
175
- return $tax_array;
176
-
177
- }
178
-
179
- /**
180
- * Get all public (and not empty) taxonomies
181
- * Returns an array associated taxonomy object names and labels.
182
- *
183
- * @since 5.0
184
- * @param void
185
- * @return array
186
- */
187
- function xmlsf_public_taxonomies() {
188
-
189
- $tax_array = array();
190
-
191
- foreach ( (array) get_option( 'xmlsf_post_types' ) as $post_type => $settings ) {
192
-
193
- if ( empty($settings['active']) ) continue;
194
-
195
- // check each tax public flag and term count and append name to array
196
- foreach ( get_object_taxonomies( $post_type, 'objects' ) as $taxonomy ) {
197
-
198
- if ( !empty( $taxonomy->public ) && !in_array( $taxonomy->name, xmlsf()->disabled_taxonomies() ) )
199
- $tax_array[$taxonomy->name] = $taxonomy->label;
200
-
201
- }
202
-
203
- }
204
-
205
- return $tax_array;
206
- }
207
-
208
- /**
209
- * Santize priority value
210
- * Expects proper locale setting for calculations: setlocale( LC_NUMERIC, 'C' );
211
- *
212
- * Returns a float within the set limits.
213
- *
214
- * @since 5.2
215
- * @param float $priority
216
- * @param float $min
217
- * @param float $max
218
- * @return float
219
- */
220
- function xmlsf_sanitize_priority( $priority, $min = .1, $max = 1 ) {
221
-
222
- $priority = (float) $priority;
223
- $min = (float) $min;
224
- $max = (float) $max;
225
-
226
- if ( $priority <= $min ) {
227
- return number_format( $min, 1 );
228
- } elseif ( $priority >= $max ) {
229
- return number_format( $max, 1 );
230
- } else {
231
- return number_format( $priority, 1 );
232
- }
233
- }
234
-
235
- /**
236
- * Get post attached | featured image(s)
237
- *
238
- * @param object $post
239
- * @param string $which
240
- *
241
- * @return array
242
- */
243
- function xmlsf_images_data( $post, $which ) {
244
- $attachments = array();
245
-
246
- if ( 'featured' == $which ) {
247
-
248
- if ( has_post_thumbnail( $post->ID ) ) {
249
- $featured = get_post( get_post_thumbnail_id( $post->ID ) );
250
- if ( is_object($featured) ) {
251
- $attachments[] = $featured;
252
- }
253
- }
254
-
255
- } elseif ( 'attached' == $which ) {
256
-
257
- $args = array(
258
- 'post_type' => 'attachment',
259
- 'post_mime_type' => 'image',
260
- 'numberposts' => -1,
261
- 'post_status' =>'inherit',
262
- 'post_parent' => $post->ID
263
- );
264
-
265
- $attachments = get_posts( $args );
266
-
267
- }
268
-
269
- if ( empty( $attachments ) ) return array();
270
-
271
- // gather all data
272
- $images_data = array();
273
-
274
- foreach ( $attachments as $attachment ) {
275
-
276
- $url = wp_get_attachment_url( $attachment->ID );
277
-
278
- if ( !empty($url) ) {
279
-
280
- $url = esc_attr( esc_url_raw( $url ) );
281
-
282
- $images_data[$url] = array(
283
- 'loc' => $url,
284
- 'title' => apply_filters( 'the_title_xmlsitemap', $attachment->post_title ),
285
- 'caption' => apply_filters( 'the_title_xmlsitemap', $attachment->post_excerpt )
286
- // 'caption' => apply_filters( 'the_title_xmlsitemap', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) )
287
- );
288
-
289
- }
290
-
291
- }
292
-
293
- return $images_data;
294
- }
295
-
296
- /* -------------------------------------
297
- * MISSING WORDPRESS FUNCTIONS
298
- * ------------------------------------- */
299
-
300
- /**
301
- * Retrieve first or last post type date data based on timezone.
302
- * Variation of function _get_last_post_time
303
- *
304
- * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
305
- * @param string $field Field to check. Can be 'date' or 'modified'.
306
- * @param string $post_type Post type to check. Defaults to 'any'.
307
- * @param string $which Which to check. Can be 'first' or 'last'. Defaults to 'last'.
308
- * @param string $m year, month or day period. Can be empty or integer.
309
- * @param string $w week. Can be empty or integer.
310
- *
311
- * @return string The date.
312
- */
313
- if ( ! function_exists( '_get_post_time' ) ) {
314
- function _get_post_time( $timezone, $field, $post_type = 'any', $which = 'last', $m = '', $w = '' ) {
315
-
316
- global $wpdb;
317
-
318
- if ( !in_array( $field, array( 'date', 'modified' ) ) ) {
319
- return false;
320
- }
321
-
322
- $timezone = strtolower( $timezone );
323
-
324
- $m = preg_replace('|[^0-9]|', '', $m);
325
-
326
- if ( ! empty( $w ) ) {
327
- // when a week number is set make sure 'm' is year only
328
- $m = substr( $m, 0, 4 );
329
- // and append 'w' to the cache key
330
- $key = "{$which}post{$field}{$m}.{$w}:$timezone";
331
- } else {
332
- $key = "{$which}post{$field}{$m}.{$w}:$timezone";
333
- }
334
-
335
- if ( 'any' !== $post_type ) {
336
- $key .= ':' . sanitize_key( $post_type );
337
- }
338
-
339
- $date = wp_cache_get( $key, 'timeinfo' );
340
- if ( false !== $date ) {
341
- return $date;
342
- }
343
-
344
- if ( $post_type === 'any' ) {
345
- $post_types = get_post_types( array( 'public' => true ) );
346
- array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) );
347
- $post_types = "'" . implode( "', '", $post_types ) . "'";
348
- } elseif ( is_array($post_type) ) {
349
- $types = get_post_types( array( 'public' => true ) );
350
- foreach ( $post_type as $type )
351
- if ( !in_array( $type, $types ) )
352
- return false;
353
- array_walk( $post_type, array( &$wpdb, 'escape_by_ref' ) );
354
- $post_types = "'" . implode( "', '", $post_type ) . "'";
355
- } else {
356
- if ( !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) )
357
- return false;
358
- $post_types = "'" . addslashes($post_type) . "'";
359
- }
360
-
361
- $where = "post_status='publish' AND post_type IN ({$post_types}) AND post_date_gmt";
362
-
363
- // If a period is specified in the querystring, add that to the query
364
- if ( !empty($m) ) {
365
- $where .= " AND YEAR(post_date)=" . substr($m, 0, 4);
366
- if ( strlen($m) > 5 ) {
367
- $where .= " AND MONTH(post_date)=" . substr($m, 4, 2);
368
- if ( strlen($m) > 7 ) {
369
- $where .= " AND DAY(post_date)=" . substr($m, 6, 2);
370
- }
371
- }
372
- }
373
- if ( !empty($w) ) {
374
- $week = _wp_mysql_week( 'post_date' );
375
- $where .= " AND $week=$w";
376
- }
377
-
378
- $order = ( $which == 'last' ) ? 'DESC' : 'ASC';
379
-
380
- /* CODE SUGGESTION BY Frédéric Demarle
381
- * to make this language aware:
382
- "SELECT post_{$field}_gmt FROM $wpdb->posts" . PLL()->model->post->join_clause()
383
- ."WHERE post_status = 'publish' AND post_type IN ({$post_types})" . PLL()->model->post->where_clause( $lang )
384
- . ORDER BY post_{$field}_gmt DESC LIMIT 1
385
- */
386
- switch ( $timezone ) {
387
- case 'gmt':
388
- $date = $wpdb->get_var("SELECT post_{$field}_gmt FROM $wpdb->posts WHERE $where ORDER BY post_{$field}_gmt $order LIMIT 1");
389
- break;
390
-
391
- case 'blog':
392
- $date = $wpdb->get_var("SELECT post_{$field} FROM $wpdb->posts WHERE $where ORDER BY post_{$field}_gmt $order LIMIT 1");
393
- break;
394
-
395
- case 'server':
396
- $add_seconds_server = date('Z');
397
- $date = $wpdb->get_var("SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE $where ORDER BY post_{$field}_gmt $order LIMIT 1");
398
- break;
399
- }
400
-
401
- if ( $date ) {
402
- wp_cache_set( $key, $date, 'timeinfo' );
403
-
404
- return $date;
405
- }
406
-
407
- return false;
408
-
409
- }
410
- }
411
-
412
- /**
413
- * Retrieve the date that the first post/page was published.
414
- * Variation of function get_lastpostdate, uses _get_post_time
415
- *
416
- * The server timezone is the default and is the difference between GMT and
417
- * server time. The 'blog' value is the date when the last post was posted. The
418
- * 'gmt' is when the last post was posted in GMT formatted date.
419
- *
420
- * @uses apply_filters() Calls 'get_firstpostdate' filter
421
- * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
422
- * @param string $post_type Post type to check.
423
- * @return string The date of the last post.
424
- */
425
- if ( ! function_exists( 'get_firstpostdate' ) ) {
426
- function get_firstpostdate( $timezone = 'server', $post_type = 'any' ) {
427
-
428
- return apply_filters( 'get_firstpostdate', _get_post_time( $timezone, 'date', $post_type, 'first' ), $timezone );
429
-
430
- }
431
- }
432
-
433
- /**
434
- * Retrieve last post/page modified date depending on timezone.
435
- * Variation of function get_lastpostmodified, uses _get_post_time
436
- *
437
- * The server timezone is the default and is the difference between GMT and
438
- * server time. The 'blog' value is the date when the last post was posted. The
439
- * 'gmt' is when the last post was posted in GMT formatted date.
440
- *
441
- * @uses apply_filters() Calls 'get_lastmodified' filter
442
- * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
443
- * @param string $post_type The post type to get the last modified date for.
444
- * @param string $m The period to check in. Defaults to any, can be YYYY, YYYYMM or YYYYMMDD
445
- * @param string $w The week to check in. Defaults to any, can be one or two digit week number. Must be used with $m in YYYY format.
446
- *
447
- * @return string The date of the oldest modified post.
448
- */
449
- if ( ! function_exists( 'get_lastmodified' ) ) {
450
- function get_lastmodified( $timezone = 'server', $post_type = 'any', $m = '', $w = '' ) {
451
-
452
- return apply_filters( 'get_lastmodified', _get_post_time( $timezone, 'modified', $post_type, 'last', $m, $w ), $timezone );
453
-
454
- }
455
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,115 +1,71 @@
1
- === XML Sitemap & Google News ===
2
  Contributors: RavanH
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed
4
- Tags: sitemap, xml sitemap, news sitemap, sitemap.xml, robots.txt, Google, Google News, Yahoo, Bing, Yandex, Baidu, seo, feed, Polylang, WPML, image sitemap
5
- Requires at least: 4.4
6
- Requires PHP: 5.4
7
- Tested up to: 6.1
8
- Stable tag: 5.3.3
9
 
10
- XML and Google News Sitemaps to feed the hungry spiders. Multisite, WP Super Cache, Polylang and WPML compatible.
11
 
12
  == Description ==
13
 
14
- This plugin dynamically creates dynamic feeds that comply with the **XML Sitemap** and the **Google News Sitemap** protocol. **Multisite**, **Polylang** and **WPML** compatible and there are no static files created.
15
 
16
- There are options to control which sitemaps are enabled, which Post Types and archive pages (like taxonomy terms and author pages) are included, how Priority and Lastmod are calculated, who to ping and a possibility to set additional robots.txt rules from within the WordPress admin.
17
 
18
- The main advantage of this plugin over other XML Sitemap plugins is **simplicity**. No need to change file or folder permissions, move files or spend time tweaking difficult plugin options.
19
-
20
- You, or site owners on your Multisite network, will not be bothered with overly complicated settings like most other XML Sitemap plugins. The default settings will suffice in most cases.
21
-
22
- An XML Sitemap Index becomes instantly available on **yourblog.url/sitemap.xml** (or yourblog.url/?feed=sitemap if you're not using a 'fancy' permalink structure) containing references to posts and pages by default, ready for indexing by search engines like Google, Bing, Yahoo, AOL and Ask. When the Google News Sitemap is activated, it will become available on **yourblog.url/sitemap-news.xml** (or yourblog.url/?feed=sitemap-news), ready for indexing by Google News. Both are automatically referenced in the dynamically created **robots.txt** on **yourblog.url/robots.txt** to tell search engines where to find your XML Sitemaps. Google and Bing will be pinged on each new publication.
23
 
24
  Please read the FAQ's for info on how to get your articles listed on Google News.
25
 
26
- **Compatible with caching solutions** like CloudFlare, WP Super Cache, W3 Total Cache and Quick Cache that cache feeds, allowing a faster serving to the impatient (when hungry) spider.
27
-
28
- **NOTES:**
29
-
30
- 1. If you _do not use fancy URL's_ or you have WordPress installed in a _subdirectory_, a dynamic **robots.txt will NOT be generated**. You'll have to create your own and upload it to your site root! See FAQ's.
31
-
32
- 2. On large sites, it is advised to use a good caching plugin like **WP Super Cache**, **Quick Cache**, **W3 Total Cache** or another to improve your site _and_ sitemap performance.
33
-
34
- = Features =
35
-
36
- * Compatible with multi-lingual sites using **Polylang** or **WPML** to allow all languages to be indexed equally.
37
- * Option to add new robots.txt rules. These can be used to further control (read: limit) the indexation of various parts of your site and subsequent spread of pagerank across your sites pages.
38
- * Includes XLS stylesheets for human readable sitemaps.
39
- * Sitemap templates and stylesheets can be overridden by theme template files.
40
-
41
- **XML Sitemap**
42
-
43
- * Sitemap Index includes **posts**, **pages** and **authors** by default.
44
- * Optionally include sitemaps for custom post types, categories and tags.
45
- * Sitemap with custom URLs optional.
46
- * Custom/static sitemaps can be added to the index.
47
- * Works out-of-the-box, even on **Multisite** installations.
48
- * Include featured images or attached images with title.
49
- * Pings Google, Bing & Yahoo on new post publication.
50
- * Options to define which post types and taxonomies get included in the sitemap.
51
- * Updates Lastmod on post modification or on comments.
52
- * Set Priority per post type, per taxonomy and per individual post.
53
- * Exclude individual posts and pages.
54
-
55
- **Google News Sitemap**
56
-
57
- * Required news sitemap tags: Publication name, language, title and publication date.
58
- * Set a News Publication Name or uses site name.
59
- * Supports custom post types.
60
- * Limit inclusion to certain post categories.
61
- * Pings Google on new publications, once per 5 minutes.
62
-
63
- = Pro Features =
64
 
65
- **[Google News Advanced](https://premium.status301.com/downloads/google-news-advanced/)**
66
 
67
- * Multiple post types - Include more than one post type in the same News Sitemap.
68
- * Keywords - Add the keywords tag to your News Sitemap. Keywords can be created from Tags, Categories or a dedicated Keywords taxonomy.
69
- * Stock tickers - Add stock tickers tag to your News Sitemap. A dedicated Stock Tickers taxonomy will be available to manage them.
70
- * Ping log - Keep a log of the latest pings to Google with exact date and response status.
71
 
 
72
 
73
- = Privacy / GDPR =
74
-
75
- This plugin does not collect any user or visitor data nor set browser cookies. Using this plugin should not impact your site privacy policy in any way.
76
-
77
- **Data that is published**
78
 
79
- An XML Sitemap index, referencing other sitemaps containing your web site's public post URLs of selected post types that are already public, along with their last modification date and associated image URLs, and any selected public archive URLs.
80
 
81
- A Google News Sitemap containing your web site's public and recent (last 48 hours) URLs of selected news post type, along with their publication time stamp and associated image URL.
82
- An author sitemap can be included, which will contain links to author archive pages. These urls contain author/user slugs, and the author archives can contain author bio information. If you wish to keep this out of public domain, then deactivate the author sitemap and use an SEO plugin to add noindex headers.
 
 
 
83
 
84
- **Data that is transmitted**
85
 
86
- Data actively transmitted to search engines is your sitemap location and time of publication. This happens upon each post publication when at least one of the Ping options on Settings > Writing is enabled. In this case, the selected search engines are alerted of the location and updated state of your sitemap.
 
 
 
 
87
 
 
88
 
89
- = Contribute =
90
 
91
- If you're happy with this plugin as it is, please consider writing a quick [rating](https://wordpress.org/support/plugin/xml-sitemap-feed/review/#new-post) or helping other users out on the [support forum](https://wordpress.org/support/plugin/xml-sitemap-feed).
92
 
93
- If you wish to help build this plugin, you're very welcome to [translate it into your language](https://translate.wordpress.org/projects/wp-plugins/xml-sitemap-feed/) or contribute code on [Github](https://github.com/RavanH/xml-sitemap-feed/).
94
 
95
  = Credits =
96
 
97
- XML Sitemap Feed was originally based on the discontinued plugin Standard XML Sitemap Generator by Patrick Chia. Since then, it has been completely rewritten and extended in many ways.
98
 
99
 
100
  == Installation ==
101
 
102
  = Wordpress =
103
 
104
- **I.** If you have been using another XML Sitemap plugin before, check your site root and remove any created sitemap.xml, sitemap-news.xml and (if you're not managing this one manually) robots.txt files that remained there.
105
-
106
- **II.** Install plugin by:
107
-
108
- Quick installation via **[Covered Web Services](http://coveredwebservices.com/wp-plugin-install/?plugin=xml-sitemap-feed)** !
109
 
110
  &hellip; OR &hellip;
111
 
112
- Search for "xml sitemap feed" and install with that slick **Plugins > Add New** admin page.
113
 
114
  &hellip; OR &hellip;
115
 
@@ -119,120 +75,137 @@ Follow these steps:
119
 
120
  2. Upload the zip file via the Plugins > Add New > Upload page &hellip; OR &hellip; unpack and upload with your favourite FTP client to the /plugins/ folder.
121
 
122
- **III.** Activate the plugin on the Plugins page.
 
 
123
 
124
- Done! Check your sparkling new XML Sitemap by visiting yourblogurl.tld/sitemap.xml (adapted to your domain name of course) with a browser or any online XML Sitemap validator. You might also want to check if the sitemap is listed in your yourblogurl.tld/robots.txt file.
125
 
126
  = WordPress 3+ in Multi Site mode =
127
 
128
  Same as above but do a **Network Activate** to make a XML sitemap available for each site on your network.
129
 
130
- Installed alongside [WordPress MU Sitewide Tags Pages](http://wordpress.org/plugins/wordpress-mu-sitewide-tags/), XML Sitemap Feed will **not** create a sitemap.xml nor change robots.txt for any **tag blogs**. This is done deliberately because they would be full of links outside the tags blogs own domain and subsequently ignored (or worse: penalised) by Google.
131
 
132
- = Uninstallation =
133
 
134
- Upon uninstalling the plugin from the Admin > Plugins page, plugin options and meta data will be cleared from the database. See notes in the uninstall.php file.
135
 
136
- On multisite, the uninstall.php *can* loop through all sites in the network to perform the uninstalltion process for each site. However, this does not scale for large networks so it *only* does a per-site uninstallation when `define('XMLSF_MULTISITE_UNINSTALL', true);` is explicitly set in wp-config.php.
137
 
138
  == Frequently Asked Questions ==
139
 
140
- = Where are the options? =
141
 
142
- On **Settings > Reading** you can enable the XML Sitemap Index and (if needed) the Google News Sitemap. There is also an Additional robots.txt rules field.
143
 
144
- Once a sitemap is enabled, its options can be found on **Settings > XML Sitemap** or on **Settings > Google News**.
145
 
146
- Ping settings can be found on **Settings > Writing**.
147
 
148
  = How do I get my latest articles listed on Google News? =
149
 
150
  Go to [Suggest News Content for Google News](http://www.google.com/support/news_pub/bin/request.py?contact_type=suggest_content) and submit your website info as detailed as possible there. Give them the URL(s) of your fresh new Google News Sitemap in the text field 'Other' at the bottom.
151
 
152
- You will also want to add the sitemap to your [Google Search Console account](https://search.google.com/search-console) to check its validity and performance. Create an account if you don't have one yet.
153
 
154
- = Can I manipulate values for Priority and Changefreq? =
155
 
156
- You can find default settings for Priority on **Settings > XML Sitemap**. A fixed priority can be set on a post by post basis too.
157
 
158
- Changefreq has been dropped since version 4.9 because it is no longer taken into account by Google.
159
 
160
- = Do I need to submit the sitemap to search engines? =
 
 
 
 
 
 
 
 
161
 
162
- No. In normal circumstances, your site will be indexed by the major search engines before you know it. The search engines will be looking for a robots.txt file and (with this plugin activated) find a pointer in it to the XML Sitemap on your blog. The search engines will return on a regular basis to see if your site has updates.
163
 
164
- Besides that, Google and Bing are pinged upon each new publication by default.
165
 
166
- **NOTE:** If you have a server _without rewrite rules_, use your blog _without fancy URLs_ (meaning, you have WordPress Permalinks set to the old default value) or have it installed in a _subdirectory_, then read **Do I need to change my robots.txt** for more instructions.
 
 
 
 
 
 
 
167
 
168
  = Does this plugin ping search engines? =
169
 
170
- Yes, Google and Bing are pinged upon each new publication. Unless you disable this feature on **Settings > Writing**.
 
 
 
 
 
171
 
172
  = Do I need to change my robots.txt? =
173
 
174
- In normal circumstances, if you have no static robots.txt file in your site root, the new sitemap url will be automatically added to the dynamic robots.txt that is generated by WordPress.
175
 
176
- If you use a static robots.txt file in your website root, you will need to open it in a text editor. If there is already a line with `Sitemap: http://yourblogurl.tld/sitemap.xml` you can just leave it like it is. But if there is no sitemap referrence there, add it (adapted to your site url) to make search engines find your XML Sitemap.
177
 
178
  Or if you have WP installed in a subdirectory, on a server without rewrite_rules or if you do not use fancy URLs in your Permalink structure settings. In these cases, WordPress will need a little help in getting ready for XML Sitemap indexing. Read on in the **WordPress** section for more.
179
 
180
  = My WordPress powered blog is installed in a subdirectory. Does that change anything? =
181
 
182
- That depends on where the index.php and .htaccess of your installation reside. If they are in the root while the rest of the WP files are installed in a subdir, so the site is accessible from your domain root, you do not have to do anything. It should work out of the box.
183
-
184
- But if the index.php is together with your wp-config.php and all other WP files in a subdir, meaning your blog is only accessible via that subdir, you need to manage your own robots.txt file in your **domain root**. It _has_ to be in the root (!) and needs a line starting with `Sitemap:` followed by the full URL to the sitemap feed provided by XML Sitemap Feed plugin. Like:
185
  `
186
  Sitemap: http://yourblogurl.tld/subdir/sitemap.xml
187
- `
188
 
189
  If you already have a robots.txt file with another Sitemap reference like it, just add the full line below or above it.
190
 
191
  = Do I need to use a fancy Permalink structure? =
192
 
193
- No. While I would advise you to use any one of the nicer Permalink structures for better indexing, you might not be able to (or don't want to) do that. If so, you can still use this plugin:
194
 
195
- Check to see if the URL yourblog.url/?feed=sitemap does produce a feed. Now manually upload your own robots.txt file to your website root containing:
196
  `
197
- Sitemap: http://yourblog.url/?feed=sitemap
198
 
199
  User-agent: *
200
  Allow: /
201
  `
202
- You can also choose to notify major search engines of your new XML sitemap manually. Start with getting a [Google Search Console account](https://search.google.com/search-console) and submit your sitemap for the first time from there to enable tracking of sitemap downloads by Google! or head over to [XML-Sitemaps.com](http://www.xml-sitemaps.com/validate-xml-sitemap.html) and enter your sites sitemap URL.
203
 
204
  = Can I change the sitemap name/URL? =
205
 
206
- No. If you have fancy URL's turned ON in WordPress (Permalinks), the sitemap url is `yourblogurl.tld/sitemap.xml` but if you have the Permalink Default option set the feed is only available via `yourblog.url/?feed=sitemap`.
 
 
 
 
 
 
207
 
208
  = I see no sitemap.xml file in my site root! =
209
 
210
- There is no actual file created. The sitemap is dynamically generated just like a feed.
211
 
212
  = I see a sitemap.xml file in site root but it does not seem to get updated! =
213
 
214
- You are most likely looking at a sitemap.xml file that has been created by another XML Sitemap plugin before you started using this one. Remove that file and let the plugin dynamically generate it just like a feed. There will not be any actual files created.
215
 
216
  If that's not the case, you are probably using a caching plugin or your browser does not update to the latest feed output. Please verify.
217
 
218
  = I use a caching plugin but the sitemap is not cached =
219
 
220
- Some caching plugins have the option to switch on/off caching of feeds. Make sure it is turned on.
221
 
222
  Frederick Townes, developer of **W3 Total Cache**, says: "There's a checkbox option on the page cache settings tab to cache feeds. They will expire according to the expires field value on the browser cache setting for HTML."
223
 
224
- The Google News sitemap is designed to NOT be cached.
225
-
226
- = I get an ERROR when opening the sitemap or robots.txt! =
227
 
228
  The absolute first thing you need to check is your blogs privacy settings. Go to **Settings > Privacy** and make sure you are **allowing search engines to index your site**. If they are blocked, your sitemap will _not_ be available.
229
 
230
- Then, you might want to make sure that there is at least ONE post published. WordPress is known to send 404 status headers with feed requests when there are NO posts. Even though the plugin tries to prevent that, in some cases the wrong status header will get sent anyway and Google Search Console will report a vague message like:
231
-
232
- We encountered an error while trying to access your Sitemap.
233
- Please ensure your Sitemap follows our guidelines and can be
234
- accessed at the location you provided and then resubmit.
235
-
236
  If that did not solve the issue, check the following errors that might be encountered along with their respective solutions:
237
 
238
  **404 page instead of my sitemap.xml**
@@ -241,20 +214,20 @@ Try to refresh the Permalink structure in WordPress. Go to Settings > Permalinks
241
 
242
  **404 page instead of both sitemap.xml and robots.txt**
243
 
244
- There are plugins like Event Calendar (at least v.3.2.beta2) known to mess with rewrite rules, causing problems with WordPress internal feeds and robots.txt generation and thus conflict with the XML Sitemap Feed plugin. Deactivate all plugins and see if you get a basic robots.txt file showing:
245
  `
246
  User-agent: *
247
  Disallow:
248
  `
249
- Reactivate your plugins one by one to find out which one is causing the problem. Then report the bug to the plugin developer.
250
 
251
  **404 page instead of robots.txt while sitemap.xml works fine**
252
 
253
- There is a known issue with WordPress (at least up to 2.8) not generating a robots.txt when there are _no posts_ with _published_ status. If you use WordPress as a CMS with only _pages_, this will affect you.
254
 
255
  To get around this, you might either at least write one post and give it _Private_ status or alternatively create your own robots.txt file containing:
256
  `
257
- Sitemap: http://yourblog.url/sitemap.xml
258
 
259
  User-agent: *
260
  Allow: /
@@ -263,359 +236,29 @@ and upload it to your web root...
263
 
264
  **Error loading stylesheet: An unknown error has occurred**
265
 
266
- On some setups (usually using the WordPress MU Domain Mapping plugin) this error occurs. The problem is known, the cause is not... Until I find out why this is happening, please take comfort in knowing that this only affects reading the sitemap in normal browsers but will NOT affect any spidering/indexing on your site. The sitemap is still readable by all search engines!
267
-
268
- **XML declaration allowed only at the start of the document**
269
-
270
- This error occurs when blank lines or other output is generated before the start of the actual sitemap content. This can be caused by blank lines at the beginning of wp-config.php or your themes functions.php or by another plugin that generates output where it shouldn't. You'll need to test by disabling all other plugins, switching to the default theme and manually inspecting your wp-config.php file.
271
 
272
  = I see only a BLANK (white) page when opening the sitemap =
273
 
274
- There are several cases where this might happen.
275
-
276
- Open your sitemap in a browser and look at the source code. This can usually be seen by hitting Ctrl+U or right-click then select 'View source...' Then scan the produced source (if any) for errors.
277
-
278
- A. If you see strange output in the first few lines (head tags) of the source, then there is a conflict or bug occuring on your installation. Please go to the [Support forum](http://wordpress.org/support/plugin/xml-sitemap-feed) for help.
279
-
280
- B. If the source is empty or incomplete then you're probably experiencing an issue with your servers PHP memory limit. In those cases, you should see a messages like `PHP Fatal error: Allowed memory size of xxxxxx bytes exhausted.` in your server/account error log file.
281
 
282
- This can happen on large sites. To avoid these issues, there is an option to split posts over different sitemaps on Settings > XML Sitemap. Try different settings, each time revisiting the main sitemap index file and open different sitemaps listed there to check.
283
-
284
- Read more on [Increasing memory allocated to PHP](http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP) (try a value higher than 256M) or ask your hosting provider what you can do.
285
-
286
- = Can I run this on a WPMU / WP3+ Multi-Site setup? =
287
-
288
- Yes. In fact, it has been designed for it. Tested on WPMU 2.9.2 and WPMS 3+ both with normal activation and with Network Activate / Site Wide Activate.
289
 
290
 
291
  == Screenshots ==
292
 
293
- 1. XML Sitemap feed viewed in a normal browser. For your eyes only ;)
294
  2. XML Sitemap source as read by search engines.
295
 
296
 
297
  == Upgrade Notice ==
298
 
299
- = 5.3.3 =
 
300
 
301
- Fix Bing ping 410 error response and help links.
302
 
303
  == Changelog ==
304
 
305
- = 5.3.3 =
306
- * FIX: Undefined variable + Invalid argument supplied for foreach(), thanks @yankyaw09
307
-
308
- = 5.3.2 =
309
- * FIX: Bing ping 410 error response
310
- * FIX: Outdated help & forum links
311
-
312
- = 5.3.1 =
313
- * FIX: Restore wp-sitemap.xml rewrite rules after deactivation
314
- * FIX: Call to undefined function xmlsf_get_archives()
315
- * Use nocache_headers()
316
-
317
- = 5.3 =
318
- * NEW: Author sitemap
319
- * NEW: allow custom theme templates and stylesheets
320
- * NEW: request filters `xmlsf_request` and `xmlsf_news_request`
321
- * NEW: news template filters `xmlsf_news_publication_name` and `xmlsf_news_title`
322
- * NEW: sitemap template action hook `xmlsf_url`
323
- * NEW: sitemap template action hooks `xmlsf_news_url` and `xmlsf_news_tags_inner`
324
- * NEW: `xmlsf_index_url_args` filter
325
- * NEW: All in One SEO Pack incompatibility message and instructions
326
- * NEW: The SEO Framework incompatibility message and instructions
327
- * Moved news template action hook `xmlsf_news_tags_after` to after closing </news:news> tag
328
- * Less DB queries, smaller memory footprint
329
- * Better debug info with SAVEQUERIES
330
- * Disable WP core sitemaps and redirect index
331
- * FIX: conflicting static file deletion
332
- * FIX: invalid form control not focusable when meta box is hidden
333
- * FIX: force Status 200 response
334
- * FIX: priority calculation last modified for post type
335
- * FIX: news sitemap redirection with Polylang
336
- * FIX: Cache-Control header no-cache
337
-
338
- = 5.2.7 =
339
- * NEW: Ad Inserter compatibility check
340
- * NEW: xmlsf_urlset and xmlsf_news_urlset action hooks, thanks to Stanislav Khromov (@khromov)
341
- * Exclude hierarchical post types from news sitemap
342
-
343
- = 5.2.6 =
344
- * NEW: xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks
345
- * Make stylesheet paths relative to prevent exclusion when using different language domains
346
- * FIX: Taxonomy selection not available to new installs
347
-
348
- = 5.2.4 =
349
- * NEW Rank Math incompatibility admin warnings
350
- * FIX undefined index
351
- * FIX invalid form control
352
-
353
- = 5.2.3 =
354
- * FIX Cannot use return value in write context
355
- * FIX issue #30 for sql_mode=ONLY_FULL_GROUP_BY, thanks @silvios
356
- * FIX invalid form control not focusable when meta box is hidden
357
-
358
- = 5.2.2 =
359
- * FIX invalid date format on some PHP versions
360
- * FIX Can't use function return value in write context
361
- * FIX non-cyrillic URLs stripped from External Web Pages field
362
- * FIX Call to undefined function xmlsf_cache_get_archives()
363
-
364
- = 5.2 =
365
- * Image query optimization and meta caching
366
- * Last comment date meta caching
367
- * Lastmod and publication dates in local time
368
- * Removed ignored image tag from news sitemap
369
- * Max memory limit for post type and taxonomy term sitemaps
370
- * Prevent CDN file urls
371
- * Zlib before GZhandler on .gz request
372
- * FIX: don't ping for excluded posts
373
- * FIX: traditional and simplified Chinese with WPML
374
- * FIX: redundant front page url
375
- * FIX: array_filter() expects parameter 1 to be array
376
- * FIX: possible division by zero
377
- * FIX: update_term_modified_meta
378
- * FIX: rewrite rules on deactivate/uninstall
379
-
380
- = 5.1.2 =
381
- * FIX: admin notice dismiss button failing
382
- * FIX: date archive redirect notice showing for inactive post types
383
- * Plugin support and rate links on plugins page
384
-
385
- = 5.1.1 =
386
- * FIX options page not found
387
- * FIX news sitemap only ping
388
-
389
- = 5.1 =
390
- * SEOPress and Catch Box incompatibility admin messages
391
- * FIX bbPress incompatibility
392
- * FIX failing last modified date for taxonomy sitemaps
393
- * FIX sitemap showing when only private posts
394
- * FIX possible sitemaps for no longer existing post types in index
395
- * Admin interface improvements: highlighting and scroll
396
- * Upgrade routines in own class only to be included when needed
397
- * Moved metabox methods to dedicated classes
398
- * NEW Respond to .gz requests (with ob_gzhandler output buffering if needed)
399
- * NEW filters xmlsf_disabled_taxonomies, xmlsf_news_keywords, xmlsf_news_stock_tickers
400
- * NEW action xmlsf_ping
401
- * NEW Tools: Ping search engines and Flush rewrite rules
402
-
403
- = 5.0.7 =
404
- * Allowed domains back to Settings > Reading
405
- * FIX static files check on activation
406
- * NEW Admin warning on conflicting plugin settings
407
- * FIX Empty post priority saved as 0.0
408
- * FIX Call to undefined function xmlsf_get_archives()
409
- * FIX force LC_NUMERIC locale to C
410
- * FIX Call to private method
411
- * FIX Custom post types with a hyphen not showing
412
- * FIX Admin static files message fatal error, thanks @kitchin
413
- * FIX Improper if statement in upgrade routine, thanks @kitchin
414
- * FIX PHP 5.4 compatibility issues
415
-
416
- = 5.0 =
417
- * Complete code restructure and cleanup: MVC and JIT inclusion
418
- * Fewer DB queries, much smaller memory footprint on normal queries
419
- * NEW Admin interface with dedicated options pages and help tabs
420
- * NEW Taxonomy term options: priority and automatic calculation
421
- * NEW Admin warning on conflicting static files
422
- * NEW Option to delete conflicting static files
423
- * NEW Filters for post types: xmlsf_post_types and xmlsf_news_post_types
424
- * NEW Filters for priority values: xmlsf_post_priority and xmlsf_term_priority
425
- * Removal of Genre, Keywords and Access tags as Google dropped support
426
- * Taxonomy term sitemaps speed improvement: get lastmod date from database
427
- * Exclude Woocommerce product_shipping_class taxonomy
428
- * PHP 7.2+ compat: create_function deprecated
429
- * No more domain filtering for custom URLs and sitemaps
430
- * FIX Gutenberg editor GN genre taxonomy not showing
431
- * FIX Plain and /index.php/ permalink structure
432
- * FIX Clear all options on uninstall
433
- * FIX Pings
434
-
435
- = 4.9.4 =
436
- * FIX: missing featured images, thanks @flyerua
437
- * FIX: double content type response header filtering
438
-
439
- = 4.9.3 =
440
- * Reinstate filter_no_news_limits, allowing post type array
441
- * Improved language handling and new language filter xmlsf_post_language
442
- * Force text/xml Content-Type response header
443
-
444
- = 4.9.2 =
445
- * FactCheck genre causes error in Search Console
446
-
447
- = 4.9.1 =
448
- * FIX: double genre terms on upgrade from 4.4, thanks @mouhalves
449
- * FIX: wp_count_posts uncached and too heavy on large sites, thanks @carlalexander
450
- * Last-modified response header now linked to Update on comments setting
451
- * FIX: plugin_basename propagation
452
-
453
- = 4.9 =
454
- * Code cleanup
455
- * NEW: FactCheck genre
456
- * Changefreq tag dropped
457
- * NEW: translation strings for genres
458
- * FIX: zlib.output_compression compatibility, thanks @alicewondermiscreations
459
- * FIX: permalink issue with Woocommerce account page endpoints
460
- * FIX: undefined index in news post types
461
-
462
- = 4.8.3 =
463
- * fix get_lastpostdate array/string
464
- * restore pre PHP 5.4 compatibility (popular request)
465
-
466
- = 4.8 =
467
- * NEW: Conditional functions is_sitemap() and is_news()
468
- * code cleanup and annotation
469
- * new google ping URL
470
- * revisit get first/last date/modified functions and cache key set/delete
471
- * FIX: cache key missing timezone
472
- * FIX: wp_rewrite init before flush_rules
473
-
474
- = 4.7.6 =
475
- * FIX Open_BaseDir issue on IIS server
476
-
477
- = 4.7.5 =
478
- * FIX: On cache_flush purge also the respective time_key cache entry,
479
- props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-in-outdated-last-modified-values-on-index-sitemap/
480
- * FIX: Variable variable php 7 compat
481
- * Detect if headers are already sent and print warning in source
482
-
483
- = 4.7.4 =
484
- * Another WPML compat issue fixed, special thanks to hermes3por3
485
-
486
- = 4.7.3 =
487
- * NEW: xmlsf_excluded filter
488
- * IMPROVEMENT: Polylang and WPML compatibility issues
489
- * FIX: "Only variables should be passed by reference" strict warning
490
- * FIX: PHP 5.3 compatibility
491
-
492
- = 4.7 =
493
- * WPML compatibility
494
- * FIX: News Sitemap chinese language tag
495
- * FIX: flush rules on plugin re-activation
496
-
497
- = 4.6.3 =
498
- * NEW: filter xmlsf_custom_sitemaps
499
- * BUGFIX: empty custom urls sitemap
500
-
501
- = 4.6.2 =
502
- * NEW: filter xmlsf_custom_urls
503
- * More cleanup
504
- * BUGFIX: broken Polylang compatibility reported by @zesseb
505
-
506
- = 4.6.1 =
507
- * Code cleanup
508
- * POT file update
509
- * Dutch translation update
510
-
511
- = 4.6 =
512
- * NEW: xmlsf_news_tags_after action hook
513
- * Attempt to remove static sitemap files left over by other sitemap plugins
514
-
515
- = 4.5.1 =
516
- * fix Persistent/Stored XSS vulnerability on admin page, thanks to Sneha Rajguru @Sneharajguru
517
-
518
- = 4.5 =
519
- * Set Google News access tag per post
520
- * Exclude posts from Google News sitemap
521
- * News Sitemap stylesheet text/links update
522
- * FIX: cache_delete cached key instead of cache_flush as suggested by Jeremy Clarke https://wordpress.org/support/topic/please-stop-running-wp_cache_flush-whenever-posts-are-edited
523
- * NEW: Nginx Helper compatibility to purge cache sitemap URLs from FastCGI Cache or Redis
524
-
525
- = 4.4.1 =
526
- * BUGFIX contribution by alejandra.aranibar: multiple news post types makes get_lastdate return oldest instead of newest date
527
- * BUGFIX plugins_url filter not working, reported by Michael
528
- * Dropped GN Geolocation tag support
529
- * Dropped XMLSF_POST_TYPE and XMLSF_NEWS_POST_TYPE defines support
530
- * Multiple default genres
531
-
532
- = 4.4 =
533
- * Pings max once per hour (5 minutes for news sitemap)
534
- * Seperate ping for Google News Sitemap
535
- * Append custom/static sitemaps to the index
536
- * Include other post types in News Sitemap
537
- * Optionally limit posts to certain categories in News Sitemap
538
- * Noindex response header for sitemaps to keep them out of search results
539
- * Static sitemap stylesheets
540
- * Controversial default robots.txt rules removed
541
- * DB query streamlining
542
- * BUGFIX: fatal error on . (dot) as category base in permalinks
543
- * BIGFIX: PHP Strict notices
544
- * Force object cache flush on post publication
545
-
546
- = 4.3.2 =
547
- * Italian translation
548
- * BUGFIX: html esc / filter image title and caption tags
549
- * BUGFIX: empty terms counted causing empty taxonomy sitemap appearing in index
550
- * BUGFIX: custom taxonomies where lastmod cannot be determined show empty lastmod tag
551
-
552
- = 4.3 =
553
- * Google News sitemap settings section
554
- * Google News tags: access, genres, keywords, geo_locations
555
- * Improved Google News stylesheet
556
- * Custom Google News Publication Name
557
- * Image tags in Google News sitemap
558
- * Custom URLs
559
- * Allow additional domains
560
- * Image caption and title tags
561
- * Ping Yandex and Baidu optional
562
- * BUGFIX: Ineffective robots.txt rules
563
- * BUGFIX: Priority value 0 in post meta not saved
564
- * BUGFIX: Ping for all post types
565
- * BUGFIX: Custom taxonomy support
566
- * BUGFIX: Split by month shows year
567
-
568
- = 4.2.4 =
569
- * NEW: Image tags
570
- * Rearranged settings section
571
- * FIX: replace permalink, title and bloginfo rss filter hooks with own
572
-
573
- = 4.2.3 =
574
- * BUGFIX: Empty ping options after disabling the main sitemap
575
- * BUGFIX: Empty language tag for Google News tags in posts sitemap
576
- * Small back end changes
577
- * NEW: Custom post types split by year/month
578
-
579
- = 4.2 =
580
- * NEW: Image & News tags
581
- * NEW: Exclude pages/posts
582
-
583
- = 4.1.4 =
584
- * BUGFIX: Pass by reference fatal error in PHP 5.4
585
- * BUGFIX: issue with Polylang language code in pretty permalinks setting
586
- * BUGFIX: unselected post types in sitemap
587
- * BUGFIX: 1+ Priority for sticky posts with comments
588
- * Dutch and French translations updated
589
-
590
- = 4.1 =
591
- * NEW: Ping Google and Bing on new publications
592
- * NEW: Set priority per post
593
- * NEW: Priority calculation options
594
- * NEW: Option to split posts by year or month for faster generation of each sitemap
595
- * Reduced queries to increase performance
596
- * Improved Lastmod and Changefreq calculations
597
- * Core class improvements
598
- * Dropped qTranslate support
599
- * Dropped PHP4 support
600
- * BUGFIX: removed several PHP notices
601
-
602
- = 4.0.1 =
603
- * NEW: Dutch and French translations
604
- * BUGFIX: Non public sites still have sitemap by default
605
- * BUGFIX: Invalid argument supplied for foreach() when all post types are off
606
- * BUGFIX: Wrong translation dir
607
-
608
- = 4.0.0 =
609
- * Moved to sitemap index and seperated post/page sitemaps
610
- * NEW: options to dswitch off sitemap and news sitemap
611
- * NEW: select which post types to include
612
- * NEW: select which taxonomies to include
613
- * NEW: set additional robots.txt rules
614
- * NEW: Translation POT catalogue
615
- * Improved Polylang support
616
- * Dropped xLanguage support
617
- * qTranslate currently untested
618
-
619
  = 3.9.2 =
620
  * Basic Google News feed stylesheet
621
  * improvement on XSS vulnerability fix
@@ -637,7 +280,7 @@ props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-i
637
  = 3.8.5 =
638
  * **xLanguage support** based on code and testing by **Daniele Pelagatti**
639
  * new FILTER HOOK `robotstxt_sitemap_url` for any translate and url changing plugins.
640
- * BUGFIX: Decimal separator cannot be a comma!
641
 
642
  = 3.8.3 =
643
  * filter out external URLs inserted by plugins like Page Links To (thanks, Francois)
@@ -689,12 +332,12 @@ props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-i
689
 
690
  = 2.0 =
691
  * priority calculation based on comments and age
692
- * changefreq based on comments
693
 
694
  = 1.0 =
695
  * changed feed template location to avoid the need to relocate files outside the plugins folder
696
  * BUGFIX: `get_post_modified_time` instead of `get_post_time`
697
 
698
  = 0.1 =
699
- * rework from Patrick Chia's [Standard XML Sitemaps](http://wordpress.org/plugins/standard-xml-sitemap/)
700
  * increased post urls limit from 100 to 1000 (of max. 50,000 allowed by the Sitemap protocol)
1
+ === XML Sitemap & Google News Sitemap Feeds ===
2
  Contributors: RavanH
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us
4
+ Tags: xml sitemap, news sitemap, sitemap.xml, Google, Google News, Yahoo, Bing, Live, MSN, seo, wpmu, feed, qtranslate, xlanguage
5
+ Requires at least: 3.1
6
+ Tested up to: 3.4.1
7
+ Stable tag: 3.9.1
 
8
 
9
+ Feeds that comply with the XML Sitemap and Google News protocol for fast indexing by Google, Yahoo, Bing, Ask and others. Multi-Site and Multi-Lingual compatible!
10
 
11
  == Description ==
12
 
13
+ This plugin dynamically creates feeds that comply with the **XML Sitemap** and the **Google News Sitemap** protocol. It is Multi-Site and Multi-Lingual compatible and there are no options to be set nor file or dir access rights to be tampered with.
14
 
15
+ You or your site owners on your Multi-site network will not be bothered with complicated settings like other XML Sitemap plugins. XML sitemap values like ChangeFreq and URL Priority is auto-calculated based on post age and comment activity.
16
 
17
+ The feeds become instantly available: One XML Sitemap on yourblogurl.tld/sitemap.xml (or yourblogurl.tld/?feed=sitemap), ready for indexing by search engines like Google, Yahoo, MSN, Ask.com and others. And one Google News Sitemap on yourblogurl.tld/sitemap-news.xml (or yourblogurl.tld/?feed=sitemap-news), ready for indexing by Google News. Both are automatically referenced in the dynamically created **robots.txt** on yourblogurl.tld/robots.txt to tell search engines where to find your XML Sitemaps.
 
 
 
 
18
 
19
  Please read the FAQ's for info on how to get your articles listed on Google News.
20
 
21
+ **Compatible with caching plugins** like WP Super Cache, W3 Total Cache and Quick Cache that cache feeds, allowing a faster serving to the hungry, impatient (!) spiders.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
+ **qTranslate and xLanguage compatible!** Tested in Pre-Path Mode and Query Mode. Each language on your site will have its own XML Sitemap.
24
 
25
+ **NOTES:**
 
 
 
26
 
27
+ 1. If you _do not use fancy URL's_ or you have WordPress installed in a _subdirectory_, a dynamic **robots.txt will NOT be generated**. You'll have to create your own and upload it to your site root! See FAQ's.
28
 
29
+ 2. On large sites, it is advised to use a good caching plugin like **Quick Cache**, **WP Super Cache** or **W3 Total Cache** to improve your site _and_ sitemap performance.
 
 
 
 
30
 
31
+ = Advantages =
32
 
33
+ * The main advantage of this plugin over other XML Sitemap plugins is **simplicity**. No need to change file or folder permissions, move files or spend time on a difficult plugin options page. In fact, there are no options at all!
34
+ * Completely **automatic** post URL _priority_ and _change frequency_ calculation based on post age and comment and trackback activity.
35
+ * Works out-of-the-box, even on **multi-site / shared codebase / multi-blog setups** like WordPress MU, WP 3.0 in MultiSite (WPMS) mode and others.
36
+ * Also works upon **Network Activate** or placed in **/mu-plugins/** on WP 3.0 in MS mode and WPMU and even takes care to exclude any tags blogs to avoid malus points for link spamming.
37
+ * Compatible with multi-lingual sites using **qTranslate** or **xLanguage** to allow all languages to be indexed equally.
38
 
39
+ = Limitations =
40
 
41
+ * The feed contains the front page and all posts and pages but _excludes_ category, tag and other dynamic archive pages. This should not be a problem and by most it is even _advised_ to exclude them. There are SEO plugins around that actively block these archive pages from search engines.
42
+ * Except by _re-saving_ older posts from time to time (keeping the lastmod date fairly recent) there is no way to manually control the priority of individual posts/pages in the sitemap. See the Faq's for more.
43
+ * This plugin does not ping any search engines. But then, WordPress does this by default already via the Ping-o-Matic service so why bother? See the Faq's for more.
44
+ * Because the feed is dynamically created, on _very_ large sites the creation process might take a while. Search engines are said to have a short fuse about waiting for a sitemap, so you may want to consider using a cache plugin that also (pre)caches feeds. If you are unfamiliar with caching and server setup start with an easy caching plugin such as **Quick Cache**. For more options (and better performance) you might find solace in **WP Super Cache** or **W3 Total Cache**.
45
+ * On **VERY** large sites (read: over 10.000 posts) with limited memory assigned to PHP, the generation of the sitemap might cause a problem when the process runs out of memory. See the FAQ's for tips to increase the PHP memory limit on your server.
46
 
47
+ = Translations =
48
 
49
+ There is nothing to translate. The sitemap protocol is international, there is no options page nor any front-end or widget output. Nothing to see here, please move along ;)
50
 
51
+ = Plugin developers =
52
 
53
+ Since 3.8.5, there is a FILTER hook `xml_sitemap_url` available that lets you filter the URL for the sitemap reference in the generated robots.txt and the home URL in the sitemap. It sends both string (for single url) and array (for multiple urls) and should receive the same. See pre-packaged examples of it's use in xml-sitemap.php for the qTranslate and xLanguage plugins.
54
 
55
  = Credits =
56
 
57
+ XML Sitemap Feed was originally based on the discontinued plugin Standard XML Sitemap Generator by Patrick Chia. Many thanks! Since then, it has been completely rewritten and extended in many ways.
58
 
59
 
60
  == Installation ==
61
 
62
  = Wordpress =
63
 
64
+ Quick installation: [Install now](http://coveredwebservices.com/wp-plugin-install/?plugin=xml-sitemap-feed) !
 
 
 
 
65
 
66
  &hellip; OR &hellip;
67
 
68
+ Search for "xml sitemap feed" and install with that slick **Plugins > Add New** back-end page.
69
 
70
  &hellip; OR &hellip;
71
 
75
 
76
  2. Upload the zip file via the Plugins > Add New > Upload page &hellip; OR &hellip; unpack and upload with your favourite FTP client to the /plugins/ folder.
77
 
78
+ 3. Activate the plugin on the Plug-ins page.
79
+
80
+ 4. If you have been using another XML Sitemap plugin before, check your site root and remove any created sitemap.xml file that remained there.
81
 
82
+ Done! Check your sparkling new XML Sitemap by visiting yourblogurl.tld/sitemap.xml (adapted to your domain name ofcourse) with a browser or any online XML Sitemap validator. You might also want to check if the sitemap is listed in your yourblogurl.tld/robots.txt file.
83
 
84
  = WordPress 3+ in Multi Site mode =
85
 
86
  Same as above but do a **Network Activate** to make a XML sitemap available for each site on your network.
87
 
88
+ = Wordpress MU =
89
 
90
+ The plugin works best from the **/mu-plugins/** folder where it runs quietly in the background without bothering any blog owner with new options or the need for special knowledge of XML Sitemap submission. Just upload the complete package content to /mu-plugins/ and move the file xml-sitemap.php from the new /mu-plugins/xml-sitemap-feed/ to /mu-plugins/.
91
 
92
+ Installed alongside [WordPress MU Sitewide Tags Pages](http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/), XML Sitemap Feed will **not** create a sitemap.xml nor change robots.txt for any **tag blogs**. This is done deliberately because they would be full of links outside the tags blogs own domain and subsequently ignored (or worse: penalised) by Google.
93
 
 
94
 
95
  == Frequently Asked Questions ==
96
 
97
+ = Can I run this on a WPMU / WP3+ Multi-Site setup? =
98
 
99
+ Yes. In fact, it has been designed for it. Tested on WPMU 2.9.2 and WPMS 3.0.1 both with normal activation and with Network Activate / Site Wide Activate.
100
 
101
+ = Can I run this plugin from /mu-plugins/ on WP3.0 MS or WPMU ? =
102
 
103
+ Yes. Upload the complete /xml-sitemap-feed/ directory to /wp-content/mu-plugins/ and move the file xml-sitemap.php one dir up.
104
 
105
  = How do I get my latest articles listed on Google News? =
106
 
107
  Go to [Suggest News Content for Google News](http://www.google.com/support/news_pub/bin/request.py?contact_type=suggest_content) and submit your website info as detailed as possible there. Give them the URL(s) of your fresh new Google News Sitemap in the text field 'Other' at the bottom.
108
 
109
+ You will also want to add the sitemap to your [Google Webmasters Tools account](https://www.google.com/webmasters/tools/) to check its validity and performance. Create an account if you don't have one yet.
110
 
111
+ = My Google News Sitemap is empty! =
112
 
113
+ The rules of the Google News game are that you do not feed the cookie monster any stale food. Older than 2 days is bad. You need to bake him some fresh bread ;)
114
 
115
+ = How are the values for priority and changefreq calculated? =
116
 
117
+ The front page has a fixed priority of 100% (1.0). When your site has more posts than pages (you must be using WordPress for a blog), pages have a default priority of 40% (0.4) and posts have a default priority of 80% (0.8). If your site has more pages than posts (you must be using WordPress as CMS), pages have a default priority of 80% (0.8) and posts have a default priority of 40% (0.4).
118
+
119
+ Page and post priority can vary between 0% (0.0) and 100% (1.0). Page priority depends on the page level (decreasing 10% for each sub-level) and relative number of comments. Post priority depends on relative number of comments and relative last comment age or (when the post has no comments) last post modification age.
120
+
121
+ The changefreq of the front page is fixed to daily and calculated for pages and post to either daily, weekly, monthly or yearly depending on age and comment activity.
122
+
123
+ Dynamic pages like category pages, tag pages and archive pages are not listed in the XML Sitemap.
124
+
125
+ = Can I manipulate values for priority and changefreq? =
126
 
127
+ Yes and No. This plugin has no options page so there is no way to manually set the priority of urls in the sitemap. But there is automatic post priority calculation based on _post modifaction date_ and _comment activity_, that can either make post priority go to 100% (1.0) for posts with many and recent comments or 0% (0) for the oldest posts with no comments.
128
 
129
+ This feature can be used to your advantage: by re-saving your most important older posts from time to time, keeping the **lastmod date** fairly recent, you can ensure a priority of at least 80% (0.8) for those URLs. And if you have enough comments on on those pages, the priority can even go up to 100% (1.0).
130
 
131
+ If you cannot live with these rules, edit the values `$min_priority`, `$max_priority` and `$frontpage_priority` in xml-sitemap-feed/feed-sitemap.php but be careful to NOT do an automatic upgrade or it will overwrite your customisation.
132
+
133
+ = Do I need to submit the sitemap to search engines? =
134
+
135
+ No. In normal circumstances, your site will be indexed by the major search engines before you know it. The search engines will be looking for a robots.txt file and (with this plugin activated) find a pointer in it to the XML Sitemap on your blog. The search engines will return on a regular basis to see if your site has updates.
136
+ ( Read more about _Ping-O-Matic_ under **Does this plugin ping search engines** (below) to make sure your site is under _normal circumstances_ ;) )
137
+
138
+ **But** if you have a server _without rewrite rules_, use your blog _without fancy URLs_ (meaning, you have WordPress Permalinks set to the old Default value) or have it installed in a _subdirectory_, read **Do I need to change my robots.txt** for more instructions.
139
 
140
  = Does this plugin ping search engines? =
141
 
142
+ No. While other XML Sitemap plugins provide pinging to some search engines upon each post edit or publication, this plugin does not. There are two reasons for that:
143
+
144
+ 1. WordPress has a built-in pinging feature. Go in your WP Admin section to Settings > Writing and make sure that the text area under **Update services** contains at least `http://rpc.pingomatic.com`. Read more on [Ping-O-Matic](http://pingomatic.com) about what excellent service you are actually getting _for free with every WordPress blog_ installation!
145
+ 1. For the average website, in my experience, pinging Google or others after each little change does not benefit anything except a theoretical smaller delay in re-indexation of your website. This is only theoretical because if your site is popular and active, major search engines will likely be crawling your site on a very regular basis anyway. And if, on the other hand, your site is not high on the agenda of the major search engines, they will likely give no priority to your pings at all.
146
+
147
+ You can always take a [Google Webmasters Tools account](https://www.google.com/webmasters/tools/) which will tell you many interesting things about your website, sitemap downloads, search terms and your visitors. Try it!
148
 
149
  = Do I need to change my robots.txt? =
150
 
151
+ That depends. In normal circumstances, if you have no physical robots.txt file in your site root, the new sitemap url will be automatically added to the dynamic robots.txt that is generated by WordPress. But in some cases this might not be the case.
152
 
153
+ If you use a static robots.txt file in your website root, you will need to open it in a text editor. If there is already a line with `Sitemap: http://yourblogurl.tld/sitemap.xml` you can just leave it like it is. But if there is no sitemap referrence there, add it (adapted to your site url) to make search engines find your XML Sitemap.
154
 
155
  Or if you have WP installed in a subdirectory, on a server without rewrite_rules or if you do not use fancy URLs in your Permalink structure settings. In these cases, WordPress will need a little help in getting ready for XML Sitemap indexing. Read on in the **WordPress** section for more.
156
 
157
  = My WordPress powered blog is installed in a subdirectory. Does that change anything? =
158
 
159
+ That depends on where the index.php and .htaccess of your installation reside. If they are in the root while the rest of the WP files are installed in a subdir, so the site is accessible from your domain root, you do not have to do anything. It should work out of the box. But if the index.php is together with your wp-config.php and all other WP files in a subdir, meaning your blog is only accessible via that subdir, you need to manage your own robots.txt file in your **domain root**. It _has_ to be in the root (!) and needs a line starting with `Sitemap:` followed by the full URL to the sitemap feed provided by XML Sitemap Feed plugin. Like:
 
 
160
  `
161
  Sitemap: http://yourblogurl.tld/subdir/sitemap.xml
162
+ `
163
 
164
  If you already have a robots.txt file with another Sitemap reference like it, just add the full line below or above it.
165
 
166
  = Do I need to use a fancy Permalink structure? =
167
 
168
+ No. While I would advise you to use any one of the nicer Permalink structures for better indexing, you might not be able to (or don't want to) do that. If so, you can still use this plugin:
169
 
170
+ Check to see if the URL yourblogurl.tld/?feed=sitemap does produce a feed. Now manually upload your own robots.txt file to your website root containing:
171
  `
172
+ Sitemap: http://yourblogurl.tld/?feed=sitemap
173
 
174
  User-agent: *
175
  Allow: /
176
  `
177
+ You can also choose to notify major search engines of your new XML sitemap manually. Start with getting a [Google Webmasters Tools account](https://www.google.com/webmasters/tools/) and submit your sitemap for the first time from there to enable tracking of sitemap downloads by Google! or head over to [XML-Sitemaps.com](http://www.xml-sitemaps.com/validate-xml-sitemap.html) and enter your sites sitemap URL.
178
 
179
  = Can I change the sitemap name/URL? =
180
 
181
+ No. If you have fancy URL's turned ON in WordPress (Permalinks), the sitemap url that you manually submit to Google (if you are impatient) should be `yourblogurl.tld/sitemap.xml` but if you have the Permalinks' Default option set the feed is only available via `yourblogurl.tld/?feed=sitemap`.
182
+
183
+ = Where can I customize the xml output? =
184
+
185
+ You may edit the XML output in `xml-sitemap-feed/feed-sitemap.php` but be careful not to break Sitemap protocol compliance. Read more on [Sitemaps XML format](http://www.sitemaps.org/protocol.php).
186
+
187
+ The stylesheet (to make the sitemap human readable) can be edited in `xml-sitemap-feed/sitemap.xsl.php`.
188
 
189
  = I see no sitemap.xml file in my site root! =
190
 
191
+ The sitemap is dynamically generated just like a feed. There is no actual file created.
192
 
193
  = I see a sitemap.xml file in site root but it does not seem to get updated! =
194
 
195
+ You are most likely looking at a sitemap.xml file that has been created by another XML Sitemap plugin before you started using this plugin. Just remove it and let the plugin dynamically generate it just like a feed. There is no actual file created.
196
 
197
  If that's not the case, you are probably using a caching plugin or your browser does not update to the latest feed output. Please verify.
198
 
199
  = I use a caching plugin but the sitemap is not cached =
200
 
201
+ Some caching plugins have the option to switch on/off caching of feeds. Make sure it is turned on.
202
 
203
  Frederick Townes, developer of **W3 Total Cache**, says: "There's a checkbox option on the page cache settings tab to cache feeds. They will expire according to the expires field value on the browser cache setting for HTML."
204
 
205
+ = I get an ERROR when opening the sitemap or robots.txt! =
 
 
206
 
207
  The absolute first thing you need to check is your blogs privacy settings. Go to **Settings > Privacy** and make sure you are **allowing search engines to index your site**. If they are blocked, your sitemap will _not_ be available.
208
 
 
 
 
 
 
 
209
  If that did not solve the issue, check the following errors that might be encountered along with their respective solutions:
210
 
211
  **404 page instead of my sitemap.xml**
214
 
215
  **404 page instead of both sitemap.xml and robots.txt**
216
 
217
+ There are plugins like Event Calendar (at least v.3.2.beta2) known to mess with rewrite rules, causing problems with WordPress internal feeds and robots.txt generation and thus conflict with the XML Sitemap Feed plugin. Deactivate all plugins and see if you get a basic robots.txt file showing:
218
  `
219
  User-agent: *
220
  Disallow:
221
  `
222
+ Reactivate your plugins one by one to find out which one is causing the problem. Then report the bug to the plugin developer.
223
 
224
  **404 page instead of robots.txt while sitemap.xml works fine**
225
 
226
+ There is a know issue with WordPress (at least up to 2.8) not generating a robots.txt when there are _no posts_ with _published_ status. If you use WordPress as a CMS with only _pages_, this will affect you.
227
 
228
  To get around this, you might either at least write one post and give it _Private_ status or alternatively create your own robots.txt file containing:
229
  `
230
+ Sitemap: http://yourblogurl.tld/sitemap.xml
231
 
232
  User-agent: *
233
  Allow: /
236
 
237
  **Error loading stylesheet: An unknown error has occurred**
238
 
239
+ On some setups (usually using the WordPress MU Domain Mapping plugin) this error occurs. The problem is known, the cause is not... Until I find out why this is happening, please take comfort in knowing that this only affects reading the sitemap in normal browsers but will NOT affect any spidering/indexing on your site. The sitemap is still readable by all search engines!
 
 
 
 
240
 
241
  = I see only a BLANK (white) page when opening the sitemap =
242
 
243
+ You might be experiencing an issue with your servers PHP memory limit. The plugin attempts to increase the memory limit to 256M by itself but in some rare cases that does not work. Or your site is just so big that that is not even enough... In those cases, you should see a messages like `PHP Fatal error: Allowed memory size of xxxxxx bytes exhausted.` in your server/account error log file.
 
 
 
 
 
 
244
 
245
+ Read more on (Increasing memory allocated to PHP)[http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP] (try a value higher than 256M) or ask your hosting provider what you can do.
 
 
 
 
 
 
246
 
247
 
248
  == Screenshots ==
249
 
250
+ 1. XML Sitemap feed viewed in a normal browser. For human eyes only ;)
251
  2. XML Sitemap source as read by search engines.
252
 
253
 
254
  == Upgrade Notice ==
255
 
256
+ = 3.9.2 =
257
+ Basic Google News feed stylesheet and XSS vulnerability improvement.
258
 
 
259
 
260
  == Changelog ==
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  = 3.9.2 =
263
  * Basic Google News feed stylesheet
264
  * improvement on XSS vulnerability fix
280
  = 3.8.5 =
281
  * **xLanguage support** based on code and testing by **Daniele Pelagatti**
282
  * new FILTER HOOK `robotstxt_sitemap_url` for any translate and url changing plugins.
283
+ * BUGFIX: Decimal separator cannot be a comma!
284
 
285
  = 3.8.3 =
286
  * filter out external URLs inserted by plugins like Page Links To (thanks, Francois)
332
 
333
  = 2.0 =
334
  * priority calculation based on comments and age
335
+ * changefreq based on comments
336
 
337
  = 1.0 =
338
  * changed feed template location to avoid the need to relocate files outside the plugins folder
339
  * BUGFIX: `get_post_modified_time` instead of `get_post_time`
340
 
341
  = 0.1 =
342
+ * rework from Patrick Chia's [Standard XML Sitemaps](http://wordpress.org/extend/plugins/standard-xml-sitemap/)
343
  * increased post urls limit from 100 to 1000 (of max. 50,000 allowed by the Sitemap protocol)
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
sitemap-index.xsl.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* ------------------------------------------
3
+ XML News Sitemap Feed Styleheet Template
4
+ ------------------------------------------ */
5
+
6
+ header('Content-Type: text/xsl; charset=utf-8', true);
7
+
8
+ echo '<?xml version="1.0" encoding="UTF-8"?>
9
+ '; ?>
10
+ <xsl:stylesheet version="2.0"
11
+ xmlns:html="http://www.w3.org/TR/REC-html40"
12
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
13
+ sitemap:news="http://www.google.com/schemas/sitemap-news/0.9"
14
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
15
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
16
+ <xsl:template match="/">
17
+ <html xmlns="http://www.w3.org/1999/xhtml">
18
+ <head>
19
+ <title>XML Sitemap Feed - Index</title>
20
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
21
+ <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:bottom}</style>
22
+ </head>
23
+ <body>
24
+ <h1>XML Sitemap Feed - Index</h1>
25
+ <div id="header">
26
+ <p>This is the XML Sitemap Index to aid search engines like <a href="http://www.google.com">Google</a>, <a href="http://www.bing.com/">Bing</a>, <a href="http://www.yahoo.com">Yahoo!</a> and <a href="http://www.ask.com">Ask</a> indexing your site better. If you have a <a href="http://www.google.com/webmasters/tools/">Google Webmaster Tools</a> and/or <a href="http://www.bing.com/toolbox/webmaster">Bing Webmaster Tools</a> account, please submit <strong><em>this index file</em></strong> as your sitemap. Read more about XML sitemaps on <a href="http://sitemaps.org">Sitemaps.org</a>.</p>
27
+ </div>
28
+ <div id="content">
29
+ <table cellpadding="5">
30
+ <tr style="border-bottom:1px black solid;">
31
+ <th>#</th>
32
+ <th>XML Sitemap</th>
33
+ <th>Last Changed</th>
34
+ </tr>
35
+ <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
36
+ <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
37
+ <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
38
+ <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
39
+ <td><xsl:value-of select="position()"/></td>
40
+ <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
41
+ <a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
42
+ </td>
43
+ <td><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/></td>
44
+ </tr>
45
+ </xsl:for-each>
46
+ </table>
47
+ </div>
48
+ <div id="footer">
49
+ <p><img src="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']); ?>/sitemapxml.gif" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" title="XML Sitemap Feed plugin for WordPress">XML &amp; Google News Sitemap Feed <?php echo (preg_match( '`^\d{1,2}\.\d{1,2}(\.\d{1,2})?$`' , $_GET['ver'] )) ? $_GET['ver'] : ''; ?></a> running on <a href="http://wordpress.org/">WordPress</a>.</p>
50
+ </div>
51
+ </body>
52
+ </html>
53
+ </xsl:template>
54
+ </xsl:stylesheet>
sitemap-news.xsl.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* ------------------------------------------
3
+ XML News Sitemap Feed Styleheet Template
4
+ ------------------------------------------ */
5
+
6
+ header('Content-Type: text/xsl; charset=utf-8', true);
7
+
8
+ echo '<?xml version="1.0" encoding="UTF-8"?>
9
+ '; ?>
10
+ <xsl:stylesheet version="2.0"
11
+ xmlns:html="http://www.w3.org/TR/REC-html40"
12
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
13
+ sitemap:news="http://www.google.com/schemas/sitemap-news/0.9"
14
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
15
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
16
+ <xsl:template match="/">
17
+ <html xmlns="http://www.w3.org/1999/xhtml">
18
+ <head>
19
+ <title>Google News Sitemap Feed</title>
20
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
21
+ <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:bottom}</style>
22
+ </head>
23
+ <body>
24
+ <h1>Google News Sitemap Feed</h1>
25
+ <div id="header">
26
+ <p>This is a Google News Sitemap to aid <a href="http://news.google.com">Google News</a> finding news on your website. Please note that <strong><em>only posts from the last 48 hours</em></strong> will be processed by Google News. Read more about <a href="http://www.google.com/schemas/sitemap-news/0.9/">Google News Sitemaps</a>, submit your site via <a href="http://www.google.com/support/news_pub/bin/request.py?contact_type=suggest_content">Google propose news content</a> and add it in your <a href="https://www.google.com/webmasters/tools/">Google Webmaster Tools</a> account.</p>
27
+ </div>
28
+ <div id="content">
29
+ <table cellpadding="5">
30
+ <tr style="border-bottom:1px black solid;">
31
+ <th>#</th>
32
+ <th>URL</th>
33
+ </tr>
34
+ <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
35
+ <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
36
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
37
+ <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
38
+ <td><xsl:value-of select="position()"/></td>
39
+ <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable>
40
+ <a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a>
41
+ </td>
42
+ </tr>
43
+ </xsl:for-each>
44
+ </table>
45
+ </div>
46
+ <div id="footer">
47
+ <p><img src="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']); ?>/sitemapxml.gif" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" title="XML Sitemap Feed plugin for WordPress">XML &amp; Google News Sitemap Feed <?php echo (preg_match( '`^\d{1,2}\.\d{1,2}(\.\d{1,2})?$`' , $_GET['ver'] )) ? $_GET['ver'] : ''; ?></a> running on <a href="http://wordpress.org/">WordPress</a>.</p>
48
+ </div>
49
+ </body>
50
+ </html>
51
+ </xsl:template>
52
+ </xsl:stylesheet>
sitemap.xsl.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* -------------------------------------
3
+ XML Sitemap Feed Styleheet Template
4
+ ------------------------------------- */
5
+
6
+ header('Content-Type: text/xsl; charset=utf-8', true);
7
+
8
+ echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
9
+ <xsl:stylesheet version="2.0"
10
+ xmlns:html="http://www.w3.org/TR/REC-html40"
11
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
12
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
13
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
14
+ <xsl:template match="/">
15
+ <html xmlns="http://www.w3.org/1999/xhtml">
16
+ <head>
17
+ <title>XML Sitemap Feed</title>
18
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19
+ <style type="text/css">body{font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;font-size:13px}#header,#footer{padding:2px;margin:10px;font-size:8pt;color:gray}a{color:black}td{font-size:11px}th{text-align:left;padding-right:30px;font-size:11px}tr.high{background-color:whitesmoke}#footer img{vertical-align:bottom}</style>
20
+ </head>
21
+ <body>
22
+ <h1>XML Sitemap Feed</h1>
23
+ <div id="header">
24
+ <p>This is an XML Sitemap to aid search engines like <a href="http://www.google.com">Google</a>, <a href="http://www.bing.com/">Bing</a>, <a href="http://www.yahoo.com">Yahoo!</a> and <a href="http://www.ask.com">Ask</a> indexing your site better. Read more about XML sitemaps on <a href="http://sitemaps.org">Sitemaps.org</a>.</p>
25
+ </div>
26
+ <div id="content">
27
+ <table cellpadding="5">
28
+ <tr style="border-bottom:1px black solid;">
29
+ <th>#</th>
30
+ <th>URL</th>
31
+ <th>Priority</th>
32
+ <th>Change Frequency</th>
33
+ <th>Last Changed</th>
34
+ </tr>
35
+ <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
36
+ <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
37
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
38
+ <tr><xsl:if test="position() mod 2 != 1"><xsl:attribute name="class">high</xsl:attribute></xsl:if>
39
+ <td><xsl:value-of select="position()"/></td>
40
+ <td><xsl:variable name="itemURL"><xsl:value-of select="sitemap:loc"/></xsl:variable><a href="{$itemURL}"><xsl:value-of select="sitemap:loc"/></a></td>
41
+ <td><xsl:value-of select="concat(sitemap:priority*100,'%')"/></td>
42
+ <td><xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/></td>
43
+ <td><xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/></td>
44
+ </tr>
45
+ </xsl:for-each>
46
+ </table>
47
+ </div>
48
+ <div id="footer">
49
+ <p><img src="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']); ?>/sitemapxml.gif" alt="XML Sitemap" title="XML Sitemap" /> generated by <a href="http://4visions.nl/wordpress-plugins/xml-sitemap-feed/" title="XML Sitemap Feed plugin for WordPress">XML &amp; Google News Sitemap Feed <?php echo (preg_match( '`^\d{1,2}\.\d{1,2}(\.\d{1,2})?$`' , $_GET['ver'] )) ? $_GET['ver'] : ''; ?></a> running on <a href="http://wordpress.org/">WordPress</a>.</p>
50
+ </div>
51
+ </body>
52
+ </html>
53
+ </xsl:template>
54
+ </xsl:stylesheet>
assets/images/sitemapxml.gif → sitemapxml.gif RENAMED
File without changes
uninstall.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * XMLSF_MULTISITE_UNINSTALL
5
- *
6
- * Set this constant in wp-config.php if you want to allow looping over each site
7
- * in the network to run XMLSitemapFeed_Uninstall->uninstall() defined in uninstall.php
8
- *
9
- * Be careful: There is NO batch-processing so it does not scale on large networks!
10
- *
11
- * example:
12
- * define('XMLSF_MULTISITE_UNINSTALL', true);
13
- */
14
-
15
- // exit if uninstall not called from WordPress
16
- defined('WP_UNINSTALL_PLUGIN') || exit();
17
-
18
- /*
19
- * XML Sitemap Feed uninstallation
20
- *
21
- * @since 4.4
22
- */
23
- class XMLSitemapFeed_Uninstall {
24
-
25
- /*
26
- * constructor: manages uninstall for multisite
27
- *
28
- * @since 4.4
29
- */
30
- function __construct()
31
- {
32
- global $wpdb;
33
-
34
- // check if it is a multisite and if XMLSF_MULTISITE_UNINSTALL constant is defined
35
- // if so, run the uninstall function for each blog id
36
- if ( is_multisite() && defined('XMLSF_MULTISITE_UNINSTALL') && XMLSF_MULTISITE_UNINSTALL ) {
37
- error_log('Clearing XML Sitemap Feeds settings from each site before uninstall:');
38
- $field = 'blog_id';
39
- $table = $wpdb->prefix.'blogs';
40
- foreach ( $wpdb->get_col("SELECT {$field} FROM {$table}") as $blog_id ) {
41
- switch_to_blog($blog_id);
42
- $this->uninstall($blog_id);
43
- }
44
- restore_current_blog();
45
- } else {
46
- $this->uninstall();
47
- }
48
- }
49
-
50
- /*
51
- * remove plugin data
52
- *
53
- * @since 4.4
54
- */
55
- function uninstall($blog_id = false)
56
- {
57
- // remove metadata
58
- global $wpdb;
59
- // posts meta
60
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_attached' ) );
61
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_featured' ) );
62
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date_gmt' ) );
63
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_priority' ) );
64
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_exclude' ) );
65
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_news_exclude' ) );
66
- // terms meta
67
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
68
-
69
- // remove transients
70
- delete_transient( 'xmlsf_flush_rewrite_rules' );
71
- delete_transient( 'xmlsf_check_static_files' );
72
- delete_transient( 'xmlsf_prefetch_post_meta_failed' );
73
-
74
- // remove plugin settings
75
- delete_option('xmlsf_version');
76
- delete_option('xmlsf_sitemaps');
77
- delete_option('xmlsf_post_types');
78
- delete_option('xmlsf_taxonomies');
79
- delete_option('xmlsf_taxonomy_settings');
80
- delete_option('xmlsf_author_settings');
81
- delete_option('xmlsf_ping');
82
- delete_option('xmlsf_robots');
83
- delete_option('xmlsf_urls');
84
- delete_option('xmlsf_custom_sitemaps');
85
- delete_option('xmlsf_domains');
86
- delete_option('xmlsf_news_tags');
87
- delete_option('xmlsf_images_meta_primed');
88
- delete_option('xmlsf_comments_meta_primed');
89
-
90
- // flush rules
91
- flush_rewrite_rules();
92
-
93
- // Kilroy was here
94
- if ( defined('WP_DEBUG') && WP_DEBUG ) {
95
- if ($blog_id)
96
- error_log( $blog_id );
97
- else
98
- error_log('XML Sitemap Feeds settings cleared on uninstall.');
99
- }
100
- }
101
- }
102
-
103
- new XMLSitemapFeed_Uninstall();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
upgrade.php DELETED
@@ -1,191 +0,0 @@
1
- <?php
2
- /*
3
- * XML Sitemap Feed upgrade routines
4
- *
5
- * @since 5.1
6
- */
7
- class XMLSitemapFeed_Upgrade {
8
-
9
- /*
10
- * constructor: manages upgrade
11
- *
12
- * @since 5.1
13
- */
14
- function __construct( $db_version = null )
15
- {
16
- // make sure rules are regenerated when admin is visited.
17
- set_transient( 'xmlsf_flush_rewrite_rules', '' );
18
- // static files checking
19
- set_transient( 'xmlsf_check_static_files', '' );
20
-
21
- if ( $db_version )
22
- $this->upgrade( $db_version );
23
- else
24
- $this->install();
25
-
26
- update_option( 'xmlsf_version', XMLSF_VERSION );
27
- }
28
-
29
- /*
30
- * set up default plugin data
31
- *
32
- * @since 5.1
33
- */
34
- private function install()
35
- {
36
- $defaults = xmlsf()->defaults();
37
-
38
- foreach ( $defaults as $option => $default ) {
39
- delete_option( 'xmlsf_'.$option );
40
- if ( in_array( $option, array( 'ping', 'robots' ) ) )
41
- add_option( 'xmlsf_'.$option, $default, null, false );
42
- else
43
- add_option( 'xmlsf_'.$option, $default );
44
- }
45
-
46
- // Kilroy was here
47
- if ( defined('WP_DEBUG') && WP_DEBUG ) {
48
- error_log('XML Sitemap Feeds version '.XMLSF_VERSION.' installed.');
49
- }
50
- }
51
-
52
- /*
53
- * upgrade plugin data
54
- *
55
- * @since 5.1
56
- */
57
- private function upgrade( $db_version )
58
- {
59
- global $wpdb;
60
-
61
- if ( version_compare( '4.4', $db_version, '>' ) ) {
62
- // remove robots.txt rules blocking stylesheets
63
- if ( $robot_rules = get_option( 'xmlsf_robots' ) ) {
64
- $robot_rules = str_replace( array('Disallow: */wp-content/','Allow: */wp-content/uploads/'), '', $robot_rules );
65
- delete_option( 'xmlsf_robots' );
66
- add_option( 'xmlsf_robots', $robot_rules, null, false );
67
- }
68
-
69
- // make sure custom sitemaps is an array
70
- $urls = get_option('xmlsf_custom_sitemaps');
71
- if ( !is_array($urls) ) {
72
- $urls = explode( PHP_EOL, $urls );
73
- update_option('xmlsf_custom_sitemaps',$urls);
74
- }
75
-
76
- // register location taxonomies then delete all terms
77
- register_taxonomy( 'gn-location-3', null );
78
- $terms = get_terms( 'gn-location-3', array('hide_empty' => false) );
79
- foreach ( $terms as $term ) {
80
- wp_delete_term( $term->term_id, 'gn-location-3' );
81
- }
82
-
83
- register_taxonomy( 'gn-location-2', null );
84
- $terms = get_terms( 'gn-location-2',array( 'hide_empty' => false ) );
85
- foreach ( $terms as $term ) {
86
- wp_delete_term( $term->term_id, 'gn-location-2' );
87
- }
88
-
89
- register_taxonomy( 'gn-location-1', null );
90
- $terms = get_terms( 'gn-location-1',array( 'hide_empty' => false ) );
91
- foreach ( $terms as $term ) {
92
- wp_delete_term( $term->term_id, 'gn-location-1' );
93
- }
94
- }
95
-
96
- if ( version_compare( '5.0.1', $db_version, '>' ) ) {
97
- // delete all taxonomy terms
98
- register_taxonomy( 'gn-genre', null );
99
-
100
- $terms = get_terms( 'gn-genre', array( 'hide_empty' => false ) );
101
-
102
- if ( is_array( $terms ) )
103
- foreach ( $terms as $term )
104
- wp_delete_term( $term->term_id, 'gn-genre' );
105
-
106
- // new taxonomy settings
107
- $taxonomies = get_option( 'xmlsf_taxonomies' );
108
- if ( empty($taxonomies) ) {
109
- $active = '';
110
- } else {
111
- $available = 0;
112
- $checked = count($taxonomies);
113
- foreach ( (array) get_option( 'xmlsf_post_types' ) as $post_type => $settings ) {
114
- if ( empty($settings['active']) ) continue;
115
- $taxonomies = get_object_taxonomies( $post_type, 'objects' );
116
- // check each tax public flag and term count and append name to array
117
- foreach ( $taxonomies as $taxonomy ) {
118
- if ( !empty( $taxonomy->public ) && !in_array( $taxonomy->name, xmlsf()->disabled_taxonomies() ) )
119
- $available++;
120
- }
121
- }
122
- if ( $checked == $available )
123
- update_option( 'xmlsf_taxonomies', '' );
124
- $active = '1';
125
- }
126
- $taxonomy_settings = array(
127
- 'active' => $active,
128
- 'priority' => '0.3',
129
- 'dynamic_priority' => '1',
130
- 'term_limit' => '5000'
131
- );
132
- add_option( 'xmlsf_taxonomy_settings', $taxonomy_settings );
133
-
134
- // update ping option
135
- $ping = get_option( 'xmlsf_ping' );
136
- $new = array( 'google', 'bing' );
137
- if ( is_array($ping) ) {
138
- foreach ( $ping as $key => $value ) {
139
- if ( is_array($value) && empty( $value['active'] ) && isset( $new[$key] ) ) {
140
- unset( $new[$key] );
141
- }
142
- }
143
- }
144
- update_option( 'xmlsf_ping', $new, false );
145
-
146
- // make sure no pong option remains
147
- delete_option( 'xmlsf_pong');
148
-
149
- // update or create robots option
150
- $robots = get_option( 'xmlsf_robots', '' );
151
- delete_option( 'xmlsf_robots');
152
- add_option( 'xmlsf_robots', $robots, null, false );
153
- }
154
-
155
- if ( version_compare( '5.1', $db_version, '>' ) ) {
156
- delete_transient('xmlsf_ping_google_sitemap_news');
157
- delete_transient('xmlsf_ping_google_sitemap');
158
- delete_transient('xmlsf_ping_bing_sitemap');
159
- }
160
-
161
- if ( version_compare( '5.2', $db_version, '>' ) ) {
162
- // remove term meta term_modified_gmt
163
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified_gmt' ) );
164
- }
165
-
166
- if ( version_compare( '5.3', $db_version, '>' ) ) {
167
- // clear comments meta
168
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date' ) );
169
- update_option( 'xmlsf_comments_meta_primed', array() );
170
- }
171
-
172
- $this->update_from_defaults();
173
-
174
- if ( defined('WP_DEBUG') && WP_DEBUG ) {
175
- error_log('XML Sitemap Feeds upgraded from '.$db_version.' to '.XMLSF_VERSION);
176
- }
177
- }
178
-
179
- private function update_from_defaults() {
180
-
181
- foreach ( xmlsf()->defaults() as $option => $default ) {
182
- if ( get_option( 'xmlsf_'.$option ) ) continue;
183
- if ( in_array( $option, array('ping','robots') ) )
184
- add_option( 'xmlsf_'.$option, $default, null, false );
185
- else
186
- add_option( 'xmlsf_'.$option, $default );
187
- }
188
-
189
- }
190
-
191
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/_generator.php DELETED
@@ -1,4 +0,0 @@
1
- <!-- generated-on="<?php echo $date; ?>" -->
2
- <!-- generator="XML Sitemap & Google News for WordPress" -->
3
- <!-- generator-url="https://status301.net/wordpress-plugins/xml-sitemap-feed/" -->
4
- <!-- generator-version="<?php echo XMLSF_VERSION; ?>" -->
 
 
 
 
views/_usage.php DELETED
@@ -1,4 +0,0 @@
1
- <!-- Queries executed: <?php echo $num; if ( $mem ) { ?> | Peak memory usage: <?php echo $mem ? $mem : 'Not availabe.'; } ?> | Memory limit: <?php echo $limit; ?> -->
2
- <!-- Query errors: <?php echo !empty($errors) ? $errors : 'None encountered.'; ?> -->
3
- <!-- Queries: <?php echo !empty($saved) ? $saved : 'Set SAVEQUERIES to show saved database queries here.'; ?> -->
4
- <!-- Average system load during the last minute: <?php $load = function_exists('sys_getloadavg') ? sys_getloadavg() : false; echo $load ? $load[0] : 'Not available.'; ?> -->
 
 
 
 
views/admin/field-news-categories.php DELETED
@@ -1,12 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <?php echo translate('Categories'); ?>
4
- </legend>
5
- <p>
6
- <?php _e('Limit to posts in these post categories:','xml-sitemap-feed'); ?>
7
- </p>
8
- <style type"text/css">ul.children{padding-left:1em}</style>
9
- <ul class="cat-checklist">
10
- <?php echo $cat_list; ?>
11
- </ul>
12
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-news-hierarchical.php DELETED
@@ -1,14 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <?php _e('Hierarchical post types','xml-sitemap-feed'); ?>
4
- </legend>
5
- <label>
6
- <input type="checkbox" name="" id="xmlsf_news_hierarchical" value="1" disabled="disabled" />
7
- <?php _e('Allow hierarchical post types', 'xml-sitemap-feed'); ?>
8
- </label>
9
-
10
- <p class="description">
11
- <?php printf( /* Translators: Pages, General */ __('Activating this option will make all hierarchical post types like %1$s available on the %2$s tab.','xml-sitemap-feed'), translate('Pages'), translate('General') ); ?>
12
- <?php printf( /* Translators: Sitemap tag name, Advanced plugin name */ __('%1$s are provided by the %2$s module.','xml-sitemap-feed'), __('Hierarchical post types','xml-sitemap-feed') ,'<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">'.__('Google News Advanced','xml-sitemap-feed').'</a>'); ?>
13
- </p>
14
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-news-keywords.php DELETED
@@ -1,13 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <?php _e('Keywords','xml-sitemap-feed'); ?>
4
- </legend>
5
- <label><?php _e('Use keywords from','xml-sitemap-feed'); ?>
6
- <select name="" disabled="disabled">
7
- <option value=""><?php echo translate('None'); ?></option>
8
- </select>
9
- </label>
10
- <p class="description">
11
- <?php printf( /* Translators: Sitemap tag name, Advanced plugin name */ __('%1$s are provided by the %2$s module.','xml-sitemap-feed'), __('Keywords','xml-sitemap-feed') ,'<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">'.__('Google News Advanced','xml-sitemap-feed').'</a>'); ?>
12
- </p>
13
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-news-labels.php DELETED
@@ -1,6 +0,0 @@
1
- <fieldset id="xmlsf_news_labels">
2
- <legend class="screen-reader-text"><?php _e('Source labels','xml-sitemap-feed'); ?></legend>
3
- <p class="description">
4
- <?php printf(__('Source labels inside a News Sitemap are no longer supported by Google News. To manage your site\'s labels, please go to the %s.','xml-sitemap-feed'),'<a href="https://publishercenter.google.com" target="_blank">'.__('Google News Publisher Center','xml-sitemap-feed').'</a>'); ?>
5
- </p>
6
- </fieldset>
 
 
 
 
 
 
views/admin/field-news-name.php DELETED
@@ -1,7 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e( 'Publication name', 'xml-sitemap-feed' ); ?></legend>
3
- <input type="text" name="xmlsf_news_tags[name]" id="xmlsf_news_name" value="<?php echo $name; ?>" class="regular-text">
4
- <p class="description">
5
- <?php printf( /* translators: Site Title linked to Options > General */ __( 'By default, the general %s setting will be used.', 'xml-sitemap-feed' ), '<a href="options-general.php">'.translate('Site Title').'</a>' ); ?>
6
- </p>
7
- </fieldset>
 
 
 
 
 
 
 
views/admin/field-news-ping-log.php DELETED
@@ -1,20 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <?php _e('Ping log','xml-sitemap-feed'); ?>
4
- </legend>
5
- <p>
6
- <label>
7
- <input type="checkbox" id="xmlsf_news_ping_log" value="1" disabled="disabled" />
8
- <?php _e('Enable Google News ping log', 'xml-sitemap-feed'); ?>
9
- </label>
10
- </p>
11
- <p>
12
- <label>
13
- <?php _e('Maximum log entries','xml-sitemap-feed'); ?>
14
- <input type="number" step="1" min="0" max="10000" id="xmlsf_news_ping_log_max" value="1000" class="medium-text" disabled="disabled" />
15
- </label>
16
- </p>
17
- <p class="description">
18
- <?php _e('Keep a log of all News Sitemap pings to Google and their responses. The log entries are stored in the database so keep the maximum number as low as is useful for you. Disabling the ping log will clear all log entries from the database.','xml-sitemap-feed'); ?>
19
- </p>
20
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-news-post-type.php DELETED
@@ -1,15 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('Post type','xml-sitemap-feed'); ?></legend>
3
- <?php foreach ( $post_types as $post_type ) : $obj = get_post_type_object( $post_type ); if ( !is_object( $obj ) ) continue; ?>
4
- <label>
5
- <input type="<?php echo $type; ?>" name="xmlsf_news_tags[post_type][]" id="xmlsf_post_type_<?php echo $obj->name; ?>" value="<?php echo $obj->name; ?>"<?php checked( in_array($obj->name, $news_post_type), true ) . disabled( !in_array($obj->name, $allowed), true ); ?> />
6
- <?php echo $obj->label; ?>
7
- </label>
8
- <br/>
9
- <?php endforeach; if ( $do_warning || 'radio' == $type ) : ?>
10
- <p class="description">
11
- <?php if ( $do_warning ) _e( 'Custom post types that do not use the post category taxonomy, cannot be included as long as any category is selected below.', 'xml-sitemap-feed' ); ?>
12
- <?php if ( 'radio' == $type ) printf( /* Translators: Advanced plugin name */ __( 'Including multiple post types in the same News Sitemap is provided by the %s module.', 'xml-sitemap-feed' ), '<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">'.__('Google News Advanced','xml-sitemap-feed').'</a>' ); ?>
13
- </p>
14
- <?php endif; ?>
15
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-news-stocktickers.php DELETED
@@ -1,14 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <?php _e('Stock tickers','xml-sitemap-feed'); ?>
4
- </legend>
5
- <label>
6
- <input type="checkbox" name="" id="xmlsf_news_stock_tickers" value="1" disabled="disabled" />
7
- <?php _e('Enable stock tickers', 'xml-sitemap-feed'); ?>
8
- </label>
9
-
10
- <p class="description">
11
- <?php _e('Stock tickers are relevant primarily for business articles.','xml-sitemap-feed'); ?>
12
- <?php printf( /* Translators: Sitemap tag name, Advanced plugin name */ __('%1$s are provided by the %2$s module.','xml-sitemap-feed'), __('Stock tickers','xml-sitemap-feed') ,'<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">'.__('Google News Advanced','xml-sitemap-feed').'</a>'); ?>
13
- </p>
14
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-ping.php DELETED
@@ -1,23 +0,0 @@
1
- <fieldset id="xmlsf_ping">
2
- <legend class="screen-reader-text"><?php echo __('Ping Services','xml-sitemap-feed'); ?></legend>
3
-
4
- <label>
5
- <input type="checkbox" name="xmlsf_ping[]" id="xmlsf_ping_google" value="google"<?php echo checked( is_array($options) && in_array('google',$options), true, false); ?> />
6
- <?php _e('Google','xml-sitemap-feed'); ?>
7
- </label>
8
-
9
- <br>
10
-
11
- <label>
12
- <input type="checkbox" name="xmlsf_ping[]" id="xmlsf_ping_bing" value="bing"<?php echo checked( is_array($options) && in_array('bing',$options), true, false); ?> />
13
- <?php _e('Bing & Yahoo','xml-sitemap-feed'); ?>
14
- </label>
15
- </fieldset>
16
- <script>
17
- jQuery( 'document' ).ready( function( $ ) {
18
- if ( window.location.hash === '#xmlsf_ping' ) {
19
- $( '#xmlsf_ping' ).closest( 'td' ).addClass( 'highlight' );
20
- $( 'html, body' ).animate( { scrollTop: $("#xmlsf_ping").offset().top-40 }, 800 );
21
- }
22
- } );
23
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-robots.php DELETED
@@ -1,7 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('Additional robots.txt rules','xml-sitemap-feed'); ?></legend>
3
-
4
- <label for="xmlsf_robots"><?php printf(__('Rules that will be appended to the %s generated by WordPress:','xml-sitemap-feed'),'<a href="'.trailingslashit(get_bloginfo('url')).'robots.txt" target="_blank">robots.txt</a>'); ?></label>
5
- <br/>
6
- <textarea name="xmlsf_robots" id="xmlsf_robots" class="large-text" cols="50" rows="6"><?php echo esc_attr( trim( get_option('xmlsf_robots','') ) ); ?></textarea>
7
- </fieldset>
 
 
 
 
 
 
 
views/admin/field-sitemap-author-settings.php DELETED
@@ -1,34 +0,0 @@
1
- <fieldset id="xmlsf_author_settings">
2
- <legend class="screen-reader-text">
3
- <?php echo translate( 'General' ); ?>
4
- </legend>
5
- <p>
6
- <label>
7
- <input type="checkbox" name="xmlsf_author_settings[active]" id="xmlsf_author_active" value="1"<?php checked( !empty( $author_settings['active'] ), true); ?> />
8
- <?php _e( 'Include authors', 'xml-sitemap-feed' ); ?> (<?php echo count( get_users( array( 'fields' => 'ID', 'who' => 'authors', 'has_published_posts' => true, ) ) ); ?>)
9
- </label>
10
- </p>
11
- <p>
12
- <label>
13
- <?php _e( 'Priority', 'xml-sitemap-feed' ); ?>
14
- <input type="number" step="0.1" min="0.1" max="0.9" name="xmlsf_author_settings[priority]" id="xmlsf_author_priority" value="<?php echo ( isset($author_settings['priority']) ? $author_settings['priority'] : '' ); ?>" class="small-text" />
15
- </label>
16
- </p>
17
- <p>
18
- <label>
19
- <?php _e( 'Maximum authors per sitemap', 'xml-sitemap-feed' ); ?>
20
- <input type="number" step="100" min="0" max="50000" name="xmlsf_author_settings[term_limit]" id="xmlsf_author_term_limit" value="<?php echo ( isset($author_settings['term_limit']) ? $author_settings['term_limit'] : '' ); ?>" class="medium-text" />
21
- </label>
22
- </p>
23
- <p class="description">
24
- <?php echo apply_filters (
25
- 'xmlsf_author_settings_description',
26
- sprintf (
27
- /* Translators: XML Sitemap Advanced */
28
- __( 'More options available in %s.', 'xml-sitemap-feed' ),
29
- '<a href="https://premium.status301.com/downloads/xml-sitemap-advanced/" target="_blank">'.__('XML Sitemap Advanced','xml-sitemap-feed').'</a>'
30
- )
31
- );
32
- ?>
33
- </p>
34
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-sitemap-custom.php DELETED
@@ -1,7 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('External XML Sitemaps','xml-sitemap-feed'); ?></legend>
3
-
4
- <label for="xmlsf_custom_sitemaps"><?php _e('Additional XML Sitemaps to append to the main XML Sitemap Index:','xml-sitemap-feed'); ?></label>
5
- <br/>
6
- <textarea name="xmlsf_custom_sitemaps" id="xmlsf_custom_sitemaps" class="large-text" cols="50" rows="4"><?php echo $lines; ?></textarea>
7
- </fieldset>
 
 
 
 
 
 
 
views/admin/field-sitemap-domains.php DELETED
@@ -1,7 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('Allowed domains','xml-sitemap-feed'); ?></legend>
3
-
4
- <label for="xmlsf_domains"><?php _e('Additional domains to allow in the XML Sitemaps:','xml-sitemap-feed'); ?></label>
5
- <br/>
6
- <textarea name="xmlsf_domains" id="xmlsf_domains" class="large-text" cols="50" rows="4"><?php echo implode("\n",$domains); ?></textarea>
7
- </fieldset>
 
 
 
 
 
 
 
views/admin/field-sitemap-name.php DELETED
@@ -1,16 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('XML Sitemap URL','xml-sitemap-feed'); ?></legend>
3
-
4
- <?php echo trailingslashit( get_home_url() ); ?><input type="text" name="xmlsf_sitemap_name" id="xmlsf_sitemap_name" placeholder="<?php echo $default; ?>" value="<?php echo $name; ?>" disabled>
5
- <p class="description" id="xmlsf-sitemap-name-description">
6
- <?php printf(
7
- /* Translators: default sitemap.xml file name */
8
- __('Set an alternative name for the sitemap index. Leave empty to use the default: %s','xml-sitemap-feed'), '<code>' . apply_filters( 'xmlsf_sitemap_filename', 'sitemap.xml' ) . '</code>'
9
- ); ?><br/>
10
- <?php printf (
11
- /* Translators: XML Sitemap Advanced */
12
- __( 'Available in %s.', 'xml-sitemap-feed' ),
13
- '<a href="https://premium.status301.com/downloads/xml-sitemap-advanced/" target="_blank">'.__('XML Sitemap Advanced','xml-sitemap-feed').'</a>'
14
- ); ?>
15
- </p>
16
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-sitemap-post-type.php DELETED
@@ -1,81 +0,0 @@
1
- <fieldset id="xmlsf_post_type_<?php echo $obj->name; ?>">
2
- <legend class="screen-reader-text">
3
- <?php echo $obj->label; ?>
4
- </legend>
5
-
6
- <p>
7
- <label>
8
- <input type="checkbox" name="xmlsf_post_types[<?php echo $obj->name; ?>][active]" id="xmlsf_post_types_<?php echo $obj->name; ?>" value="1"<?php checked( !empty($options[$obj->name]["active"]), true); ?> />
9
- <?php printf( /* translators: Post type name and post count */ __( 'Include %s', 'xml-sitemap-feed' ), $obj->label ); ?> (<?php echo $count->publish; ?>)
10
- </label>
11
- </p>
12
-
13
- <?php
14
- if ( empty($obj->hierarchical) ) {
15
- $archive = isset($options[$obj->name]['archive']) ? $options[$obj->name]['archive'] : 'yearly';
16
- ?>
17
- <p>
18
- <label><?php _e( 'Split by', 'xml-sitemap-feed' ); ?>
19
- <select name="xmlsf_post_types[<?php echo $obj->name; ?>][archive]" id="xmlsf_post_types_'<?php echo $obj->name; ?>_archive">
20
- <option value="">
21
- <?php echo translate('None'); ?>
22
- </option>
23
- <option value="yearly"<?php echo selected( $archive == 'yearly', true, false ); ?>>
24
- <?php echo __( 'Year', 'xml-sitemap-feed' ); ?>
25
- </option>
26
- <option value="monthly"<?php echo selected( $archive == 'monthly', true, false ); ?>>
27
- <?php echo __( 'Month', 'xml-sitemap-feed' ); ?>
28
- </option>
29
- <?php do_action( 'xmlsf_posttype_archive_field_options', $obj, $archive ); ?>
30
- </select>
31
- </label>
32
- <span class="description"><?php echo apply_filters(
33
- 'xmlsf_posttype_archive_field_description',
34
- sprintf( /* Translators: XML Sitemap Advanced */ __( 'More options available in %s.', 'xml-sitemap-feed' ), '<a href="https://premium.status301.com/downloads/xml-sitemap-advanced/" target="_blank">'.__('XML Sitemap Advanced','xml-sitemap-feed').'</a>' ) ); ?></span>
35
- </p>
36
- <?php
37
- }
38
-
39
- $priority_val = !empty($options[$obj->name]['priority']) ? $options[$obj->name]['priority'] : '0.5';
40
- $image = isset($options[$obj->name]['tags']['image']) ? $options[$obj->name]['tags']['image'] : 'attached';
41
- $context = ( $obj->name === 'page' ) ? 'page' : 'post';
42
- ?>
43
-
44
- <p>
45
- <label><?php echo __('Priority','xml-sitemap-feed'); ?>
46
- <input type="number" step="0.1" min="0.1" max="0.9" name="xmlsf_post_types[<?php echo $obj->name; ?>][priority]" id="xmlsf_post_types_<?php echo $obj->name; ?>_priority" value="<?php echo $priority_val; ?>" class="small-text" />
47
- </label>
48
- </p>
49
-
50
- <p>
51
- <label>
52
- <input type="checkbox" name="xmlsf_post_types[<?php echo $obj->name; ?>][dynamic_priority]" value="1"<?php echo checked( !empty($options[$obj->name]['dynamic_priority']), true, false); ?> />
53
- <?php echo __('Automatic Priority calculation.','xml-sitemap-feed'); ?>
54
- </label>
55
- </p>
56
-
57
- <p>
58
- <label>
59
- <input type="checkbox" name="xmlsf_post_types[<?php echo $obj->name; ?>][update_lastmod_on_comments]" value="1"<?php echo checked( !empty($options[$obj->name]["update_lastmod_on_comments"]), true, false); ?> />
60
- <?php echo __('Update the Last Changed date on each new comment.','xml-sitemap-feed'); ?>
61
- </label>
62
- </p>
63
-
64
- <p>
65
- <label>
66
- <?php echo __('Add image tags for','xml-sitemap-feed'); ?>
67
- <select name="xmlsf_post_types[<?php echo $obj->name; ?>][tags][image]">
68
- <option value="">
69
- <?php echo translate('None'); ?>
70
- </option>
71
- <option value="featured"<?php echo selected( $image == "featured", true, false); ?>>
72
- <?php echo translate_with_gettext_context('Featured Image',$context); ?>
73
- </option>
74
- <option value="attached"<?php echo selected( $image == "attached", true, false); ?>>
75
- <?php echo __('Attached images','xml-sitemap-feed'); ?>
76
- </option>
77
- </select>
78
- </label>
79
- </p>
80
-
81
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-sitemap-taxonomies.php DELETED
@@ -1,24 +0,0 @@
1
- <fieldset id="xmlsf_taxonomies">
2
- <legend class="screen-reader-text">
3
- <?php _e( 'Taxonomies', 'xml-sitemap-feed' ); ?>
4
- </legend>
5
- <p>
6
- <?php _e('Limit to these taxonomies:','xml-sitemap-feed'); ?>
7
- </p>
8
- <?php if ( !empty( $this->public_taxonomies() ) ) { ?>
9
- <ul class="cat-checklist">
10
- <?php foreach ( $this->public_taxonomies() as $name => $label ) { ?>
11
- <li>
12
- <label>
13
- <input type="checkbox" name="xmlsf_taxonomies[]" id="xmlsf_taxonomies_'<?php echo $name; ?>" value="<?php echo $name; ?>" <?php checked( in_array( $name, (array) $taxonomies ) ); ?>/>
14
- <?php echo $label; ?> (<?php echo wp_count_terms( $name ); ?>)
15
- </label>
16
- </li>
17
- <?php } ?>
18
- </ul>
19
- <?php } else { ?>
20
- <p class="description warning" style="color: red;">
21
- <?php _e( 'No taxonomies available for the currently included post types.', 'xml-sitemap-feed' ); ?>
22
- </p>
23
- <?php } ?>
24
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-sitemap-taxonomy-settings.php DELETED
@@ -1,34 +0,0 @@
1
- <fieldset id="xmlsf_taxonomy_settings">
2
- <legend class="screen-reader-text">
3
- <?php echo translate( 'General' ); ?>
4
- </legend>
5
- <p>
6
- <label>
7
- <input type="checkbox" name="xmlsf_taxonomy_settings[active]" id="xmlsf_taxonomy_active" value="1"<?php checked( !empty( $taxonomy_settings['active'] ), true); ?> />
8
- <?php _e( 'Include taxonomies', 'xml-sitemap-feed' ); ?> (<?php echo count( $this->public_taxonomies() ); ?>)
9
- </label>
10
- <?php if ( ! $this->public_taxonomies() ) { ?>
11
- <p class="description warning" style="color: red;">
12
- <?php _e( 'No taxonomies available for the currently included post types.', 'xml-sitemap-feed' ); ?>
13
- </p>
14
- <?php } ?>
15
- </p>
16
- <p>
17
- <label>
18
- <?php _e('Priority','xml-sitemap-feed'); ?>
19
- <input type="number" step="0.1" min="0.1" max="0.9" name="xmlsf_taxonomy_settings[priority]" id="xmlsf_taxonomy_priority" value="<?php echo ( isset($taxonomy_settings['priority']) ? $taxonomy_settings['priority'] : '' ); ?>" class="small-text" />
20
- </label>
21
- </p>
22
- <p>
23
- <label>
24
- <input type="checkbox" name="xmlsf_taxonomy_settings[dynamic_priority]" id="xmlsf_taxonomy_dynamic_priority" value="1"<?php echo checked( !empty($taxonomy_settings['dynamic_priority']), true, false ); ?> />
25
- <?php _e('Automatic Priority calculation.','xml-sitemap-feed'); ?>
26
- </label>
27
- </p>
28
- <p>
29
- <label>
30
- <?php _e('Maximum terms per sitemap','xml-sitemap-feed'); ?>
31
- <input type="number" step="100" min="0" max="50000" name="xmlsf_taxonomy_settings[term_limit]" id="xmlsf_taxonomy_term_limit" value="<?php echo ( isset($taxonomy_settings['term_limit']) ? $taxonomy_settings['term_limit'] : '' ); ?>" class="medium-text" />
32
- </label>
33
- </p>
34
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/field-sitemap-urls.php DELETED
@@ -1,7 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text"><?php _e('External web pages','xml-sitemap-feed'); ?></legend>
3
-
4
- <label for="xmlsf_urls"><?php _e('Additional web pages to append in an extra XML Sitemap:','xml-sitemap-feed'); ?></label>
5
- <br/>
6
- <textarea name="xmlsf_urls" id="xmlsf_urls" class="large-text" cols="50" rows="4"><?php echo implode("\n",$lines); ?></textarea>
7
- </fieldset>
 
 
 
 
 
 
 
views/admin/field-sitemaps.php DELETED
@@ -1,45 +0,0 @@
1
- <fieldset id="xmlsf_sitemaps">
2
- <legend class="screen-reader-text">
3
- <?php _e('Enable XML sitemaps','xml-sitemap-feed'); ?>
4
- </legend>
5
- <label>
6
- <input type="checkbox" name="xmlsf_sitemaps[sitemap]" id="xmlsf_sitemaps_index" value="sitemap.xml"<?php echo checked(isset($this->sitemaps['sitemap']), true, false); ?> />
7
- <?php _e('XML Sitemap Index','xml-sitemap-feed'); ?>
8
- </label>
9
-
10
- <?php if ( isset($this->sitemaps['sitemap']) ) {
11
- $sitemap_url = trailingslashit(get_bloginfo('url')) . ( xmlsf()->plain_permalinks() ? '?feed=sitemap' : $this->sitemaps['sitemap'] );
12
- ?>
13
- <span class="description">
14
- &nbsp;&ndash;&nbsp;
15
- <a href="<?php echo admin_url('options-general.php'); ?>?page=xmlsf" id="xmlsf_link"><?php echo translate('Settings'); ?></a> |
16
- <a href="<?php echo $sitemap_url; ?>" target="_blank"><?php echo translate('View'); ?></a>
17
- </span>
18
- <?php } ?>
19
-
20
- <br>
21
-
22
- <label>
23
- <input type="checkbox" name="xmlsf_sitemaps[sitemap-news]" id="xmlsf_sitemaps_news" value="sitemap-news.xml"<?php echo checked(isset($this->sitemaps['sitemap-news']), true, false); ?> />
24
- <?php _e('Google News Sitemap','xml-sitemap-feed'); ?>
25
- </label>
26
-
27
- <?php if (isset($this->sitemaps['sitemap-news'])) {
28
- $news_url = trailingslashit(get_bloginfo('url')) . ( xmlsf()->plain_permalinks() ? '?feed=sitemap-news' : $this->sitemaps['sitemap-news'] );
29
- ?>
30
- <span class="description">
31
- &nbsp;&ndash;&nbsp;
32
- <a href="<?php echo admin_url('options-general.php'); ?>?page=xmlsf_news" id="xmlsf_news_link"><?php echo translate('Settings'); ?></a> |
33
- <a href="<?php echo $news_url; ?>" target="_blank"><?php echo translate('View'); ?></a>
34
- </span>
35
- <?php } ?>
36
-
37
- </fieldset>
38
- <script>
39
- jQuery( 'document' ).ready( function( $ ) {
40
- if ( window.location.hash === '#xmlsf_sitemaps' ) {
41
- $( '#xmlsf_sitemaps' ).closest( 'td' ).addClass( 'highlight' );
42
- $( 'html, body' ).animate( { scrollTop: $("#xmlsf_sitemaps").offset().top-40 }, 800 );
43
- }
44
- } );
45
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-advanced.php DELETED
@@ -1,17 +0,0 @@
1
- <p>
2
- <strong><?php _e( 'External web pages', 'xml-sitemap-feed' ); ?></strong>
3
- <br />
4
- <?php _e( 'Add the full URL, including protocol (http/https) and domain.', 'xml-sitemap-feed' ); ?>
5
- <?php _e( 'Optionally add a priority value between 0 and 1, separated with a space after the URL.', 'xml-sitemap-feed' ); ?>
6
- <?php _e( 'Start each URL on a new line.', 'xml-sitemap-feed' ); ?>
7
- </p>
8
- <p>
9
- <strong><?php _e( 'External XML Sitemaps', 'xml-sitemap-feed' ); ?></strong>
10
- <br />
11
- <?php _e('Add the full URL, including protocol (http/https) and domain.','xml-sitemap-feed'); ?>
12
- <?php _e('Start each URL on a new line.','xml-sitemap-feed'); ?>
13
- <br>
14
- <span style="color: red" class="warning">
15
- <?php _e('Only valid sitemaps are allowed in the Sitemap Index. Use your Google/Bing Webmaster Tools to verify!','xml-sitemap-feed'); ?>
16
- </span>
17
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-allowed-domains.php DELETED
@@ -1,4 +0,0 @@
1
- <p>
2
- <?php printf( /* translators: WordPress site domain */ __( 'By default, only the domain %s as used in your WordPress site address is allowed.','xml-sitemap-feed'), '<strong>'.parse_url( home_url(), PHP_URL_HOST ).'</strong>' ); ?>
3
- <?php _e( 'This means that all URLs that use another domain (custom URLs or using a plugin like Page Links To) are filtered from the XML Sitemap. However, if you are the verified owner of other domains in your Google/Bing Webmaster Tools account, you can include these in the same sitemap. Add these domains, without protocol (http/https) each on a new line. Note that if you enter a domain with www, all URLs without it or with other subdomains will be filtered.','xml-sitemap-feed'); ?>
4
- </p>
 
 
 
 
views/admin/help-tab-authors.php DELETED
@@ -1,27 +0,0 @@
1
- <p>
2
- <strong><?php _e( 'Include authors', 'xml-sitemap-feed' ); ?></strong>
3
- <br />
4
- <?php _e( 'Activate this to include an author sitemap in the sitemap index. Only users of level Contributor and higher, with at least one published post, are included in the author sitemap.', 'xml-sitemap-feed' ); ?>
5
- </p>
6
- <p>
7
- <strong><?php _e( 'Priority', 'xml-sitemap-feed' ); ?></strong>
8
- <br />
9
- <?php echo __( 'Priority can be used to signal the importance of author archives relative to other content like posts, pages or taxonomy term archives.', 'xml-sitemap-feed' ); ?>
10
- </p>
11
- <p>
12
- <strong><?php _e( 'Maximum authors per sitemap', 'xml-sitemap-feed' ); ?></strong>
13
- <br />
14
- <?php _e( 'The absolute maximum allowed is 50.000 per sitemap. Reduce this number if you experience errors or slow sitemaps.', 'xml-sitemap-feed' ); ?>
15
- <?php _e( 'Authors are ordered by number of posts, starting with the most published posts down to the least. Authors without any posts will not appear in the sitemap.', 'xml-sitemap-feed' ); ?>
16
- </p>
17
- <p>
18
- <?php echo apply_filters (
19
- 'xmlsf_author_settings_description',
20
- sprintf (
21
- /* Translators: XML Sitemap Advanced */
22
- __( 'More options available in %s.', 'xml-sitemap-feed' ),
23
- '<a href="https://premium.status301.com/downloads/xml-sitemap-advanced/" target="_blank">'.__('XML Sitemap Advanced','xml-sitemap-feed').'</a>'
24
- )
25
- );
26
- ?>
27
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-news-categories.php DELETED
@@ -1,3 +0,0 @@
1
- <p>
2
- <?php _e('If you wish to limit posts that will feature in your News Sitemap to certain categories, select them here. If no categories are selected, posts of all categories will be included in your News Sitemap.','xml-sitemap-feed'); ?>
3
- </p>
 
 
 
views/admin/help-tab-news-keywords.php DELETED
@@ -1,3 +0,0 @@
1
- <p>
2
- <?php _e('Use a built-in or custom taxonomy to create a list of relevant keywords that describe the topic of the news article.','xml-sitemap-feed'); ?>
3
- </p>
 
 
 
views/admin/help-tab-news-labels.php DELETED
@@ -1,7 +0,0 @@
1
- <p>
2
- <?php _e('Source labels provide more information about the content of your articles.','xml-sitemap-feed'); ?>
3
- </p>
4
- <p>
5
- <?php printf(__('Source labels inside a News Sitemap are no longer supported by Google News. To manage your site\'s labels, please go to the %s.','xml-sitemap-feed'),'<a href="https://publishercenter.google.com/" target="_blank">'.__('Google News Publisher Center','xml-sitemap-feed').'</a>'); ?>
6
- <?php printf(__('Read more about source labels on %s','xml-sitemap-feed'),'<a href="https://support.google.com/news/publisher-center/answer/9606542" target="_blank">'.__('What does each source label mean?','xml-sitemap-feed').'</a>'); ?>
7
- </p>
 
 
 
 
 
 
 
views/admin/help-tab-news-name.php DELETED
@@ -1,4 +0,0 @@
1
- <p>
2
- <?php printf( /* translators: Site Title linked to Options > General */ __( 'By default, the general %s setting will be used.', 'xml-sitemap-feed' ), '<a href="options-general.php">'.translate('Site Title').'</a>' ); ?>
3
- <?php _e( 'The publication name should match the name submitted on the Google News Publisher Center. If you wish to change it, please read <a href="https://support.google.com/news/publisher/answer/40402" target="_blank">Updated publication name</a>.', 'xml-sitemap-feed' ); ?>
4
- </p>
 
 
 
 
views/admin/help-tab-news-sidebar.php DELETED
@@ -1,31 +0,0 @@
1
- <p>
2
- <strong><?php echo translate('General'); ?></strong>
3
- </p>
4
- <ul>
5
- <li>
6
- <a href="https://support.google.com/googlenews/" target="_blank"><?php _e( /* Translators: Site title https://support.google.com/googlenews/ */ 'Google News Help Center', 'xml-sitemap-feed' ); ?></a>
7
- </li>
8
- <li>
9
- <a href="https://support.google.com/googlenews/community" target="_blank"><?php _e( /* Translators: Forum title https://support.google.com/googlenews/community */ 'Publisher Help Forum', 'xml-sitemap-feed' ); ?></a>
10
- </li>
11
- </ul>
12
- <p>
13
- <strong><?php echo translate('For more information:'); ?></strong>
14
- </p>
15
- <ul>
16
- <li>
17
- <a href="https://developers.google.com/search/docs/advanced/sitemaps/news-sitemap" target="_blank"><?php _e( /* Translators: Article title https://developers.google.com/search/docs/advanced/sitemaps/news-sitemap */ 'Create a Google News sitemap', 'xml-sitemap-feed' ); ?></a>
18
- </li>
19
- <li>
20
- <a href="https://support.google.com/news/publisher-center/answer/9607025" target="_blank"><?php _e( /* Translators: Article title https://support.google.com/news/publisher-center/answer/9607025 */ 'Appear in Google News', 'xml-sitemap-feed' ); ?></a>
21
- </li>
22
- <li>
23
- <a href="https://developers.google.com/search/blog/2019/01/ways-to-succeed-in-google-news" target="_blank"><?php _e( /* Translators: Article title https://developers.google.com/search/blog/2019/01/ways-to-succeed-in-google-news */ 'Ways to succeed in Google News', 'xml-sitemap-feed' ); ?></a>
24
- </li>
25
- <li>
26
- <a href="https://support.google.com/news/publisher-center/answer/9607104" target="_blank"><?php _e( /* Translators: Article title https://support.google.com/news/publisher-center/answer/9607104 */ 'Best practices for your article pages', 'xml-sitemap-feed' ); ?></a>
27
- </li>
28
- <li>
29
- <a href="https://support.google.com/news/publisher-center/answer/9606470" target="_blank"><?php _e( /* Translators: Article title https://support.google.com/news/publisher-center/answer/9606470 */ 'News sitemap errors', 'xml-sitemap-feed' ); ?></a>
30
- </li>
31
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-news-stocktickers.php DELETED
@@ -1,7 +0,0 @@
1
- <p>
2
- <?php _e( 'Enabling stock tickers will create a custom taxonomy, allowing to attach stocks to individual posts.', 'xml-sitemap-feed' ); ?>
3
- <?php _e( 'Each ticker must be prefixed by the name of its stock exchange, and must match its entry in Google Finance. For example: NASDAQ:AMAT (but not NASD:AMAT) or BOM:500325 (but not BOM:RIL).', 'xml-sitemap-feed' ); ?>
4
- </p>
5
- <p>
6
- <?php _e( 'Note: Google News allows at most 5 stocks per article in the News Sitemap. The stocks must be relevant to the related news article.', 'xml-sitemap-feed' ); ?>
7
- </p>
 
 
 
 
 
 
 
views/admin/help-tab-news.php DELETED
@@ -1,20 +0,0 @@
1
- <p>
2
- <?php _e (
3
- 'The options on this page allow you to configure an XML Sitemap dedicated to keep Google News informed of your latest posts.',
4
- 'xml-sitemap-feed'
5
- ); ?>
6
- <?php _e (
7
- 'Updates are instantly pinged to Google, who will then crawl your sitemap to find out more. The sitemap adheres to the Google News Sitemap standard and helps Google News to find your news content as quickly as possible. However, it is up to you to to produce high-quality content and comply with Google News content policies!',
8
- 'xml-sitemap-feed'
9
- ); ?>
10
- </p>
11
- <p>
12
- <?php _e (
13
- 'When you are done configuring and preparing your news content and you are convinced your site adheres to the <a href="https://support.google.com/news/publisher-center/answer/6204050" target="_blank">Google News guidelines</a>, go ahead and <a href="https://publishercenter.google.com/" target="_blank">submit your site for inclusion</a>!',
14
- 'xml-sitemap-feed'
15
- ); ?>
16
- <?php _e (
17
- 'It is strongly recommended to submit your news sitemap to your Google Search Console account to monitor for warnings or errors.',
18
- 'xml-sitemap-feed'
19
- ); ?>
20
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-ping.php DELETED
@@ -1,10 +0,0 @@
1
- <p>
2
- <?php printf (
3
- /* translators: Plugin name, Reading Settings URL */
4
- __( 'If desired, %1$s will automatically alert search engines of your updated <a href="%2$s">XML Sitemaps</a> upon each new publication.', 'xml-sitemap-feed' ),
5
- __('XML Sitemap & Google News','xml-sitemap-feed'), admin_url('options-reading.php')
6
- ); ?>
7
- </p>
8
- <p>
9
- <?php _e('Pings are limited to once per hour for your XML Sitemap and once per 5 minutes for your Google News Sitemap.', 'xml-sitemap-feed'); ?>
10
- </p>
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-post-types.php DELETED
@@ -1,38 +0,0 @@
1
- <p>
2
- <strong><?php _e( 'Include...', 'xml-sitemap-feed' ); ?></strong>
3
- <br />
4
- <?php _e( 'Activate these to include a post type sitemap in the sitemap index.', 'xml-sitemap-feed' ); ?>
5
- <?php _e( 'Make sure that post types are public by following links in the sitemap in an anonymous browser window or after logging out.', 'xml-sitemap-feed' ); ?>
6
- <?php _e( 'Some post types or posts may be carrying noindex headers. Make sure to NOT include those post types or posts.', 'xml-sitemap-feed' ); ?>
7
- </p>
8
- <p>
9
- <strong><?php _e( 'Split by', 'xml-sitemap-feed' ); ?></strong>
10
- <br />
11
- <?php _e( 'Choose Split by Month if you experience errors or slow sitemaps.', 'xml-sitemap-feed' ); ?>
12
- <?php echo apply_filters(
13
- 'xmlsf_posttype_archive_field_description',
14
- sprintf( /* Translators: XML Sitemap Advanced */ __( 'More options available in %s.', 'xml-sitemap-feed' ), '<a href="https://premium.status301.com/downloads/xml-sitemap-advanced/" target="_blank">'.__('XML Sitemap Advanced','xml-sitemap-feed').'</a>' ) ); ?>
15
- </p>
16
- <p>
17
- <strong><?php _e( 'Priority', 'xml-sitemap-feed' ); ?></strong>
18
- <br />
19
- <?php echo __( 'Priority can be used to signal the relative importance of post types in general and individual posts in particular.', 'xml-sitemap-feed' ); ?>
20
- <?php echo __( 'Priority can be overridden on individual posts.', 'xml-sitemap-feed' ); ?>
21
- </p>
22
- <p>
23
- <strong><?php _e( 'Automatic Priority calculation.', 'xml-sitemap-feed' ); ?></strong>
24
- <br />
25
- <?php echo __( 'Adjusts the Priority based on factors like age, comments, sticky post or blog page.', 'xml-sitemap-feed' ); ?>
26
- <?php echo __( 'Please note: this option can make sitemap generation slower and more resource intensive.', 'xml-sitemap-feed' ); ?>
27
- </p>
28
- <p>
29
- <strong><?php _e( 'Update the Last Changed date on each new comment.', 'xml-sitemap-feed' ); ?></strong>
30
- <br />
31
- <?php echo __( 'The Last Changed timestamp will be updated whenever a comment is added. Useful for sites where user interaction like comments play a large role and give added content value. But otherwise this is not advised.', 'xml-sitemap-feed' ); ?>
32
- <?php echo __( 'Please note: this option can make sitemap generation slower and more resource intensive.', 'xml-sitemap-feed' ); ?>
33
- </p>
34
- <p>
35
- <strong><?php _e( 'Add image tags for', 'xml-sitemap-feed' ); ?></strong>
36
- <br />
37
- <?php echo __( 'Choose which images should be added to the sitemap. Note that images can be present in a post while not being attached to that post. If you have images in your Library that are not attached to any post, or not used as featured image, then those will not be present in your sitemap.', 'xml-sitemap-feed' ); ?>
38
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-robots.php DELETED
@@ -1,13 +0,0 @@
1
- <p>
2
- <?php _e('These rules will not have effect when you are using a static robots.txt file.','xml-sitemap-feed'); ?>
3
- <br>
4
- <span style="color: red" class="warning">
5
- <?php _e('Only add rules here when you know what you are doing, otherwise you might break search engine access to your site.','xml-sitemap-feed'); ?>
6
- </span>
7
- </p>
8
- <p>
9
- <a href="https://www.google.com/webmasters/tools/robots-testing-tool" target="_blank" class="button"><?php _e('Open robots.txt Tester','xml-sitemap-feed'); ?></a>
10
- </p>
11
- <p>
12
- <?php printf( __('For more help see %s and %s.','xml-sitemap-feed'), '<a href="https://developers.google.com/search/reference/robots_txt" target="_blank">'.__('Learn about robots.txt files','xml-sitemap-feed').'</a>','<a href="https://developers.google.com/search/reference/robots_txt" target="_blank">'.__('Robots.txt Specifications','xml-sitemap-feed').'</a>' ); ?>
13
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-sidebar.php DELETED
@@ -1,25 +0,0 @@
1
- <p>
2
- <strong><?php echo translate('General'); ?></strong>
3
- </p>
4
- <ul>
5
- <li>
6
- <a href="https://support.google.com/webmasters" target="_blank"><?php _e( /* Translators: Site title https://support.google.com/webmasters */ 'Search Console Help', 'xml-sitemap-feed' ); ?></a>
7
- </li>
8
- <li>
9
- <a href="https://support.google.com/webmasters/community" target="_blank"><?php _e( /* Translators: Forum title https://support.google.com/webmasters/community */ 'Webmasters Help Community', 'xml-sitemap-feed' ); ?></a>
10
- </li>
11
- </ul>
12
- <p>
13
- <strong><?php echo translate('For more information:'); ?></strong>
14
- </p>
15
- <ul>
16
- <li>
17
- <a href="https://developers.google.com/search/docs/advanced/sitemaps/overview" target="_blank"><?php _e( /* Translators: Page title https://developers.google.com/search/docs/advanced/sitemaps/overview */ 'Learn more about sitemaps on Google Search Console Help', 'xml-sitemap-feed' ); ?></a>
18
- </li>
19
- <li>
20
- <a href="https://support.google.com/webmasters/answer/7451001" target="_blank"><?php _e( /* Translators: Page title https://support.google.com/webmasters/answer/7451001 */ 'Manage sitemaps with the Sitemaps report', 'xml-sitemap-feed' ); ?></a>
21
- </li>
22
- <li>
23
- <a href="https://moz.com/blog/xml-sitemaps" target="_blank"><?php _e( /* Translators: Page title https://moz.com/blog/xml-sitemaps */ 'XML Sitemaps: The Most Misunderstood Tool in the SEO\'s Toolbox', 'xml-sitemap-feed' ); ?></a>
24
- </li>
25
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-sitemaps.php DELETED
@@ -1,11 +0,0 @@
1
- <p>
2
- <?php _e( 'XML sitemaps list the web pages of your site to tell search engines about the organization of your site content. Search engine web crawlers read this file to more intelligently crawl your site.', 'xml-sitemap-feed' ); ?>
3
- </p>
4
- <p>
5
- <?php _e( 'The options under the different tabs on this page allow you to include different content element sitemaps in the sitemap index.', 'xml-sitemap-feed' ); ?>
6
- </p>
7
- <p>
8
- <!--<strong><?php echo translate('Tools'); ?></strong>
9
- <br />-->
10
- <?php _e( 'In the side bar you can find tools related to sitemap generation, debugging and search engines, and links for more information and help. Use the button Reset settings to revert all options to their default.', 'xml-sitemap-feed' ); ?>
11
- </p>
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-support.php DELETED
@@ -1,18 +0,0 @@
1
- <hr />
2
- <p class="description">
3
- <?php printf (
4
- /* translators: Plugin name, Support forum URL on WordPress.org */
5
- __( 'These options are provided by %1$s. For help, please go to <a href="%2$s" target="_blank">Support</a>.', 'xml-sitemap-feed' ),
6
- '<strong>'.__('XML Sitemap & Google News','xml-sitemap-feed') . '</strong>', 'https://wordpress.org/support/plugin/xml-sitemap-feed'
7
- ); ?>
8
- <?php printf (
9
- /* translators: Review page URL and Translation page URL on WordPress.org */
10
- __( 'If you would like to contribute and share with the rest of the WordPress community, please consider writing a quick <a href="%1$s" target="_blank">Review</a> or help out with <a href="%2$s" target="_blank">Translating</a>!', 'xml-sitemap-feed' ),
11
- 'https://wordpress.org/support/plugin/xml-sitemap-feed/reviews/?filter=5#new-post', 'https://translate.wordpress.org/projects/wp-plugins/xml-sitemap-feed'
12
- ); ?>
13
- <?php printf (
14
- /* translators: Github project URL */
15
- __( 'For feature requests, reporting issues or contributing code, you can find and fork this plugin on <a href="%s" target="_blank">Github</a>.', 'xml-sitemap-feed' ),
16
- 'https://github.com/RavanH/xml-sitemap-feed'
17
- ); ?>
18
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/help-tab-taxonomies.php DELETED
@@ -1,26 +0,0 @@
1
- <p>
2
- <strong><?php _e( 'Include taxonomies', 'xml-sitemap-feed' ); ?></strong>
3
- <br />
4
- <?php _e( 'Activate this to include a taxonomy terms sitemap in the sitemap index.', 'xml-sitemap-feed' ); ?>
5
- </p>
6
- <p>
7
- <strong><?php _e( 'Priority', 'xml-sitemap-feed' ); ?></strong>
8
- <br />
9
- <?php echo __( 'Priority can be used to signal the importance of taxonomy term archives relative to other content like posts, pages or author archives.', 'xml-sitemap-feed' ); ?>
10
- </p>
11
- <p>
12
- <strong><?php _e( 'Automatic Priority calculation.', 'xml-sitemap-feed' ); ?></strong>
13
- <br />
14
- <?php echo __('Adjusts the Priority of each taxonomy term based on the relative number of attributed posts.','xml-sitemap-feed'); ?>
15
- </p>
16
- <p>
17
- <strong><?php _e( 'Maximum terms per sitemap', 'xml-sitemap-feed' ); ?></strong>
18
- <br />
19
- <?php _e( 'The absolute maximum allowed is 50.000 per sitemap. Reduce this number if you experience errors or slow sitemaps.', 'xml-sitemap-feed' ); ?>
20
- <?php _e( 'Terms are ordered by number of posts, starting with the most used terms down to the least used. Terms without any posts will not appear in the sitemap.', 'xml-sitemap-feed' ); ?>
21
- </p>
22
- <p>
23
- <strong><?php _e('Limit to these taxonomies:','xml-sitemap-feed'); ?></strong>
24
- <br />
25
- <?php _e( 'Select the taxonomies to include in the sitemap index. Select none to automatically include all public taxonomies.', 'xml-sitemap-feed' ); ?>
26
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/meta-box-news.php DELETED
@@ -1,6 +0,0 @@
1
- <p>
2
- <label>
3
- <input type="checkbox" name="xmlsf_news_exclude" id="xmlsf_news_exclude" value="1"<?php checked( !empty($exclude) ); disabled( $disabled ); ?> />
4
- <?php _e('Exclude from Google News Sitemap','xml-sitemap-feed'); ?>
5
- </label>
6
- </p>
 
 
 
 
 
 
views/admin/meta-box.php DELETED
@@ -1,19 +0,0 @@
1
- <p>
2
- <label>
3
- <?php _e('Priority','xml-sitemap-feed'); ?>
4
- <input type="number" step="0.1" min="0.1" max="1" name="xmlsf_priority" id="xmlsf_priority" value="<?php echo $priority; ?>" class="small-text"<?php disabled( $disabled )?> />
5
- </label>
6
- <span class="description">
7
- <?php printf(
8
- __('Leave empty for automatic Priority as configured on %1$s > %2$s.','xml-sitemap-feed'),
9
- translate('Settings'),
10
- '<a href="' . admin_url('options-general.php') . '?page=xmlsf">' . __('XML Sitemap','xml-sitemap-feed') . '</a>'
11
- ); ?>
12
- </span>
13
- </p>
14
- <p>
15
- <label>
16
- <input type="checkbox" name="xmlsf_exclude" id="xmlsf_exclude" value="1"<?php checked( !empty($exclude) ); disabled( $disabled ); ?> />
17
- <?php _e('Exclude from XML Sitemap','xml-sitemap-feed'); ?>
18
- </label>
19
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-ad-insterter-feed.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="notice notice-error fade is-dismissible">
2
- <p>
3
- <?php printf( /* Translators: RSS Feed (plugin option name), Plugin name, plugin settings page (linked) */
4
- __( 'The option %1$s in %2$s is not compatible with %3$s. Please disable it under the %4$s tab of each active ad block.', 'xml-sitemap-feed'),
5
- '<strong>' . translate('RSS Feed', 'ad-inserter') . '</strong>',
6
- '<a href="' . admin_url('options-general.php') . '?page=ad-inserter.php">' . translate('Ad Inserter', 'ad-inserter') . '</a>',
7
- __('XML Sitemap & Google News','xml-sitemap-feed'),
8
- translate('Misc', 'ad-inserter')
9
- ); ?>
10
- </p>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-aioseop-sitemap.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php printf( /* translators: Conflicting Plugn name, Plugin name */
7
- __( 'The %1$s XML Sitemap is not compatible with %2$s.', 'xml-sitemap-feed'),
8
- translate('All in One SEO Pack','all-in-one-seo-pack'),
9
- __('XML Sitemap & Google News','xml-sitemap-feed')
10
- ); ?>
11
- <?php printf( /* translators: Sitemap page name (linked to SEOPress plugin settings), XML Sitemap Index, Reading Settings admin page (linked to Reading settings) */
12
- __( 'Please either disable the XML Sitemap under %1$s in your SEO settings or disable the option %2$s on %3$s.', 'xml-sitemap-feed'),
13
- '<a href="' . admin_url('admin.php') . '?page=all-in-one-seo-pack%2Fmodules%2Faioseop_feature_manager.php">' . translate('Feature Manager','all-in-one-seo-pack') . '</a>',
14
- __('XML Sitemap Index','xml-sitemap-feed'),
15
- '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Reading Settings') . '</a>'
16
- ); ?>
17
- </p>
18
- <form action="" method="post">
19
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
20
- <p>
21
- <input type="hidden" name="xmlsf-dismiss" value="aioseop_sitemap" />
22
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
23
- </p>
24
- </form>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-catchbox-feed-redirect.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="notice notice-error fade is-dismissible">
2
- <p>
3
- <?php printf( /* Translators: Feed Redirect URL (Theme option name), Plugn name, Theme Options, Customizer (linked to Customizer page) */
4
- __( 'The Catch Box theme option %1$s is not compatible with %2$s. Please go to %3$s in the %4$s and remove it.', 'xml-sitemap-feed'),
5
- '<strong>' . translate('Feed Redirect URL', 'catch-box') . '</strong>',
6
- __('XML Sitemap & Google News','xml-sitemap-feed'),
7
- '<strong>' . translate('Theme Options', 'catch-box') . '</strong>',
8
- '<a href="' . admin_url('customize.php') . '" target="_blank">' . translate('Customizer') . '</a>'
9
- ); ?>
10
- </p>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-rankmath-date-redirect.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="notice notice-error fade is-dismissible">
2
- <p>
3
- <?php printf( /* translators: conflicting plugin name */
4
- __( 'A setting in the %s plugin causes all date based sitemaps to redirect to the main page.', 'xml-sitemap-feed'),
5
- translate('Rank Math','rank-math')
6
- ); ?>
7
- <?php printf( /* translators: Date archives, Archives (linked to WP SEO plugin settings), Split by, None, Included post types (linked to Sitemap settings) */
8
- __( 'Please either enable <strong>%1$s</strong> under %2$s in your SEO settings or set all <strong>%3$s</strong> options to <strong>%4$s</strong> under %5$s in your XML Sitemap settings.', 'xml-sitemap-feed'),
9
- translate('Date Archives','rank-math'),
10
- '<a href="' . admin_url('admin.php') . '?page=rank-math-options-titles#setting-panel-misc">' . translate('Misc Pages','rank-math') . '</a>',
11
- __( 'Split by', 'xml-sitemap-feed' ),
12
- translate('None'),
13
- '<a href="' . admin_url('options-general.php') . '?page=xmlsf">' . __('Included post types','xml-sitemap-feed') . '</a>'
14
- ); ?>
15
- </p>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-rankmath-sitemap.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php printf( /* translators: Conflicting Plugn name, Plugin name */
7
- __( 'The %1$s XML Sitemap is not compatible with %2$s.', 'xml-sitemap-feed'),
8
- translate('Rank Math','rank-math'),
9
- __('XML Sitemap & Google News','xml-sitemap-feed')
10
- ); ?>
11
- <?php printf( /* translators: Sitemap page name (linked to SEOPress plugin settings), XML Sitemap Index, Reading Settings admin page (linked to Reading settings) */
12
- __( 'Please either disable the XML Sitemap under %1$s in your SEO settings or disable the option %2$s on %3$s.', 'xml-sitemap-feed'),
13
- '<a href="' . admin_url('admin.php') . '?page=rank-math&view=modules">' . translate('Modules','rank-math') . '</a>',
14
- __('XML Sitemap Index','xml-sitemap-feed'),
15
- '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Reading Settings') . '</a>'
16
- ); ?>
17
- </p>
18
- <form action="" method="post">
19
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
20
- <p>
21
- <input type="hidden" name="xmlsf-dismiss" value="rankmath_sitemap" />
22
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
23
- </p>
24
- </form>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-seoframework-sitemap.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php printf( /* translators: Conflicting Plugn name, Plugin name */
7
- __( 'The %1$s XML Sitemap is not compatible with %2$s.', 'xml-sitemap-feed'),
8
- translate('The SEO Framework','autodescription'),
9
- __('XML Sitemap & Google News','xml-sitemap-feed')
10
- ); ?>
11
- <?php printf( /* translators: Sitemap tab name (linked to The SEO Framework plugin settings), XML Sitemap Index, Reading Settings admin page (linked to Reading settings) */
12
- __( 'Please either disable the XML Sitemap under %1$s in your SEO settings or disable the option %2$s on %3$s.', 'xml-sitemap-feed'),
13
- '<a href="' . admin_url('admin.php') . '?page=theseoframework-settings#autodescription-sitemap-settings">' . translate('Sitemap Settings','autodescription') . '</a>',
14
- __('XML Sitemap Index','xml-sitemap-feed'),
15
- '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Reading Settings') . '</a>'
16
- ); ?>
17
- </p>
18
- <form action="" method="post">
19
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
20
- <p>
21
- <input type="hidden" name="xmlsf-dismiss" value="seoframework_sitemap" />
22
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
23
- </p>
24
- </form>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-seopress-date-redirect.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="notice notice-error fade is-dismissible">
2
- <p>
3
- <?php printf( /* translators: conflicting plugin name */
4
- __( 'A setting in the %s plugin causes all date based sitemaps to redirect to the main page.', 'xml-sitemap-feed'),
5
- translate('SEOPress','wp-seopress')
6
- ); ?>
7
- <?php printf( /* translators: Date archives, Archives (linked to WP SEO plugin settings), Split by, None, Included post types (linked to Sitemap settings) */
8
- __( 'Please either enable <strong>%1$s</strong> under %2$s in your SEO settings or set all <strong>%3$s</strong> options to <strong>%4$s</strong> under %5$s in your XML Sitemap settings.', 'xml-sitemap-feed'),
9
- translate('Date archives','wp-seopress'),
10
- '<a href="' . admin_url('admin.php') . '?page=seopress-titles#tab=tab_seopress_titles_archives">' . translate('Archives','wp-seopress') . '</a>',
11
- __( 'Split by', 'xml-sitemap-feed' ),
12
- translate('None'),
13
- '<a href="' . admin_url('options-general.php') . '?page=xmlsf">' . __('Included post types','xml-sitemap-feed') . '</a>'
14
- ); ?>
15
- </p>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-seopress-sitemap.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php printf( /* translators: Conflicting Plugn name, Plugin name */
7
- __( 'The %1$s XML Sitemap is not compatible with %2$s.', 'xml-sitemap-feed'),
8
- translate('SEOPress','wp-seopress'),
9
- __('XML Sitemap & Google News','xml-sitemap-feed')
10
- ); ?>
11
- <?php printf( /* translators: Sitemap page name (linked to SEOPress plugin settings), XML Sitemap Index, Reading Settings admin page (linked to Reading settings) */
12
- __( 'Please either disable the XML Sitemap under %1$s in your SEO settings or disable the option %2$s on %3$s.', 'xml-sitemap-feed'),
13
- '<a href="' . admin_url('admin.php') . '?page=seopress-xml-sitemap">' . translate('XML / HTML Sitemap','wp-seopress') . '</a>',
14
- __('XML Sitemap Index','xml-sitemap-feed'),
15
- '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Reading Settings') . '</a>'
16
- ); ?>
17
- </p>
18
- <form action="" method="post">
19
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
20
- <p>
21
- <input type="hidden" name="xmlsf-dismiss" value="seopress_sitemap" />
22
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
23
- </p>
24
- </form>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-static-files.php DELETED
@@ -1,30 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php
7
- $number = count( self::$static_files );
8
- printf( /* translators: %1$s number of files, %2$s is Reading Settings URL */ _n(
9
- 'The following static file has been found. Either delete it or disable the conflicting <a href="%2$s">sitemap</a>.',
10
- 'The following %1$s static files have been found. Either delete them or disable the conflicting <a href="%2$s">sitemaps</a>.',
11
- $number,'xml-sitemap-feed'), number_format_i18n($number), admin_url('options-reading.php') . '#xmlsf_sitemaps'
12
- ); ?>
13
- </p>
14
- <form action="" method="post">
15
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
16
- <ul>
17
- <?php foreach ( self::$static_files as $name => $file) { ?>
18
- <li>
19
- <label><input type="checkbox" name="xmlsf-delete[]" value="<?php echo $name; ?>" /> <strong><?php echo $name; ?></strong> (<?php echo $file; ?>)</label>
20
- </li>
21
- <?php } ?>
22
- </ul>
23
- <p>
24
- <input type="submit" class="button button-small" name="xmlsf-delete-submit" value="<?php _e('Delete selected files','xml-sitemap-feed'); ?>" onclick="return confirm('<?php _e('Attempt to delete selected conflicting files.','xml-sitemap-feed'); ?>\n\n<?php echo translate('Are you sure you want to do this?'); ?>')" />
25
- &nbsp;
26
- <input type="hidden" name="xmlsf-dismiss" value="static_files" />
27
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
28
- </p>
29
- </form>
30
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-wpseo-date-redirect.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="notice notice-error fade is-dismissible">
2
- <p>
3
- <?php printf( /* translators: conflicting plugin name */
4
- __( 'A setting in the %s plugin causes all date based sitemaps to redirect to the main page.', 'xml-sitemap-feed'),
5
- translate('WordPress SEO','wordpress-seo')
6
- ); ?>
7
- <?php printf( /* translators: Date archives, Archives (linked to WP SEO plugin settings), Split by, None, Included post types (linked to Sitemap settings) */
8
- __( 'Please either enable <strong>%1$s</strong> under %2$s in your SEO settings or set all <strong>%3$s</strong> options to <strong>%4$s</strong> under %5$s in your XML Sitemap settings.', 'xml-sitemap-feed'),
9
- translate('Date archives','wordpress-seo'),
10
- '<a href="' . admin_url('admin.php') . '?page=wpseo_titles#top#archives">' . translate('Archives','wordpress-seo') . '</a>',
11
- __( 'Split by', 'xml-sitemap-feed' ),
12
- translate('None'),
13
- '<a href="' . admin_url('options-general.php') . '?page=xmlsf">' . __('Included post types','xml-sitemap-feed') . '</a>'
14
- ); ?>
15
- </p>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-wpseo-sitemap.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <p>
6
- <?php printf( /* translators: Conflicting Plugn name, Plugin name */
7
- __( 'The %1$s XML Sitemap is not compatible with %2$s.', 'xml-sitemap-feed'),
8
- translate('WordPress SEO','wordpress-seo'),
9
- __( 'XML Sitemap & Google News', 'xml-sitemap-feed' )
10
- ); ?>
11
- <?php printf( /* translators: Sitemap page name (linked to SEOPress plugin settings), XML Sitemap Index, Reading Settings admin page (linked to Reading settings) */
12
- __( 'Please either disable the XML Sitemap under %1$s in your SEO settings or disable the option %2$s on %3$s.', 'xml-sitemap-feed'),
13
- '<a href="' . admin_url('admin.php') . '?page=wpseo_dashboard#top#features">' . translate('Features','wordpress-seo') . '</a>',
14
- __('XML Sitemap Index','xml-sitemap-feed'),
15
- '<a href="' . admin_url('options-reading.php') . '#xmlsf_sitemaps">' . translate('Reading Settings') . '</a>'
16
- ); ?>
17
- </p>
18
- <form action="" method="post">
19
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
20
- <p>
21
- <input type="hidden" name="xmlsf-dismiss" value="wpseo_sitemap" />
22
- <input type="submit" class="button button-small" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
23
- </p>
24
- </form>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/notice-xmlsf-advanced-news.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="notice notice-warning fade is-dismissible">
2
- <p>
3
- <strong><?php _e('XML Sitemap & Google News','xml-sitemap-feed'); ?></strong>
4
- </p>
5
- <form action="" method="post">
6
- <?php wp_nonce_field( XMLSF_BASENAME.'-notice', '_xmlsf_notice_nonce' ); ?>
7
- <input type="hidden" name="xmlsf-dismiss" value="xmlsf_advanced_news" />
8
- <input type="submit" class="button button-small alignright" name="xmlsf-dismiss-submit" value="<?php echo translate('Dismiss'); ?>" />
9
- </form>
10
- <?php include XMLSF_DIR . '/views/admin/section-advanced-compat-message.php'; ?>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
views/admin/page-sitemap-news.php DELETED
@@ -1,80 +0,0 @@
1
- <style type="text/css">
2
- <?php include XMLSF_DIR . '/assets/admin.css'; ?>
3
- </style>
4
- <div class="wrap">
5
-
6
- <h1><?php _e('Google News Sitemap','xml-sitemap-feed'); ?></h1>
7
-
8
- <p>
9
- <?php printf( __( 'These settings control the Google News Sitemap generated by the %s plugin.', 'xml-sitemap-feed' ), __( 'XML Sitemap & Google News', 'xml-sitemap-feed' ) ); ?>
10
- <?php printf( /* translators: Writing Settings URL */ __( 'For ping options, go to %s.', 'xml-sitemap-feed' ), '<a href="'.admin_url('options-writing.php').'#xmlsf_ping">'.translate('Writing Settings').'</a>' ); ?>
11
- </p>
12
-
13
- <nav class="nav-tab-wrapper">
14
- <a href="?page=xmlsf_news&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>"><?php echo translate('General'); ?></a>
15
- <a href="?page=xmlsf_news&tab=advanced" class="nav-tab <?php echo $active_tab == 'advanced' ? 'nav-tab-active' : ''; ?>"><?php echo translate('Advanced'); ?></a>
16
- <?php do_action( 'xmlsf_news_nav_tabs', $active_tab ); ?>
17
- </nav>
18
-
19
- <div class="main">
20
- <form method="post" action="options.php">
21
-
22
- <?php do_action( 'xmlsf_news_settings_before', $active_tab ); ?>
23
-
24
- <?php settings_fields( 'xmlsf_news_'.$active_tab ); ?>
25
-
26
- <?php do_settings_sections( 'xmlsf_news_'.$active_tab ); ?>
27
-
28
- <?php do_action( 'xmlsf_news_settings_after', $active_tab ); ?>
29
-
30
- <?php submit_button(); ?>
31
-
32
- </form>
33
- </div>
34
-
35
- <div class="sidebar">
36
-
37
- <?php if ( defined( 'XMLSF_NEWS_ADV_VERSION' ) && version_compare( XMLSF_NEWS_ADV_VERSION, parent::$compat_pro_min, '<' ) ) {
38
- $class = 'update-nag';
39
- include XMLSF_DIR . '/views/admin/section-advanced-compat-message.php';
40
- } ?>
41
-
42
- <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo translate('View'); ?></h3>
43
- <p>
44
- <?php
45
- printf (
46
- /* translators: Sitemap name with URL */
47
- __( 'Open your %s', 'xml-sitemap-feed' ),
48
- '<strong><a href="' . home_url( $sitemap ) . '" target="_blank">' . __('Google News Sitemap','xml-sitemap-feed') . '</a></strong><span class="dashicons dashicons-external"></span>'
49
- ); ?>
50
- </p>
51
-
52
- <h3><span class="dashicons dashicons-admin-tools"></span> <?php echo translate('Tools'); ?></h3>
53
- <form action="" method="post">
54
- <?php wp_nonce_field( XMLSF_BASENAME.'-help', '_xmlsf_help_nonce' ); ?>
55
- <p>
56
- <input type="submit" name="xmlsf-ping-sitemap-news" class="button button-small" value="<?php _e( 'Ping Google News', 'xml-sitemap-feed' ); ?>" />
57
- </p>
58
- <p>
59
- <input type="submit" name="xmlsf-flush-rewrite-rules" class="button button-small" value="<?php _e( 'Flush rewrite rules', 'xml-sitemap-feed' ); ?>" />
60
- </p>
61
- <p>
62
- <input type="submit" name="xmlsf-check-conflicts" class="button button-small" value="<?php _e( 'Check for conflicts', 'xml-sitemap-feed' ); ?>" />
63
- </p>
64
- <p>
65
- <input type="hidden" name="xmlsf-clear-settings" value="sitemap-news" />
66
- <input type="submit" name="xmlsf-clear-settings-submit" class="button button-small button-link-delete" value="<?php _e( 'Reset settings', 'xml-sitemap-feed' ); ?>" onclick="javascript:return confirm('<?php _e('This will revert your sitemap settings to the plugin defaults.','xml-sitemap-feed'); ?>\n\n<?php echo translate('Are you sure you want to do this?'); ?>')" />
67
- </p>
68
- </form>
69
-
70
- <?php include XMLSF_DIR . '/views/admin/sidebar-news-links.php'; ?>
71
-
72
- <?php include XMLSF_DIR . '/views/admin/sidebar-help.php'; ?>
73
-
74
- <?php include XMLSF_DIR . '/views/admin/help-tab-news-sidebar.php'; ?>
75
-
76
- <?php include XMLSF_DIR . '/views/admin/sidebar-contribute.php'; ?>
77
-
78
- </div>
79
-
80
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/page-sitemap.php DELETED
@@ -1,77 +0,0 @@
1
- <style type="text/css">
2
- <?php include XMLSF_DIR . '/assets/admin.css'; ?>
3
- </style>
4
- <div class="wrap">
5
-
6
- <h1><?php _e('XML Sitemap','xml-sitemap-feed'); ?></h1>
7
-
8
- <p>
9
- <?php printf( /* translators: Plugin name */ __('These settings control the XML Sitemaps generated by the %s plugin.','xml-sitemap-feed'),__('XML Sitemap & Google News','xml-sitemap-feed')); ?>
10
- <?php printf( /* translators: Writing Settings URL */ __('For ping options, go to %s.','xml-sitemap-feed'),'<a href="'.admin_url('options-writing.php').'#xmlsf_ping">'.translate('Writing Settings').'</a>'); ?>
11
- </p>
12
-
13
- <nav class="nav-tab-wrapper">
14
- <a class="nav-tab<?php echo $active_tab == 'post_types' ? ' nav-tab-active' : '" href="?page=xmlsf&tab=post_types'; ?>"><?php _e('Post types','xml-sitemap-feed'); ?></a>
15
- <a class="nav-tab<?php echo $active_tab == 'taxonomies' ? ' nav-tab-active' : '" href="?page=xmlsf&tab=taxonomies'; ?>"><?php _e('Taxonomies','xml-sitemap-feed'); ?></a>
16
- <a class="nav-tab<?php echo $active_tab == 'authors' ? ' nav-tab-active' : '" href="?page=xmlsf&tab=authors'; ?>"><?php _e('Authors','xml-sitemap-feed'); ?></a>
17
- <a class="nav-tab<?php echo $active_tab == 'advanced' ? ' nav-tab-active' : '" href="?page=xmlsf&tab=advanced'; ?>"><?php echo translate('Advanced'); ?></a>
18
- <?php do_action( 'xmlsf_sitemap_nav_tabs', $active_tab ); ?>
19
- </nav>
20
-
21
- <div class="main">
22
- <form method="post" action="options.php">
23
-
24
- <?php settings_fields( 'xmlsf_'.$active_tab ); ?>
25
-
26
- <?php do_settings_sections( 'xmlsf_'.$active_tab ); ?>
27
-
28
- <?php submit_button(); ?>
29
-
30
- </form>
31
- </div>
32
-
33
- <div class="sidebar">
34
- <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo translate('View'); ?></h3>
35
- <p>
36
- <?php
37
- printf (
38
- /* translators: Sitemap name with URL */
39
- __( 'Open your %s', 'xml-sitemap-feed' ),
40
- '<strong><a href="' . home_url( $sitemap ) . '" target="_blank">' . __('XML Sitemap Index','xml-sitemap-feed') . '</a></strong><span class="dashicons dashicons-external"></span>'
41
- ); ?>
42
- </p>
43
-
44
- <h3><span class="dashicons dashicons-admin-tools"></span> <?php echo translate('Tools'); ?></h3>
45
- <form action="" method="post">
46
- <?php wp_nonce_field( XMLSF_BASENAME.'-help', '_xmlsf_help_nonce' ); ?>
47
- <p>
48
- <input type="submit" name="xmlsf-ping-sitemap" class="button button-small" value="<?php _e( 'Ping search engines', 'xml-sitemap-feed' ); ?>" />
49
- </p>
50
- <p>
51
- <input type="submit" name="xmlsf-flush-rewrite-rules" class="button button-small" value="<?php _e( 'Flush rewrite rules', 'xml-sitemap-feed' ); ?>" />
52
- </p>
53
- <p>
54
- <input type="submit" name="xmlsf-check-conflicts" class="button button-small" value="<?php _e( 'Check for conflicts', 'xml-sitemap-feed' ); ?>" />
55
- </p>
56
- <p>
57
- <?php //printf( __('%1$s or %2$s all cached Sitemap metadata.'), '<input type="submit" name="xmlsf-prime-meta" class="button button-small" value="'.__( 'Rebuild', 'xml-sitemap-feed' ).'"/>', '<input type="submit" name="xmlsf-clear-meta" class="button button-small" value="'.__( 'Clear', 'xml-sitemap-feed' ).'"/>'); ?>
58
- <input type="submit" name="xmlsf-clear-post-meta" class="button button-small" value="<?php _e( 'Clear post meta caches', 'xml-sitemap-feed' ); ?>" />
59
- <input type="submit" name="xmlsf-clear-term-meta" class="button button-small" value="<?php _e( 'Clear term meta cache', 'xml-sitemap-feed' ); ?>" />
60
- </p>
61
- <p>
62
- <input type="hidden" name="xmlsf-clear-settings" value="sitemap" />
63
- <input type="submit" name="xmlsf-clear-settings-submit" class="button button-small button-link-delete" value="<?php _e( 'Reset settings', 'xml-sitemap-feed' ); ?>" onclick="javascript:return confirm('<?php _e('This will revert your sitemap settings to the plugin defaults.','xml-sitemap-feed'); ?>\n\n<?php echo translate('Are you sure you want to do this?'); ?>')" />
64
- </p>
65
- </form>
66
-
67
- <?php include XMLSF_DIR . '/views/admin/sidebar-links.php'; ?>
68
-
69
- <?php include XMLSF_DIR . '/views/admin/sidebar-help.php'; ?>
70
-
71
- <?php include XMLSF_DIR . '/views/admin/help-tab-sidebar.php'; ?>
72
-
73
- <?php include XMLSF_DIR . '/views/admin/sidebar-contribute.php'; ?>
74
-
75
- </div>
76
-
77
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/section-advanced-compat-message.php DELETED
@@ -1,7 +0,0 @@
1
- <p<?php echo ! empty( $class ) ? ' class="'.$class.'' : '' ?>">
2
- <?php _e ( 'Your current version of Google News Advanced is outdated. Some advanced options may not be functional.', 'xml-sitemap-feed' ); ?>
3
- <?php printf (
4
- __( 'Please <a href="%1$s" target="_blank">download and install the latest version</a>.', 'xml-sitemap-feed' ),
5
- 'https://premium.status301.com/account/'
6
- ); ?>
7
- </p>
 
 
 
 
 
 
 
views/admin/section-advanced-intro.php DELETED
@@ -1,3 +0,0 @@
1
- <p>
2
- <?php printf( /* Translators: Advanced options, Advanced plugin name */ __('%1$s are provided by the %2$s module.','xml-sitemap-feed'), __('Advanced options','xml-sitemap-feed') ,'<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">'.__('Google News Advanced','xml-sitemap-feed').'</a>'); ?>
3
- </p>
 
 
 
views/admin/sidebar-contribute.php DELETED
@@ -1,19 +0,0 @@
1
- <h3><span class="dashicons dashicons-thumbs-up"></span> <?php _e('Contribute','xml-sitemap-feed'); ?></h3>
2
- <p>
3
- <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feeds&item_number=version%20<?php echo XMLSF_VERSION; ?>&no_shipping=0&tax=0&charset=UTF%2d8"
4
- title="<?php printf(__('Donate to keep the free %s plugin development & support going!','xml-sitemap-feed'),__('XML Sitemap & Google News','xml-sitemap-feed')); ?>">
5
- <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" style="border:none;float:right;margin:4px 0 0 10px" width="92" height="26" />
6
- </a>
7
- <?php printf (
8
- /* translators: Review page URL and Translation page URL on WordPress.org */
9
- __( 'If you would like to contribute and share with the rest of the WordPress community, please consider writing a quick <a href="%1$s" target="_blank">Review</a> or help out with <a href="%2$s" target="_blank">Translating</a>!', 'xml-sitemap-feed' ),
10
- 'https://wordpress.org/support/plugin/xml-sitemap-feed/reviews/?filter=5#new-post', 'https://translate.wordpress.org/projects/wp-plugins/xml-sitemap-feed'
11
- ); ?>
12
- </p>
13
- <p>
14
- <?php printf (
15
- /* translators: Github project URL */
16
- __( 'For feature requests, reporting issues or contributing code, you can find and fork this plugin on <a href="%s" target="_blank">Github</a>.', 'xml-sitemap-feed' ),
17
- 'https://github.com/RavanH/xml-sitemap-feed'
18
- ); ?>
19
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/sidebar-help.php DELETED
@@ -1,8 +0,0 @@
1
- <h3><span class="dashicons dashicons-sos"></span> <?php echo translate('Help'); ?></h3>
2
- <p>
3
- <?php printf (
4
- /* translators: Support forum URL on WordPress.org */
5
- __( 'You can find instructions on the help tab above. If you still have questions, please go to the <a href="%s" target="_blank">Support forum</a>.', 'xml-sitemap-feed' ),
6
- 'https://wordpress.org/support/plugin/xml-sitemap-feed'
7
- ); ?>
8
- </p>
 
 
 
 
 
 
 
 
views/admin/sidebar-links.php DELETED
@@ -1,18 +0,0 @@
1
- <h3><span class="dashicons dashicons-admin-links"></span> <?php echo translate('Links'); ?></h3>
2
- <ul>
3
- <li>
4
- <a href="https://search.google.com/search-console" target="_blank"><?php _e( /* Translators: Site title https://search.google.com/search-console */ 'Google Search Console', 'xml-sitemap-feed' ); ?></a>
5
- </li>
6
- <li>
7
- <a href="https://www.bing.com/webmasters" target="_blank"><?php _e( /* Translators: Site title https://www.bing.com/webmasters */ 'Bing Webmaster Tools', 'xml-sitemap-feed' ); ?></a>
8
- </li>
9
- <li>
10
- <a href="https://ziyuan.baidu.com/site/index" target="_blank"><?php _e( /* Translators: Site title https://ziyuan.baidu.com/site/index */ 'Baidu Webmaster Tools', 'xml-sitemap-feed' ); ?></a>
11
- </li>
12
- <li>
13
- <a href="https://webmaster.yandex.com/sites/" target="_blank"><?php _e( /* Translators: Site title https://webmaster.yandex.com/sites/ */ 'Yandex.Webmaster', 'xml-sitemap-feed' ); ?></a>
14
- </li>
15
- <li>
16
- <a href="https://www.xml-sitemaps.com/validate-xml-sitemap.html" target="_blank"><?php _e( /* Translators: Page title https://www.xml-sitemaps.com/validate-xml-sitemap.html */ 'Validate an XML Sitemap', 'xml-sitemap-feed' ); ?></a>
17
- </li>
18
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/sidebar-news-links.php DELETED
@@ -1,12 +0,0 @@
1
- <h3><span class="dashicons dashicons-admin-links"></span> <?php echo translate('Links'); ?></h3>
2
- <ul>
3
- <li>
4
- <a href="https://publishercenter.google.com/publications" target="_blank"><?php _e( /* https://publishercenter.google.com/publications */ 'Google News Publisher Center', 'xml-sitemap-feed' ); ?></a>
5
- </li>
6
- <li>
7
- <a href="https://search.google.com/search-console" target="_blank"><?php _e( /* */ 'Google Search Console', 'xml-sitemap-feed' ); ?></a>
8
- </li>
9
- <li>
10
- <a href="https://www.xml-sitemaps.com/validate-xml-sitemap.html" target="_blank"><?php _e( /* https://www.xml-sitemaps.com/validate-xml-sitemap.html */ 'Validate an XML Sitemap', 'xml-sitemap-feed' ); ?></a>
11
- </li>
12
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-author.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml tag via echo or SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
12
- '; ?>
13
- <?php xmlsf_xml_stylesheet( 'author' ); ?>
14
- <?php xmlsf_generator(); ?>
15
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
16
- <?php do_action('xmlsf_urlset', 'home'); ?>
17
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
19
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
20
- <?php
21
- foreach ( xmlsf_get_author_data() as $url => $data ) {
22
- ?>
23
- <url>
24
- <loc><?php echo esc_url( $url ); ?></loc>
25
- <?php if ( ! empty( $data['priority'] ) ) { ?>
26
- <priority><?php echo $data['priority']; ?></priority>
27
- <?php } ?>
28
- <?php if ( ! empty( $data['lastmod'] ) ) { ?>
29
- <lastmod><?php echo $data['lastmod']; ?></lastmod>
30
- <?php } ?>
31
- <?php do_action( 'xmlsf_tags_after', 'author' ); ?>
32
- </url>
33
- <?php
34
- do_action( 'xmlsf_url_after', 'author' );
35
- }
36
- ?>
37
- </urlset>
38
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-custom.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml tag via echo or SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
12
- '; ?>
13
- <?php xmlsf_xml_stylesheet( 'custom' ); ?>
14
- <?php xmlsf_generator(); ?>
15
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
16
- <?php do_action('xmlsf_urlset', 'custom'); ?>
17
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
19
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
20
- <?php
21
-
22
- // get our custom urls array
23
- $urls = apply_filters( 'xmlsf_custom_urls', get_option('xmlsf_urls') );
24
- if ( is_array($urls) ) :
25
- // and loop away!
26
- foreach ( $urls as $url ) {
27
- if (empty($url[0])) continue;
28
- ?>
29
- <url>
30
- <loc><?php echo esc_url( $url[0] ); ?></loc>
31
- <priority><?php echo ( isset($url[1]) && is_numeric($url[1]) ) ? $url[1] : '0.5'; ?></priority>
32
- <?php do_action( 'xmlsf_tags_after', 'custom' ); ?>
33
- </url>
34
- <?php
35
- do_action( 'xmlsf_url_after', 'custom' );
36
- };
37
-
38
- endif;
39
- ?></urlset>
40
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-home.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml tag via echo or SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
12
- <?xml-stylesheet type="text/xsl" href="' . wp_make_link_relative( plugins_url('assets/styles/sitemap.xsl',XMLSF_BASENAME) ) . '?ver=' . XMLSF_VERSION . '"?>
13
- '; ?>
14
- <?php xmlsf_generator(); ?>
15
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
16
- <?php do_action('xmlsf_urlset', 'home'); ?>
17
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
19
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
20
- <?php
21
- foreach ( xmlsf_get_root_data() as $url => $data ) {
22
- ?>
23
- <url>
24
- <loc><?php echo esc_url( $url ); ?></loc>
25
- <priority><?php echo $data['priority']; ?></priority>
26
- <lastmod><?php echo $data['lastmod']; ?></lastmod>
27
- <?php do_action( 'xmlsf_tags_after', 'home' ); ?>
28
- </url>
29
- <?php
30
- do_action( 'xmlsf_url_after', 'home' );
31
- }
32
- ?>
33
- </urlset>
34
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-news.php DELETED
@@ -1,77 +0,0 @@
1
- <?php
2
- /**
3
- * Google News Sitemap Feed Template
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- $options = get_option('xmlsf_news_tags');
11
-
12
- // do xml tag via echo or SVN parser is going to freak out
13
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
14
- '; ?>
15
- <?php xmlsf_xml_stylesheet( 'news' ); ?>
16
- <?php xmlsf_generator(); ?>
17
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
18
- <?php do_action('xmlsf_urlset', 'news'); ?>
19
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
20
- <?php
21
- global $wp_query, $post;
22
- // loop away!
23
- if ( have_posts() ) :
24
- $wp_query->in_the_loop = true;
25
- while ( have_posts() ) :
26
- //the_post(); // disabled to avoid expensive but useless setup_postdata(), just do:
27
- // TODO : maybe make our own setup_postdata version?
28
- $post = $wp_query->next_post();
29
-
30
- // check if we are not dealing with an external URL :: Thanks to Francois Deschenes :)
31
- // or if post meta says "exclude me please"
32
- if ( apply_filters(
33
- 'xmlsf_news_excluded',
34
- get_post_meta( $post->ID, '_xmlsf_news_exclude', true ),
35
- $post->ID
36
- ) || !xmlsf_is_allowed_domain( get_permalink() )
37
- ) continue;
38
-
39
- $did_posts = true;
40
-
41
- do_action( 'xmlsf_news_url' ); ?>
42
- <url>
43
- <loc><?php echo esc_url( get_permalink() ); ?></loc>
44
- <news:news>
45
- <news:publication>
46
- <news:name><?php
47
- if( !empty($options['name']) )
48
- echo apply_filters( 'xmlsf_news_publication_name', $options['name'] );
49
- elseif(defined('XMLSF_GOOGLE_NEWS_NAME'))
50
- echo apply_filters( 'xmlsf_news_publication_name', XMLSF_GOOGLE_NEWS_NAME );
51
- else
52
- echo apply_filters( 'xmlsf_news_publication_name', get_bloginfo('name') ); ?></news:name>
53
- <news:language><?php echo apply_filters( 'xmlsf_news_language', xmlsf()->blog_language(), $post->ID, $post->post_type ); ?></news:language>
54
- </news:publication>
55
- <news:publication_date><?php echo get_date_from_gmt( $post->post_date_gmt, DATE_W3C ); ?></news:publication_date>
56
- <news:title><?php echo apply_filters( 'xmlsf_news_title', get_the_title() ); ?></news:title>
57
- <news:keywords><?php echo implode( ', ', apply_filters( 'xmlsf_news_keywords', array() ) ); ?></news:keywords>
58
- <news:stock_tickers><?php echo implode( ', ', apply_filters( 'xmlsf_news_stock_tickers', array() ) ); ?></news:stock_tickers>
59
- <?php do_action( 'xmlsf_news_tags_inner' ); ?>
60
- </news:news>
61
- <?php do_action( 'xmlsf_news_tags_after' ); ?>
62
- </url>
63
- <?php do_action( 'xmlsf_news_url_after' );
64
- endwhile;
65
- $wp_query->in_the_loop = false;
66
- endif;
67
-
68
- if ( empty( $did_posts ) ) :
69
- // No posts done? Then do at least the homepage to prevent error message in GWT.
70
- ?>
71
- <url>
72
- <loc><?php echo esc_url( home_url() ); ?></loc>
73
- </url>
74
- <?php
75
- endif;
76
- ?></urlset>
77
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-post_type.php DELETED
@@ -1,99 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- extract ( xmlsf_do_tags( get_query_var('post_type') ) );
11
-
12
- xmlsf_sitemap()->prefetch_posts_meta();
13
-
14
- if ( !empty($image) ) {
15
- $image_xmlns = ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"'.PHP_EOL;
16
- $image_schema = '
17
- http://www.google.com/schemas/sitemap-image/1.1
18
- http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd';
19
- } else {
20
- $image_xmlns = '';
21
- $image_schema = '';
22
- }
23
-
24
- // do xml tag via echo or SVN parser is going to freak out
25
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
26
- <?xml-stylesheet type="text/xsl" href="' . wp_make_link_relative( plugins_url('assets/styles/sitemap.xsl',XMLSF_BASENAME) ) . '?ver=' . XMLSF_VERSION . '"?>
27
- '; ?>
28
- <?php xmlsf_generator(); ?>
29
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
30
- <?php do_action('xmlsf_urlset', 'post_type'); ?>
31
- <?php echo $image_xmlns; ?>
32
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
34
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd<?php echo $image_schema; ?>">
35
- <?php
36
- // loop away!
37
- if ( have_posts() ) :
38
- while ( have_posts() ) :
39
- the_post();
40
-
41
- // check if page is in the exclusion list (like front page or post meta)
42
- // or if we are dealing with an external URL :: Thanks to Francois Deschenes :)
43
- if ( $post->ID == get_option('page_on_front')
44
- || apply_filters( 'xmlsf_excluded', get_post_meta( $post->ID, '_xmlsf_exclude', true ), $post->ID )
45
- || !xmlsf_is_allowed_domain( get_permalink() )
46
- ) continue;
47
-
48
- $did_posts = true;
49
- ?>
50
- <url>
51
- <loc><?php echo esc_url( get_permalink() ); ?></loc>
52
- <priority><?php echo xmlsf_get_post_priority(); ?></priority>
53
- <?php if ( $lastmod = xmlsf_get_post_modified() ) { ?>
54
- <lastmod><?php echo $lastmod; ?></lastmod>
55
- <?php } ?>
56
- <?php
57
- if ( !empty($image) ) :
58
- foreach ( get_post_meta( $post->ID, '_xmlsf_image_'.$image ) as $img_data ) {
59
- if ( empty($img_data['loc']) )
60
- continue;
61
- ?>
62
- <image:image>
63
- <image:loc><?php echo utf8_uri_encode( $img_data['loc'] ); ?></image:loc>
64
- <?php
65
- if ( !empty($img_data['title']) ) {
66
- ?>
67
- <image:title><![CDATA[<?php echo str_replace(']]>', ']]&gt;', $img_data['title']); ?>]]></image:title>
68
- <?php
69
- }
70
- if ( !empty($img_data['caption']) ) {
71
- ?>
72
- <image:caption><![CDATA[<?php echo str_replace(']]>', ']]&gt;', $img_data['caption']); ?>]]></image:caption>
73
- <?php
74
- }
75
- ?>
76
- </image:image>
77
- <?php
78
- }
79
- endif;
80
-
81
- do_action( 'xmlsf_tags_after', 'post_type' );
82
- ?>
83
- </url>
84
- <?php
85
- do_action( 'xmlsf_url_after', 'post_type' );
86
- endwhile;
87
- endif;
88
-
89
- if ( empty( $did_posts ) ) :
90
- // No posts done? Then do at least the homepage to prevent error message in GWT.
91
- ?>
92
- <url>
93
- <loc><?php echo esc_url( home_url() ); ?></loc>
94
- <priority>1.0</priority>
95
- </url>
96
- <?php
97
- endif;
98
- ?></urlset>
99
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-posttype.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- extract ( xmlsf_do_tags( get_query_var('post_type') ) );
11
-
12
- global $xmlsf_sitemap;
13
- $xmlsf_sitemap->prefetch_posts_meta();
14
-
15
- if ( !empty($image) ) {
16
- $image_xmlns = ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"'.PHP_EOL;
17
- $image_schema = '
18
- http://www.google.com/schemas/sitemap-image/1.1
19
- http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd';
20
- } else {
21
- $image_xmlns = '';
22
- $image_schema = '';
23
- }
24
-
25
- // do xml tag via echo or SVN parser is going to freak out
26
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
27
- '; ?>
28
- <?php xmlsf_xml_stylesheet( 'posttype' ); ?>
29
- <?php xmlsf_generator(); ?>
30
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
31
- <?php do_action('xmlsf_urlset', 'post_type'); ?>
32
- <?php echo $image_xmlns; ?>
33
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
35
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd<?php echo $image_schema; ?>">
36
- <?php
37
- global $wp_query, $post;
38
- // loop away!
39
- if ( have_posts() ) :
40
- while ( have_posts() ) :
41
- // don't do the_post() here to avoid expensive setup_postdata(), just do:
42
- $wp_query->in_the_loop = true;
43
- $post = $wp_query->next_post();
44
-
45
- // check if page is in the exclusion list (like front page or post meta)
46
- // or if we are dealing with an external URL :: Thanks to Francois Deschenes :)
47
- if ( $post->ID == get_option('page_on_front')
48
- || apply_filters( 'xmlsf_excluded', get_post_meta( $post->ID, '_xmlsf_exclude', true ), $post->ID )
49
- || !xmlsf_is_allowed_domain( get_permalink() )
50
- ) continue;
51
-
52
- $did_posts = true;
53
-
54
- do_action( 'xmlsf_url', 'post_type' );
55
- ?>
56
- <url>
57
- <loc><?php echo esc_url( get_permalink() ); ?></loc>
58
- <priority><?php echo xmlsf_get_post_priority(); ?></priority>
59
- <?php if ( $lastmod = xmlsf_get_post_modified() ) { ?>
60
- <lastmod><?php echo $lastmod; ?></lastmod>
61
- <?php } ?>
62
- <?php
63
- if ( !empty($image) ) :
64
- foreach ( get_post_meta( $post->ID, '_xmlsf_image_'.$image ) as $img_data ) {
65
-
66
- if ( empty($img_data['loc']) )
67
- continue; ?>
68
- <image:image>
69
- <image:loc><?php echo utf8_uri_encode( $img_data['loc'] ); ?></image:loc>
70
- <?php if ( !empty($img_data['title']) ) { ?>
71
- <image:title><![CDATA[<?php echo str_replace(']]>', ']]&gt;', $img_data['title']); ?>]]></image:title>
72
- <?php }; if ( !empty($img_data['caption']) ) { ?>
73
- <image:caption><![CDATA[<?php echo str_replace(']]>', ']]&gt;', $img_data['caption']); ?>]]></image:caption>
74
- <?php }
75
- do_action( 'xmlsf_image_tags_inner', 'post_type' ); ?>
76
- </image:image>
77
- <?php }
78
- endif;
79
- do_action( 'xmlsf_tags_after', 'post_type' ); ?>
80
- </url>
81
- <?php do_action( 'xmlsf_url_after', 'post_type' );
82
- endwhile;
83
- endif;
84
-
85
- if ( empty( $did_posts ) ) :
86
- // No posts done? Then do at least the homepage to prevent error message in GWT.
87
- ?>
88
- <url>
89
- <loc><?php echo esc_url( home_url() ); ?></loc>
90
- <priority>1.0</priority>
91
- </url>
92
- <?php
93
- endif;
94
- ?></urlset>
95
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-root.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Feed Template for displaying an XML Sitemap feed.
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml tag via echo or SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
12
- '; ?>
13
- <?php xmlsf_xml_stylesheet( 'root' ); ?>
14
- <?php xmlsf_generator(); ?>
15
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
16
- <?php do_action('xmlsf_urlset', 'home'); ?>
17
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
19
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
20
- <?php
21
- foreach ( xmlsf_get_root_data() as $url => $data ) {
22
- ?>
23
- <url>
24
- <loc><?php echo esc_url( $url ); ?></loc>
25
- <priority><?php echo $data['priority']; ?></priority>
26
- <lastmod><?php echo $data['lastmod']; ?></lastmod>
27
- <?php do_action( 'xmlsf_tags_after', 'home' ); ?>
28
- </url>
29
- <?php
30
- do_action( 'xmlsf_url_after', 'home' );
31
- }
32
- ?>
33
- </urlset>
34
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap-taxonomy.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * Google News Sitemap Feed Template
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml prolog via echo or plugin repository SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>
12
- '; ?>
13
- <?php xmlsf_xml_stylesheet( 'taxonomy' ); ?>
14
- <?php xmlsf_generator(); ?>
15
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
16
- <?php do_action( 'xmlsf_urlset', 'taxonomy' ); ?>
17
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
19
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
20
- <?php
21
- $terms = get_terms( array('taxonomy'=>get_query_var('taxonomy')) );
22
-
23
- if ( is_array($terms) ) :
24
- foreach ( $terms as $term ) :
25
- ?>
26
- <url>
27
- <loc><?php echo get_term_link( $term ); ?></loc>
28
- <priority><?php echo xmlsf_get_term_priority( $term ); ?></priority>
29
- <?php if ( $lastmod = xmlsf_get_term_modified( $term ) ) { ?>
30
- <lastmod><?php echo $lastmod; ?></lastmod>
31
- <?php }
32
- do_action( 'xmlsf_tags_after', 'taxonomy' );
33
- ?>
34
- </url>
35
- <?php
36
- do_action( 'xmlsf_url_after', 'taxonomy' );
37
- endforeach;
38
- endif;
39
-
40
- ?></urlset>
41
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/feed-sitemap.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- * XML Sitemap Index Feed Template
4
- *
5
- * @package XML Sitemap Feed plugin for WordPress
6
- */
7
-
8
- if ( ! defined( 'WPINC' ) ) die;
9
-
10
- // do xml tag via echo or SVN parser is going to freak out
11
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?>'; ?>
12
- <?php xmlsf_xml_stylesheet(); ?>
13
- <?php xmlsf_generator(); ?>
14
- <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
15
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
17
- http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">
18
- <sitemap>
19
- <loc><?php echo xmlsf_get_index_url(); ?></loc>
20
- <lastmod><?php echo get_date_from_gmt( get_lastpostdate( 'GMT' ), DATE_W3C ); ?></lastmod>
21
- </sitemap>
22
- <?php
23
-
24
- // public post types
25
- $post_types = (array) apply_filters( 'xmlsf_post_types', get_option( 'xmlsf_post_types', array() ) );
26
- if ( ! empty( $post_types ) ) :
27
- foreach ( $post_types as $post_type => $settings ) {
28
- if ( empty( $settings['active'] ) || ! post_type_exists( $post_type ) )
29
- continue;
30
-
31
- $archive = isset( $settings['archive'] ) ? $settings['archive'] : '';
32
-
33
- foreach ( xmlsf_get_index_archive_data( $post_type, $archive ) as $url => $lastmod ) {
34
- ?>
35
- <sitemap>
36
- <loc><?php echo $url; ?></loc>
37
- <lastmod><?php echo $lastmod; ?></lastmod>
38
- </sitemap>
39
- <?php
40
- }
41
- }
42
- endif;
43
-
44
- // public taxonomies
45
- foreach ( xmlsf_get_taxonomies() as $taxonomy ) : ?>
46
- <sitemap>
47
- <loc><?php echo xmlsf_get_index_url( 'taxonomy', array( 'type' => $taxonomy ) ); ?></loc>
48
- <?php if ( $lastmod = xmlsf_get_taxonomy_modified( $taxonomy ) ) { ?>
49
- <lastmod><?php echo $lastmod; ?></lastmod>
50
- <?php } ?>
51
- </sitemap>
52
- <?php
53
- endforeach;
54
-
55
- // authors
56
- if ( xmlsf_do_authors() ) : ?>
57
- <sitemap>
58
- <loc><?php echo xmlsf_get_index_url( 'author' ); ?></loc>
59
- <lastmod><?php echo get_date_from_gmt( get_lastpostdate( 'GMT' ), DATE_W3C ); ?></lastmod>
60
- </sitemap>
61
- <?php
62
- endif;
63
-
64
- // custom URLs sitemap
65
- if ( apply_filters( 'xmlsf_custom_urls', get_option( 'xmlsf_urls' ) ) ) :
66
- ?>
67
- <sitemap>
68
- <loc><?php echo xmlsf_get_index_url( 'custom' ); ?></loc>
69
- </sitemap>
70
- <?php
71
- endif;
72
-
73
- // custom sitemaps
74
- $custom_sitemaps = apply_filters( 'xmlsf_custom_sitemaps', get_option( 'xmlsf_custom_sitemaps', array() ) );
75
- if ( is_array( $custom_sitemaps ) ) :
76
- foreach ( $custom_sitemaps as $url ) {
77
- if ( empty( $url ) ) continue;
78
- ?>
79
- <sitemap>
80
- <loc><?php echo esc_url( $url ); ?></loc>
81
- </sitemap>
82
- <?php
83
- }
84
- endif;
85
- ?></sitemapindex>
86
- <?php xmlsf_usage(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
xml-sitemap.php CHANGED
@@ -1,364 +1,83 @@
1
  <?php
2
  /*
3
- Plugin Name: XML Sitemap & Google News
4
- Plugin URI: https://status301.net/wordpress-plugins/xml-sitemap-feed/
5
- Description: Feed the hungry spiders in compliance with the XML Sitemap and Google News protocols. Happy with the results? Please leave me a <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed">tip</a></strong> for continued development and support. Thanks :)
6
- Version: 5.3.3
7
  Text Domain: xml-sitemap-feed
8
- Requires at least: 4.6
9
- Requires PHP: 5.6
10
  Author: RavanH
11
- Author URI: https://status301.net/
12
  */
13
 
14
- define( 'XMLSF_VERSION', '5.3.3' );
15
- /**
16
- * Copyright 2021 RavanH
17
- * https://status301.net/
18
- * mailto: ravanhagen@gmail.com
19
 
20
- * This program is free software; you can redistribute it and/or modify
21
- * it under the terms of the GNU General Public License version 3 as
22
- * published by the Free Software Foundation.
 
23
 
24
- * This program is distributed in the hope that it will be useful,
25
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
- * GNU General Public License for more details.
28
- */
29
 
30
- /**
31
- * --------------------
 
 
 
 
32
  * AVAILABLE HOOKS
33
  * --------------------
34
  *
35
- * FILTERS
36
- *
37
- * xmlsf_defaults -> Filters the default array values for different option groups.
38
- * xmlsf_request -> Filters request when an xml sitemap request is found,
39
- * can be used for plugin compatibility.
40
- * xmlsf_news_request -> Filters request when a news sitemap request is found
41
- * can be used for plugin compatibility.
42
- * xmlsf_allowed_domain -> Filters the response when checking the url against allowed domains.
43
- * Passes variable $url; must return true or false.
44
- * xmlsf_index_url_args -> Filters the index url arguments array
45
- * xmlsf_excluded -> Filters the response when checking the post for exclusion flags in
46
- * XML Sitemap context. Passes the post exclusion flag and $post_id; must return true or false.
47
- * xmlsf_news_excluded -> Filters the response when checking the post for exclusion flags in
48
- * Google News sitemap context. Passes variable $post_id; must exclusion flag, return true or false.
49
- * xmlsf_news_keywords -> Filters the news keywords array
50
- * xmlsf_news_stock_tickers -> Filters the news stock tickers array
51
- * xmlsf_disabled_taxonomies -> Filters the taxonomies that should be unavailable for sitemaps
52
- * Passes an array of taxonomies to exclude; must return an array.
53
- * the_title_xmlsitemap -> Filters the Image title and caption tags.
54
- * xmlsf_news_publication_name-> Filters the Google News publication name.
55
- * xmlsf_news_title -> Filters the Google News post title.
56
- * xmlsf_root_data -> Filters the root data urls (with priority and lastmod) array
57
- * xmlsf_custom_urls -> Filters the custom urls array
58
- * xmlsf_custom_sitemaps -> Filters the custom sitemaps array
59
- * xmlsf_post_language -> Filters the post language tag used in the news sitemap.
60
- * Passes variable $post_id; must return a 2 or 3 letter
61
- * language ISO 639 code with the exception of zh-cn and zh-tw.
62
- * xmlsf_post_types -> Filters the post types array for the XML sitemaps index.
63
- * xmlsf_post_priority -> Filters a post priority value. Passes variables $priority and $post->ID.
64
- * Must return a float value between 0.1 and 1.0
65
- * xmlsf_term_priority -> Filters a taxonomy term priority value. Passes variables $priority and $term->slug.
66
- * Must return a float value between 0.1 and 1.0
67
- * xmlsf_news_post_types -> Filters the post types array for the Google News sitemap settings page.
68
- *
69
- * ACTIONS
70
- *
71
- * xmlsf_ping -> Fires when a search engine has been pinged. Carries four arguments:
72
- * search engine (google|bing), sitemap name, full ping url, ping repsonse code.
73
- * xmlsf_urlset -> Fired inside each sitemap's urlset tag. Can be used to
74
- * echo additional XML namespaces. Passes parameter home|post_type|taxonomy|custom
75
- * to allow identification of the current sitemap.
76
- * xmlsf_url -> Fired inside the XML Sitemap loop at the start of each sitemap url tag. Can be used to
77
- * echo additional XML namespaces. Passes parameter home|post_type|taxonomy|custom
78
- * to allow identification of the current sitemap.
79
- * xmlsf_image_tags_inner -> Fired inside the XML Sitemap loop just before each closing </image:image> is generated. Can be used to
80
- * echo custom <image:image> tags or trigger another action in the background.
81
- * xmlsf_tags_after -> Fired inside the XML Sitemap loop at the end of the tags, just before each
82
- * closing </url> is generated. Can be used to echo custom tags or trigger another
83
- * action in the background. Passes parameter home|post_type|taxonomy|custom
84
- * to allow identification of the current sitemap.
85
- * xmlsf_url_after -> Fired inside the XML Sitemap loop after each url node. Can be used to append
86
- * alternative url or trigger another action in the background. Passes parameter
87
- * home|post_type|taxonomy|custom to allow identification of the current sitemap.
88
- * xmlsf_news_urlset -> Fired inside the Google News Sitemap urlset tag. Can be used to
89
- * echo additional XML namespaces.
90
- * xmlsf_news_tags_inner -> Fired inside the Google News Sitemap loop at the end of the news
91
- * tags, just before each closing </news:news> is generated. Can be used to
92
- * echo custom news:news tags or trigger another action in the background.
93
- * xmlsf_news_tags_after -> Fired inside the Google News Sitemap loop at the end of the news
94
- * tags, just before each closing </url> is generated. Can be used to
95
- * echo custom news tags or trigger another action in the background.
96
- * xmlsf_news_url_after -> Fired inside the Google News Sitemap loop after each news url node.
97
- * Can be used to append alternative url or trigger another action in the background.
98
- * xmlsf_news_settings_before -> Fired before the Google News Sitemap settings form
99
- * xmlsf_news_settings_after -> Fired after the Google News Sitemap settings form
100
- *
101
- * ---------------------
102
- * AVAILABLE FUNCTIONS
103
- * ---------------------
104
- *
105
- * is_sitemap() -> conditional, returns bolean, true if the request is for an xml sitemap
106
- * is_news() -> conditional, returns bolean, true if the request is for an xml news sitemap
107
- *
108
- * Feel free to request, suggest or submit more :)
109
- */
110
-
111
- if ( ! defined( 'WPINC' ) ) die;
112
-
113
- define( 'XMLSF_DIR', dirname(__FILE__) );
114
-
115
- define( 'XMLSF_BASENAME', plugin_basename(__FILE__) );
116
-
117
- // main plugin init
118
- add_action( 'init', 'xmlsf_init', 9 );
119
-
120
- register_activation_hook( __FILE__, 'xmlsf_activate' );
121
-
122
- register_deactivation_hook( __FILE__, 'xmlsf_deactivate' );
123
-
124
- /***********************
125
- * CONTROLLERS
126
- ***********************/
127
-
128
- /**
129
- * Plugin initialization
130
- *
131
- * @since 1.0
132
- * @return void
133
- */
134
- function xmlsf_init() {
135
-
136
- // add robots.txt filter
137
- add_filter( 'robots_txt', 'xmlsf_robots_txt', 9 );
138
-
139
- // Upgrade/install, maybe...
140
- $db_version = get_option( 'xmlsf_version', 0 );
141
- if ( ! version_compare( XMLSF_VERSION, $db_version, '=' ) ) {
142
- require_once XMLSF_DIR . '/upgrade.php';
143
- new XMLSitemapFeed_Upgrade( $db_version );
144
- }
145
-
146
- if ( is_admin() ) {
147
- require XMLSF_DIR . '/controllers/class.xmlsf-admin.php';
148
- new XMLSF_Admin();
149
- }
150
-
151
- $sitemaps = get_option( 'xmlsf_sitemaps' );
152
-
153
- // return if nothing enabled
154
- if ( empty( $sitemaps ) ) return;
155
-
156
- // main model functions
157
- require XMLSF_DIR . '/models/functions.shared.php';
158
-
159
- // force remove url trailing slash
160
- add_filter( 'user_trailingslashit', 'xmlsf_untrailingslash' );
161
-
162
- // MAIN REQUEST filter
163
- add_filter( 'request', 'xmlsf_filter_request', 0 );
164
-
165
- // NGINX HELPER PURGE URLS
166
- add_filter( 'rt_nginx_helper_purge_urls', 'xmlsf_nginx_helper_purge_urls', 10, 2 );
167
-
168
- // main controller functions
169
- require XMLSF_DIR . '/controllers/functions.shared.php';
170
-
171
- add_action( 'xmlsf_ping', 'xmlsf_debug_ping', 9, 4 );
172
-
173
- // include and instantiate main class
174
- xmlsf();
175
-
176
- if ( ! empty( $sitemaps['sitemap'] ) ) {
177
- //add_rewrite_rule('sitemap(?:_index)?(\-[a-z0-9\-_]+)?(\.\d{4,6})?(\.\d{1,2})?\.xml(\.gz)?$', 'index.php?feed=sitemap$matches[1]$matches[4]&m=$matches[2]&w=$matches[3]', 'top');
178
-
179
- require XMLSF_DIR . '/models/functions.sitemap.php';
180
- add_filter( 'xmlsf_post_types', 'xmlsf_filter_post_types' );
181
-
182
- // sitemap title element filters
183
- add_filter( 'the_title_xmlsitemap', 'strip_tags' );
184
- add_filter( 'the_title_xmlsitemap', 'ent2ncr', 8 );
185
- add_filter( 'the_title_xmlsitemap', 'esc_html' );
186
-
187
- global $xmlsf_sitemap;
188
- require XMLSF_DIR . '/controllers/class.xmlsf-sitemap.php';
189
- $xmlsf_sitemap = new XMLSF_Sitemap( $sitemaps['sitemap'] );
190
-
191
- // replace core sitemap
192
- remove_action( 'init', 'wp_sitemaps_get_server' );
193
- }
194
-
195
- if ( ! empty( $sitemaps['sitemap-news'] ) ) {
196
- //add_rewrite_rule('sitemap-news\.xml(\.gz)?$', 'index.php?feed=sitemap-news$matches[1]', 'top');
197
-
198
- require XMLSF_DIR . '/models/functions.sitemap-news.php';
199
- add_filter( 'xmlsf_news_post_types', 'xmlsf_news_filter_post_types' );
200
-
201
- // common sitemap element filters
202
- add_filter( 'xmlsf_news_publication_name', 'strip_tags' );
203
- add_filter( 'xmlsf_news_publication_name', 'ent2ncr', 8 );
204
- add_filter( 'xmlsf_news_publication_name', 'esc_html' );
205
- add_filter( 'xmlsf_news_title', 'strip_tags' );
206
- add_filter( 'xmlsf_news_title', 'ent2ncr', 8 );
207
- add_filter( 'xmlsf_news_title', 'esc_html' );
208
-
209
- require XMLSF_DIR . '/controllers/class.xmlsf-sitemap-news.php';
210
- new XMLSF_Sitemap_News( $sitemaps['sitemap-news'] );
211
- }
212
-
213
- }
214
-
215
- /**
216
- * Plugin activation
217
- *
218
- * @since 5.0
219
- * @return void
220
  */
221
- function xmlsf_activate() {
222
- set_transient( 'xmlsf_flush_rewrite_rules', '' );
223
- set_transient( 'xmlsf_check_static_files', '' );
224
- }
225
 
226
- /**
227
- * Plugin de-activation
228
- *
229
- * @since 5.0
230
- * @return void
231
- */
232
- function xmlsf_deactivate() {
233
- delete_transient( 'xmlsf_flush_rewrite_rules' );
234
- delete_transient( 'xmlsf_check_static_files' );
235
 
236
- // remove metadata
237
- global $wpdb;
238
- // posts meta
239
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_attached' ) );
240
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_image_featured' ) );
241
- $wpdb->delete( $wpdb->prefix.'postmeta', array( 'meta_key' => '_xmlsf_comment_date_gmt' ) );
242
- // terms meta
243
- $wpdb->delete( $wpdb->prefix.'termmeta', array( 'meta_key' => 'term_modified' ) );
244
 
245
- // remove rules so they can be REGENERATED on the next page load (without this plugin active)
246
- delete_option( 'rewrite_rules' );
247
-
248
- }
249
 
250
- /*****************
251
- * MODELS
252
- *****************/
 
253
 
254
- /**
255
- * Get instantiated sitemap class
256
- *
257
- * @since 5.0
258
- *
259
- * @global XMLSitemapFeed $xmlsf
260
- * @return XMLSitemapFeed object
261
- */
262
- function xmlsf() {
263
- global $xmlsf;
264
 
265
- if ( ! isset( $xmlsf ) ) {
266
- if ( ! class_exists( 'XMLSitemapFeed' ) )
267
- require XMLSF_DIR . '/models/class-xmlsitemapfeed.php';
268
 
269
- $xmlsf = new XMLSitemapFeed();
270
- }
271
 
272
- return $xmlsf;
273
- }
274
 
275
- /**
276
- * Filter robots.txt rules
277
- *
278
- * @param $output
279
- * @return string
280
- */
281
- function xmlsf_robots_txt( $output ) {
282
- $url = trailingslashit( get_bloginfo('url') );
283
-
284
- $sitemaps = get_option( 'xmlsf_sitemaps' );
285
-
286
- // PRE
287
- $pre = '# XML Sitemap & Google News version ' . XMLSF_VERSION . ' - https://status301.net/wordpress-plugins/xml-sitemap-feed/' . PHP_EOL;
288
- if ( '1' != get_option('blog_public') )
289
- $pre .= '# XML Sitemaps are disabled because of this site\'s privacy settings.' . PHP_EOL;
290
- elseif( !is_array($sitemaps) || empty( $sitemaps ) )
291
- $pre .= '# No XML Sitemaps are enabled on this site.' . PHP_EOL;
292
- else
293
- foreach ( $sitemaps as $pretty )
294
- $pre .= 'Sitemap: ' . $url . $pretty . PHP_EOL;
295
- $pre .= PHP_EOL;
296
-
297
- // DEFAULT
298
- if ( substr($output, -1) !== PHP_EOL ) $output .= PHP_EOL;
299
-
300
- // POST
301
- $post = get_option('xmlsf_robots');
302
- if ( $post !== '' ) $post .= PHP_EOL;
303
-
304
- return $pre . $output . $post;
305
- }
306
-
307
- /* --------------------------------
308
- * CONDITIONAL FUNCTIONS
309
- * -------------------------------- */
310
 
311
- /**
312
- * Is the query for a sitemap?
313
- *
314
- * @since 4.8
315
- * @return bool
316
- */
317
- function is_sitemap() {
318
- global $xmlsf;
319
- if ( ! is_object( $xmlsf ) || $xmlsf->request_filtered === false ) {
320
- _doing_it_wrong( __FUNCTION__, __( 'Conditional sitemap tags do not work before the sitemap request filter is run. Before then, they always return false.', 'xml-sitemap-feed' ), '4.8' );
321
- return false;
322
- }
323
- return $xmlsf->is_sitemap;
324
- }
325
-
326
- /**
327
- * Is the query for a news sitemap?
328
- *
329
- * @since 4.8
330
- * @return bool
331
- */
332
- function is_news() {
333
- global $xmlsf;
334
- if ( ! is_object( $xmlsf ) || $xmlsf->request_filtered === false ) {
335
- _doing_it_wrong( __FUNCTION__, __( 'Conditional sitemap tags do not work before the sitemap request filter is run. Before then, they always return false.', 'xml-sitemap-feed' ), '4.8' );
336
- return false;
337
- }
338
- return $xmlsf->is_news;
339
- }
340
-
341
- // TODO start with namespacing and autoload
342
- // http://justintadlock.com/archives/2018/12/14/php-namespaces-for-wordpress-developers
343
- /*
344
- spl_autoload_register( function( $class ) {
345
 
346
- $namespace = 'XMLSF\\';
347
 
348
- // Bail if the class is not in our namespace.
349
- if ( 0 !== strpos( $class, $namespace ) ) {
350
- return;
351
- }
352
 
353
- // Build the filename.
354
- $class = str_replace( $namespace, '', $class );
355
- $class = strtolower( $class );
356
- $class = str_replace( '_', '-', $class );
357
- $file = realpath( __DIR__ ) . DIRECTORY_SEPARATOR . str_replace( '\\', DIRECTORY_SEPARATOR, $class ) . '.php';
358
 
359
- // If the file exists for the class name, load it.
360
- if ( file_exists( $file ) ) {
361
- include( $file );
362
- }
363
- } );
364
- */
1
  <?php
2
  /*
3
+ Plugin Name: XML Sitemap Feed
4
+ Plugin URI: http://status301.net/wordpress-plugins/xml-sitemap-feed/
5
+ Description: Creates a feed that complies with the XML Sitemap protocol ready for indexing by Google, Yahoo, Bing, Ask and others. Happy with it? Please leave me a <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=3%2e8&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us">Tip</a></strong> for development and support time. Thanks :)
 
6
  Text Domain: xml-sitemap-feed
7
+ Version: 3.9.9.18
 
8
  Author: RavanH
9
+ Author URI: http://status301.net/
10
  */
11
 
12
+ /* Copyright 2010 RavanH (http://status301.net/ email : ravanhagen@gmail.com)
 
 
 
 
13
 
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License as published by
16
+ the Free Software Foundation; either version 2 of the License, or
17
+ (at your option) any later version.
18
 
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
 
23
 
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+
29
+ /* --------------------
30
  * AVAILABLE HOOKS
31
  * --------------------
32
  *
33
+ * FILTERS
34
+ * xml_sitemap_url -> Filters the URL used in the sitemap reference in robots.txt
35
+ * (receives an ARRAY and MUST return one; can be multiple urls)
36
+ * and for the home URL in the sitemap (receives a STRING and MUST
37
+ * return one) itself. Useful for multi language plugins or other
38
+ * plugins that affect the blogs main URL... See pre-defined filter
39
+ * XMLSitemapFeed::qtranslate() in XMLSitemapFeed.class.php as an
40
+ * example.
41
+ * ACTIONS
42
+ * [ none at this point, but feel free to request, suggest or submit one :) ]
43
+ *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  */
 
 
 
 
45
 
46
+ if(!empty($_SERVER['SCRIPT_FILENAME']) && 'xml-sitemap.php' == basename($_SERVER['SCRIPT_FILENAME']))
47
+ die('You can not access this page directly!');
 
 
 
 
 
 
 
48
 
49
+ /* --------------------
50
+ * CONSTANTS
51
+ * -------------------- */
 
 
 
 
 
52
 
53
+ define('XMLSF_VERSION', '3.9.9.18');
 
 
 
54
 
55
+ if ( file_exists ( dirname(__FILE__).'/xml-sitemap-feed' ) )
56
+ define('XMLSF_PLUGIN_DIR', dirname(__FILE__) . '/xml-sitemap-feed');
57
+ else
58
+ define('XMLSF_PLUGIN_DIR', dirname(__FILE__));
59
 
60
+ /* The following constants can be overridden by defining them in wp-config.php */
 
 
 
 
 
 
 
 
 
61
 
 
 
 
62
 
63
+ if ( !defined('XMLSF_POST_TYPE_NEWS_TAGS') ) // post types append sitemap tags to which
64
+ define('XMLSF_POST_TYPE_NEWS_TAGS', 'any');
65
 
66
+ // dedicated google news sitemap settings
 
67
 
68
+ if ( !defined('XMLSF_NEWS_POST_TYPE') )
69
+ define('XMLSF_NEWS_POST_TYPE', 'post');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ /* -------------------------------------
72
+ * MISSING WORDPRESS FUNCTIONS
73
+ * ------------------------------------- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
+ include_once(XMLSF_PLUGIN_DIR . '/hacks.php');
76
 
77
+ /* ----------------------
78
+ * CLASS OBJECT
79
+ * ---------------------- */
 
80
 
81
+ if ( class_exists('XMLSitemapFeed') || include( XMLSF_PLUGIN_DIR . '/XMLSitemapFeed.class.php' ) )
82
+ $xmlsitemapfeed = new XMLSitemapFeed();
 
 
 
83