Better WordPress Google XML Sitemaps (support Sitemap Index, Multi-site and Google News) - Version 1.3.0

Version Description

  • New features

    • Added a new setting to control which post types can be used to ping search engines
    • Added a ping limit setting
    • Added a "Save changes and Flush cache" button
  • Enhancements

    • Plugin's admin areas have been re-organized to be easier to use.
    • Updated all sitemap modules with easier to use APIs.
    • Last modified dates are now more properly handled.
    • Error log has been refined to be more friendly and useful.
    • Post types that do not have any post should not be listed in sitemapindex.xml by default.
    • Posts that are password-protected should not be listed in sitemap files.
    • Be more selective when pinging search engines, this is to avoid double pinging when using plugin like Snitch.
    • Replaced the "Clean PHP errors" function with a "Debug extra" mode that can be used to easily debug "Content Encoding error" and similar errors, more info about "Debug extra" here.
    • When debug or debug extra is on, no-cache headers are sent to ensure a proper debugging environment.
    • Caching is now disabled by default to avoid confusion when setting up the sitemapindex.
    • Cache directory can now be edited via:
      • Plugin's admin area: BWP Sitemaps >> XML Sitemaps >> Caching
      • PHP Constant: e.g. define('BWP_GXS_CACHE_DIR', 'path/to/cache/directory');
      • Filters: use bwp_gxs_cache_dir
    • Added bwp_gxs_excluded_posts filter hook to let users exclude posts using an array of IDs instead of an SQL string. This is meant to replace bwp_gxs_post_where filter hook when using to exclude certain posts. More info here.
    • Added bwp_gxs_excluded_terms filter hook as a taxonomy-equivalent to bwp_gxs_excluded_posts, this works the same as (and deprecates) bwp_gxs_term_exclude.
    • Added bwp_gxs_sitemap_lastmod filter hook to let users modify last modified dates of sitemaps inside a sitemapindex programmatically when needed.
    • Ping settings can now be set per blog instead of site-wise.
    • Added a Spanish translation - Thanks to Ruben!
    • Added more News languages:
      • Hebrew (he)
      • Traditional Chinese (zh-tw)
      • Arabic (ar)
      • Hindi (hi)
      • Japanese (ja)
    • Other enhancements.
  • Bugfixes:

    • Fixed an issue that might cause an extraneous split part to appear.
    • Fixed an issue that might cause "Invalid last modified date" error
    • Fixed an issue that might cause the sitemapindex to use the regular XSLT stylesheet
    • Sitemapindex should now respect excluded posts when splitting post-based sitemaps
    • Other bugfixes.

Important Update Note:

  • if you're using custom modules make sure that you re-read the documentation for updated info about the module API.
  • When the sitemapindex is generated for the first time, you won't see any Last modified date for any child sitemaps because none of them have been generated yet. This is expected and adhered to the official sitemap protocol.

Next major version (1.4.0) will have Image and Video sitemap support, so make sure you stay alerted!

Download this release

Release Info

Developer OddOneOut
Plugin Icon wp plugin Better WordPress Google XML Sitemaps (support Sitemap Index, Multi-site and Google News)
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.1.6 to 1.3.0

Files changed (50) hide show
  1. bwp-simple-gxs-ms.php +2 -3
  2. bwp-simple-gxs.php +20 -31
  3. bwp-simple-gxs.pot +709 -278
  4. cache/.htaccess +3 -3
  5. css/bwp-simple-gxs.css +43 -12
  6. includes/bwp-option-page/bwp-option-page.php +0 -2
  7. includes/bwp-option-page/css/bwp-option-page.css +50 -10
  8. includes/bwp-option-page/images/ad_250x250.png +0 -0
  9. includes/bwp-option-page/includes/class-bwp-option-page.php +343 -118
  10. includes/bwp-option-page/includes/index.php +3 -0
  11. includes/bwp-option-page/index.php +3 -0
  12. includes/class-bwp-framework-improved.php +733 -0
  13. includes/class-bwp-framework.php +0 -455
  14. includes/class-bwp-gxs-cache.php +147 -136
  15. includes/class-bwp-gxs-module.php +687 -421
  16. includes/class-bwp-simple-gxs.php +3547 -1519
  17. includes/common-functions.php +19 -0
  18. includes/index.php +3 -0
  19. includes/modules/archive.php +81 -66
  20. includes/modules/author.php +75 -59
  21. includes/modules/index.php +2 -0
  22. includes/modules/page.php +67 -54
  23. includes/modules/page_external.php +52 -43
  24. includes/modules/post.php +162 -113
  25. includes/modules/post_attachment.php +3 -4
  26. includes/modules/post_google_news.php +250 -0
  27. includes/modules/post_most_popular.php +83 -71
  28. includes/modules/site.php +121 -76
  29. includes/modules/sitemapindex.php +186 -143
  30. includes/modules/taxonomy.php +121 -94
  31. index.php +3 -0
  32. js/bwp-gxs.js +14 -0
  33. languages/bwp-simple-gxs-es_ES.mo +0 -0
  34. languages/bwp-simple-gxs-es_ES.po +1035 -0
  35. languages/bwp-simple-gxs-ms_MY.mo +0 -0
  36. languages/bwp-simple-gxs-ms_MY.po +462 -156
  37. languages/bwp-simple-gxs-ro_RO.mo +0 -0
  38. languages/bwp-simple-gxs-ro_RO.po +793 -0
  39. languages/bwp-simple-gxs-zh_TW.mo +0 -0
  40. languages/bwp-simple-gxs-zh_TW.po +785 -0
  41. readme.txt +275 -257
  42. screenshot-1.gif +0 -0
  43. screenshot-1.png +0 -0
  44. screenshot-2.gif +0 -0
  45. screenshot-2.png +0 -0
  46. screenshot-3.gif +0 -0
  47. screenshot-3.png +0 -0
  48. screenshot-4.gif +0 -0
  49. xsl/bwp-sitemap.xsl +99 -99
  50. xsl/bwp-sitemapindex.xsl +90 -90
bwp-simple-gxs-ms.php CHANGED
@@ -1,3 +1,2 @@
1
- <?php
2
- include_once(dirname(__FILE__). '/bwp-google-xml-sitemaps/bwp-simple-gxs.php');
3
- ?>
1
+ <?php
2
+ include_once dirname(__FILE__) . '/bwp-google-xml-sitemaps/bwp-simple-gxs.php';
 
bwp-simple-gxs.php CHANGED
@@ -1,31 +1,20 @@
1
- <?php
2
- /*
3
- Plugin Name: BWP Google XML Sitemaps
4
- Plugin URI: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/
5
- Description: A more lightweight Google XML Sitemap WordPress plugin that generates a <a href="http://en.wikipedia.org/wiki/Sitemap_index">Sitemap index</a> rather than a single sitemap. Despite its simplicity, it is still very powerful and has plenty of options to choose.
6
- Version: 1.1.6
7
- Text Domain: bwp-simple-gxs
8
- Domain Path: /languages/
9
- Author: Khang Minh
10
- Author URI: http://betterwp.net
11
- License: GPLv3
12
- */
13
-
14
- // Pre-emptive
15
- $bwp_gxs_ob_level = @ob_get_level();
16
- $bwp_gxs_ob_start = ob_start();
17
-
18
- // Frontend
19
- require_once(dirname(__FILE__) . '/includes/class-bwp-simple-gxs.php');
20
- $bwp_gxs_gzipped = (!BWP_SIMPLE_GXS::is_gzipped()) ? false : true;
21
- $bwp_gxs = new BWP_SIMPLE_GXS();
22
-
23
- // Backend
24
- add_action('admin_menu', 'bwp_gxs_init_admin', 1);
25
-
26
- function bwp_gxs_init_admin()
27
- {
28
- global $bwp_gxs;
29
- $bwp_gxs->init_admin();
30
- }
31
- ?>
1
+ <?php
2
+ /*
3
+ Plugin Name: Better WordPress Google XML Sitemaps
4
+ Plugin URI: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/
5
+ Description: A more lightweight Google XML Sitemap WordPress plugin that generates a <a href="http://en.wikipedia.org/wiki/Sitemap_index">Sitemap index</a> rather than a single sitemap. Despite its simplicity, it is still very powerful and has plenty of options to choose.
6
+ Version: 1.3.0
7
+ Text Domain: bwp-simple-gxs
8
+ Domain Path: /languages/
9
+ Author: Khang Minh
10
+ Author URI: http://betterwp.net
11
+ License: GPLv3 or later
12
+ */
13
+
14
+ // In case someone integrates this plugin in a theme or calling this directly
15
+ if (class_exists('BWP_SIMPLE_GXS') || !defined('ABSPATH'))
16
+ return;
17
+
18
+ // init plugin
19
+ require_once dirname(__FILE__) . '/includes/class-bwp-simple-gxs.php';
20
+ $bwp_gxs = new BWP_SIMPLE_GXS();
 
 
 
 
 
 
 
 
 
 
 
bwp-simple-gxs.pot CHANGED
@@ -2,614 +2,1045 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: BWP Google XML Sitemaps\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-09-20 12:59+0700\n"
6
- "PO-Revision-Date: 2011-09-20 12:59+0700\n"
7
- "Last-Translator: \n"
8
- "Language-Team: \n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
  "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SourceCharset: utf-8\n"
 
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
- #: includes/class-bwp-framework.php:172
 
 
 
 
 
 
 
 
18
  #, php-format
19
- msgid "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin."
 
 
 
20
  msgstr ""
21
 
22
- #: includes/class-bwp-framework.php:183
23
  msgid "Development Log"
24
  msgstr ""
25
 
26
- #: includes/class-bwp-framework.php:183
27
  msgid "Frequently Asked Questions"
28
  msgstr ""
29
 
30
- #: includes/class-bwp-framework.php:183
31
  msgid "FAQ"
32
  msgstr ""
33
 
34
- #: includes/class-bwp-framework.php:183
35
  msgid "Got a problem? Send me a feedback!"
36
  msgstr ""
37
 
38
- #: includes/class-bwp-framework.php:183
39
  msgid "Contact"
40
  msgstr ""
41
 
42
- #: includes/class-bwp-framework.php:190
43
- msgid "You can buy me some special coffees if you appreciate my work, thank you!"
 
44
  msgstr ""
45
 
46
- #: includes/class-bwp-framework.php:204
47
- msgid "Donate to "
 
48
  msgstr ""
49
 
50
- #: includes/class-bwp-framework.php:206
51
  msgid "One cup $5.00"
52
  msgstr ""
53
 
54
- #: includes/class-bwp-framework.php:207
55
  msgid "Two cups $10.00"
56
  msgstr ""
57
 
58
- #: includes/class-bwp-framework.php:208
59
  msgid "Five cups! $25.00"
60
  msgstr ""
61
 
62
- #: includes/class-bwp-framework.php:209
63
  msgid "One LL-cup!!! $50.00"
64
  msgstr ""
65
 
66
- #: includes/class-bwp-framework.php:210
67
  msgid "... or any amount!"
68
  msgstr ""
69
 
70
- #: includes/class-bwp-framework.php:225
71
  msgid "Latest updates from BetterWP.net!"
72
  msgstr ""
73
 
74
- #: includes/class-bwp-framework.php:226
75
  msgid "Follow me on Twitter!"
76
  msgstr ""
77
 
78
- #: includes/class-bwp-framework.php:235
 
 
 
 
79
  #, php-format
80
  msgid "You are using version %s!"
81
  msgstr ""
82
 
83
- #: includes/class-bwp-framework.php:372
84
  msgid "Settings"
85
  msgstr ""
86
 
87
- #: includes/class-bwp-gxs-cache.php:34
88
- #, php-format
89
- msgid "Cache directory (\"%s\") does not exist or is not writable."
90
  msgstr ""
91
 
92
- #: includes/class-bwp-gxs-cache.php:56
93
- #, php-format
94
- msgid "Cache file for module <em>%s</em> is not found and will be built right away."
95
  msgstr ""
96
 
97
- #: includes/class-bwp-gxs-cache.php:108
98
- #: includes/class-bwp-simple-gxs.php:1121
99
- #, php-format
100
- msgid "Successfully served a cached version of <em>%s.xml</em>."
101
  msgstr ""
102
 
103
- #: includes/class-bwp-simple-gxs.php:129
104
- #: includes/class-bwp-simple-gxs.php:310
105
- msgid "Sitemap Statistics"
 
 
106
  msgstr ""
107
 
108
- #: includes/class-bwp-simple-gxs.php:130
109
- #: includes/class-bwp-simple-gxs.php:311
110
- msgid "Sitemap Generator"
111
  msgstr ""
112
 
113
- #: includes/class-bwp-simple-gxs.php:149
114
- #, php-format
115
- msgid "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
116
  msgstr ""
117
 
118
- #: includes/class-bwp-simple-gxs.php:308
119
- msgid "BWP Google XML Sitemaps"
120
  msgstr ""
121
 
122
- #: includes/class-bwp-simple-gxs.php:310
123
- msgid "BWP Google XML Sitemaps Statistics"
124
  msgstr ""
125
 
126
- #: includes/class-bwp-simple-gxs.php:311
127
  msgid "BWP Google XML Sitemaps Generator"
128
  msgstr ""
129
 
130
- #: includes/class-bwp-simple-gxs.php:322
131
- msgid "You do not have sufficient permissions to access this page."
132
  msgstr ""
133
 
134
- #: includes/class-bwp-simple-gxs.php:343
135
- #: includes/class-bwp-simple-gxs.php:587
136
- #: includes/class-bwp-simple-gxs.php:589
137
- msgid "Notice"
138
  msgstr ""
139
 
140
- #: includes/class-bwp-simple-gxs.php:343
141
- msgid "All logs have been cleared successfully!"
142
  msgstr ""
143
 
144
- #: includes/class-bwp-simple-gxs.php:350
145
- msgid "What are Sitemaps?"
146
  msgstr ""
147
 
148
- #: includes/class-bwp-simple-gxs.php:351
149
- msgid "Your sitemaps"
150
  msgstr ""
151
 
152
- #: includes/class-bwp-simple-gxs.php:352
153
- msgid "Submit your sitemaps"
154
  msgstr ""
155
 
156
- #: includes/class-bwp-simple-gxs.php:353
157
- msgid "Pinging search engines"
 
 
158
  msgstr ""
159
 
160
- #: includes/class-bwp-simple-gxs.php:354
161
- msgid "Enable pinging functionality?"
162
  msgstr ""
163
 
164
- #: includes/class-bwp-simple-gxs.php:355
165
- msgid "Enable pinging individual SE"
166
  msgstr ""
167
 
168
- #: includes/class-bwp-simple-gxs.php:356
169
- msgid "Sitemap Generator's Log"
170
  msgstr ""
171
 
172
- #: includes/class-bwp-simple-gxs.php:357
173
- msgid "Enable logging?"
174
  msgstr ""
175
 
176
- #: includes/class-bwp-simple-gxs.php:358
177
- msgid "Enable debugging?"
178
  msgstr ""
179
 
180
- #: includes/class-bwp-simple-gxs.php:368
181
- msgid "In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; <em>http://www.sitemaps.org/</em>"
 
182
  msgstr ""
183
 
184
- #: includes/class-bwp-simple-gxs.php:368
185
- msgid "This plugin helps you generate both Sitemap Index files as well as normal Sitemap files. A Sitemap Index, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemap files inside it."
186
  msgstr ""
187
 
188
- #: includes/class-bwp-simple-gxs.php:369
189
- msgid "<em>Basic information about all your sitemaps.</em>"
190
  msgstr ""
191
 
192
- #: includes/class-bwp-simple-gxs.php:370
193
- msgid "<em>More detailed information about how your sitemaps are generated including <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;\">success messages</span>.</em>"
194
  msgstr ""
195
 
196
- #: includes/class-bwp-simple-gxs.php:371
197
- #, php-format
198
- msgid "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
199
  msgstr ""
200
 
201
- #: includes/class-bwp-simple-gxs.php:372
202
- msgid "<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>"
203
  msgstr ""
204
 
205
- #: includes/class-bwp-simple-gxs.php:377
206
- msgid "Selected SE below will be pinged when you publish new posts."
207
  msgstr ""
208
 
209
- #: includes/class-bwp-simple-gxs.php:378
210
- msgid "No additional load is needed so enabling this is recommended."
211
  msgstr ""
212
 
213
- #: includes/class-bwp-simple-gxs.php:379
214
- msgid "Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules."
215
  msgstr ""
216
 
217
- #: includes/class-bwp-simple-gxs.php:380
218
- msgid "Google"
219
  msgstr ""
220
 
221
- #: includes/class-bwp-simple-gxs.php:381
222
- #, php-format
223
- msgid "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
224
  msgstr ""
225
 
226
- #: includes/class-bwp-simple-gxs.php:382
227
- msgid "Bing"
228
  msgstr ""
229
 
230
- #: includes/class-bwp-simple-gxs.php:383
231
- msgid "Ask.com"
232
  msgstr ""
233
 
234
- #: includes/class-bwp-simple-gxs.php:386
235
- #, php-format
236
- msgid "After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href=\"%s\">How-to</a> if you are interested."
237
  msgstr ""
238
 
239
- #: includes/class-bwp-simple-gxs.php:414
240
- msgid "Output no more than"
241
  msgstr ""
242
 
243
- #: includes/class-bwp-simple-gxs.php:415
244
- msgid "Default change frequency"
245
  msgstr ""
246
 
247
- #: includes/class-bwp-simple-gxs.php:416
248
- msgid "Default priority"
249
  msgstr ""
250
 
251
- #: includes/class-bwp-simple-gxs.php:417
252
- msgid "Minimum priority"
253
  msgstr ""
254
 
255
- #: includes/class-bwp-simple-gxs.php:418
256
- msgid "Use GMT for Last Modified date?"
257
  msgstr ""
258
 
259
- #: includes/class-bwp-simple-gxs.php:419
260
- msgid "Style your sitemaps with an XSLT stylesheet?"
261
  msgstr ""
262
 
263
- #: includes/class-bwp-simple-gxs.php:420
264
- msgid "Custom XSLT stylesheet URL"
265
  msgstr ""
266
 
267
- #: includes/class-bwp-simple-gxs.php:421
268
- msgid "Show build stats in sitemaps?"
269
  msgstr ""
270
 
271
- #: includes/class-bwp-simple-gxs.php:422
272
- msgid "Enable credit?"
273
  msgstr ""
274
 
275
- #: includes/class-bwp-simple-gxs.php:423
276
- msgid "Enable Gzip?"
277
  msgstr ""
278
 
279
- #: includes/class-bwp-simple-gxs.php:424
280
- msgid "Clean unexpected output before sitemap generation?"
281
  msgstr ""
282
 
283
- #: includes/class-bwp-simple-gxs.php:425
284
- msgid "Sitemap Index Options"
285
  msgstr ""
286
 
287
- #: includes/class-bwp-simple-gxs.php:426
288
- msgid "Automatically split post-based sitemaps into smaller sitemaps?"
289
  msgstr ""
290
 
291
- #: includes/class-bwp-simple-gxs.php:427
292
- msgid "Add sitemapindex to individual blog's virtual robots.txt?"
293
  msgstr ""
294
 
295
- #: includes/class-bwp-simple-gxs.php:428
296
- msgid "Add sitemapindex from all blogs within network to primary blog's virtual robots.txt?"
297
  msgstr ""
298
 
299
- #: includes/class-bwp-simple-gxs.php:429
300
- msgid "In sitemapindex, include"
301
  msgstr ""
302
 
303
- #: includes/class-bwp-simple-gxs.php:430
304
- msgid "Exclude following post types:"
305
  msgstr ""
306
 
307
- #: includes/class-bwp-simple-gxs.php:431
308
- msgid "Exclude following taxonomies:"
309
  msgstr ""
310
 
311
- #: includes/class-bwp-simple-gxs.php:432
312
- msgid "Module Options"
313
  msgstr ""
314
 
315
- #: includes/class-bwp-simple-gxs.php:433
316
- msgid "Alternate module directory"
317
  msgstr ""
318
 
319
- #: includes/class-bwp-simple-gxs.php:434
320
- msgid "Get no more than"
321
  msgstr ""
322
 
323
- #: includes/class-bwp-simple-gxs.php:435
324
- msgid "Caching Options"
325
  msgstr ""
326
 
327
- #: includes/class-bwp-simple-gxs.php:436
328
- msgid "Enable caching?"
 
 
 
 
329
  msgstr ""
330
 
331
- #: includes/class-bwp-simple-gxs.php:437
332
- msgid "Enable auto cache re-generation?"
333
  msgstr ""
334
 
335
- #: includes/class-bwp-simple-gxs.php:438
336
- msgid "Cached sitemaps will last for"
 
 
 
 
 
337
  msgstr ""
338
 
339
- #: includes/class-bwp-simple-gxs.php:439
340
- msgid "Cached sitemaps are stored in (auto detected)"
 
 
341
  msgstr ""
342
 
343
- #: includes/class-bwp-simple-gxs.php:443
344
- msgid "<em>Cache your sitemaps for better performance.</em>"
 
 
 
345
  msgstr ""
346
 
347
- #: includes/class-bwp-simple-gxs.php:444
348
  #, php-format
349
- msgid "<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href=\"%s#using-modules\">here</a>.</em>"
 
 
 
350
  msgstr ""
351
 
352
- #: includes/class-bwp-simple-gxs.php:445
353
- msgid "<em>Here you can change some settings that affect the default Sitemap Index file.</em>"
 
 
354
  msgstr ""
355
 
356
- #: includes/class-bwp-simple-gxs.php:459
357
- #: includes/class-bwp-simple-gxs.php:465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  msgid "second(s)"
359
  msgstr ""
360
 
361
- #: includes/class-bwp-simple-gxs.php:460
362
- #: includes/class-bwp-simple-gxs.php:466
363
  msgid "minute(s)"
364
  msgstr ""
365
 
366
- #: includes/class-bwp-simple-gxs.php:461
367
- #: includes/class-bwp-simple-gxs.php:467
368
  msgid "hour(s)"
369
  msgstr ""
370
 
371
- #: includes/class-bwp-simple-gxs.php:462
372
- #: includes/class-bwp-simple-gxs.php:468
373
  msgid "day(s)"
374
  msgstr ""
375
 
376
- #: includes/class-bwp-simple-gxs.php:475
377
- #: includes/class-bwp-simple-gxs.php:476
378
- #: includes/class-bwp-simple-gxs.php:477
379
  msgid "read more"
380
  msgstr ""
381
 
382
- #: includes/class-bwp-simple-gxs.php:480
383
- msgid "your sitemaps are generated and then cached to reduce unnecessary work."
384
  msgstr ""
385
 
386
- #: includes/class-bwp-simple-gxs.php:481
387
- msgid "when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while."
 
 
388
  msgstr ""
389
 
390
- #: includes/class-bwp-simple-gxs.php:481
391
- msgid "Flush the cache"
 
392
  msgstr ""
393
 
394
- #: includes/class-bwp-simple-gxs.php:482
395
- msgid "tell you useful information such as build time, memory usage, SQL queries, etc."
 
 
 
396
  msgstr ""
397
 
398
- #: includes/class-bwp-simple-gxs.php:483
399
  #, php-format
400
- msgid "make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an error after enabling this, it's very likely that you have gzip active on your server already."
 
 
 
 
 
 
401
  msgstr ""
402
 
403
- #: includes/class-bwp-simple-gxs.php:484
404
- msgid "only disable this when sitemaps appear in either blank page or plain text."
405
  msgstr ""
406
 
407
- #: includes/class-bwp-simple-gxs.php:485
 
 
 
 
408
  #, php-format
409
- msgid "If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex.xml</code> entries will be added to your primary blog's robots.txt, i.e. <code>%s</code>."
 
 
410
  msgstr ""
411
 
412
- #: includes/class-bwp-simple-gxs.php:486
413
- msgid "taxonomy archives' sitemaps, including custom taxonomies."
414
  msgstr ""
415
 
416
- #: includes/class-bwp-simple-gxs.php:488
417
- msgid "date archives' sitemaps."
 
 
418
  msgstr ""
419
 
420
- #: includes/class-bwp-simple-gxs.php:489
421
- msgid "external pages' sitemap. This allows you to add links to pages that do not belong to WordPress to the sitemap."
 
 
 
 
 
422
  msgstr ""
423
 
424
- #: includes/class-bwp-simple-gxs.php:490
425
- msgid "some copyrighted info is also added to your sitemaps. Thanks!"
 
 
 
 
 
 
 
 
426
  msgstr ""
427
 
428
- #: includes/class-bwp-simple-gxs.php:491
429
- msgid "This will load the default style sheet provided by this plugin. You can set a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook."
 
 
 
430
  msgstr ""
431
 
432
- #: includes/class-bwp-simple-gxs.php:492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  #, php-format
434
- msgid "If you're on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more info."
 
 
435
  msgstr ""
436
 
437
- #: includes/class-bwp-simple-gxs.php:493
438
- msgid "e.g. post1.xml, post2.xml, etc. And each sitemap will contain"
 
 
439
  msgstr ""
440
 
441
- #: includes/class-bwp-simple-gxs.php:494
442
- msgid "If you disable this, make sure you also use <code>date_default_timezone_set</code> to correctly set up a timezone for your application."
 
 
 
 
443
  msgstr ""
444
 
445
- #: includes/class-bwp-simple-gxs.php:495
446
- msgid "author archives' sitemap."
 
447
  msgstr ""
448
 
449
- #: includes/class-bwp-simple-gxs.php:496
450
- msgid "site's home URL sitemap. For a multi-site installation of WordPress, this sitemap will list all domains within your network, not just the main blog. This also supports WPMU Domain Mapping plugin."
451
  msgstr ""
452
 
453
- #: includes/class-bwp-simple-gxs.php:499
454
- msgid "item(s) in one sitemap. You can not go over 50,000."
 
 
 
 
 
 
 
 
 
 
455
  msgstr ""
456
 
457
- #: includes/class-bwp-simple-gxs.php:500
458
- msgid "item(s). Again , you can not go over 50,000."
 
 
459
  msgstr ""
460
 
461
- #: includes/class-bwp-simple-gxs.php:501
462
- msgid "Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead."
463
  msgstr ""
464
 
465
- #: includes/class-bwp-simple-gxs.php:502
466
- msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
 
467
  msgstr ""
468
 
469
- #: includes/class-bwp-simple-gxs.php:503
470
- msgid "item(s) in one SQL query. This helps you avoid running too heavy queries."
 
471
  msgstr ""
472
 
473
- #: includes/class-bwp-simple-gxs.php:506
474
- msgid "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use."
 
 
475
  msgstr ""
476
 
477
- #: includes/class-bwp-simple-gxs.php:513
 
 
 
 
 
 
478
  #, php-format
479
- msgid "<em><strong>Note:</strong> If you encounter white page problem, please refer to the <a target=\"_blank\" href=\"%s\">FAQ section</a> to know how to change this limit appropriately to make this plugin work. Also note that, for post-based sitemaps, this option will be overridden by the limit you set in the Sitemap Index Options below.</em>"
 
 
 
480
  msgstr ""
481
 
482
- #: includes/class-bwp-simple-gxs.php:587
483
  #, php-format
484
- msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  msgstr ""
486
 
487
- #: includes/class-bwp-simple-gxs.php:589
488
- msgid "Could not delete any cached sitemaps. Please manually check the cache directory."
489
  msgstr ""
490
 
491
- #: includes/class-bwp-simple-gxs.php:658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  msgid "Warning"
493
  msgstr ""
494
 
495
- #: includes/class-bwp-simple-gxs.php:658
496
- msgid "Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix)."
 
 
 
 
 
 
 
 
497
  msgstr ""
498
 
499
- #: includes/class-bwp-simple-gxs.php:669
 
 
 
 
500
  msgid "Clear All Logs"
501
  msgstr ""
502
 
503
- #: includes/class-bwp-simple-gxs.php:723
504
- msgid "(Debug is on)"
 
 
 
 
 
 
 
505
  msgstr ""
506
 
507
- #: includes/class-bwp-simple-gxs.php:736
508
  msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
509
  msgstr ""
510
 
511
- #: includes/class-bwp-simple-gxs.php:736
512
  msgid "BWP Google XML Sitemaps Error"
513
  msgstr ""
514
 
515
- #: includes/class-bwp-simple-gxs.php:759
516
- #, php-format
517
- msgid "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> first!"
518
  msgstr ""
519
 
520
- #: includes/class-bwp-simple-gxs.php:759
 
 
 
 
 
 
 
 
 
 
521
  msgid "No log yet!"
522
  msgstr ""
523
 
524
- #: includes/class-bwp-simple-gxs.php:769
525
  #, php-format
526
- msgid "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on <strong>%s</strong>."
 
527
  msgstr ""
528
 
529
- #: includes/class-bwp-simple-gxs.php:779
530
- #: includes/class-bwp-simple-gxs.php:796
 
 
 
 
531
  msgid "M j, Y : H:i:s"
532
  msgstr ""
533
 
534
- #: includes/class-bwp-simple-gxs.php:1089
 
 
 
 
535
  #, php-format
536
- msgid "Requested module (<em>%s</em>) not found or not allowed."
 
 
537
  msgstr ""
538
 
539
- #: includes/class-bwp-simple-gxs.php:1148
540
- #: includes/class-bwp-simple-gxs.php:1168
541
  #, php-format
542
- msgid "Loaded a custom sub-module file: <strong>%s</strong>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  msgstr ""
544
 
545
- #: includes/class-bwp-simple-gxs.php:1157
546
  #, php-format
547
- msgid "Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead."
548
  msgstr ""
549
 
550
- #: includes/class-bwp-simple-gxs.php:1176
551
  #, php-format
552
- msgid "Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead."
 
 
553
  msgstr ""
554
 
555
- #: includes/class-bwp-simple-gxs.php:1189
556
  #, php-format
557
- msgid "Loaded a custom module file: <strong>%s</strong>."
558
  msgstr ""
559
 
560
- #: includes/class-bwp-simple-gxs.php:1195
561
  #, php-format
562
- msgid "Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists."
 
 
563
  msgstr ""
564
 
565
- #: includes/class-bwp-simple-gxs.php:1213
566
  #, php-format
567
- msgid "There is no class named <strong>%s</strong> in the module file <strong>%s</strong>."
568
  msgstr ""
569
 
570
- #: includes/class-bwp-simple-gxs.php:1222
571
  #, php-format
572
- msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
 
 
573
  msgstr ""
574
 
575
- #: includes/class-bwp-simple-gxs.php:1245
576
  #, php-format
577
- msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
578
  msgstr ""
579
 
580
- #: includes/class-bwp-simple-gxs.php:1276
581
- msgid "<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of the time PHP errors) is preventing BWP GXS from showing any sitemap contents. Try disabling <code>WP_DEBUG</code> or this plugin's debug mode, whichever is on. All unexpected outputs should be shown just above this message. If you don't see any, contact me and I might be able to help."
 
 
 
582
  msgstr ""
583
 
584
- #: includes/class-bwp-simple-gxs.php:1382
585
- msgid "Unknown response code from search engines. Ping failed."
 
 
586
  msgstr ""
587
 
588
- #: includes/class-bwp-simple-gxs.php:1384
589
  #, php-format
590
- msgid "Pinged %s successfully!"
591
  msgstr ""
592
 
593
- #: includes/class-bwp-simple-gxs.php:1389
594
  #, php-format
595
- msgid "Error %s from %s"
 
 
596
  msgstr ""
597
 
598
- #: includes/class-bwp-simple-gxs.php:1394
599
  #, php-format
600
- msgid "Ping limit for today to %s has been reached, sorry!"
 
 
 
601
  msgstr ""
602
 
603
- #: includes/class-bwp-simple-gxs.php:1422
604
  #, php-format
605
- msgid "<em>%s.xml</em> does not have any item. The plugin has fired a 404 header to the search engine that requests it. You should check the module that generates that sitemap (<em>%s.php</em>)."
606
  msgstr ""
607
 
608
- #: includes/bwp-option-page/includes/class-bwp-option-page.php:80
609
- msgid "Plugin Configurations"
 
 
610
  msgstr ""
611
 
612
- #: includes/bwp-option-page/includes/class-bwp-option-page.php:398
613
- msgid "Save Changes"
 
 
 
 
 
 
 
614
  msgstr ""
615
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: BWP Google XML Sitemaps\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-09-03 15:10+0700\n"
6
+ "PO-Revision-Date: 2014-09-03 15:10+0700\n"
7
+ "Last-Translator: Khang Minh <contact@betterwp.net>\n"
8
+ "Language-Team: BWP <contact@betterwp.net>\n"
9
+ "Language: en_US\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 1.6.5\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:81
20
+ msgid "Plugin Configurations"
21
+ msgstr ""
22
+
23
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:623
24
+ msgid "Save Changes"
25
+ msgstr ""
26
+
27
+ #: includes/class-bwp-framework-improved.php:211
28
  #, php-format
29
+ msgid ""
30
+ "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</"
31
+ "strong> or higher. The plugin will not protected function until you update "
32
+ "your software. Please deactivate this plugin."
33
  msgstr ""
34
 
35
+ #: includes/class-bwp-framework-improved.php:232
36
  msgid "Development Log"
37
  msgstr ""
38
 
39
+ #: includes/class-bwp-framework-improved.php:232
40
  msgid "Frequently Asked Questions"
41
  msgstr ""
42
 
43
+ #: includes/class-bwp-framework-improved.php:232
44
  msgid "FAQ"
45
  msgstr ""
46
 
47
+ #: includes/class-bwp-framework-improved.php:232
48
  msgid "Got a problem? Send me a feedback!"
49
  msgstr ""
50
 
51
+ #: includes/class-bwp-framework-improved.php:232
52
  msgid "Contact"
53
  msgstr ""
54
 
55
+ #: includes/class-bwp-framework-improved.php:239
56
+ msgid ""
57
+ "You can buy me some special coffees if you appreciate my work, thank you!"
58
  msgstr ""
59
 
60
+ #: includes/class-bwp-framework-improved.php:253
61
+ #, php-format
62
+ msgid "Donate to %s"
63
  msgstr ""
64
 
65
+ #: includes/class-bwp-framework-improved.php:255
66
  msgid "One cup $5.00"
67
  msgstr ""
68
 
69
+ #: includes/class-bwp-framework-improved.php:256
70
  msgid "Two cups $10.00"
71
  msgstr ""
72
 
73
+ #: includes/class-bwp-framework-improved.php:257
74
  msgid "Five cups! $25.00"
75
  msgstr ""
76
 
77
+ #: includes/class-bwp-framework-improved.php:258
78
  msgid "One LL-cup!!! $50.00"
79
  msgstr ""
80
 
81
+ #: includes/class-bwp-framework-improved.php:259
82
  msgid "... or any amount!"
83
  msgstr ""
84
 
85
+ #: includes/class-bwp-framework-improved.php:274
86
  msgid "Latest updates from BetterWP.net!"
87
  msgstr ""
88
 
89
+ #: includes/class-bwp-framework-improved.php:275
90
  msgid "Follow me on Twitter!"
91
  msgstr ""
92
 
93
+ #: includes/class-bwp-framework-improved.php:285
94
+ msgid "This Plugin is Proudly Sponsored By"
95
+ msgstr ""
96
+
97
+ #: includes/class-bwp-framework-improved.php:305
98
  #, php-format
99
  msgid "You are using version %s!"
100
  msgstr ""
101
 
102
+ #: includes/class-bwp-framework-improved.php:546
103
  msgid "Settings"
104
  msgstr ""
105
 
106
+ #: includes/class-bwp-simple-gxs.php:361 includes/class-bwp-simple-gxs.php:785
107
+ msgid "XML Sitemaps"
 
108
  msgstr ""
109
 
110
+ #: includes/class-bwp-simple-gxs.php:363 includes/class-bwp-simple-gxs.php:793
111
+ msgid "Google News Sitemap"
 
112
  msgstr ""
113
 
114
+ #: includes/class-bwp-simple-gxs.php:365 includes/class-bwp-simple-gxs.php:801
115
+ msgid "Sitemap Log"
 
 
116
  msgstr ""
117
 
118
+ #: includes/class-bwp-simple-gxs.php:397
119
+ #, php-format
120
+ msgid ""
121
+ "This sitemap was originally generated in %s second(s) (Memory usage: %s) - "
122
+ "%s queries - %s URL(s) listed"
123
  msgstr ""
124
 
125
+ #: includes/class-bwp-simple-gxs.php:751
126
+ msgid "BWP Google XML Sitemaps Statistics"
 
127
  msgstr ""
128
 
129
+ #: includes/class-bwp-simple-gxs.php:752
130
+ msgid "BWP XML Sitemaps"
 
131
  msgstr ""
132
 
133
+ #: includes/class-bwp-simple-gxs.php:758
134
+ msgid "BWP Google News XML Sitemap"
135
  msgstr ""
136
 
137
+ #: includes/class-bwp-simple-gxs.php:759
138
+ msgid "BWP Google News Sitemap"
139
  msgstr ""
140
 
141
+ #: includes/class-bwp-simple-gxs.php:765
142
  msgid "BWP Google XML Sitemaps Generator"
143
  msgstr ""
144
 
145
+ #: includes/class-bwp-simple-gxs.php:766
146
+ msgid "BWP Sitemap Log"
147
  msgstr ""
148
 
149
+ #: includes/class-bwp-simple-gxs.php:775
150
+ msgid "Better WordPress Google XML Sitemaps"
 
 
151
  msgstr ""
152
 
153
+ #: includes/class-bwp-simple-gxs.php:784
154
+ msgid "Better WordPress Google XML Sitemaps Statistics"
155
  msgstr ""
156
 
157
+ #: includes/class-bwp-simple-gxs.php:792
158
+ msgid "Better WordPress Google News XML Sitemap"
159
  msgstr ""
160
 
161
+ #: includes/class-bwp-simple-gxs.php:800
162
+ msgid "Better WordPress Google XML Sitemaps Generator"
163
  msgstr ""
164
 
165
+ #: includes/class-bwp-simple-gxs.php:878
166
+ msgid "You do not have sufficient permissions to access this page."
167
  msgstr ""
168
 
169
+ #: includes/class-bwp-simple-gxs.php:925
170
+ #: includes/class-bwp-simple-gxs.php:1776
171
+ #: includes/class-bwp-simple-gxs.php:1788
172
+ msgid "Notice"
173
  msgstr ""
174
 
175
+ #: includes/class-bwp-simple-gxs.php:926
176
+ msgid "All logs have been cleared successfully!"
177
  msgstr ""
178
 
179
+ #: includes/class-bwp-simple-gxs.php:974
180
+ msgid "Your sitemaps"
181
  msgstr ""
182
 
183
+ #: includes/class-bwp-simple-gxs.php:975
184
+ msgid "Sitemaps to generate"
185
  msgstr ""
186
 
187
+ #: includes/class-bwp-simple-gxs.php:976
188
+ msgid "<strong>Enable</strong> following sitemaps"
189
  msgstr ""
190
 
191
+ #: includes/class-bwp-simple-gxs.php:977
192
+ msgid "For post-based sitemaps, <strong>disable</strong> following post types:"
193
  msgstr ""
194
 
195
+ #: includes/class-bwp-simple-gxs.php:978
196
+ msgid ""
197
+ "For taxonomy-based sitemaps, <strong>disable</strong> following taxonomies:"
198
  msgstr ""
199
 
200
+ #: includes/class-bwp-simple-gxs.php:979
201
+ msgid "Item limits"
202
  msgstr ""
203
 
204
+ #: includes/class-bwp-simple-gxs.php:980
205
+ msgid "Global limit"
206
  msgstr ""
207
 
208
+ #: includes/class-bwp-simple-gxs.php:981
209
+ msgid "Split <strong>post-based</strong> sitemaps"
210
  msgstr ""
211
 
212
+ #: includes/class-bwp-simple-gxs.php:982
213
+ msgid "Split limit"
 
214
  msgstr ""
215
 
216
+ #: includes/class-bwp-simple-gxs.php:983
217
+ msgid "Default values & Formatting"
218
  msgstr ""
219
 
220
+ #: includes/class-bwp-simple-gxs.php:984
221
+ msgid "Default change frequency"
222
  msgstr ""
223
 
224
+ #: includes/class-bwp-simple-gxs.php:985
225
+ msgid "Default priority"
226
  msgstr ""
227
 
228
+ #: includes/class-bwp-simple-gxs.php:986
229
+ msgid "Minimum priority"
230
  msgstr ""
231
 
232
+ #: includes/class-bwp-simple-gxs.php:987
233
+ msgid "Use GMT for Last Modified date"
234
  msgstr ""
235
 
236
+ #: includes/class-bwp-simple-gxs.php:988
237
+ msgid "Compress sitemaps"
 
238
  msgstr ""
239
 
240
+ #: includes/class-bwp-simple-gxs.php:989
241
+ msgid "Look and Feel"
242
  msgstr ""
243
 
244
+ #: includes/class-bwp-simple-gxs.php:990
245
+ msgid "Make sitemaps look pretty"
246
  msgstr ""
247
 
248
+ #: includes/class-bwp-simple-gxs.php:991
249
+ msgid "Custom XSLT stylesheet URL"
 
250
  msgstr ""
251
 
252
+ #: includes/class-bwp-simple-gxs.php:992
253
+ msgid "Enable build stats"
254
  msgstr ""
255
 
256
+ #: includes/class-bwp-simple-gxs.php:993
257
+ msgid "Enable credit"
258
  msgstr ""
259
 
260
+ #: includes/class-bwp-simple-gxs.php:994
261
+ msgid "Virtual robots.txt"
262
  msgstr ""
263
 
264
+ #: includes/class-bwp-simple-gxs.php:995
265
+ msgid "Add a sitemapindex entry to blog's robots.txt"
266
  msgstr ""
267
 
268
+ #: includes/class-bwp-simple-gxs.php:996
269
+ msgid "Add sitemapindex entries from all blogs to primary blog's robots.txt"
270
  msgstr ""
271
 
272
+ #: includes/class-bwp-simple-gxs.php:997
273
+ msgid "Ping search engines"
274
  msgstr ""
275
 
276
+ #: includes/class-bwp-simple-gxs.php:998
277
+ msgid "Enable pinging"
278
  msgstr ""
279
 
280
+ #: includes/class-bwp-simple-gxs.php:999
281
+ msgid "Search engines to ping"
282
  msgstr ""
283
 
284
+ #: includes/class-bwp-simple-gxs.php:1000
285
+ msgid "<strong>Disable pinging</strong> for following post types:"
286
  msgstr ""
287
 
288
+ #: includes/class-bwp-simple-gxs.php:1001
289
+ msgid "Ping limit for each search engine"
290
  msgstr ""
291
 
292
+ #: includes/class-bwp-simple-gxs.php:1002
293
+ msgid "Caching"
294
  msgstr ""
295
 
296
+ #: includes/class-bwp-simple-gxs.php:1003
297
+ msgid "Enable caching"
298
  msgstr ""
299
 
300
+ #: includes/class-bwp-simple-gxs.php:1004
301
+ msgid "Enable auto cache re-generation"
302
  msgstr ""
303
 
304
+ #: includes/class-bwp-simple-gxs.php:1005
305
+ msgid "Cache expiry time"
306
  msgstr ""
307
 
308
+ #: includes/class-bwp-simple-gxs.php:1006
309
+ msgid "Cache directory"
310
  msgstr ""
311
 
312
+ #: includes/class-bwp-simple-gxs.php:1007
313
+ msgid "Sitemap modules"
314
  msgstr ""
315
 
316
+ #: includes/class-bwp-simple-gxs.php:1008
317
+ msgid "Database query limit"
318
  msgstr ""
319
 
320
+ #: includes/class-bwp-simple-gxs.php:1009
321
+ msgid "Custom module directory"
322
  msgstr ""
323
 
324
+ #: includes/class-bwp-simple-gxs.php:1010
325
+ msgid "Sitemap log & debug"
326
  msgstr ""
327
 
328
+ #: includes/class-bwp-simple-gxs.php:1011
329
+ msgid "Enable sitemap log"
330
  msgstr ""
331
 
332
+ #: includes/class-bwp-simple-gxs.php:1012
333
+ msgid "Enable debug mode"
334
  msgstr ""
335
 
336
+ #: includes/class-bwp-simple-gxs.php:1013
337
+ msgid "Enable debug extra mode"
338
  msgstr ""
339
 
340
+ #: includes/class-bwp-simple-gxs.php:1061
341
+ #, php-format
342
+ msgid ""
343
+ "Choose appropriate sitemaps to generate. For each sitemap, you can use "
344
+ "filters to further <a href=\"%s#exclude_items\" target=\"_blank\">exclude "
345
+ "items</a> you do not need."
346
  msgstr ""
347
 
348
+ #: includes/class-bwp-simple-gxs.php:1068
349
+ msgid "Limit the number of items to output in one sitemap. "
350
  msgstr ""
351
 
352
+ #: includes/class-bwp-simple-gxs.php:1069
353
+ #, php-format
354
+ msgid ""
355
+ "Avoid setting too high limits, i.e. ones that your server can not handle. In "
356
+ "such case, you might encounter white page error due to timeout or memory "
357
+ "issue. Refer to this plugin's <a target=\"_blank\" href=\"%s\">FAQ section</"
358
+ "a> for more info."
359
  msgstr ""
360
 
361
+ #: includes/class-bwp-simple-gxs.php:1076
362
+ msgid ""
363
+ "Customize default values and some formating for your sitemaps. Default "
364
+ "values are only used when valid ones can not be calculated."
365
  msgstr ""
366
 
367
+ #: includes/class-bwp-simple-gxs.php:1081
368
+ msgid ""
369
+ "Customize the look and feel of your sitemaps. Note that an XSLT stylesheet "
370
+ "will NOT be used for the Google News Sitemap module regardless of any "
371
+ "setting in this section."
372
  msgstr ""
373
 
374
+ #: includes/class-bwp-simple-gxs.php:1087
375
  #, php-format
376
+ msgid ""
377
+ "WordPress generates a %svirtual robots.txt%s file for your blog by default. "
378
+ "You can add links to sitemapindex files generated by this plugin to that "
379
+ "robots.txt file using settings below."
380
  msgstr ""
381
 
382
+ #: includes/class-bwp-simple-gxs.php:1099
383
+ msgid ""
384
+ "Whenever you post something new to your blog, you can <em>ping</em> search "
385
+ "engines with your sitemapindex to tell them your blog just got updated."
386
  msgstr ""
387
 
388
+ #: includes/class-bwp-simple-gxs.php:1104
389
+ msgid ""
390
+ "Cache your sitemaps for better performance. If you are still configuring the "
391
+ "plugin it's best to disable caching or you might have to manually flush the "
392
+ "cache for any changes to show up."
393
+ msgstr ""
394
+
395
+ #: includes/class-bwp-simple-gxs.php:1110
396
+ #, php-format
397
+ msgid ""
398
+ "Extend this plugin using customizable modules. More info <a href="
399
+ "\"%s#module_api\">here</a>."
400
+ msgstr ""
401
+
402
+ #: includes/class-bwp-simple-gxs.php:1132
403
+ #: includes/class-bwp-simple-gxs.php:1138
404
  msgid "second(s)"
405
  msgstr ""
406
 
407
+ #: includes/class-bwp-simple-gxs.php:1133
408
+ #: includes/class-bwp-simple-gxs.php:1139
409
  msgid "minute(s)"
410
  msgstr ""
411
 
412
+ #: includes/class-bwp-simple-gxs.php:1134
413
+ #: includes/class-bwp-simple-gxs.php:1140
414
  msgid "hour(s)"
415
  msgstr ""
416
 
417
+ #: includes/class-bwp-simple-gxs.php:1135
418
+ #: includes/class-bwp-simple-gxs.php:1141
419
  msgid "day(s)"
420
  msgstr ""
421
 
422
+ #: includes/class-bwp-simple-gxs.php:1149
423
+ #: includes/class-bwp-simple-gxs.php:1152
424
+ #: includes/class-bwp-simple-gxs.php:1155
425
  msgid "read more"
426
  msgstr ""
427
 
428
+ #: includes/class-bwp-simple-gxs.php:1159
429
+ msgid "Your sitemaps are generated and then cached to reduce unnecessary work."
430
  msgstr ""
431
 
432
+ #: includes/class-bwp-simple-gxs.php:1160
433
+ msgid ""
434
+ "Re-generate sitemap cache when expired. If you disable this, remember to "
435
+ "manually flush the cache once in a while."
436
  msgstr ""
437
 
438
+ #: includes/class-bwp-simple-gxs.php:1161
439
+ msgid ""
440
+ "print useful information such as build time, memory usage, SQL queries, etc."
441
  msgstr ""
442
 
443
+ #: includes/class-bwp-simple-gxs.php:1162
444
+ #, php-format
445
+ msgid ""
446
+ "Use gzip to make sitemaps ~70% smaller. If you see an error after enabling "
447
+ "this, it's very likely that you have gzip active on your server already."
448
  msgstr ""
449
 
450
+ #: includes/class-bwp-simple-gxs.php:1163
451
  #, php-format
452
+ msgid ""
453
+ "If you have for example 50 blogs, 50 sitemapindex entries will be added to "
454
+ "your primary blog's <a href=\"%s\" target=\"_blank\">robots.txt</a>."
455
+ msgstr ""
456
+
457
+ #: includes/class-bwp-simple-gxs.php:1164
458
+ msgid "Taxonomy (including custom taxonomies)."
459
  msgstr ""
460
 
461
+ #: includes/class-bwp-simple-gxs.php:1165
462
+ msgid "Date archives."
463
  msgstr ""
464
 
465
+ #: includes/class-bwp-simple-gxs.php:1166
466
+ msgid "Author archives."
467
+ msgstr ""
468
+
469
+ #: includes/class-bwp-simple-gxs.php:1167
470
  #, php-format
471
+ msgid ""
472
+ "External pages. More info <a href=\"%s#external_sitemap\" target=\"_blank"
473
+ "\">here</a>."
474
  msgstr ""
475
 
476
+ #: includes/class-bwp-simple-gxs.php:1168
477
+ msgid "some copyrighted info is also added to your sitemaps. Thanks!"
478
  msgstr ""
479
 
480
+ #: includes/class-bwp-simple-gxs.php:1169
481
+ msgid ""
482
+ "Default XSLT stylesheets will be used. Set your custom stylesheets below or "
483
+ "filter the <code>bwp_gxs_xslt</code> hook."
484
  msgstr ""
485
 
486
+ #: includes/class-bwp-simple-gxs.php:1170
487
+ #, php-format
488
+ msgid ""
489
+ "If you're on a Multi-site installation with <strong>Sub-domain</strong> "
490
+ "enabled, each blog will have its own robots.txt. Blogs in <strong>sub-"
491
+ "directory</strong> will not, however. Please read the <a href=\"%s#robots.txt"
492
+ "\" target=\"_blank\">documentation</a> for more info."
493
  msgstr ""
494
 
495
+ #: includes/class-bwp-simple-gxs.php:1171
496
+ msgid ""
497
+ "Sitemaps like <code>post.xml</code> are split into <code>post_part1.xml</"
498
+ "code>, <code>post_part2.xml</code>, etc. when limit reached."
499
+ msgstr ""
500
+
501
+ #: includes/class-bwp-simple-gxs.php:1172
502
+ msgid ""
503
+ "Disable this to use the local timezone setting in <em>Settings >> General</"
504
+ "em>."
505
  msgstr ""
506
 
507
+ #: includes/class-bwp-simple-gxs.php:1173
508
+ msgid ""
509
+ "Site Address. For a multi-site installation of WordPress, this sitemap will "
510
+ "list all appropriate blogs' addresses within your network, not just the main "
511
+ "blog's."
512
  msgstr ""
513
 
514
+ #: includes/class-bwp-simple-gxs.php:1174
515
+ msgid ""
516
+ "Ping search engines when you publish new posts. By default all public posts "
517
+ "are considered, unless explicitly disabled below."
518
+ msgstr ""
519
+
520
+ #: includes/class-bwp-simple-gxs.php:1175
521
+ msgid "Google"
522
+ msgstr ""
523
+
524
+ #: includes/class-bwp-simple-gxs.php:1176
525
+ msgid "Bing"
526
+ msgstr ""
527
+
528
+ #: includes/class-bwp-simple-gxs.php:1177
529
  #, php-format
530
+ msgid ""
531
+ "No additional load is needed so enabling this is highly recommended. You can "
532
+ "check the log <a href=\"%s\">here</a>."
533
  msgstr ""
534
 
535
+ #: includes/class-bwp-simple-gxs.php:1178
536
+ msgid ""
537
+ "When this is on, NO caching is used and <code>WP_DEBUG</code> is respected, "
538
+ "useful when developing new modules."
539
  msgstr ""
540
 
541
+ #: includes/class-bwp-simple-gxs.php:1179
542
+ #, php-format
543
+ msgid ""
544
+ "When this is on, NO headers are sent and sitemaps are NOT compressed, useful "
545
+ "when debugging <em>Content Encoding Error</em>. More info <a href="
546
+ "\"%s#sitemap_log_debug\" target=\"_blank\">here</a>."
547
  msgstr ""
548
 
549
+ #: includes/class-bwp-simple-gxs.php:1184
550
+ msgid ""
551
+ "Maximum is <strong>50,000</strong>. This setting is applied to all sitemaps."
552
  msgstr ""
553
 
554
+ #: includes/class-bwp-simple-gxs.php:1189
555
+ msgid "Maximum is <strong>50,000</strong>. Set to 0 to use the Global limit."
556
  msgstr ""
557
 
558
+ #: includes/class-bwp-simple-gxs.php:1195
559
+ msgid ""
560
+ "Expect an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</"
561
+ "code>. You must also have a stylesheet for the sitemapindex that can be "
562
+ "accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and "
563
+ "<code>my-stylesheetindex.xsl</code>. Leave blank to use provided stylesheets."
564
+ msgstr ""
565
+
566
+ #: includes/class-bwp-simple-gxs.php:1206
567
+ msgid ""
568
+ "Expect an absolute path to the directory where you put your custom modules "
569
+ "(e.g. <code>/home/mysite/public_html/gxs-modules/</code>). "
570
  msgstr ""
571
 
572
+ #: includes/class-bwp-simple-gxs.php:1210
573
+ msgid ""
574
+ "Override a built-in module by having a module with the same filename in "
575
+ "specified directory."
576
  msgstr ""
577
 
578
+ #: includes/class-bwp-simple-gxs.php:1216
579
+ msgid "set via constant (BWP_GXS_CACHE_DIR)"
580
  msgstr ""
581
 
582
+ #: includes/class-bwp-simple-gxs.php:1218
583
+ msgid ""
584
+ "Expect an absolute path to a writable directory (i.e. CHMOD to 755 or 777). "
585
  msgstr ""
586
 
587
+ #: includes/class-bwp-simple-gxs.php:1221
588
+ #, php-format
589
+ msgid "Leave empty to use <code>%s</code>."
590
  msgstr ""
591
 
592
+ #: includes/class-bwp-simple-gxs.php:1226
593
+ msgid ""
594
+ "Only get this many items when querying from Database. This is to make sure "
595
+ "we are not running too heavy queries."
596
  msgstr ""
597
 
598
+ #: includes/class-bwp-simple-gxs.php:1239
599
+ msgid ""
600
+ "time(s) per day. Increase this limit if you publish a lot of posts in a "
601
+ "single day."
602
+ msgstr ""
603
+
604
+ #: includes/class-bwp-simple-gxs.php:1252
605
  #, php-format
606
+ msgid ""
607
+ "Submit your <a href=\"%s\" target=\"_blank\">sitemapindex</a> to major "
608
+ "search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s"
609
+ "\" target=\"_blank\">Bing</a>."
610
  msgstr ""
611
 
612
+ #: includes/class-bwp-simple-gxs.php:1259
613
  #, php-format
614
+ msgid ""
615
+ "Only the sitemapindex needs to be submitted as search engines will "
616
+ "automatically recognize other included sitemaps. More info can be found <a "
617
+ "href=\"%s\">here</a>."
618
+ msgstr ""
619
+
620
+ #: includes/class-bwp-simple-gxs.php:1370
621
+ msgid "Add Google News Sitemap to your sitemapindex"
622
+ msgstr ""
623
+
624
+ #: includes/class-bwp-simple-gxs.php:1371
625
+ msgid "Enable news sitemap"
626
+ msgstr ""
627
+
628
+ #: includes/class-bwp-simple-gxs.php:1372
629
+ msgid "Enable keywords support"
630
+ msgstr ""
631
+
632
+ #: includes/class-bwp-simple-gxs.php:1373
633
+ msgid "Get keywords from"
634
+ msgstr ""
635
+
636
+ #: includes/class-bwp-simple-gxs.php:1374
637
+ msgid "Enable multi-category support"
638
+ msgstr ""
639
+
640
+ #: includes/class-bwp-simple-gxs.php:1375
641
+ msgid "Ping search engines when a news article is published"
642
+ msgstr ""
643
+
644
+ #: includes/class-bwp-simple-gxs.php:1376
645
+ msgid "News sitemap's language"
646
+ msgstr ""
647
+
648
+ #: includes/class-bwp-simple-gxs.php:1377
649
+ #: includes/class-bwp-simple-gxs.php:1436
650
+ msgid "News categories"
651
+ msgstr ""
652
+
653
+ #: includes/class-bwp-simple-gxs.php:1378
654
+ msgid "The Google News sitemap will"
655
+ msgstr ""
656
+
657
+ #: includes/class-bwp-simple-gxs.php:1393
658
+ msgid ""
659
+ "A Google News Sitemap is a file that allows you to control which content you "
660
+ "submit to Google News. By creating and submitting a Google News Sitemap, "
661
+ "you're able to help Google News discover and crawl your site's news articles "
662
+ "&mdash; http://support.google.com/"
663
+ msgstr ""
664
+
665
+ #: includes/class-bwp-simple-gxs.php:1401
666
+ msgid ""
667
+ "Below you will be able to choose what categories to use (or not use) in the "
668
+ "news sitemap. You can also assign genres to a specific category."
669
+ msgstr ""
670
+
671
+ #: includes/class-bwp-simple-gxs.php:1407
672
+ msgid "below selected categories in the news sitemap."
673
+ msgstr ""
674
+
675
+ #: includes/class-bwp-simple-gxs.php:1412
676
+ msgid "English"
677
  msgstr ""
678
 
679
+ #: includes/class-bwp-simple-gxs.php:1413
680
+ msgid "Arabic"
681
  msgstr ""
682
 
683
+ #: includes/class-bwp-simple-gxs.php:1414
684
+ msgid "Chinese (simplified)"
685
+ msgstr ""
686
+
687
+ #: includes/class-bwp-simple-gxs.php:1415
688
+ msgid "Chinese (traditional)"
689
+ msgstr ""
690
+
691
+ #: includes/class-bwp-simple-gxs.php:1416
692
+ msgid "Dutch"
693
+ msgstr ""
694
+
695
+ #: includes/class-bwp-simple-gxs.php:1417
696
+ msgid "French"
697
+ msgstr ""
698
+
699
+ #: includes/class-bwp-simple-gxs.php:1418
700
+ msgid "German"
701
+ msgstr ""
702
+
703
+ #: includes/class-bwp-simple-gxs.php:1419
704
+ msgid "Hebrew"
705
+ msgstr ""
706
+
707
+ #: includes/class-bwp-simple-gxs.php:1420
708
+ msgid "Hindi"
709
+ msgstr ""
710
+
711
+ #: includes/class-bwp-simple-gxs.php:1421
712
+ msgid "Italian"
713
+ msgstr ""
714
+
715
+ #: includes/class-bwp-simple-gxs.php:1422
716
+ msgid "Japanese"
717
+ msgstr ""
718
+
719
+ #: includes/class-bwp-simple-gxs.php:1423
720
+ msgid "Norwegian"
721
+ msgstr ""
722
+
723
+ #: includes/class-bwp-simple-gxs.php:1424
724
+ msgid "Portuguese"
725
+ msgstr ""
726
+
727
+ #: includes/class-bwp-simple-gxs.php:1425
728
+ msgid "Polish"
729
+ msgstr ""
730
+
731
+ #: includes/class-bwp-simple-gxs.php:1426
732
+ msgid "Russian"
733
+ msgstr ""
734
+
735
+ #: includes/class-bwp-simple-gxs.php:1427
736
+ msgid "Spanish"
737
+ msgstr ""
738
+
739
+ #: includes/class-bwp-simple-gxs.php:1428
740
+ msgid "Turkish"
741
+ msgstr ""
742
+
743
+ #: includes/class-bwp-simple-gxs.php:1429
744
+ msgid "Vietnamese"
745
+ msgstr ""
746
+
747
+ #: includes/class-bwp-simple-gxs.php:1432
748
+ msgid "include"
749
+ msgstr ""
750
+
751
+ #: includes/class-bwp-simple-gxs.php:1433
752
+ msgid "exclude"
753
+ msgstr ""
754
+
755
+ #: includes/class-bwp-simple-gxs.php:1437
756
+ msgid "News tags"
757
+ msgstr ""
758
+
759
+ #: includes/class-bwp-simple-gxs.php:1443
760
+ #, php-format
761
+ msgid ""
762
+ "A <code>post_google_news.xml</code> sitemap will be added to the main <a "
763
+ "href=\"%s\" target=\"_blank\">sitemapindex.xml</a>. It is strongly "
764
+ "recommended that you take a look at <a href=\"%s\" target=\"_blank"
765
+ "\">Google's guidelines</a> before enabling this feature."
766
+ msgstr ""
767
+
768
+ #: includes/class-bwp-simple-gxs.php:1444
769
+ #, php-format
770
+ msgid "More info <a href=\"%s\" target=\"_blank\">here</a>."
771
+ msgstr ""
772
+
773
+ #: includes/class-bwp-simple-gxs.php:1445
774
+ msgid ""
775
+ "This ping works separately from the sitemapindex ping, and only occurs when "
776
+ "you publish an article in one of the news categories set below."
777
+ msgstr ""
778
+
779
+ #: includes/class-bwp-simple-gxs.php:1446
780
+ msgid "Enable this if you have posts assigned to more than one categories."
781
+ msgstr ""
782
+
783
+ #: includes/class-bwp-simple-gxs.php:1454
784
+ msgid "Note"
785
+ msgstr ""
786
+
787
+ #: includes/class-bwp-simple-gxs.php:1455
788
+ msgid ""
789
+ "The Google News sitemap is an extension (or sub-module) of the <code>post."
790
+ "xml</code> sitemap, which means it also uses posts from the <strong>Post</"
791
+ "strong> post type, but only from categories that are selected."
792
+ msgstr ""
793
+
794
+ #: includes/class-bwp-simple-gxs.php:1506
795
+ msgid "Sitemap Generator's Log"
796
+ msgstr ""
797
+
798
+ #: includes/class-bwp-simple-gxs.php:1514
799
+ msgid ""
800
+ "Below are details on how your sitemaps are generated including <span style="
801
+ "\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</"
802
+ "span> and <span style=\"color: #009900;\">success messages</span>."
803
+ msgstr ""
804
+
805
+ #: includes/class-bwp-simple-gxs.php:1520
806
+ msgid ""
807
+ "Logging is not currently enabled. You can enable this feature by checking "
808
+ "\"Enable sitemap log\" in <strong>XML Sitemaps >> Sitemap log & debug</"
809
+ "strong>."
810
+ msgstr ""
811
+
812
+ #: includes/class-bwp-simple-gxs.php:1654
813
+ msgid "All options have been saved."
814
+ msgstr ""
815
+
816
+ #: includes/class-bwp-simple-gxs.php:1679
817
  msgid "Warning"
818
  msgstr ""
819
 
820
+ #: includes/class-bwp-simple-gxs.php:1680
821
+ #, php-format
822
+ msgid ""
823
+ "Cache directory (<code>%s</code>) does not exist or is not writable. Please "
824
+ "try CHMODing it to either 755 or 777, or disable caching to hide this "
825
+ "warning (not recommended)."
826
+ msgstr ""
827
+
828
+ #: includes/class-bwp-simple-gxs.php:1704
829
+ msgid "Save Changes and Flush Cache"
830
  msgstr ""
831
 
832
+ #: includes/class-bwp-simple-gxs.php:1706
833
+ msgid "Flush Cache"
834
+ msgstr ""
835
+
836
+ #: includes/class-bwp-simple-gxs.php:1718
837
  msgid "Clear All Logs"
838
  msgstr ""
839
 
840
+ #: includes/class-bwp-simple-gxs.php:1778
841
+ #, php-format
842
+ msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
843
+ msgstr ""
844
+
845
+ #: includes/class-bwp-simple-gxs.php:1789
846
+ msgid ""
847
+ "Could not delete any cached sitemaps. Please manually check the cache "
848
+ "directory."
849
  msgstr ""
850
 
851
+ #: includes/class-bwp-simple-gxs.php:1815
852
  msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
853
  msgstr ""
854
 
855
+ #: includes/class-bwp-simple-gxs.php:1816
856
  msgid "BWP Google XML Sitemaps Error"
857
  msgstr ""
858
 
859
+ #: includes/class-bwp-simple-gxs.php:1837
860
+ msgid "Debug extra was on"
 
861
  msgstr ""
862
 
863
+ #: includes/class-bwp-simple-gxs.php:1838
864
+ msgid "Debug was on"
865
+ msgstr ""
866
+
867
+ #: includes/class-bwp-simple-gxs.php:1928
868
+ msgid ""
869
+ "It appears that no sitemap has been generated yet, or you have recently "
870
+ "cleared the sitemap log."
871
+ msgstr ""
872
+
873
+ #: includes/class-bwp-simple-gxs.php:1931
874
  msgid "No log yet!"
875
  msgstr ""
876
 
877
+ #: includes/class-bwp-simple-gxs.php:1940
878
  #, php-format
879
+ msgid ""
880
+ "<a href=\"%s\" target=\"_blank\">%s</a> was generated on <strong>%s</strong>."
881
  msgstr ""
882
 
883
+ #: includes/class-bwp-simple-gxs.php:1945
884
+ msgid "Below you can find a list of generated sitemaps:"
885
+ msgstr ""
886
+
887
+ #: includes/class-bwp-simple-gxs.php:1977
888
+ #: includes/class-bwp-simple-gxs.php:2012
889
  msgid "M j, Y : H:i:s"
890
  msgstr ""
891
 
892
+ #: includes/class-bwp-simple-gxs.php:2113
893
+ msgid "Category's name"
894
+ msgstr ""
895
+
896
+ #: includes/class-bwp-simple-gxs.php:2114
897
  #, php-format
898
+ msgid ""
899
+ "<span>Genres used for this category</span> (more info <a href=\"%s\" target="
900
+ "\"_blank\">here</a>)"
901
  msgstr ""
902
 
903
+ #: includes/class-bwp-simple-gxs.php:2409
 
904
  #, php-format
905
+ msgid ""
906
+ "Google news posts that are published within last 48 hours (as per <a href="
907
+ "\"%s\" target=\"_blank\">Google's guidelines</a>)"
908
+ msgstr ""
909
+
910
+ #: includes/class-bwp-simple-gxs.php:2416
911
+ msgid "Post"
912
+ msgstr ""
913
+
914
+ #: includes/class-bwp-simple-gxs.php:2423
915
+ msgid "External page"
916
+ msgstr ""
917
+
918
+ #: includes/class-bwp-simple-gxs.php:2425
919
+ msgid "Page"
920
+ msgstr ""
921
+
922
+ #: includes/class-bwp-simple-gxs.php:2433
923
+ msgid "Date archive"
924
+ msgstr ""
925
+
926
+ #: includes/class-bwp-simple-gxs.php:2437
927
+ msgid "Author archive"
928
  msgstr ""
929
 
930
+ #: includes/class-bwp-simple-gxs.php:2589
931
  #, php-format
932
+ msgid "Successfully served a cached version of <em>%s.xml</em>."
933
  msgstr ""
934
 
935
+ #: includes/class-bwp-simple-gxs.php:2617
936
  #, php-format
937
+ msgid ""
938
+ "Cache directory <strong>%s</strong> is not writable, no cache file was "
939
+ "created."
940
  msgstr ""
941
 
942
+ #: includes/class-bwp-simple-gxs.php:2630
943
  #, php-format
944
+ msgid "Could not write sitemap file to cache directory <strong>%s</strong>"
945
  msgstr ""
946
 
947
+ #: includes/class-bwp-simple-gxs.php:2661
948
  #, php-format
949
+ msgid ""
950
+ "<em>%s.xml</em> will be served using module file <em>%s</em> in the custom "
951
+ "module directory."
952
  msgstr ""
953
 
954
+ #: includes/class-bwp-simple-gxs.php:2678
955
  #, php-format
956
+ msgid "<em>%s.xml</em> will be served using module file <em>%s</em>."
957
  msgstr ""
958
 
959
+ #: includes/class-bwp-simple-gxs.php:2685
960
  #, php-format
961
+ msgid ""
962
+ "<strong>%s</strong> can not be served because of a missing module file: "
963
+ "<strong>%s</strong>."
964
  msgstr ""
965
 
966
+ #: includes/class-bwp-simple-gxs.php:2770
967
  #, php-format
968
+ msgid "Requested sitemap (<em>%s.xml</em>) was not found or not enabled."
969
  msgstr ""
970
 
971
+ #: includes/class-bwp-simple-gxs.php:2898
972
+ #, php-format
973
+ msgid ""
974
+ "There is no class named <strong>%s</strong> in the module file <strong>%s</"
975
+ "strong>."
976
  msgstr ""
977
 
978
+ #: includes/class-bwp-simple-gxs.php:2926
979
+ #, php-format
980
+ msgid ""
981
+ "Successfully generated <em>%s.xml</em> using custom module file <em>%s</em>."
982
  msgstr ""
983
 
984
+ #: includes/class-bwp-simple-gxs.php:2927
985
  #, php-format
986
+ msgid "Successfully generated <em>%s.xml</em> using module file <em>%s</em>."
987
  msgstr ""
988
 
989
+ #: includes/class-bwp-simple-gxs.php:2944
990
  #, php-format
991
+ msgid ""
992
+ "An unknown error occurred when generating <em>%s</em> using module file <em>"
993
+ "%s</em>. Try again later."
994
  msgstr ""
995
 
996
+ #: includes/class-bwp-simple-gxs.php:2959
997
  #, php-format
998
+ msgid ""
999
+ "<em>%s.xml</em> was successfully generated but could not be served properly "
1000
+ "because some headers have already been sent (something was printed on line "
1001
+ "<strong>%s</strong> in file <strong>%s</strong>)."
1002
  msgstr ""
1003
 
1004
+ #: includes/class-bwp-simple-gxs.php:3157
1005
  #, php-format
1006
+ msgid "<em>%s.xml</em> does not have any item."
1007
  msgstr ""
1008
 
1009
+ #: includes/class-bwp-simple-gxs.php:3163
1010
+ msgid ""
1011
+ "Enable/disable sitemaps via <em>BWP Sitemaps >> XML Sitemaps >> Sitemaps to "
1012
+ "generate</em>."
1013
  msgstr ""
1014
 
1015
+ #: includes/class-bwp-simple-gxs.php:3168
1016
+ #, php-format
1017
+ msgid "There are no public <em>%s</em>."
1018
+ msgstr ""
1019
+
1020
+ #: includes/class-bwp-simple-gxs.php:3174
1021
+ msgid ""
1022
+ "Please make sure that you have at least one sitemap enabled in <em>BWP "
1023
+ "Sitemaps >> XML Sitemaps >> Sitemaps to generate</em>."
1024
  msgstr ""
1025
 
1026
+ #: includes/class-bwp-simple-gxs.php:3508
1027
+ msgid "Unknown response code from search engines. Ping failed."
1028
+ msgstr ""
1029
+
1030
+ #: includes/class-bwp-simple-gxs.php:3513
1031
+ #, php-format
1032
+ msgid "Pinged <em>%s</em> with <em>%s</em> successfully!"
1033
+ msgstr ""
1034
+
1035
+ #: includes/class-bwp-simple-gxs.php:3523
1036
+ #, php-format
1037
+ msgid "<strong>Error %s</strong> from <em>%s</em>."
1038
+ msgstr ""
1039
+
1040
+ #: includes/class-bwp-simple-gxs.php:3534
1041
+ #, php-format
1042
+ msgid ""
1043
+ "Ping limit for today to <em>%s</em> has been reached, consider increasing "
1044
+ "the ping limit via <em>XML Sitemaps >> Ping search engines >> \"Ping limit "
1045
+ "for each search engine\"</em>"
1046
+ msgstr ""
cache/.htaccess CHANGED
@@ -1,4 +1,4 @@
1
- <Files *>
2
- Order Allow,Deny
3
- Deny from All
4
  </Files>
1
+ <Files *>
2
+ Order Allow,Deny
3
+ Deny from All
4
  </Files>
css/bwp-simple-gxs.css CHANGED
@@ -1,12 +1,43 @@
1
- * html .bwp-gxs-log {
2
- height: expression( this.scrollHeight > 200 ? "200px" : "auto" );
3
- }
4
- .bwp-gxs-log {
5
- font-size: 0.95em;
6
- background-color: #ffffff;
7
- padding: 5px 10px; padding-top: 0px;
8
- width: 90%;
9
- border: 1px solid #cccccc;
10
- max-height: 200px;
11
- overflow: auto;
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * html .bwp-gxs-log {
2
+ height: expression( this.scrollHeight > 200 ? "200px" : "auto" );
3
+ }
4
+ .bwp-gxs-log {
5
+ font-size: 0.95em;
6
+ background-color: #ffffff;
7
+ padding: 5px 10px; padding-top: 0px;
8
+ width: 72%;
9
+ border: 1px solid #cccccc;
10
+ overflow: auto;
11
+ }
12
+
13
+ .bwp-gxs-log-big {
14
+ max-height: 600px;
15
+ min-height: 500px;
16
+ }
17
+
18
+ .bwp-gxs-log-small {
19
+ max-height: 200px;
20
+ }
21
+
22
+ .bwp-table {
23
+ width: 100%;
24
+ background-color: #f8f8f8;
25
+ border: 1px solid #cccccc;
26
+ padding: 10px;
27
+ }
28
+
29
+ .bwp-table th {
30
+ text-align: left;
31
+ }
32
+
33
+ .bwp-table th span {
34
+ text-decoration: underline;
35
+ }
36
+
37
+ .bwp-table td, .bwp-table th {
38
+ padding: 3px 7px;
39
+ }
40
+
41
+ .bwp-table td.bwp_gxs_news_cat_td {
42
+ width: 148px;
43
+ }
includes/bwp-option-page/bwp-option-page.php CHANGED
@@ -1,5 +1,3 @@
1
  <?php
2
  if (!is_admin()) return;
3
-
4
  require_once(dirname(__FILE__) . '/includes/class-bwp-option-page.php');
5
- ?>
1
  <?php
2
  if (!is_admin()) return;
 
3
  require_once(dirname(__FILE__) . '/includes/class-bwp-option-page.php');
 
includes/bwp-option-page/css/bwp-option-page.css CHANGED
@@ -1,8 +1,37 @@
1
  /* For WordPress of older versions */
2
- .nav-tab{border-style:solid;border-color:#ccc #ccc #f9f9f9;border-width:1px 1px 0;color:#c1c1c1;text-shadow:rgba(255,255,255,1) 0 1px 0;font-size:12px;line-height:16px;display:inline-block;padding:4px 14px 6px;text-decoration:none;margin:0 6px -1px 0;-moz-border-radius:5px 5px 0 0;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-khtml-border-top-left-radius:5px;-khtml-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;}.nav-tab-active{border-width:1px;color:#464646;}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0;}h2 .nav-tab{padding:4px 20px 6px;font:italic normal normal 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  .bwp-option-page {
5
- margin-top: 1em;
6
  }
7
 
8
  .bwp-option-page p {
@@ -11,8 +40,9 @@
11
  zoom: 1;
12
  }
13
 
14
- .bwp-option-page li.clear, .bwp-option-page div.clear {
15
  clear: left;
 
16
  margin: 1em 0 0 0;
17
  zoom: 1;
18
  }
@@ -29,12 +59,14 @@
29
  }
30
 
31
  .bwp-option-page-tabs a {
32
- font-size: 19px;
 
 
33
  }
34
 
35
  .bwp-option-page-tabs a.version {
36
- font-size: 17px;
37
- line-height: 22px;
38
  }
39
 
40
  .bwp-opton-page-label {
@@ -88,7 +120,7 @@ p.bwp-option-page-inputs {
88
  margin: 0 0 10px 10px;
89
  }
90
 
91
- #bwp-donation, #bwp-contact {
92
  width: 255px;
93
  padding: 7px; padding-bottom: 0px;
94
  background-color: #ffffff;
@@ -96,10 +128,18 @@ p.bwp-option-page-inputs {
96
  text-align: center;
97
  }
98
 
99
- #bwp-donation p {
100
  margin: 0.5em 0 1em 0;
101
  }
102
 
 
 
 
 
 
 
 
 
103
  #bwp-info-place small {
104
  font-size: 0.8em;
105
  }
@@ -111,7 +151,7 @@ p.bwp-option-page-inputs {
111
  padding: 0px;
112
  }
113
 
114
- #bwp-seperator {
115
  width: 271px;
116
  }
117
 
@@ -133,4 +173,4 @@ p.bwp-option-page-inputs {
133
 
134
  #bwp-contact .bwp-twitter {
135
  background: transparent url("../images/icon-twitter.png") no-repeat left center;
136
- }
1
  /* For WordPress of older versions */
2
+ .nav-tab{
3
+ border-style:solid;
4
+ border-color:#ccc #ccc #f9f9f9;
5
+ border-width:1px 1px 0;
6
+ color:#c1c1c1;
7
+ text-shadow:rgba(255,255,255,1) 0 1px 0;
8
+ font-size:12px;
9
+ line-height:16px;
10
+ display:inline-block;
11
+ padding:4px 14px 6px;
12
+ text-decoration:none;
13
+ margin:0 3px -1px 0;
14
+ /* -moz-border-radius:5px 5px 0 0; */
15
+ /* -webkit-border-top-left-radius:5px; */
16
+ /* -webkit-border-top-right-radius:5px; */
17
+ /* -khtml-border-top-left-radius:5px; */
18
+ /* -khtml-border-top-right-radius:5px; */
19
+ /* border-top-left-radius:5px; */
20
+ /* border-top-right-radius:5px; */
21
+ }
22
+ .nav-tab-active{
23
+ border-width:1px;
24
+ border-bottom-color: transparent;
25
+ color: #000000;
26
+ }
27
+ h2.nav-tab-wrapper, h3.nav-tab-wrapper{
28
+ border-bottom:1px solid #ccc;
29
+ padding-bottom:0;
30
+ }
31
+ h2 .nav-tab{padding:6px 15px 6px;}
32
 
33
  .bwp-option-page {
34
+ margin-top: 1em;
35
  }
36
 
37
  .bwp-option-page p {
40
  zoom: 1;
41
  }
42
 
43
+ .bwp-option-page li.bwp-clear, .bwp-option-page div.bwp-clear {
44
  clear: left;
45
+ display: block;
46
  margin: 1em 0 0 0;
47
  zoom: 1;
48
  }
59
  }
60
 
61
  .bwp-option-page-tabs a {
62
+ font-size: 18px;
63
+ line-height: 24px;
64
+ font-style: italic;
65
  }
66
 
67
  .bwp-option-page-tabs a.version {
68
+ font-size: 14px;
69
+ line-height: 14px;
70
  }
71
 
72
  .bwp-opton-page-label {
120
  margin: 0 0 10px 10px;
121
  }
122
 
123
+ #bwp-donation, #bwp-contact, #bwp-ads {
124
  width: 255px;
125
  padding: 7px; padding-bottom: 0px;
126
  background-color: #ffffff;
128
  text-align: center;
129
  }
130
 
131
+ #bwp-donation p, #bwp-ads p {
132
  margin: 0.5em 0 1em 0;
133
  }
134
 
135
+ #bwp-ads {
136
+ padding-bottom: 5px;
137
+ }
138
+
139
+ #bwp-ads p {
140
+ text-decoration: underline;
141
+ }
142
+
143
  #bwp-info-place small {
144
  font-size: 0.8em;
145
  }
151
  padding: 0px;
152
  }
153
 
154
+ .bwp-separator {
155
  width: 271px;
156
  }
157
 
173
 
174
  #bwp-contact .bwp-twitter {
175
  background: transparent url("../images/icon-twitter.png") no-repeat left center;
176
+ }
includes/bwp-option-page/images/ad_250x250.png ADDED
Binary file
includes/bwp-option-page/includes/class-bwp-option-page.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
  * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
  */
6
 
@@ -30,17 +30,17 @@ class BWP_OPTION_PAGE {
30
  * This holds the form items, determining the position
31
  */
32
  var $form_items = array();
33
-
34
  /**
35
  * This holds the name for each items (an item can have more than one fields)
36
  */
37
  var $form_item_names = array();
38
-
39
  /**
40
  * This holds the form label
41
  */
42
  var $form_item_labels = array();
43
-
44
  /**
45
  * This holds the form option aka data
46
  */
@@ -56,9 +56,9 @@ class BWP_OPTION_PAGE {
56
  */
57
  function __construct($form_name = 'bwp_option_page', $site_options = array(), $domain = '')
58
  {
59
- $this->form_name = $form_name;
60
- $this->site_options = $site_options;
61
- $this->domain = $domain;
62
  }
63
 
64
  /**
@@ -67,56 +67,64 @@ class BWP_OPTION_PAGE {
67
  * @param array $form The form array that contains everything we need to build the form
68
  * @param array $options The data array that contains all data fetched from db or by default
69
  * @param string $form_name The name of the form, change this if you have more than one forms on a page
70
- */
71
  function init($form = array(), $options = array(), $form_tabs = array())
72
- {
73
- $this->form_items = $form['items'];
74
- $this->form_item_names = $form['item_names'];
75
- $this->form_item_labels = $form['item_labels'];
76
- $this->form = $form;
77
- $this->form_options = $options;
78
- $this->form_tabs = $form_tabs;
 
79
  if (sizeof($this->form_tabs) == 0)
80
- $this->form_tabs = array(__('Plugin Configurations', 'bwp-option-page'));
81
  }
82
 
83
  function get_form_name()
84
  {
85
  return $this->form_name;
86
  }
87
-
88
  function set_current_tab($current_tab = 0)
89
  {
90
  $this->current_tab = $current_tab;
91
  }
92
-
93
  function get_options($options = array(), $options_default = array())
94
  {
95
  foreach ($options_default as $key => $option)
96
  {
97
  if (!in_array($key, $options))
98
  unset($options_default[$key]);
99
- }
 
100
  return $options_default;
101
  }
102
-
103
  function get_db_options($name = '', $options = array())
104
  {
105
  $db_options = get_option($name);
 
106
  if (!$db_options)
 
107
  update_option($name, $options);
 
108
  else if (array_keys($options) != array_keys($db_options))
109
  {
110
  foreach ($db_options as $key => $data)
111
  if (isset($options[$key]) && !in_array($key, $this->site_options))
112
  $options[$key] = $data;
 
113
  update_option($name, $options);
114
  }
115
  else
116
  {
117
  foreach ($db_options as $key => $data)
 
118
  if (!in_array($key, $this->site_options))
119
  $options[$key] = $data;
 
120
  }
121
 
122
  return $options;
@@ -137,10 +145,23 @@ class BWP_OPTION_PAGE {
137
  $_POST[$key] = strip_tags($_POST[$key]);
138
  }
139
 
140
- function kill_html_fields(&$form = array(), $ids)
141
  {
142
- $ids = (array) $ids;
143
- $in_keys = array('items', 'item_labels', 'item_names');
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  foreach ($ids as $id)
145
  {
146
  foreach ($in_keys as $key)
@@ -150,77 +171,208 @@ class BWP_OPTION_PAGE {
150
 
151
  /**
152
  * Generate HTML field
153
- *
154
- * @params they explain themselves
155
  */
156
  function generate_html_field($type = '', $data = array(), $name = '', $in_section = false)
157
  {
158
- $pre_html_field = '';
159
- $post_html_field = '';
160
- $checked = 'checked="checked" ';
161
- $selected = 'selected="selected" ';
162
- $value = (isset($this->form_options[$name])) ? $this->form_options[$name] : '';
163
- $value = (!empty($this->domain) && ('textarea' == $type || 'input' == $type)) ? __($value, $this->domain) : $value;
164
- $value = ('textarea' == $type) ? esc_html($value) : esc_attr($value);
165
- $array_replace = array();
166
- $array_search = array('size', 'name', 'value', 'cols', 'rows', 'label', 'disabled', 'pre', 'post');
167
- $return_html = '';
168
- $br = (isset($this->form['inline_fields'][$name]) && is_array($this->form['inline_fields'][$name])) ? '' : "<br />\n";
169
- $pre = (!empty($data['pre'])) ? $data['pre'] : '';
170
- $post = (!empty($data['post'])) ? $data['post'] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  switch ($type)
173
  {
174
- case 'heading':
175
  $html_field = '%s';
176
  break;
177
 
178
- case 'input':
179
- $html_field = (!$in_section) ? '%pre%<input%disabled% size="%size%" type="text" id="' . $name . '" name="' . $name . '" value="' . $value . '" /> <em>%label%</em>' : '<label for="' . $name . '">%pre%<input%disabled% size="%size%" type="text" id="' . $name . '" name="' . $name . '" value="' . $value . '" /> <em>%label%</em></label>';
 
 
 
 
 
 
 
 
180
  break;
181
 
182
  case 'select':
183
- $pre_html_field = '%pre%<select id="' . $name . '" name="' . $name . '">' . "\n";
184
- $html_field = '<option %selected%value="%value%" />%option%</option>';
 
 
 
 
 
185
  $post_html_field = '</select>%post%' . $br;
186
  break;
187
-
188
  case 'checkbox':
189
- $html_field = '<label for="%name%">' . '<input %checked%type="checkbox" id="%name%" name="%name%" value="yes" /> %label%</label>';
 
 
 
 
 
 
190
  break;
191
-
192
  case 'radio':
193
- $html_field = '<label>' . '<input %checked%type="radio" name="' . $name . '" value="%value%" /> %label%</label>';
 
194
  break;
195
-
196
  case 'textarea':
197
- $html_field = '%pre%<textarea%disabled% id="' . $name . '" name="' . $name . '" cols="%cols%" rows="%rows%">' . $value . '</textarea>%post%';
 
 
 
198
  break;
199
  }
200
 
201
  if (!isset($data))
202
- return;
203
-
204
  if ($type == 'heading' && !is_array($data))
205
- {
206
  $return_html .= sprintf($html_field, $data) . $br;
207
  }
208
- else if ($type == 'radio' || $type == 'checkbox' || $type == 'select')
209
- {
 
 
210
  foreach ($data as $key => $value)
211
  {
212
- // handle checkbox a little bit differently
213
  if ($type == 'checkbox')
214
  {
 
215
  if ($this->form_options[$value] == 'yes')
216
- $return_html .= str_replace(array('%value%', '%name%', '%label%', '%checked%'), array($value, $value, $key, $checked), $html_field) . $br;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  else
218
- $return_html .= str_replace(array('%value%', '%name%', '%label%', '%checked%'), array($value, $value, $key, ''), $html_field) . $br;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  }
220
- else if (isset($this->form_options[$name]) && $this->form_options[$name] == $value)
221
- $return_html .= str_replace(array('%value%', '%name%', '%label%', '%option%', '%checked%', '%selected%', '%pre%', '%post%'), array($value, $value, $key, $key, $checked, $selected, $pre, $post), $html_field) . $br;
222
  else
223
- $return_html .= str_replace(array('%value%', '%name%', '%label%', '%option%', '%checked%', '%selected%', '%pre%', '%post%'), array($value, $value, $key, $key, '', '', $pre, $post), $html_field) . $br;
 
 
 
 
 
 
 
 
224
  }
225
  }
226
  else
@@ -228,12 +380,15 @@ class BWP_OPTION_PAGE {
228
  foreach ($array_search as &$keyword)
229
  {
230
  $array_replace[$keyword] = '';
 
231
  if (!empty($data[$keyword]))
232
  {
233
  $array_replace[$keyword] = $data[$keyword];
234
  }
 
235
  $keyword = '%' . $keyword . '%';
236
  }
 
237
  $return_html = str_replace($array_search, $array_replace, $html_field) . $br;
238
  }
239
 
@@ -247,10 +402,12 @@ class BWP_OPTION_PAGE {
247
  $inline_html = ' ' . $this->generate_html_field($field_type, $this->form[$field_type][$field], $field, $in_section);
248
  }
249
  }
250
-
251
- // Post
252
- $post = (!empty($this->form['post'][$name])) ? ' ' . $this->form['post'][$name] : $post;
253
-
 
 
254
  return str_replace('%pre%', $pre, $pre_html_field) . $return_html . str_replace('%post%', $post, $post_html_field) . $inline_html;
255
  }
256
 
@@ -261,31 +418,38 @@ class BWP_OPTION_PAGE {
261
  */
262
  function generate_html_fields($type, $name)
263
  {
264
- $item_label = '';
265
- $return_html = '';
266
-
267
  $item_key = array_keys($this->form_item_names, $name);
268
-
269
- $input_class = ($type == 'heading') ? 'bwp-option-page-heading-desc' : 'bwp-option-page-inputs';
270
 
271
- // An inline item can hold any HTML markup
272
- // An example is to display some kinds of button right be low the label
273
- $inline = '';
274
- if (isset($this->form['inline']) && is_array($this->form['inline']) && array_key_exists($name, $this->form['inline']))
275
- {
276
- $inline = (empty($this->form['inline'][$name])) ? '' : $this->form['inline'][$name];
 
 
 
 
 
 
277
  }
 
278
  $inline .= "\n";
279
-
280
  switch ($type)
281
  {
282
- case 'section':
283
-
284
  if (!isset($this->form[$name]) || !is_array($this->form[$name]))
285
  return;
286
-
287
- $item_label = '<span class="bwp-opton-page-label">' . $this->form_item_labels[$item_key[0]] . $inline . '</span>';
288
-
 
 
 
289
  foreach ($this->form[$name] as $section_field)
290
  {
291
  $type = $section_field[0];
@@ -295,44 +459,63 @@ class BWP_OPTION_PAGE {
295
  {
296
  $return_html .= $this->generate_html_field($section_field[0], $this->form[$type][$name], $name, true);
297
  }
298
- }
299
  break;
300
-
301
  default:
302
-
303
- if (!isset($this->form[$type][$name]) || ($type != 'heading' && !is_array($this->form[$type][$name])))
304
- return;
305
 
306
- /*$item_label = (empty($this->form[$type][$name]['label'])) ? '<label class="bwp-opton-page-label" for="' . $name . '">' . $this->form_item_labels[$item_key[0]] . '</label>' : '<span class="bwp-opton-page-label">' . $this->form_item_labels[$item_key[0]] . '</span>';*/
307
- $item_label = ($type != 'checkbox' && $type != 'radio') ? '<label class="bwp-opton-page-label" for="' . $name . '">' . $this->form_item_labels[$item_key[0]] . $inline . '</label>' : '<span class="bwp-opton-page-label type-' . $type . '">' . $this->form_item_labels[$item_key[0]] . $inline . '</span>';
308
- $item_label = ($type == 'heading') ? '<h3>' . $this->form_item_labels[$item_key[0]] . '</h3>' . $inline : $item_label;
 
 
 
 
 
 
 
 
309
 
310
  if (isset($this->form[$type]))
311
- {
312
  $return_html = $this->generate_html_field($type, $this->form[$type][$name], $name);
313
- }
314
  break;
315
  }
316
-
317
- // A container can hold some result executed by customized script,
318
  // such as displaying something when user press the submit button
319
  $containers = '';
320
- if (isset($this->form['container']) && is_array($this->form['container']) && array_key_exists($name, $this->form['container']))
321
- {
 
 
 
322
  $container_array = (array) $this->form['container'][$name];
 
323
  foreach ($container_array as $container)
324
  {
325
- $containers .= (empty($container)) ? '<div style="display: none;"><!-- --></div>' : '<div class="clear">' . $container . '</div>' . "\n";
 
 
326
  }
327
  }
328
-
329
  $pure_return = trim(strip_tags($return_html));
 
330
  if (empty($pure_return) && $type == 'heading')
 
331
  return $item_label . $containers;
 
332
  else
333
- return $item_label . '<p class="' . $input_class . '">' . $return_html . '</p>' . $containers;
 
 
 
 
334
  }
335
-
336
  /**
337
  * Generate HTML form
338
  *
@@ -341,65 +524,107 @@ class BWP_OPTION_PAGE {
341
  function generate_html_form()
342
  {
343
  $return_str = '<div class="wrap" style="padding-bottom: 20px;">' . "\n";
 
344
  if (sizeof($this->form_tabs) >= 2)
345
  $return_str .= apply_filters('bwp-admin-form-icon', '<div class="icon32" id="icon-options-general"><br></div>' . "\n");
346
  else
347
- $return_str .= '<div class="icon32" id="icon-options-general"><br></div>';
348
-
349
  if (sizeof($this->form_tabs) >= 2)
350
  {
351
  $count = 0;
 
352
  $return_str .= '<h2 class="bwp-option-page-tabs">' . "\n";
353
  $return_str .= apply_filters('bwp-admin-plugin-version', '') . "\n";
 
354
  foreach ($this->form_tabs as $title => $link)
355
  {
356
  $count++;
357
- $active = ($count == $this->current_tab) ? ' nav-tab-active' : '';
 
358
  $return_str .= '<a class="nav-tab' . $active . '" href="' . $link . '">' . $title . '</a>' . "\n";
359
  }
 
360
  $return_str .= '</h2>' . "\n";
361
  }
362
  else if (!isset($this->form_tabs[0]))
363
  {
364
- $title = array_keys($this->form_tabs);
365
  $return_str .= '<h2>' . $title[0] . '</h2>' . "\n";
366
  }
367
  else
368
  $return_str .= '<h2>' . $this->form_tabs[0] . '</h2>' . "\n";
369
-
370
  $return_str .= apply_filters('bwp_option_before_form', '');
371
  echo $return_str;
 
372
  do_action('bwp_option_action_before_form');
373
- $return_str = '';
 
374
  $return_str .= '<form class="bwp-option-page" name="' . $this->form_name . '" method="post" action="">' . "\n";
 
375
  if (function_exists('wp_nonce_field'))
376
  {
377
  echo $return_str;
 
378
  wp_nonce_field($this->form_name);
 
379
  $return_str = '';
380
  }
 
381
  $return_str .= '<ul>' . "\n";
382
 
383
  // generate filled form
384
  if (isset($this->form_items) && is_array($this->form_items))
385
- foreach ($this->form_items as $key => $type)
386
- {
387
- if (!empty($this->form_item_names[$key]) && !empty($this->form_item_labels[$key]))
388
  {
389
- $return_str .= '<li class="clear">' . $this->generate_html_fields($type, $this->form_item_names[$key]) . '</li>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  }
391
  }
392
 
393
- $return_str .= '</ul>' . "\n";
394
- $return_str .= apply_filters('bwp_option_before_submit_button', '');
395
- echo $return_str;
396
- do_action('bwp_option_action_before_submit_button');
397
- $return_str = '';
398
- $return_str .= apply_filters('bwp_option_submit_button', '<p class="submit"><input type="submit" class="button-primary" name="submit_' . $this->form_name . '" value="' . __('Save Changes') . '" /></p>') . "\n";
399
- $return_str .= '</form>' . "\n";
 
 
 
 
 
400
  $return_str .= '</div>' . "\n";
401
-
402
  echo $return_str;
403
  }
404
  }
405
- ?>
1
  <?php
2
  /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
  * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
  */
6
 
30
  * This holds the form items, determining the position
31
  */
32
  var $form_items = array();
33
+
34
  /**
35
  * This holds the name for each items (an item can have more than one fields)
36
  */
37
  var $form_item_names = array();
38
+
39
  /**
40
  * This holds the form label
41
  */
42
  var $form_item_labels = array();
43
+
44
  /**
45
  * This holds the form option aka data
46
  */
56
  */
57
  function __construct($form_name = 'bwp_option_page', $site_options = array(), $domain = '')
58
  {
59
+ $this->form_name = $form_name;
60
+ $this->site_options = $site_options;
61
+ $this->domain = $domain;
62
  }
63
 
64
  /**
67
  * @param array $form The form array that contains everything we need to build the form
68
  * @param array $options The data array that contains all data fetched from db or by default
69
  * @param string $form_name The name of the form, change this if you have more than one forms on a page
70
+ */
71
  function init($form = array(), $options = array(), $form_tabs = array())
72
+ {
73
+ $this->form_items = $form['items'];
74
+ $this->form_item_names = $form['item_names'];
75
+ $this->form_item_labels = $form['item_labels'];
76
+ $this->form = $form;
77
+ $this->form_options = $options;
78
+ $this->form_tabs = $form_tabs;
79
+
80
  if (sizeof($this->form_tabs) == 0)
81
+ $this->form_tabs = array(__('Plugin Configurations', 'bwp-option-page'));
82
  }
83
 
84
  function get_form_name()
85
  {
86
  return $this->form_name;
87
  }
88
+
89
  function set_current_tab($current_tab = 0)
90
  {
91
  $this->current_tab = $current_tab;
92
  }
93
+
94
  function get_options($options = array(), $options_default = array())
95
  {
96
  foreach ($options_default as $key => $option)
97
  {
98
  if (!in_array($key, $options))
99
  unset($options_default[$key]);
100
+ }
101
+
102
  return $options_default;
103
  }
104
+
105
  function get_db_options($name = '', $options = array())
106
  {
107
  $db_options = get_option($name);
108
+
109
  if (!$db_options)
110
+ {
111
  update_option($name, $options);
112
+ }
113
  else if (array_keys($options) != array_keys($db_options))
114
  {
115
  foreach ($db_options as $key => $data)
116
  if (isset($options[$key]) && !in_array($key, $this->site_options))
117
  $options[$key] = $data;
118
+
119
  update_option($name, $options);
120
  }
121
  else
122
  {
123
  foreach ($db_options as $key => $data)
124
+ {
125
  if (!in_array($key, $this->site_options))
126
  $options[$key] = $data;
127
+ }
128
  }
129
 
130
  return $options;
145
  $_POST[$key] = strip_tags($_POST[$key]);
146
  }
147
 
148
+ function kill_html_fields(&$form, $names)
149
  {
150
+ $ids = array();
151
+ $names = (array) $names;
152
+
153
+ foreach ($this->form_item_names as $key => $name)
154
+ {
155
+ if (in_array($name, $names))
156
+ $ids[] = $key;
157
+ }
158
+
159
+ $in_keys = array(
160
+ 'items',
161
+ 'item_labels',
162
+ 'item_names'
163
+ );
164
+
165
  foreach ($ids as $id)
166
  {
167
  foreach ($in_keys as $key)
171
 
172
  /**
173
  * Generate HTML field
 
 
174
  */
175
  function generate_html_field($type = '', $data = array(), $name = '', $in_section = false)
176
  {
177
+ $pre_html_field = '';
178
+ $post_html_field = '';
179
+
180
+ $checked = 'checked="checked" ';
181
+ $selected = 'selected="selected" ';
182
+
183
+ $value = isset($this->form_options[$name])
184
+ ? $this->form_options[$name]
185
+ : '';
186
+
187
+ $value = isset($data['value']) ? $data['value'] : $value;
188
+
189
+ $value = !empty($this->domain)
190
+ && ('textarea' == $type || 'input' == $type)
191
+ ? __($value, $this->domain)
192
+ : $value;
193
+
194
+ if (is_array($value))
195
+ {
196
+ foreach ($value as &$v)
197
+ $v = is_array($v) ? array_map('esc_attr', $v) : esc_attr($v);
198
+ }
199
+ else
200
+ {
201
+ $value = 'textarea' == $type
202
+ ? esc_html($value)
203
+ : esc_attr($value);
204
+ }
205
+
206
+ $array_replace = array();
207
+ $array_search = array(
208
+ 'size',
209
+ 'name',
210
+ 'value',
211
+ 'cols',
212
+ 'rows',
213
+ 'label',
214
+ 'disabled',
215
+ 'pre',
216
+ 'post'
217
+ );
218
+
219
+ $return_html = '';
220
+
221
+ $br = isset($this->form['inline_fields'][$name])
222
+ && is_array($this->form['inline_fields'][$name])
223
+ ? ''
224
+ : "<br />\n";
225
+
226
+ $pre = !empty($data['pre']) ? $data['pre'] : '';
227
+ $post = !empty($data['post']) ? $data['post'] : '';
228
+
229
+ $param = empty($this->form['params'][$name])
230
+ ? false : $this->form['params'][$name];
231
 
232
  switch ($type)
233
  {
234
+ case 'heading':
235
  $html_field = '%s';
236
  break;
237
 
238
+ case 'input':
239
+ $html_field = !$in_section
240
+ ? '%pre%<input%disabled% size="%size%" type="text" '
241
+ . 'id="' . $name . '" '
242
+ . 'name="' . $name . '" '
243
+ . 'value="' . $value . '" /> <em>%label%</em>'
244
+ : '<label for="' . $name . '">%pre%<input%disabled% size="%size%" type="text" '
245
+ . 'id="' . $name . '" '
246
+ . 'name="' . $name . '" '
247
+ . 'value="' . $value . '" /> <em>%label%</em></label>';
248
  break;
249
 
250
  case 'select':
251
+ case 'select_multi':
252
+ $pre_html_field = 'select_multi' == $type
253
+ ? '%pre%<select id="' . $name . '" name="' . $name . '[]" multiple>' . "\n"
254
+ : '%pre%<select id="' . $name . '" name="' . $name . '">' . "\n";
255
+
256
+ $html_field = '<option %selected%value="%value%">%option%</option>';
257
+
258
  $post_html_field = '</select>%post%' . $br;
259
  break;
260
+
261
  case 'checkbox':
262
+ $html_field = '<label for="%name%">'
263
+ . '<input %checked%type="checkbox" id="%name%" name="%name%" value="yes" /> %label%</label>';
264
+ break;
265
+
266
+ case 'checkbox_multi':
267
+ $html_field = '<label for="%name%-%value%">'
268
+ . '<input %checked%type="checkbox" id="%name%-%value%" name="%name%[]" value="%value%" /> %label%</label>';
269
  break;
270
+
271
  case 'radio':
272
+ $html_field = '<label>' . '<input %checked%type="radio" '
273
+ . 'name="' . $name . '" value="%value%" /> %label%</label>';
274
  break;
275
+
276
  case 'textarea':
277
+ $html_field = '%pre%<textarea%disabled% '
278
+ . 'id="' . $name . '" '
279
+ . 'name="' . $name . '" cols="%cols%" rows="%rows%">'
280
+ . $value . '</textarea>%post%';
281
  break;
282
  }
283
 
284
  if (!isset($data))
285
+ return;
286
+
287
  if ($type == 'heading' && !is_array($data))
288
+ {
289
  $return_html .= sprintf($html_field, $data) . $br;
290
  }
291
+ else if ($type == 'radio'
292
+ || $type == 'checkbox' || $type == 'checkbox_multi'
293
+ || $type == 'select' || $type == 'select_multi'
294
+ ) {
295
  foreach ($data as $key => $value)
296
  {
 
297
  if ($type == 'checkbox')
298
  {
299
+ // handle checkbox a little bit differently
300
  if ($this->form_options[$value] == 'yes')
301
+ {
302
+ $return_html .= str_replace(
303
+ array('%value%', '%name%', '%label%', '%checked%'),
304
+ array($value, $value, $key, $checked),
305
+ $html_field
306
+ );
307
+
308
+ $return_html .= apply_filters('bwp_option_after_' . $type . '_' . $name . '_checked', '', $value, $param);
309
+ $return_html .= $br;
310
+ }
311
+ else
312
+ {
313
+ $return_html .= str_replace(
314
+ array('%value%', '%name%', '%label%', '%checked%'),
315
+ array($value, $value, $key, ''),
316
+ $html_field
317
+ );
318
+
319
+ $return_html .= apply_filters('bwp_option_after_' . $type . '_' . $name, '', $value, $param);
320
+ $return_html .= $br;
321
+ }
322
+ }
323
+ else if ($type == 'checkbox_multi')
324
+ {
325
+ // handle a multi checkbox differently
326
+ if (isset($this->form_options[$name])
327
+ && is_array($this->form_options[$name])
328
+ && (in_array($value, $this->form_options[$name])
329
+ || array_key_exists($value, $this->form_options[$name]))
330
+ ) {
331
+ $return_html .= str_replace(
332
+ array('%value%', '%name%', '%label%', '%checked%'),
333
+ array($value, $name, $key, $checked),
334
+ $html_field
335
+ );
336
+
337
+ $return_html .= apply_filters('bwp_option_after_' . $type . '_' . $name . '_checked', '', $value, $param);
338
+ $return_html .= $br;
339
+ }
340
  else
341
+ {
342
+ $return_html .= str_replace(
343
+ array('%value%', '%name%', '%label%', '%checked%'),
344
+ array($value, $name, $key, ''),
345
+ $html_field
346
+ );
347
+
348
+ $return_html .= apply_filters('bwp_option_after_' . $type . '_' . $name, '', $value, $param);
349
+ $return_html .= $br;
350
+ }
351
+ }
352
+ else if (isset($this->form_options[$name])
353
+ && ($this->form_options[$name] == $value
354
+ || (is_array($this->form_options[$name])
355
+ && (in_array($value, $this->form_options[$name])
356
+ || array_key_exists($value, $this->form_options[$name]))))
357
+ ) {
358
+ $item_br = $type == 'select' || $type == 'select_multi' ? "\n" : $br;
359
+
360
+ $return_html .= str_replace(
361
+ array('%value%', '%name%', '%label%', '%option%', '%checked%', '%selected%', '%pre%', '%post%'),
362
+ array($value, $value, $key, $key, $checked, $selected, $pre, $post),
363
+ $html_field
364
+ ) . $item_br;
365
  }
 
 
366
  else
367
+ {
368
+ $item_br = $type == 'select' || $type == 'select_multi' ? "\n" : $br;
369
+
370
+ $return_html .= str_replace(
371
+ array('%value%', '%name%', '%label%', '%option%', '%checked%', '%selected%', '%pre%', '%post%'),
372
+ array($value, $value, $key, $key, '', '', $pre, $post),
373
+ $html_field
374
+ ) . $item_br;
375
+ }
376
  }
377
  }
378
  else
380
  foreach ($array_search as &$keyword)
381
  {
382
  $array_replace[$keyword] = '';
383
+
384
  if (!empty($data[$keyword]))
385
  {
386
  $array_replace[$keyword] = $data[$keyword];
387
  }
388
+
389
  $keyword = '%' . $keyword . '%';
390
  }
391
+
392
  $return_html = str_replace($array_search, $array_replace, $html_field) . $br;
393
  }
394
 
402
  $inline_html = ' ' . $this->generate_html_field($field_type, $this->form[$field_type][$field], $field, $in_section);
403
  }
404
  }
405
+
406
+ // html after field
407
+ $post = !empty($this->form['post'][$name])
408
+ ? ' ' . $this->form['post'][$name]
409
+ : $post;
410
+
411
  return str_replace('%pre%', $pre, $pre_html_field) . $return_html . str_replace('%post%', $post, $post_html_field) . $inline_html;
412
  }
413
 
418
  */
419
  function generate_html_fields($type, $name)
420
  {
421
+ $item_label = '';
422
+ $return_html = '';
423
+
424
  $item_key = array_keys($this->form_item_names, $name);
 
 
425
 
426
+ $input_class = $type == 'heading'
427
+ ? 'bwp-option-page-heading-desc'
428
+ : 'bwp-option-page-inputs';
429
+
430
+ // an inline item can hold any HTML markup, example is to display some
431
+ // kinds of button right be low the label
432
+ $inline = '';
433
+
434
+ if (isset($this->form['inline']) && is_array($this->form['inline'])
435
+ && array_key_exists($name, $this->form['inline'])
436
+ ) {
437
+ $inline = empty($this->form['inline'][$name]) ? '' : $this->form['inline'][$name];
438
  }
439
+
440
  $inline .= "\n";
441
+
442
  switch ($type)
443
  {
444
+ case 'section':
 
445
  if (!isset($this->form[$name]) || !is_array($this->form[$name]))
446
  return;
447
+
448
+ $item_label = '<span class="bwp-opton-page-label">'
449
+ . $this->form_item_labels[$item_key[0]]
450
+ . $inline
451
+ . '</span>';
452
+
453
  foreach ($this->form[$name] as $section_field)
454
  {
455
  $type = $section_field[0];
459
  {
460
  $return_html .= $this->generate_html_field($section_field[0], $this->form[$type][$name], $name, true);
461
  }
462
+ }
463
  break;
464
+
465
  default:
466
+ if (!isset($this->form[$type][$name])
467
+ || ($type != 'heading' && !is_array($this->form[$type][$name])))
468
+ return;
469
 
470
+ $item_label = $type != 'checkbox' && $type != 'checkbox_multi' && $type != 'radio'
471
+ ? '<label class="bwp-opton-page-label" for="' . $name . '">'
472
+ . $this->form_item_labels[$item_key[0]] . $inline
473
+ . '</label>'
474
+ : '<span class="bwp-opton-page-label type-' . $type . '">'
475
+ . $this->form_item_labels[$item_key[0]] . $inline
476
+ . '</span>';
477
+
478
+ $item_label = $type == 'heading'
479
+ ? '<h3>' . $this->form_item_labels[$item_key[0]] . '</h3>' . $inline
480
+ : $item_label;
481
 
482
  if (isset($this->form[$type]))
 
483
  $return_html = $this->generate_html_field($type, $this->form[$type][$name], $name);
 
484
  break;
485
  }
486
+
487
+ // a container can hold some result executed by customized script,
488
  // such as displaying something when user press the submit button
489
  $containers = '';
490
+
491
+ if (isset($this->form['container'])
492
+ && is_array($this->form['container'])
493
+ && array_key_exists($name, $this->form['container'])
494
+ ) {
495
  $container_array = (array) $this->form['container'][$name];
496
+
497
  foreach ($container_array as $container)
498
  {
499
+ $containers .= empty($container)
500
+ ? '<div style="display: none;"><!-- --></div>'
501
+ : '<div class="bwp-clear">' . $container . '</div>' . "\n";
502
  }
503
  }
504
+
505
  $pure_return = trim(strip_tags($return_html));
506
+
507
  if (empty($pure_return) && $type == 'heading')
508
+ {
509
  return $item_label . $containers;
510
+ }
511
  else
512
+ {
513
+ return $item_label . '<p class="' . $input_class . '">'
514
+ . $return_html . '</p>'
515
+ . $containers;
516
+ }
517
  }
518
+
519
  /**
520
  * Generate HTML form
521
  *
524
  function generate_html_form()
525
  {
526
  $return_str = '<div class="wrap" style="padding-bottom: 20px;">' . "\n";
527
+
528
  if (sizeof($this->form_tabs) >= 2)
529
  $return_str .= apply_filters('bwp-admin-form-icon', '<div class="icon32" id="icon-options-general"><br></div>' . "\n");
530
  else
531
+ $return_str .= '<div class="icon32" id="icon-options-general"><br></div>';
532
+
533
  if (sizeof($this->form_tabs) >= 2)
534
  {
535
  $count = 0;
536
+
537
  $return_str .= '<h2 class="bwp-option-page-tabs">' . "\n";
538
  $return_str .= apply_filters('bwp-admin-plugin-version', '') . "\n";
539
+
540
  foreach ($this->form_tabs as $title => $link)
541
  {
542
  $count++;
543
+
544
+ $active = $count == $this->current_tab ? ' nav-tab-active' : '';
545
  $return_str .= '<a class="nav-tab' . $active . '" href="' . $link . '">' . $title . '</a>' . "\n";
546
  }
547
+
548
  $return_str .= '</h2>' . "\n";
549
  }
550
  else if (!isset($this->form_tabs[0]))
551
  {
552
+ $title = array_keys($this->form_tabs);
553
  $return_str .= '<h2>' . $title[0] . '</h2>' . "\n";
554
  }
555
  else
556
  $return_str .= '<h2>' . $this->form_tabs[0] . '</h2>' . "\n";
557
+
558
  $return_str .= apply_filters('bwp_option_before_form', '');
559
  echo $return_str;
560
+
561
  do_action('bwp_option_action_before_form');
562
+
563
+ $return_str = '';
564
  $return_str .= '<form class="bwp-option-page" name="' . $this->form_name . '" method="post" action="">' . "\n";
565
+
566
  if (function_exists('wp_nonce_field'))
567
  {
568
  echo $return_str;
569
+
570
  wp_nonce_field($this->form_name);
571
+
572
  $return_str = '';
573
  }
574
+
575
  $return_str .= '<ul>' . "\n";
576
 
577
  // generate filled form
578
  if (isset($this->form_items) && is_array($this->form_items))
579
+ {
580
+ foreach ($this->form_items as $key => $type)
 
581
  {
582
+ $name = !empty($this->form_item_names[$key])
583
+ ? $this->form_item_names[$key]
584
+ : '';
585
+
586
+ if (isset($this->form['env'])
587
+ && !BWP_FRAMEWORK_IMPROVED::is_multisite()
588
+ && array_key_exists($name, $this->form['env'])
589
+ && $this->form['env'][$name] == 'multisite')
590
+ {
591
+ // hide multisite field if not in multisite environment
592
+ continue;
593
+ }
594
+
595
+ if (isset($this->form['role'])
596
+ && BWP_FRAMEWORK_IMPROVED::is_normal_admin()
597
+ && array_key_exists($name, $this->form['role'])
598
+ && $this->form['role'][$name] == 'superadmin')
599
+ {
600
+ // hide superadmin-only fields if user is normal admin
601
+ continue;
602
+ }
603
+
604
+ if (!empty($name) && !empty($this->form_item_labels[$key])
605
+ ) {
606
+ $return_str .= '<li class="bwp-clear">'
607
+ . $this->generate_html_fields($type, $name)
608
+ . '</li>'
609
+ . "\n";
610
+ }
611
  }
612
  }
613
 
614
+ $return_str .= '</ul>' . "\n";
615
+ $return_str .= apply_filters('bwp_option_before_submit_button', '');
616
+
617
+ echo $return_str;
618
+ do_action('bwp_option_action_before_submit_button');
619
+
620
+ $return_str = '';
621
+ $return_str .= apply_filters('bwp_option_submit_button',
622
+ '<p class="submit"><input type="submit" class="button-primary" name="submit_'
623
+ . $this->form_name . '" value="' . __('Save Changes') . '" /></p>') . "\n";
624
+
625
+ $return_str .= '</form>' . "\n";
626
  $return_str .= '</div>' . "\n";
627
+
628
  echo $return_str;
629
  }
630
  }
 
includes/bwp-option-page/includes/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // White page
3
+ ?>
includes/bwp-option-page/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // White page
3
+ ?>
includes/class-bwp-framework-improved.php ADDED
@@ -0,0 +1,733 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
+ */
6
+
7
+ class BWP_FRAMEWORK_IMPROVED
8
+ {
9
+ /**
10
+ * Database related data
11
+ */
12
+ var $options = array();
13
+
14
+ /**
15
+ * Default data
16
+ */
17
+ var $options_default = array(), $site_options = array();
18
+
19
+ /**
20
+ * Hold db option keys
21
+ */
22
+ var $option_keys = array();
23
+
24
+ /**
25
+ * Hold extra option keys
26
+ */
27
+ var $extra_option_keys = array();
28
+
29
+ /**
30
+ * Hold old option pages
31
+ */
32
+ var $option_pages = array();
33
+
34
+ /**
35
+ * Key to identify plugin
36
+ */
37
+ var $plugin_key;
38
+
39
+ /**
40
+ * Constant Key to identify plugin
41
+ */
42
+ var $plugin_ckey;
43
+
44
+ /**
45
+ * Domain Key to identify plugin
46
+ */
47
+ var $plugin_dkey;
48
+
49
+ /**
50
+ * Title of the plugin
51
+ */
52
+ var $plugin_title;
53
+
54
+ /**
55
+ * Homepage of the plugin
56
+ */
57
+ var $plugin_url;
58
+
59
+ /**
60
+ * Urls to various parts of homepage or other places
61
+ *
62
+ * Expect to have a format of array('relative' => bool, 'url' => url)
63
+ */
64
+ var $urls = array();
65
+
66
+ /**
67
+ * Plugin file
68
+ */
69
+ var $plugin_file;
70
+
71
+ /**
72
+ * Plugin folder
73
+ */
74
+ var $plugin_folder;
75
+
76
+ /**
77
+ * Plugin WP url
78
+ */
79
+ var $plugin_wp_url;
80
+
81
+ /**
82
+ * Version of the plugin
83
+ */
84
+ var $plugin_ver = '';
85
+
86
+ /**
87
+ * Message shown to user (Warning, Notes, etc.)
88
+ */
89
+ var $notices = array(), $notice_shown = false;
90
+
91
+ /**
92
+ * Error shown to user
93
+ */
94
+ var $errors = array(), $error_shown = false;
95
+
96
+ /**
97
+ * Capabilities to manage this plugin
98
+ */
99
+ var $plugin_cap = 'manage_options';
100
+
101
+ /**
102
+ * Whether or not to create filter for media paths
103
+ */
104
+ var $need_media_filters;
105
+
106
+ /**
107
+ * Form tabs to build
108
+ */
109
+ var $form_tabs = array();
110
+
111
+ /**
112
+ * Other things
113
+ */
114
+ var $wp_ver = '3.0';
115
+ var $php_ver = '5';
116
+ var $domain = '';
117
+
118
+ /**
119
+ * Other special variables
120
+ */
121
+ protected $_menu_under_settings = false;
122
+ protected $_simple_menu = false;
123
+
124
+ /**
125
+ * Build base properties
126
+ */
127
+ protected function build_properties($key, $dkey, $options, $plugin_title = '',
128
+ $plugin_file = '', $plugin_url = '', $need_media_filters = true)
129
+ {
130
+ $this->plugin_key = strtolower($key);
131
+ $this->plugin_ckey = strtoupper($key);
132
+ $this->plugin_dkey = $dkey;
133
+ $this->plugin_title = $plugin_title;
134
+ $this->plugin_url = $plugin_url;
135
+
136
+ $this->options_default = $options;
137
+ $this->need_media_filters = (boolean) $need_media_filters;
138
+
139
+ $this->plugin_file = $plugin_file;
140
+ $this->plugin_folder = basename(dirname($plugin_file));
141
+
142
+ $this->pre_init_actions();
143
+ $this->init_actions();
144
+
145
+ // Load locale
146
+ load_plugin_textdomain($dkey, false, $this->plugin_folder . '/languages');
147
+ }
148
+
149
+ protected function add_option_key($key, $option, $title)
150
+ {
151
+ $this->option_keys[$key] = $option;
152
+ $this->option_pages[$key] = $title;
153
+ }
154
+
155
+ protected function add_extra_option_key($key, $option, $title)
156
+ {
157
+ $this->extra_option_keys[$key] = $option;
158
+ $this->option_pages[$key] = $title;
159
+ }
160
+
161
+ public function add_icon()
162
+ {
163
+ return '<div class="icon32" id="icon-bwp-plugin" '
164
+ . 'style=\'background-image: url("'
165
+ . constant($this->plugin_ckey . '_IMAGES')
166
+ . '/icon_menu_32.png");\'><br></div>' . "\n";
167
+ }
168
+
169
+ protected function set_version($ver = '', $type = '')
170
+ {
171
+ switch ($type)
172
+ {
173
+ case '': $this->plugin_ver = $ver;
174
+ break;
175
+ case 'php': $this->php_ver = $ver;
176
+ break;
177
+ case 'wp': $this->wp_ver = $ver;
178
+ break;
179
+ }
180
+ }
181
+
182
+ protected function get_version($type = '')
183
+ {
184
+ switch ($type)
185
+ {
186
+ case '': return $this->plugin_ver;
187
+ break;
188
+ case 'php': return $this->php_ver;
189
+ break;
190
+ case 'wp': return $this->wp_ver;
191
+ break;
192
+ }
193
+ }
194
+
195
+ protected function check_required_versions()
196
+ {
197
+ if (version_compare(PHP_VERSION, $this->php_ver, '<')
198
+ || version_compare(get_bloginfo('version'), $this->wp_ver, '<')
199
+ ) {
200
+ add_action('admin_notices', array($this, 'warn_required_versions'));
201
+ add_action('network_admin_notices', array($this, 'warn_required_versions'));
202
+ return false;
203
+ }
204
+ else
205
+ return true;
206
+ }
207
+
208
+ public function warn_required_versions()
209
+ {
210
+ echo '<div class="error"><p>' . sprintf(
211
+ __('%s requires WordPress <strong>%s</strong> or higher '
212
+ . 'and PHP <strong>%s</strong> or higher. '
213
+ . 'The plugin will not protected function until you update your software. '
214
+ . 'Please deactivate this plugin.', $this->plugin_dkey),
215
+ $this->plugin_title, $this->wp_ver, $this->php_ver)
216
+ . '</p></div>';
217
+ }
218
+
219
+ public function show_donation()
220
+ {
221
+ $info_showable = apply_filters('bwp_info_showable', true);
222
+ $donation_showable = apply_filters('bwp_donation_showable', true);
223
+ $ad_showable = apply_filters('bwp_ad_showable', true);
224
+
225
+ if (true == $info_showable || (self::is_multisite() && is_super_admin()))
226
+ {
227
+ ?>
228
+ <div id="bwp-info-place">
229
+ <div id="bwp-donation" style="margin-bottom: 0px;">
230
+ <a href="<?php echo $this->plugin_url; ?>"><?php echo $this->plugin_title; ?></a> <small>v<?php echo $this->plugin_ver; ?></small><br />
231
+ <small>
232
+ <a href="<?php echo str_replace('/wordpress-plugins/', '/topic/', $this->plugin_url); ?>"><?php _e('Development Log', $this->plugin_dkey); ?></a> &ndash; <a href="<?php echo $this->plugin_url . 'faq/'; ?>" title="<?php _e('Frequently Asked Questions', $this->plugin_dkey) ?>"><?php _e('FAQ', $this->plugin_dkey); ?></a> &ndash; <a href="http://betterwp.net/contact/" title="<?php _e('Got a problem? Send me a feedback!', $this->plugin_dkey) ?>"><?php _e('Contact', $this->plugin_dkey); ?></a>
233
+ </small>
234
+ <br />
235
+ <?php
236
+ if (true == $donation_showable || (self::is_multisite() && is_super_admin()))
237
+ {
238
+ ?>
239
+ <small><?php _e('You can buy me some special coffees if you appreciate my work, thank you!', $this->plugin_dkey); ?></small>
240
+ <form class="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
241
+ <p>
242
+ <input type="hidden" name="cmd" value="_xclick">
243
+ <input type="hidden" name="business" value="NWBB8JUDW5VSY">
244
+ <input type="hidden" name="lc" value="VN">
245
+ <input type="hidden" name="button_subtype" value="services">
246
+ <input type="hidden" name="no_note" value="0">
247
+ <input type="hidden" name="cn" value="Would you like to say anything to me?">
248
+ <input type="hidden" name="no_shipping" value="1">
249
+ <input type="hidden" name="rm" value="1">
250
+ <input type="hidden" name="return" value="http://betterwp.net">
251
+ <input type="hidden" name="currency_code" value="USD">
252
+ <input type="hidden" name="bn" value="PP-BuyNowBF:icon-paypal.gif:NonHosted">
253
+ <input type="hidden" name="item_name" value="<?php printf(__('Donate to %s', $this->plugin_dkey), $this->plugin_title); ?>" />
254
+ <select name="amount">
255
+ <option value="5.00"><?php _e('One cup $5.00', $this->plugin_dkey); ?></option>
256
+ <option value="10.00"><?php _e('Two cups $10.00', $this->plugin_dkey); ?></option>
257
+ <option value="25.00"><?php _e('Five cups! $25.00', $this->plugin_dkey); ?></option>
258
+ <option value="50.00"><?php _e('One LL-cup!!! $50.00', $this->plugin_dkey); ?></option>
259
+ <option value="100.00"><?php _e('... or any amount!', $this->plugin_dkey); ?></option>
260
+ </select>
261
+ <span class="paypal-alternate-input" style="display: none;"><!-- --></span>
262
+ <input class="paypal-submit" type="image" src="<?php echo $this->plugin_wp_url . 'includes/bwp-option-page/images/icon-paypal.gif'; ?>" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
263
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
264
+ </p>
265
+ </form>
266
+ <?php
267
+ }
268
+ ?>
269
+ </div>
270
+ <div class="bwp-separator">
271
+ <div style="height: 10px; width: 5px; background-color: #cccccc; margin: 0 auto;"><!-- --></div>
272
+ </div>
273
+ <div id="bwp-contact">
274
+ <a class="bwp-rss" href="http://feeds.feedburner.com/BetterWPnet"><?php _e('Latest updates from BetterWP.net!', $this->plugin_dkey); ?></a>
275
+ <a class="bwp-twitter" href="http://twitter.com/0dd0ne0ut"><?php _e('Follow me on Twitter!', $this->plugin_dkey); ?></a>
276
+ </div>
277
+ <?php
278
+ if (true == $ad_showable)
279
+ {
280
+ ?>
281
+ <div class="bwp-separator">
282
+ <div style="height: 10px; width: 5px; background-color: #cccccc; margin: 0 auto;"><!-- --></div>
283
+ </div>
284
+ <div id="bwp-ads">
285
+ <p><strong><?php _e('This Plugin is Proudly Sponsored By', $this->plugin_dkey); ?></strong></p>
286
+ <div style="width: 250px; margin: 0 auto;">
287
+ <a href="http://bit.ly/<?php echo $this->plugin_dkey; ?>-mwp" target="_blank">
288
+ <img src="<?php echo $this->plugin_wp_url . 'includes/bwp-option-page/images/ad_250x250.png'; ?>" />
289
+ </a>
290
+ </div>
291
+ </div>
292
+ <?php
293
+ }
294
+ ?>
295
+ </div>
296
+ <?php
297
+ }
298
+ }
299
+
300
+ public function show_version()
301
+ {
302
+ if (empty($this->plugin_ver)) return '';
303
+
304
+ return '<a class="nav-tab version" title="'
305
+ . sprintf(esc_attr(__('You are using version %s!', $this->plugin_dkey)), $this->plugin_ver)
306
+ . '">' . $this->plugin_ver . '</a>';
307
+ }
308
+
309
+ protected function pre_init_actions()
310
+ {
311
+ $this->pre_init_build_constants();
312
+ $this->pre_init_build_options();
313
+ $this->pre_init_properties();
314
+ $this->load_libraries();
315
+ $this->pre_init_hooks();
316
+ $this->pre_init_update_plugin();
317
+
318
+ // Support installation and uninstallation
319
+ register_activation_hook($this->plugin_file, array($this, 'install'));
320
+ register_deactivation_hook($this->plugin_file, array($this, 'uninstall'));
321
+ }
322
+
323
+ protected function init_actions()
324
+ {
325
+ add_action('init', array($this, 'build_wp_properties'));
326
+ add_action('init', array($this, 'init'));
327
+
328
+ // register backend hooks
329
+ add_action('admin_menu', array($this, 'init_admin'), 1);
330
+ }
331
+
332
+ public function init()
333
+ {
334
+ do_action($this->plugin_key . '_pre_init');
335
+
336
+ $this->init_update_plugin();
337
+ $this->build_constants();
338
+ $this->build_options();
339
+ $this->init_properties();
340
+ $this->init_hooks();
341
+ $this->enqueue_media();
342
+
343
+ do_action($this->plugin_key . '_loaded');
344
+
345
+ // icon 32px
346
+ if ($this->is_admin_page())
347
+ {
348
+ add_filter('bwp-admin-form-icon', array($this, 'add_icon'));
349
+ add_filter('bwp-admin-plugin-version', array($this, 'show_version'));
350
+ add_action('bwp_option_action_before_form', array($this, 'show_donation'), 12);
351
+ }
352
+ }
353
+
354
+ protected function add_cap($cap)
355
+ {
356
+ $this->plugin_cap = $cap;
357
+ }
358
+
359
+ public function build_wp_properties()
360
+ {
361
+ // set the plugin WP url here so it can be filtered
362
+ if (defined('BWP_USE_SYMLINKS'))
363
+ // make use of symlinks on development environment
364
+ $this->plugin_wp_url = trailingslashit(plugins_url($this->plugin_folder));
365
+ else
366
+ // this should allow other package to include BWP plugins while
367
+ // retaining correct URLs pointing to assets
368
+ $this->plugin_wp_url = trailingslashit(plugin_dir_url($this->plugin_file));
369
+ }
370
+
371
+ protected function pre_init_build_constants()
372
+ {
373
+ // url to plugin bwp website
374
+ define($this->plugin_ckey . '_PLUGIN_URL', $this->plugin_url);
375
+ // the capability needed to configure this plugin
376
+ define($this->plugin_ckey . '_CAPABILITY', $this->plugin_cap);
377
+
378
+ // define registered option keys, to be used when building option pages
379
+ // and build options
380
+ foreach ($this->option_keys as $key => $option)
381
+ {
382
+ define(strtoupper($key), $option);
383
+ }
384
+ foreach ($this->extra_option_keys as $key => $option)
385
+ {
386
+ define(strtoupper($key), $option);
387
+ }
388
+ }
389
+
390
+ protected function build_constants()
391
+ {
392
+ // these constants are only available once plugin_wp_url is available
393
+ if (true == $this->need_media_filters)
394
+ {
395
+ define($this->plugin_ckey . '_IMAGES',
396
+ apply_filters($this->plugin_key . '_image_path',
397
+ $this->plugin_wp_url . 'images'));
398
+ define($this->plugin_ckey . '_CSS',
399
+ apply_filters($this->plugin_key . '_css_path',
400
+ $this->plugin_wp_url . 'css'));
401
+ define($this->plugin_ckey . '_JS',
402
+ apply_filters($this->plugin_key . '_js_path',
403
+ $this->plugin_wp_url . 'js'));
404
+ }
405
+ else
406
+ {
407
+ define($this->plugin_ckey . '_IMAGES', $this->plugin_wp_url . 'images');
408
+ define($this->plugin_ckey . '_CSS', $this->plugin_wp_url . 'css');
409
+ define($this->plugin_ckey . '_JS', $this->plugin_wp_url . 'js');
410
+ }
411
+ }
412
+
413
+ protected function pre_init_build_options()
414
+ {
415
+ $this->build_options();
416
+ }
417
+
418
+ protected function build_options()
419
+ {
420
+ // Get all options and merge them
421
+ $options = $this->options_default;
422
+ foreach ($this->option_keys as $option)
423
+ {
424
+ $db_option = get_option($option);
425
+ if ($db_option && is_array($db_option))
426
+ $options = array_merge($options, $db_option);
427
+ unset($db_option);
428
+ // Also check for global options if in Multi-site
429
+ if (self::is_multisite())
430
+ {
431
+ $db_option = get_site_option($option);
432
+ if ($db_option && is_array($db_option))
433
+ {
434
+ $temp = array();
435
+ foreach ($db_option as $k => $o)
436
+ {
437
+ if (in_array($k, $this->site_options))
438
+ $temp[$k] = $o;
439
+ }
440
+ $options = array_merge($options, $temp);
441
+ }
442
+ }
443
+ }
444
+ $this->options = $options;
445
+ }
446
+
447
+ protected function pre_init_properties()
448
+ {
449
+ /* intentionally left blank */
450
+ }
451
+
452
+ protected function init_properties()
453
+ {
454
+ /* intentionally left blank */
455
+ }
456
+
457
+ protected function load_libraries()
458
+ {
459
+ /* intentionally left blank */
460
+ }
461
+
462
+ protected function update_plugin($when = '')
463
+ {
464
+ if (!is_admin())
465
+ return;
466
+
467
+ $current_version = $this->plugin_ver;
468
+ $db_version = get_option($this->plugin_key . '_version');
469
+
470
+ $action_hook = 'pre_init' == $when
471
+ ? $this->plugin_key . '_upgrade'
472
+ : $this->plugin_key . '_init_upgrade';
473
+
474
+ if (!$db_version || version_compare($db_version, $current_version, '<'))
475
+ {
476
+ do_action($action_hook, $db_version, $current_version);
477
+ // only mark as upgraded when this is init update
478
+ if ('init' == $when)
479
+ update_option($this->plugin_key . '_version', $current_version);
480
+ }
481
+ }
482
+
483
+ protected function pre_init_update_plugin()
484
+ {
485
+ $this->update_plugin('pre_init');
486
+ }
487
+
488
+ protected function init_update_plugin()
489
+ {
490
+ $this->update_plugin('init');
491
+ }
492
+
493
+ protected function pre_init_hooks()
494
+ {
495
+ /* intentionally left blank */
496
+ }
497
+
498
+ protected function init_hooks()
499
+ {
500
+ /* intentionally left blank */
501
+ }
502
+
503
+ protected function enqueue_media()
504
+ {
505
+ /* intentionally left blank */
506
+ }
507
+
508
+ public function install()
509
+ {
510
+ /* intentionally left blank */
511
+ }
512
+
513
+ public function uninstall()
514
+ {
515
+ /* intentionally left blank */
516
+ }
517
+
518
+ protected function is_admin_page($page = '')
519
+ {
520
+ if (is_admin() && !empty($_GET['page'])
521
+ && (in_array($_GET['page'], $this->option_keys)
522
+ || in_array($_GET['page'], $this->extra_option_keys))
523
+ && (empty($page)
524
+ || (!empty($page) && $page == $_GET['page']))
525
+ ) {
526
+ return true;
527
+ }
528
+ }
529
+
530
+ public function get_admin_page($page)
531
+ {
532
+ $option_script = !$this->_menu_under_settings && !$this->_simple_menu
533
+ ? 'admin.php'
534
+ : 'options-general.php';
535
+
536
+ return add_query_arg(array('page' => $page), admin_url($option_script));
537
+ }
538
+
539
+ public function plugin_action_links($links, $file)
540
+ {
541
+ $option_keys = array_values($this->option_keys);
542
+
543
+ if (false !== strpos(plugin_basename($this->plugin_file), $file))
544
+ {
545
+ $links[] = '<a href="' . $this->get_admin_page($option_keys[0]) . '">'
546
+ . __('Settings') . '</a>';
547
+ }
548
+
549
+ return $links;
550
+ }
551
+
552
+ public function init_admin()
553
+ {
554
+ $this->_menu_under_settings = apply_filters('bwp_menus_under_settings', false);
555
+
556
+ add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
557
+
558
+ if ($this->is_admin_page())
559
+ {
560
+ // Build tabs
561
+ $this->build_tabs();
562
+
563
+ // Load option page builder
564
+ if (!class_exists('BWP_OPTION_PAGE'))
565
+ require_once dirname(__FILE__) . '/bwp-option-page/bwp-option-page.php';
566
+
567
+ // Enqueue style sheets and scripts for the option page
568
+ wp_enqueue_style(
569
+ 'bwp-option-page',
570
+ $this->plugin_wp_url . 'includes/bwp-option-page/css/bwp-option-page.css',
571
+ self::is_multisite() || class_exists('JCP_UseGoogleLibraries') ? array('wp-admin') : array(),
572
+ '1.1.0'
573
+ );
574
+
575
+ wp_enqueue_script(
576
+ 'bwp-paypal-js',
577
+ $this->plugin_wp_url . 'includes/bwp-option-page/js/paypal.js',
578
+ array('jquery')
579
+ );
580
+ }
581
+
582
+ $this->build_menus();
583
+ }
584
+
585
+ /**
586
+ * Build the Menus
587
+ */
588
+ protected function build_menus()
589
+ {
590
+ /* intentionally left blank */
591
+ }
592
+
593
+ protected function build_tabs()
594
+ {
595
+ $option_script = !$this->_menu_under_settings
596
+ ? 'admin.php'
597
+ : 'options-general.php';
598
+
599
+ foreach ($this->option_pages as $key => $page)
600
+ {
601
+ $pagelink = !empty($this->option_keys[$key])
602
+ ? $this->option_keys[$key]
603
+ : $this->extra_option_keys[$key];
604
+
605
+ $this->form_tabs[$page] = admin_url($option_script)
606
+ . '?page=' . $pagelink;
607
+ }
608
+ }
609
+
610
+ /**
611
+ * Build the option pages
612
+ *
613
+ * Utilizes BWP Option Page Builder (@see BWP_OPTION_PAGE)
614
+ */
615
+ protected function build_option_pages()
616
+ {
617
+ /* intentionally left blank */
618
+ }
619
+
620
+ protected function add_notice($notice)
621
+ {
622
+ if (!in_array($notice, $this->notices))
623
+ {
624
+ $this->notices[] = $notice;
625
+ add_action('bwp_option_action_before_form', array($this, 'show_notices'));
626
+ }
627
+ }
628
+
629
+ public function show_notices()
630
+ {
631
+ if (false == $this->notice_shown)
632
+ {
633
+ foreach ($this->notices as $notice)
634
+ {
635
+ echo '<div class="updated fade"><p>' . $notice . '</p></div>';
636
+ }
637
+ $this->notice_shown = true;
638
+ }
639
+ }
640
+
641
+ protected function add_error($error)
642
+ {
643
+ if (!in_array($error, $this->errors))
644
+ {
645
+ $this->errors[] = $error;
646
+ add_action('bwp_option_action_before_form', array($this, 'show_errors'));
647
+ }
648
+ }
649
+
650
+ public function show_errors()
651
+ {
652
+ if (false == $this->error_shown)
653
+ {
654
+ foreach ($this->errors as $error)
655
+ {
656
+ echo '<div class="error"><p>' . $error . '</p></div>';
657
+ }
658
+ $this->error_shown = true;
659
+ }
660
+ }
661
+
662
+ public function add_url($key, $url, $relative = true)
663
+ {
664
+ $this->urls[$key] = array(
665
+ 'relative' => $relative,
666
+ 'url' => $url
667
+ );
668
+ }
669
+
670
+ public function get_url($key)
671
+ {
672
+ if (isset($this->urls[$key]))
673
+ {
674
+ $url = $this->urls[$key];
675
+ if ($url['relative'])
676
+ return trailingslashit($this->plugin_url) . $url['url'];
677
+
678
+ return $url['url'];
679
+ }
680
+
681
+ return '';
682
+ }
683
+
684
+ public static function is_multisite()
685
+ {
686
+ if (function_exists('is_multisite') && is_multisite())
687
+ return true;
688
+
689
+ if (defined('MULTISITE'))
690
+ return MULTISITE;
691
+
692
+ if (defined('SUBDOMAIN_INSTALL') || defined('VHOST') || defined('SUNRISE'))
693
+ return true;
694
+
695
+ return false;
696
+ }
697
+
698
+ public static function is_subdomain_install()
699
+ {
700
+ if (defined('SUBDOMAIN_INSTALL') && SUBDOMAIN_INSTALL)
701
+ return true;
702
+
703
+ return false;
704
+ }
705
+
706
+ public static function is_normal_admin()
707
+ {
708
+ if (self::is_multisite() && !is_super_admin())
709
+ return true;
710
+ return false;
711
+ }
712
+
713
+ protected static function is_apache()
714
+ {
715
+ if (isset($_SERVER['SERVER_SOFTWARE'])
716
+ && false !== stripos($_SERVER['SERVER_SOFTWARE'], 'apache')
717
+ ) {
718
+ return true;
719
+ }
720
+ return false;
721
+ }
722
+
723
+ protected static function is_nginx()
724
+ {
725
+ if (isset($_SERVER['SERVER_SOFTWARE'])
726
+ && false !== stripos($_SERVER['SERVER_SOFTWARE'], 'nginx')
727
+ ) {
728
+ return true;
729
+ }
730
+
731
+ return false;
732
+ }
733
+ }
includes/class-bwp-framework.php DELETED
@@ -1,455 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
- */
6
-
7
- define('BWP_FRAMEWORK_VERSION', '1.0.0');
8
-
9
- class BWP_FRAMEWORK {
10
-
11
- /**
12
- * Database related data
13
- */
14
- var $options = array();
15
-
16
- /**
17
- * Default data
18
- */
19
- var $options_default = array(), $site_options = array();
20
-
21
- /**
22
- * Hold db option keys
23
- */
24
- var $option_keys = array();
25
-
26
- /**
27
- * Hold extra option keys
28
- */
29
- var $extra_option_keys = array();
30
-
31
- /**
32
- * Hold old option pages
33
- */
34
- var $option_pages = array();
35
-
36
- /**
37
- * Key to identify plugin
38
- */
39
- var $plugin_key;
40
-
41
- /**
42
- * Constant Key to identify plugin
43
- */
44
- var $plugin_ckey;
45
-
46
- /**
47
- * Domain Key to identify plugin
48
- */
49
- var $plugin_dkey;
50
-
51
- /**
52
- * Title of the plugin
53
- */
54
- var $plugin_title;
55
-
56
- /**
57
- * Homepage of the plugin
58
- */
59
- var $plugin_url;
60
-
61
- /**
62
- * Plugin file
63
- */
64
- var $plugin_file;
65
-
66
- /**
67
- * Version of the plugin
68
- */
69
- var $plugin_ver = '';
70
-
71
- /**
72
- * Message shown to user (Warning, Notes, etc.)
73
- */
74
- var $notices = array(), $notice_shown = false;
75
-
76
- /**
77
- * Capabilities to manage this plugin
78
- */
79
- var $plugin_cap = 'manage_options';
80
-
81
- /**
82
- * Whether or not to create filter for media paths
83
- */
84
- var $need_media_filters;
85
-
86
- /**
87
- * Form tabs to build
88
- */
89
- var $form_tabs = array();
90
-
91
- /**
92
- * Other things
93
- */
94
- var $wp_ver = '2.8';
95
- var $php_ver = '5';
96
-
97
- /**
98
- * Build base properties
99
- */
100
- function build_properties($key, $dkey, $options, $plugin_title = '', $plugin_file = '', $plugin_url = '', $need_media_filters = true)
101
- {
102
- $this->plugin_key = strtolower($key);
103
- $this->plugin_ckey = strtoupper($key);
104
- $this->plugin_dkey = $dkey;
105
- $this->plugin_title = $plugin_title;
106
- $this->plugin_url = $plugin_url;
107
- // The default options
108
- $this->options_default = $options;
109
- $this->need_media_filters = (boolean) $need_media_filters;
110
- $this->plugin_file = $plugin_file;
111
- // Load locale
112
- load_plugin_textdomain($dkey, false, basename(dirname($plugin_file)) . '/languages');
113
- }
114
-
115
- function add_option_key($key, $option, $title)
116
- {
117
- $this->option_keys[$key] = $option;
118
- $this->option_pages[$key] = $title;
119
- }
120
-
121
- function add_extra_option_key($key, $option, $title)
122
- {
123
- $this->extra_option_keys[$key] = $option;
124
- $this->option_pages[$key] = $title;
125
- }
126
-
127
- function add_icon()
128
- {
129
- return '<div class="icon32" id="icon-bwp-plugin" style=\'background-image: url("' . constant($this->plugin_ckey . '_IMAGES') . '/icon_menu_32.png");\'><br></div>' . "\n";
130
- }
131
-
132
- function set_version($ver = '', $type = '')
133
- {
134
- switch ($type)
135
- {
136
- case '': $this->plugin_ver = $ver;
137
- break;
138
- case 'php': $this->php_ver = $ver;
139
- break;
140
- case 'wp': $this->wp_ver = $ver;
141
- break;
142
- }
143
- }
144
-
145
- function get_version($type = '')
146
- {
147
- switch ($type)
148
- {
149
- case '': return $this->plugin_ver;
150
- break;
151
- case 'php': return $this->php_ver;
152
- break;
153
- case 'wp': return $this->wp_ver;
154
- break;
155
- }
156
- }
157
-
158
- function check_required_versions()
159
- {
160
- if (version_compare(PHP_VERSION, $this->php_ver, '<') || version_compare(get_bloginfo('version'), $this->wp_ver, '<'))
161
- {
162
- add_action('admin_notices', array($this, 'warn_required_versions'));
163
- add_action('network_admin_notices', array($this, 'warn_required_versions'));
164
- return false;
165
- }
166
- else
167
- return true;
168
- }
169
-
170
- function warn_required_versions()
171
- {
172
- echo '<div class="error"><p>' . sprintf(__('%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin.', $this->plugin_dkey), $this->plugin_title, $this->wp_ver, $this->php_ver) . '</p></div>';
173
- }
174
-
175
- function show_donation()
176
- {
177
- $showable = apply_filters('bwp_donation_showable', true);
178
- ?>
179
- <div id="bwp-info-place">
180
- <div id="bwp-donation" style="margin-bottom: 0px;">
181
- <a href="<?php echo $this->plugin_url; ?>"><?php echo $this->plugin_title; ?></a> <small>v<?php echo $this->plugin_ver; ?></small><br />
182
- <small>
183
- <a href="<?php echo str_replace('/wordpress-plugins/', '/topic/', $this->plugin_url); ?>"><?php _e('Development Log', $this->plugin_dkey); ?></a> &ndash; <a href="<?php echo $this->plugin_url . 'faq/'; ?>" title="<?php _e('Frequently Asked Questions', $this->plugin_dkey) ?>"><?php _e('FAQ', $this->plugin_dkey); ?></a> &ndash; <a href="http://betterwp.net/contact/" title="<?php _e('Got a problem? Send me a feedback!', $this->plugin_dkey) ?>"><?php _e('Contact', $this->plugin_dkey); ?></a>
184
- </small>
185
- <br />
186
- <?php
187
- if (true == $showable || ($this->is_multisite() && is_super_admin()))
188
- {
189
- ?>
190
- <small><?php _e('You can buy me some special coffees if you appreciate my work, thank you!', $this->plugin_dkey); ?></small>
191
- <form class="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
192
- <p>
193
- <input type="hidden" name="cmd" value="_xclick">
194
- <input type="hidden" name="business" value="NWBB8JUDW5VSY">
195
- <input type="hidden" name="lc" value="VN">
196
- <input type="hidden" name="button_subtype" value="services">
197
- <input type="hidden" name="no_note" value="0">
198
- <input type="hidden" name="cn" value="Would you like to say anything to me?">
199
- <input type="hidden" name="no_shipping" value="1">
200
- <input type="hidden" name="rm" value="1">
201
- <input type="hidden" name="return" value="http://betterwp.net">
202
- <input type="hidden" name="currency_code" value="USD">
203
- <input type="hidden" name="bn" value="PP-BuyNowBF:icon-paypal.gif:NonHosted">
204
- <input type="hidden" name="item_name" value="<?php echo __('Donate to ' . $this->plugin_title, $this->plugin_dkey); ?>" />
205
- <select name="amount">
206
- <option value="5.00"><?php _e('One cup $5.00', $this->plugin_dkey); ?></option>
207
- <option value="10.00"><?php _e('Two cups $10.00', $this->plugin_dkey); ?></option>
208
- <option value="25.00"><?php _e('Five cups! $25.00', $this->plugin_dkey); ?></option>
209
- <option value="50.00"><?php _e('One LL-cup!!! $50.00', $this->plugin_dkey); ?></option>
210
- <option value="100.00"><?php _e('... or any amount!', $this->plugin_dkey); ?></option>
211
- </select>
212
- <span class="paypal-alternate-input" style="display: none;"><!-- --></span>
213
- <input class="paypal-submit" type="image" src="<?php echo plugin_dir_url($this->plugin_file) . 'includes/bwp-option-page/images/icon-paypal.gif'; ?>" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
214
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
215
- </p>
216
- </form>
217
- <?php
218
- }
219
- ?>
220
- </div>
221
- <div id="bwp-seperator">
222
- <div style="height: 10px; width: 5px; background-color: #cccccc; margin: 0 auto;"><!-- --></div>
223
- </div>
224
- <div id="bwp-contact">
225
- <a class="bwp-rss" href="http://feeds.feedburner.com/BetterWPnet"><?php _e('Latest updates from BetterWP.net!', $this->plugin_dkey); ?></a>
226
- <a class="bwp-twitter" href="http://twitter.com/0dd0ne0ut"><?php _e('Follow me on Twitter!', $this->plugin_dkey); ?></a>
227
- </div>
228
- </div>
229
- <?php
230
- }
231
-
232
- function show_version()
233
- {
234
- if (empty($this->plugin_ver)) return '';
235
- return '<a class="nav-tab version" title="' . sprintf(esc_attr(__('You are using version %s!', $this->plugin_dkey)), $this->plugin_ver) . '">' . $this->plugin_ver . '</a>';
236
- }
237
-
238
- function init()
239
- {
240
- // Build constants
241
- $this->build_constants();
242
- // Build tabs
243
- $this->build_tabs();
244
- // Build options
245
- $this->build_options();
246
- // Load libraries
247
- $this->load_libraries();
248
- // Add actions and filters
249
- $this->add_hooks();
250
- // Enqueue needed media, conditionally
251
- $this->enqueue_media();
252
- // Load other properties
253
- $this->init_properties();
254
- // Loaded everything for this plugin, now you can add other things to it, such as stylesheet, etc.
255
- do_action($this->plugin_key . '_loaded');
256
- // Support installation and uninstallation
257
- register_activation_hook($this->plugin_file, array($this, 'install'));
258
- register_deactivation_hook($this->plugin_file, array($this, 'uninstall'));
259
- // icon 32px
260
- if ($this->is_admin_page())
261
- {
262
- add_filter('bwp-admin-form-icon', array($this, 'add_icon'));
263
- add_filter('bwp-admin-plugin-version', array($this, 'show_version'));
264
- add_action('bwp_option_action_before_form', array($this, 'show_donation'), 12);
265
- }
266
- }
267
-
268
- function add_cap($cap)
269
- {
270
- $this->plugin_cap = $cap;
271
- }
272
-
273
- function build_constants()
274
- {
275
- define($this->plugin_ckey . '_PLUGIN_URL', $this->plugin_url);
276
- // Path
277
- if (true == $this->need_media_filters)
278
- {
279
- define($this->plugin_ckey . '_IMAGES', apply_filters($this->plugin_key . '_image_path', plugin_dir_url($this->plugin_file) . 'images'));
280
- define($this->plugin_ckey . '_CSS', apply_filters($this->plugin_key . '_css_path', plugin_dir_url($this->plugin_file) . 'css'));
281
- define($this->plugin_ckey . '_JS', apply_filters($this->plugin_key . '_js_path', plugin_dir_url($this->plugin_file) . 'js'));
282
- }
283
- else
284
- {
285
- define($this->plugin_ckey . '_IMAGES', plugin_dir_url($this->plugin_file) . 'images');
286
- define($this->plugin_ckey . '_CSS', plugin_dir_url($this->plugin_file) . 'css');
287
- define($this->plugin_ckey . '_JS', plugin_dir_url($this->plugin_file) . 'js');
288
- }
289
- // Option page related
290
- define($this->plugin_ckey . '_CAPABILITY', $this->plugin_cap); // the capability needed to configure this plugin
291
-
292
- foreach ($this->option_keys as $key => $option)
293
- {
294
- define(strtoupper($key), $option);
295
- }
296
-
297
- foreach ($this->extra_option_keys as $key => $option)
298
- {
299
- define(strtoupper($key), $option);
300
- }
301
- }
302
-
303
- function build_options()
304
- {
305
- // Get all options and merge them
306
- $options = $this->options_default;
307
- foreach ($this->option_keys as $option)
308
- {
309
- $db_option = get_option($option);
310
- if ($db_option && is_array($db_option))
311
- $options = array_merge($options, $db_option);
312
- unset($db_option);
313
- // Also check for global options if in Multi-site
314
- if ($this->is_multisite())
315
- {
316
- $db_option = get_site_option($option);
317
- if ($db_option && is_array($db_option))
318
- {
319
- $temp = array();
320
- foreach ($db_option as $k => $o)
321
- {
322
- if (in_array($k, $this->site_options))
323
- $temp[$k] = $o;
324
- }
325
- $options = array_merge($options, $temp);
326
- }
327
- }
328
- }
329
- $this->options = $options;
330
- }
331
-
332
- function init_properties()
333
- {
334
- /* intentionally left blank */
335
- }
336
-
337
- function load_libraries()
338
- {
339
- /* intentionally left blank */
340
- }
341
-
342
- function add_hooks()
343
- {
344
- /* intentionally left blank */
345
- }
346
-
347
- function enqueue_media()
348
- {
349
- /* intentionally left blank */
350
- }
351
-
352
- function install()
353
- {
354
- /* intentionally left blank */
355
- }
356
-
357
- function uninstall()
358
- {
359
- /* intentionally left blank */
360
- }
361
-
362
- function is_admin_page()
363
- {
364
- if (is_admin() && !empty($_GET['page']) && (in_array($_GET['page'], $this->option_keys) || in_array($_GET['page'], $this->extra_option_keys)))
365
- return true;
366
- }
367
-
368
- function plugin_action_links($links, $file)
369
- {
370
- $option_keys = array_values($this->option_keys);
371
- if ($file == plugin_basename($this->plugin_file))
372
- $links[] = '<a href="admin.php?page=' . $option_keys[0] . '">' . __('Settings') . '</a>';
373
-
374
- return $links;
375
- }
376
-
377
- function init_admin()
378
- {
379
- add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
380
-
381
- if ($this->is_admin_page())
382
- {
383
- // Load option page builder
384
- if (!class_exists('BWP_OPTION_PAGE'))
385
- require_once(dirname(__FILE__) . '/bwp-option-page/bwp-option-page.php');
386
- // Enqueue style sheets and scripts for the option page
387
- wp_enqueue_style('bwp-option-page', plugin_dir_url($this->plugin_file) . 'includes/bwp-option-page/css/bwp-option-page.css', array(), '1.0.1');
388
- wp_enqueue_script('bwp-paypal-js', plugin_dir_url($this->plugin_file) . 'includes/bwp-option-page/js/paypal.js', array('jquery'));
389
- }
390
- $this->build_menus();
391
- }
392
-
393
- /**
394
- * Build the Menus
395
- */
396
- function build_menus()
397
- {
398
- /* intentionally left blank */
399
- }
400
-
401
- function build_tabs()
402
- {
403
- foreach ($this->option_pages as $key => $page)
404
- {
405
- $pagelink = (!empty($this->option_keys[$key])) ? $this->option_keys[$key] : $this->extra_option_keys[$key];
406
- $this->form_tabs[$page] = get_option('siteurl') . '/wp-admin/admin.php?page=' . $pagelink;
407
- }
408
- }
409
-
410
- /**
411
- * Build the option pages
412
- *
413
- * Utilizes BWP Option Page Builder (@see BWP_OPTION_PAGE)
414
- */
415
- function build_option_pages()
416
- {
417
- /* intentionally left blank */
418
- }
419
-
420
- function add_notice($notice)
421
- {
422
- if (!in_array($notice, $this->notices))
423
- {
424
- $this->notices[] = $notice;
425
- add_action('bwp_option_action_before_form', array($this, 'show_notices'));
426
- }
427
- }
428
-
429
- function show_notices()
430
- {
431
- if (false == $this->notice_shown)
432
- {
433
- foreach ($this->notices as $notice)
434
- {
435
- echo '<div class="updated fade"><p>' . $notice . '</p></div>';
436
- }
437
- $this->notice_shown = true;
438
- }
439
- }
440
-
441
- function is_multisite()
442
- {
443
- if (function_exists('is_multisite') && is_multisite())
444
- return true;
445
- return false;
446
- }
447
-
448
- function is_normal_admin()
449
- {
450
- if ($this->is_multisite() && !is_super_admin())
451
- return true;
452
- return false;
453
- }
454
- }
455
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-bwp-gxs-cache.php CHANGED
@@ -1,136 +1,147 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_CACHE {
8
-
9
- var $module = '';
10
- var $cache_dir = '';
11
- var $cache_file = '';
12
- var $cache_time = 0;
13
- var $gzip = false;
14
- var $has_cache = false;
15
- var $options;
16
- var $now;
17
- var $cache_header = array();
18
- var $cache_ok = false;
19
-
20
- function __construct($config = array())
21
- {
22
- global $bwp_gxs;
23
-
24
- // Init necessary config to work with the cache
25
- $this->options = $bwp_gxs->get_options();
26
- $this->module = $config['module'];
27
- $this->module_name = $config['module_name'];
28
- $this->cache_dir = $this->options['input_cache_dir'];
29
- $this->gzip = ('yes' == $this->options['enable_gzip']) ? true : false;
30
- $this->cache_time = (int) $this->options['input_cache_age'] * (int) $this->options['select_time_type'];
31
- $this->now = time();
32
-
33
- if (empty($this->cache_dir) || !@is_writable($this->cache_dir))
34
- $bwp_gxs->elog(sprintf(__('Cache directory ("%s") does not exist or is not writable.', 'bwp-simple-gxs'), $this->cache_dir));
35
- else
36
- $this->setup_cache();
37
- }
38
-
39
- function get_header()
40
- {
41
- return $this->cache_header;
42
- }
43
-
44
- function get_cache_file()
45
- {
46
- return $this->cache_file;
47
- }
48
-
49
- function check_cache()
50
- {
51
- global $bwp_gxs;
52
-
53
- // If the cache file is not found
54
- if (!@file_exists($this->cache_file))
55
- {
56
- $bwp_gxs->nlog(sprintf(__('Cache file for module <em>%s</em> is not found and will be built right away.', 'bwp-simple-gxs'), $this->module));
57
- return false;
58
- }
59
- $this->has_cache = true;
60
-
61
- return true;
62
- }
63
-
64
- function setup_cache()
65
- {
66
- global $bwp_gxs;
67
- // Build cache file name, WPMS compatible
68
- $file_name = 'gxs_' . md5($this->module . '_' . get_option('home'));
69
- // $file_name .= (true == $this->gzip) ? '.xml.gz' : '.xml';
70
- // Use gz all the time to save space
71
- $file_name .= '.xml.gz';
72
- $this->cache_file = trailingslashit($this->cache_dir) . $file_name;
73
- $this->cache_ok = true;
74
-
75
- if ($this->check_cache())
76
- {
77
- // So cache is found, check if we can still use it
78
- $filemtime = @filemtime($this->cache_file);
79
- if ($filemtime + $this->cache_time <= $this->now && 'yes' == $this->options['enable_cache_auto_gen'])
80
- {
81
- @unlink($this->cache_file);
82
- $this->has_cache = false;
83
- }
84
-
85
- if (!$this->has_cache)
86
- {
87
- $header['lastmod'] = $bwp_gxs->format_header_time($this->now);
88
- $header['expires'] = $bwp_gxs->format_header_time($this->now + $this->cache_time);
89
- $header['etag'] = md5($header['expires'] . $this->cache_file);
90
- }
91
- else
92
- {
93
- $header['lastmod'] = $bwp_gxs->format_header_time($filemtime);
94
- $header['expires'] = $bwp_gxs->format_header_time($filemtime + $this->cache_time);
95
- $header['etag'] = md5($header['expires'] . $this->cache_file);
96
- }
97
-
98
- $this->cache_header = $header;
99
-
100
- if ('yes' == $this->options['enable_debug'])
101
- return;
102
-
103
- if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH']))
104
- {
105
- if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $header['lastmod']) ||
106
- (isset($_SERVER['HTTP_IF_NONE_MATCH']) && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == $header['etag']))
107
- {
108
- $bwp_gxs->slog(sprintf(__('Successfully served a cached version of <em>%s.xml</em>.', 'bwp-simple-gxs'), $this->module_name), true);
109
- $bwp_gxs->commit_logs();
110
- header('HTTP/1.1 304 Not Modified');
111
- exit();
112
- }
113
- }
114
- }
115
- }
116
-
117
- function write_cache()
118
- {
119
- global $bwp_gxs;
120
-
121
- $file = $this->cache_file;
122
-
123
- $handle = @gzopen($file, 'wb');
124
- @flock($handle, LOCK_EX);
125
- @gzwrite($handle, $bwp_gxs->output);
126
- @flock($handle, LOCK_UN);
127
- @gzclose($handle);
128
-
129
- @umask(0000);
130
- @chmod($file, 0666);
131
-
132
- return true;
133
- }
134
- }
135
-
136
- ?>
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ */
6
+
7
+ class BWP_GXS_CACHE
8
+ {
9
+ var $main = false;
10
+ var $options = array();
11
+
12
+ var $module_name = '';
13
+ var $sitemap_name = '';
14
+
15
+ var $cache_dir = '';
16
+ var $cache_file = '';
17
+ var $cache_time = 0;
18
+ var $cache_headers = array();
19
+
20
+ var $gzip = false;
21
+ var $now;
22
+
23
+ public function __construct($main)
24
+ {
25
+ // Init necessary config to work with the cache
26
+ $this->main = $main;
27
+ $this->options = $main->options;
28
+
29
+ $this->cache_dir = $this->main->cache_directory;
30
+ $this->gzip = 'yes' == $this->options['enable_gzip'] ? true : false;
31
+ $this->cache_time = (int) $this->options['input_cache_age'] * (int) $this->options['select_time_type'];
32
+
33
+ $this->now = time();
34
+ }
35
+
36
+ private function _check_http_cache($lastmod, $etag)
37
+ {
38
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH']))
39
+ {
40
+ // a conditional GET
41
+ if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
42
+ && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $lastmod)
43
+ || (isset($_SERVER['HTTP_IF_NONE_MATCH'])
44
+ && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == $etag)
45
+ ) {
46
+ // if the cached file in browser matches 'modified since'
47
+ // or 'etag' header of server's cached file, we only need to
48
+ // send a 304 Not Modified header back
49
+ return true;
50
+ }
51
+ }
52
+
53
+ return false;
54
+ }
55
+
56
+ private function _check_cache()
57
+ {
58
+ // cache is found and readable, check if we can still use it based
59
+ // on its last modified timestamp
60
+ $last_modified = @filemtime($this->cache_file);
61
+
62
+ if ($last_modified + $this->cache_time <= $this->now
63
+ && 'yes' == $this->options['enable_cache_auto_gen']
64
+ ) {
65
+ // cached sitemap file has expired, and cache auto-regenerate
66
+ // is enabled, remove the cached sitemap file and return to the main
67
+ // handle to re-generate a new sitemap file.
68
+ @unlink($this->cache_file);
69
+ return false;
70
+ }
71
+
72
+ $lastmod = bwp_gxs_format_header_time($last_modified);
73
+ $expires = bwp_gxs_format_header_time($last_modified + $this->cache_time);
74
+ $etag = md5($expires . $this->cache_file);
75
+
76
+ // build cached sitemap's headers for later use
77
+ $this->cache_headers = array(
78
+ 'lastmod' => $lastmod,
79
+ 'expires' => $expires,
80
+ 'etag' => $etag
81
+ );
82
+
83
+ if ($this->_check_http_cache($lastmod, $etag))
84
+ return '304';
85
+
86
+ return '200';
87
+ }
88
+
89
+ public function write_cache($contents)
90
+ {
91
+ $cache_file = $this->cache_file;
92
+
93
+ $handle = @gzopen($cache_file, 'wb');
94
+
95
+ if ($handle)
96
+ {
97
+ @flock($handle, LOCK_EX);
98
+ @gzwrite($handle, $contents);
99
+ @flock($handle, LOCK_UN);
100
+ @gzclose($handle);
101
+
102
+ /* @umask(0000); */
103
+ @chmod($cache_file, 0644);
104
+ }
105
+ else
106
+ {
107
+ return false;
108
+ }
109
+
110
+ // return the modification timestamp to construct etag
111
+ return @filemtime($cache_file);
112
+ }
113
+
114
+ /**
115
+ * Gets current cache status for the requested sitemap
116
+ *
117
+ * @since BWP GXS 1.3.0
118
+ * @access public
119
+ * @return bool|string false if cache is invalid
120
+ * '304' if http cache can be used
121
+ * '200' if file cache must be used
122
+ */
123
+ public function get_cache_status($module_name, $sitemap_name)
124
+ {
125
+ global $bwp_gxs;
126
+
127
+ $this->module_name = $module_name;
128
+ $this->sitemap_name = $sitemap_name;
129
+
130
+ $this->cache_file = bwp_gxs_get_filename($sitemap_name);
131
+
132
+ if (!@is_readable($this->cache_file))
133
+ return false;
134
+
135
+ return $this->_check_cache();
136
+ }
137
+
138
+ public function get_headers()
139
+ {
140
+ return $this->cache_headers;
141
+ }
142
+
143
+ public function get_cache_file()
144
+ {
145
+ return $this->cache_file;
146
+ }
147
+ }
includes/class-bwp-gxs-module.php CHANGED
@@ -1,421 +1,687 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
- */
6
-
7
- class BWP_GXS_MODULE {
8
-
9
- /**
10
- * Data used to build a sitemap
11
- */
12
- var $data = array();
13
-
14
- /**
15
- * Is this a sitemapindex or a url set?
16
- */
17
- var $type = 'url';
18
-
19
- /**
20
- * Priority mapping
21
- */
22
- var $freq_to_pri = array('always' => 1.0, 'hourly' => 0.8, 'daily' => 0.7, 'weekly' => 0.6, 'monthly' => 0.4, 'yearly' => 0.3, 'never' => 0.2);
23
-
24
- var $comment_count = 0, $now, $offset = 0, $url_sofar = 0, $circle = 0;
25
- var $perma_struct = '', $post_type = NULL;
26
-
27
- function __contruct()
28
- {
29
- /* Intetionally left blank */
30
- }
31
-
32
- function set_current_time()
33
- {
34
- $this->now = (int) time();
35
- }
36
-
37
- function init_data($pre_data = array())
38
- {
39
- global $bwp_gxs;
40
-
41
- if (empty($this->now))
42
- $this->set_current_time();
43
-
44
- $data['location'] = '';
45
- $data['lastmod'] = (!empty($pre_data['lastmod'])) ? strtotime($pre_data['lastmod']) - $bwp_gxs->oldest_time : $this->now - $bwp_gxs->oldest_time;
46
- $data['lastmod'] = $this->format_lastmod($data['lastmod']);
47
-
48
- if (empty($pre_data) || sizeof($pre_data) == 0)
49
- return $data;
50
-
51
- if (isset($pre_data['freq'])) $data['freq'] = $pre_data['freq'];
52
- if (isset($pre_data['priority'])) $data['priority'] = $pre_data['priority'];
53
-
54
- return $data;
55
- }
56
-
57
- function get_xml_link($slug)
58
- {
59
- global $bwp_gxs;
60
-
61
- if (!$bwp_gxs->use_permalink)
62
- return get_option('home') . '/?' . $bwp_gxs->query_var_non_perma . '=' . $slug;
63
- else
64
- {
65
- $permalink = get_option('permalink_structure');
66
- // If user is using index.php in their permalink structure, we will have to include it also
67
- $indexphp = (strpos($permalink, 'index.php') === false) ? '' : '/index.php';
68
- return get_option('home') . $indexphp . '/' . $slug . '.xml';
69
- }
70
- }
71
-
72
- /**
73
- * Calculate the change frequency for a specific item.
74
- *
75
- * @copyright (c) 2006 - 2009 www.phpbb-seo.com
76
- */
77
- function cal_frequency($item = '', $lastmod = '')
78
- {
79
- global $bwp_gxs;
80
-
81
- if (empty($this->now))
82
- $this->now = $this->set_current_time();
83
-
84
- $lastmod = (is_object($item)) ? $item->post_modified : $lastmod;
85
-
86
- if (empty($lastmod))
87
- $freq = $bwp_gxs->options['select_default_freq'];
88
- else
89
- {
90
- $time = $this->now - strtotime($lastmod);
91
- $freq = $time > 30000000 ? 'yearly' : ($time > 2592000 ? 'monthly' : ($time > 604800 ? 'weekly' : ($time > 86400 ? 'daily' : ($time > 43200 ? 'hourly' : 'always'))));
92
- }
93
- return apply_filters('bwp_gxs_freq', $freq, $item);
94
- }
95
-
96
- /**
97
- * Calculate the priority for a specific item.
98
- *
99
- * This is just a basic way to calculate priority and module should use its own function instead.
100
- * Search engines don't really care about priority and change frequency much, do they ;)?
101
- */
102
- function cal_priority($item, $freq = 'daily')
103
- {
104
- global $bwp_gxs;
105
-
106
- if (empty($this->now))
107
- $this->now = $this->set_current_time();
108
-
109
- if (!is_object($item)) // determine score by change frequency
110
- $score = $this->freq_to_pri[$freq];
111
- else
112
- {
113
- $comment = (!empty($item->comment_count)) ? $item->comment_count : 1;
114
- // There is no magic behind this, number of comments and freshness define priority
115
- // yes, 164 is a lucky (and random) number :). Actually this number works well with current Unix Timestamp,
116
- // which is larger than 13m.
117
- $score = $this->now + ($this->now - (int) strtotime($item->post_modified)) / $comment * 164;
118
- $score = $this->now / $score;
119
- }
120
-
121
- $score = ($score < $bwp_gxs->options['select_min_pri']) ? $bwp_gxs->options['select_min_pri'] : $score;
122
-
123
- // For people who doesn't like using module
124
- return apply_filters('bwp_gxs_priority_score', $score, $item, $freq);
125
- }
126
-
127
- function format_lastmod($lastmod)
128
- {
129
- global $bwp_gxs;
130
- if ('yes' == $bwp_gxs->options['enable_gmt'])
131
- return gmdate('Y-m-d\TH:i:s' . '+00:00', (int) $lastmod);
132
- else
133
- return date('Y-m-d\TH:i:s' . '+00:00', (int) $lastmod);
134
- }
135
-
136
- function post_type_uses($post_type, $taxonomy_object)
137
- {
138
- if (isset($taxonomy_object->object_type) && is_array($taxonomy_object->object_type) && in_array($post_type, $taxonomy_object->object_type))
139
- return true;
140
- return false;
141
- }
142
-
143
- function get_post_by_post_type($post_type, $result)
144
- {
145
- if (!isset($result) || !is_array($result))
146
- return false;
147
-
148
- for ($i = 0; $i < sizeof($result); $i++)
149
- {
150
- $post = $result[$i];
151
- if ($post_type == $post->post_type)
152
- return $post;
153
- }
154
-
155
- return false;
156
- }
157
-
158
- function sort_data_by($column = 'lastmod')
159
- {
160
- if (!isset($this->data[0][$column]))
161
- return false;
162
- // Obtain a list of columns
163
- $lastmod = array();
164
- for ($i = 0; $i < sizeof($this->data); $i++)
165
- $lastmod[$i] = $this->data[$i][$column];
166
- // Add $data as the last parameter, to sort by the common key
167
- array_multisort($lastmod, SORT_DESC, $this->data);
168
- }
169
-
170
- /**
171
- * Get term links without using any SQL queries and the cache.
172
- */
173
- function get_term_link($term, $taxonomy = '')
174
- {
175
- global $wp_rewrite;
176
-
177
- $taxonomy = $term->taxonomy;
178
- $termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
179
- $slug = $term->slug;
180
- $t = get_taxonomy($taxonomy);
181
-
182
- if (empty($termlink))
183
- {
184
- if ('category' == $taxonomy)
185
- $termlink = '?cat=' . $term->term_id;
186
- elseif ($t->query_var)
187
- $termlink = "?$t->query_var=$slug";
188
- else
189
- $termlink = "?taxonomy=$taxonomy&term=$slug";
190
- $termlink = home_url($termlink);
191
- }
192
- else
193
- {
194
- if ($t->rewrite['hierarchical'] && !empty($term->parent))
195
- {
196
- $hierarchical_slugs = array();
197
- $ancestors = get_ancestors($term->term_id, $taxonomy);
198
- foreach ((array)$ancestors as $ancestor)
199
- {
200
- $ancestor_term = get_term($ancestor, $taxonomy);
201
- $hierarchical_slugs[] = $ancestor_term->slug;
202
- }
203
- $hierarchical_slugs = array_reverse($hierarchical_slugs);
204
- $hierarchical_slugs[] = $slug;
205
- $termlink = str_replace("%$taxonomy%", implode('/', $hierarchical_slugs), $termlink);
206
- }
207
- else
208
- {
209
- $termlink = str_replace("%$taxonomy%", $slug, $termlink);
210
- }
211
- $termlink = home_url( user_trailingslashit($termlink, 'category') );
212
- }
213
-
214
- // Back Compat filters.
215
- if ('post_tag' == $taxonomy)
216
- $termlink = apply_filters('tag_link', $termlink, $term->term_id);
217
- elseif ('category' == $taxonomy)
218
- $termlink = apply_filters('category_link', $termlink, $term->term_id);
219
-
220
- return apply_filters('term_link', $termlink, $term, $taxonomy);
221
- }
222
-
223
- function get_post_permalink($leavename = false, $sample = false)
224
- {
225
- global $wp_rewrite, $post;
226
-
227
- if (is_wp_error($post))
228
- return $post;
229
-
230
- $post_link = $wp_rewrite->get_extra_permastruct($post->post_type);
231
- $slug = $post->post_name;
232
- $draft_or_pending = isset($post->post_status) && in_array($post->post_status, array('draft', 'pending', 'auto-draft'));
233
- $post_type = get_post_type_object($post->post_type);
234
-
235
- if (!empty($post_link) && (!$draft_or_pending || $sample))
236
- {
237
- if (!$leavename)
238
- $post_link = str_replace("%$post->post_type%", $slug, $post_link);
239
- $post_link = home_url(user_trailingslashit($post_link));
240
- }
241
- else
242
- {
243
- if ($post_type->query_var && (isset($post->post_status) && !$draft_or_pending))
244
- $post_link = add_query_arg($post_type->query_var, $slug, '');
245
- else
246
- $post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
247
- $post_link = home_url($post_link);
248
- }
249
-
250
- return apply_filters('post_type_link', $post_link, $post, $leavename, $sample);
251
- }
252
-
253
- function get_permalink($leavename = false)
254
- {
255
- global $post;
256
-
257
- $rewritecode = array(
258
- '%year%',
259
- '%monthnum%',
260
- '%day%',
261
- '%hour%',
262
- '%minute%',
263
- '%second%',
264
- $leavename? '' : '%postname%',
265
- '%post_id%',
266
- '%category%',
267
- '%author%',
268
- $leavename? '' : '%pagename%',
269
- );
270
-
271
- if (!isset($post) || !is_object($post))
272
- return '';
273
-
274
- $custom_post_types = get_post_types(array('_builtin' => false));
275
- if (!isset($this->post_type))
276
- $this->post_type = get_post_type_object($post->post_type);
277
-
278
- if ('post' != $post->post_type && !in_array($post->post_type, $custom_post_types))
279
- return '';
280
-
281
- if (in_array($post->post_type, $custom_post_types))
282
- {
283
- if ($this->post_type->hierarchical)
284
- {
285
- wp_cache_add($post->ID, $post, 'posts');
286
- return get_post_permalink($post->ID, $leavename);
287
- }
288
- else
289
- return $this->get_post_permalink();
290
- }
291
-
292
- // In case module author doesn't initialize this variable
293
- $permalink = (empty($this->perma_struct)) ? get_option('permalink_structure') : $this->perma_struct;
294
- $permalink = apply_filters('pre_post_link', $permalink, $post, $leavename);
295
- if ('' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')))
296
- {
297
- $unixtime = strtotime($post->post_date);
298
- $category = '';
299
- if (strpos($permalink, '%category%') !== false)
300
- {
301
- // If this post belongs to a category with a parent, we have to rely on WordPress to build our permalinks
302
- // This can cause white page for sites that have a lot of posts, don't blame this plugin, blame WordPress ;)
303
- if (empty($post->slug) || !empty($post->parent))
304
- {
305
- $cats = get_the_category($post->ID);
306
- if ($cats)
307
- {
308
- usort($cats, '_usort_terms_by_ID'); // order by ID
309
- $category = $cats[0]->slug;
310
- if ($parent = $cats[0]->parent)
311
- $category = get_category_parents($parent, false, '/', true) . $category;
312
- }
313
- }
314
- else
315
- $category = (strpos($permalink, '%category%') !== false) ? $post->slug : '';
316
-
317
- if (empty($category))
318
- {
319
- $default_category = get_category( get_option( 'default_category' ) );
320
- $category = is_wp_error($default_category) ? '' : $default_category->slug;
321
- }
322
- }
323
-
324
- $author = '';
325
- if (strpos($permalink, '%author%') !== false)
326
- {
327
- $authordata = get_userdata($post->post_author);
328
- $author = $authordata->user_nicename;
329
- }
330
-
331
- $date = explode(' ', date('Y m d H i s', $unixtime));
332
- $rewritereplace =
333
- array(
334
- $date[0],
335
- $date[1],
336
- $date[2],
337
- $date[3],
338
- $date[4],
339
- $date[5],
340
- $post->post_name,
341
- $post->ID,
342
- $category,
343
- $author,
344
- $post->post_name
345
- );
346
-
347
- $permalink = home_url(str_replace($rewritecode, $rewritereplace, $permalink));
348
- $permalink = user_trailingslashit($permalink, 'single');
349
- }
350
- else // if they're not using the fancy permalink option
351
- $permalink = home_url('?p=' . $post->ID);
352
-
353
- return apply_filters('post_link', $permalink, $post, $leavename);
354
- }
355
-
356
- /**
357
- * Always call this function when you query for something.
358
- *
359
- * $query_str should be already escaped using either $wpdb->escape() or $wpdb->prepare().
360
- */
361
- function get_results($query_str)
362
- {
363
- global $bwp_gxs, $wpdb;
364
-
365
- $start = (!empty($this->url_sofar)) ? $this->offset + (int) $this->url_sofar : $this->offset;
366
- $end = (int) $bwp_gxs->options['input_sql_limit'];
367
- $limit = (empty($this->part)) ? $bwp_gxs->options['input_item_limit'] : $bwp_gxs->options['input_split_limit_post'];
368
- // If we exceed the actual limit, limit $end to the correct limit - @since 1.1.5
369
- if ($this->url_sofar + $end > $limit)
370
- $end = $limit - $this->url_sofar;
371
- $query_str = trim($query_str);
372
- $query_str .= ' LIMIT ' . $start . ',' . $end;
373
-
374
- return $wpdb->get_results($query_str);
375
- }
376
-
377
- /**
378
- * Always call this function when you query for something.
379
- *
380
- * $query_str should be similar to what WP_Query accepts.
381
- */
382
- function query_posts($query_str)
383
- {
384
- $this->circle += 1;
385
- if (is_array($query_str))
386
- {
387
- $query_str['posts_per_page'] = (int) $bwp_gxs->options['input_sql_limit'];
388
- $query_str['paged'] = $this->circle;
389
- }
390
- else if (is_string($query_str))
391
- {
392
- $query_str = trim($query_str);
393
- $query_str .= '&posts_per_page=' . (int) $bwp_gxs->options['input_sql_limit'];
394
- $query_str .= '&paged=' . $this->circle;
395
- }
396
- $query = new WP_Query($query_str);
397
- return $query;
398
- }
399
-
400
- function generate_data()
401
- {
402
- return false;
403
- }
404
-
405
- function build_data($sort_column = '')
406
- {
407
- global $bwp_gxs;
408
-
409
- // Use part limit or global item limit - @since 1.1.0
410
- $limit = (empty($this->part)) ? $bwp_gxs->options['input_item_limit'] : $bwp_gxs->options['input_split_limit_post'];
411
- $this->offset = (empty($this->part)) ? 0 : ($this->part - 1) * $bwp_gxs->options['input_split_limit_post'];
412
-
413
- while ($this->url_sofar < $limit && false != $this->generate_data())
414
- $this->url_sofar = sizeof($this->data);
415
-
416
- // Sort the data by preference
417
- if (!empty($sort_column))
418
- $this->sort_data_by($sort_column);
419
- }
420
- }
421
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE VERSION 3.0 OR LATER
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE
9
+ {
10
+ /**
11
+ * Sitemap type, either 'url', 'news', or 'index'
12
+ *
13
+ * @var string
14
+ */
15
+ public $type = 'url';
16
+
17
+ /**
18
+ * The actual requested sitemap module
19
+ *
20
+ * @var string
21
+ */
22
+ public $requested;
23
+
24
+ /**
25
+ * Hold module data coming from main GXS class
26
+ *
27
+ * @var array
28
+ */
29
+ protected $module_data;
30
+
31
+ /**
32
+ * Requested sitemap part, used for split sitemaps
33
+ *
34
+ * @var integer
35
+ */
36
+ protected $part;
37
+
38
+ /**
39
+ * Holds sitemap items
40
+ *
41
+ * @var array
42
+ */
43
+ protected $data = array();
44
+
45
+ /**
46
+ * Priority mapping
47
+ *
48
+ * @var array
49
+ */
50
+ public $freq_to_pri = array(
51
+ 'always' => 1.0,
52
+ 'hourly' => 0.8,
53
+ 'daily' => 0.7,
54
+ 'weekly' => 0.6,
55
+ 'monthly' => 0.4,
56
+ 'yearly' => 0.3,
57
+ 'never' => 0.2
58
+ );
59
+
60
+ public $comment_count = 0, $now, $offset = 0, $url_sofar = 0, $circle = 0;
61
+ public $perma_struct = '', $post_type = NULL;
62
+ public $limit = 0;
63
+
64
+ /**
65
+ * Column to sort sitemap items by
66
+ *
67
+ * @since 1.3.0
68
+ * @var string
69
+ */
70
+ public $sort_column = false;
71
+
72
+ public function __contruct()
73
+ {
74
+ /* Intetionally left blank */
75
+ }
76
+
77
+ protected function init_data($pre_data = array())
78
+ {
79
+ global $bwp_gxs;
80
+
81
+ if (empty($this->now))
82
+ $this->set_current_time();
83
+
84
+ $data['location'] = '';
85
+ $data['lastmod'] = ''; // @since 1.3.0 no more assumption of last mod
86
+
87
+ if (empty($pre_data) || sizeof($pre_data) == 0)
88
+ return $data;
89
+
90
+ if (isset($pre_data['freq'])) $data['freq'] = $pre_data['freq'];
91
+ if (isset($pre_data['priority'])) $data['priority'] = $pre_data['priority'];
92
+
93
+ return $data;
94
+ }
95
+
96
+ /**
97
+ * @deprecated 1.3.0 in favor of ::get_sitemap_url
98
+ */
99
+ protected function get_xml_link($slug)
100
+ {
101
+ return $this->get_sitemap_url($slug);
102
+ }
103
+
104
+ protected function get_sitemap_url($slug)
105
+ {
106
+ global $bwp_gxs;
107
+
108
+ return $bwp_gxs->get_sitemap_url($slug);
109
+ }
110
+
111
+ /**
112
+ * Calculate the change frequency for a specific item.
113
+ *
114
+ * @copyright (c) 2006 - 2009 www.phpbb-seo.com
115
+ */
116
+ protected function cal_frequency($item = '', $lastmod = '')
117
+ {
118
+ global $bwp_gxs;
119
+
120
+ if (empty($this->now))
121
+ $this->now = $this->set_current_time();
122
+
123
+ $lastmod = is_object($item) ? $item->post_modified : $lastmod;
124
+
125
+ if (empty($lastmod))
126
+ {
127
+ $freq = $bwp_gxs->options['select_default_freq'];
128
+ }
129
+ else
130
+ {
131
+ $time = $this->now - strtotime($lastmod);
132
+
133
+ $freq = $time <= 30000000
134
+ ? ($time > 2592000 ? 'monthly'
135
+ : ($time > 604800 ? 'weekly'
136
+ : ($time > 86400 ? 'daily'
137
+ : ($time > 43200 ? 'hourly'
138
+ : 'always'))))
139
+ : 'yearly';
140
+ }
141
+
142
+ return apply_filters('bwp_gxs_freq', $freq, $item);
143
+ }
144
+
145
+ /**
146
+ * Calculate the priority for a specific item.
147
+ *
148
+ * This is just a basic way to calculate priority and module should use its
149
+ * own function instead. Search engines don't really care about priority
150
+ * and change frequency much, do they ;)?
151
+ */
152
+ protected function cal_priority($item, $freq = 'daily')
153
+ {
154
+ global $bwp_gxs;
155
+
156
+ if (empty($this->now))
157
+ $this->now = $this->set_current_time();
158
+
159
+ if (!is_object($item))
160
+ {
161
+ // determine score by change frequency
162
+ $score = $this->freq_to_pri[$freq];
163
+ }
164
+ else
165
+ {
166
+ $comment = !empty($item->comment_count) ? $item->comment_count : 1;
167
+ $last_mod = !empty($item->post_modified) ? strtotime($item->post_modified) : 0;
168
+
169
+ // There is no magic behind this, number of comments and freshness
170
+ // define priority yes, 164 is a lucky (and random) number :).
171
+ // Actually this number works well with current Unix Timestamp,
172
+ // which is larger than 13m.
173
+ $score = $this->now + ($this->now - $last_mod) / $comment * 164;
174
+ $score = $this->now / $score;
175
+ }
176
+
177
+ $score = $score < $bwp_gxs->options['select_min_pri']
178
+ ? $bwp_gxs->options['select_min_pri']
179
+ : $score;
180
+
181
+ return apply_filters('bwp_gxs_priority_score', $score, $item, $freq);
182
+ }
183
+
184
+ /**
185
+ * Get last modified date from post object
186
+ *
187
+ * Sometimes post_modified is not set due to improper data import into
188
+ * database, we will have to use post_date. If post_date is invalid too,
189
+ * we're out of luck.
190
+ *
191
+ * By default lastmod is in GMT so `post_date_gmt` and `post_modified_gmt`
192
+ * will be used. If local time is used `post_date` and `post_modified`
193
+ * will be used instead. Because modified times can come from various
194
+ * sources and not all sources have a GMT equivalent, we expect other
195
+ * modified times to be in local time and will be converted to GMT using
196
+ * `gmt_offset`.
197
+ *
198
+ * @since 1.3.0
199
+ * @access protected
200
+ */
201
+ protected function get_lastmod($post)
202
+ {
203
+ global $bwp_gxs;
204
+
205
+ $lastmod = '';
206
+
207
+ // handle GMT using `post_date_gmt`, `post_modified_gmt` and
208
+ // `gmt_offset` if `date_default_timezone_set` function does exist
209
+ $need_gmt = $bwp_gxs->options['enable_gmt'] == 'yes'
210
+ && function_exists('date_default_timezone_set')
211
+ ? true : false;
212
+
213
+ $post_modified_field = $need_gmt ? 'post_modified_gmt' : 'post_modified';
214
+ $post_date_field = $need_gmt ? 'post_date_gmt' : 'post_date';
215
+
216
+ if (isset($post->lastmod))
217
+ {
218
+ // lastmod is expected to be in local time
219
+ $lastmod = strtotime($post->lastmod);
220
+ $lastmod = $need_gmt ? $lastmod - get_option('gmt_offset') * 3600 : $lastmod;
221
+ }
222
+ elseif (isset($post->$post_modified_field))
223
+ {
224
+ $lastmod = strtotime($post->$post_modified_field);
225
+ }
226
+
227
+ $post_date = isset($post->$post_date_field) ? strtotime($post->$post_date_field) : '';
228
+
229
+ $lastmod = empty($lastmod) || $lastmod < 0 ? $post_date : $lastmod;
230
+ $lastmod = empty($lastmod) || $lastmod < 0 ? '' : $lastmod;
231
+
232
+ return !empty($lastmod) ? $this->format_lastmod($lastmod, false) : '';
233
+ }
234
+
235
+ protected function format_lastmod($lastmod, $expect_local = true)
236
+ {
237
+ global $bwp_gxs;
238
+
239
+ $need_gmt = $bwp_gxs->options['enable_gmt'] == 'yes' ? true : false;
240
+ $gmt_offset = (float) get_option('gmt_offset');
241
+
242
+ if ($lastmod < 0)
243
+ return '';
244
+
245
+ if (!function_exists('date_default_timezone_set'))
246
+ {
247
+ // prior to PHP 5.1.0 this function is not available, so we will
248
+ // have to reply on date functions entirely, and the incoming
249
+ // `$lastmod` is the original datetime value without any modifications
250
+ // from `gmt_offset` and/or WordPress's GMT datetime fields
251
+ return $need_gmt ? gmdate('Y-m-d\TH:i:s\Z', (int) $lastmod) : date('c', (int) $lastmod);
252
+ }
253
+
254
+ // lastmod is expected to be in local time, make it GMT/UTC if needed
255
+ $lastmod = $expect_local && $need_gmt ? $lastmod - $gmt_offset * 3600 : $lastmod;
256
+
257
+ // WordPress uses 'UTC' as its timezone for date function but other
258
+ // plugins might change this so it's best to set to 'UTC' here and
259
+ // assing the current timezone back later on. This is to ensure that
260
+ // the `date` function does not manage timezone on its own.
261
+ $current_timezone = date_default_timezone_get();
262
+ date_default_timezone_set('UTC');
263
+
264
+ $date = date('c', (int) $lastmod);
265
+
266
+ if ($need_gmt)
267
+ {
268
+ // use GMT/UTC for sitemap
269
+ return str_replace('+00:00', 'Z', $date);
270
+ }
271
+
272
+ // calculate the UTC designator, e.g. '+07:00'
273
+ $sign = $gmt_offset > 0 ? '+' : '-';
274
+
275
+ $gmt_offset = abs($gmt_offset);
276
+
277
+ $hour = intval($gmt_offset);
278
+ $minute = $gmt_offset - $hour;
279
+ $minute = $minute * 60;
280
+
281
+ return str_replace('+00:00', $sign . sprintf('%02d:%02d', $hour, $minute), $date);
282
+ }
283
+
284
+ protected function post_type_uses($post_type, $taxonomy_object)
285
+ {
286
+ if (isset($taxonomy_object->object_type)
287
+ && is_array($taxonomy_object->object_type)
288
+ && in_array($post_type, $taxonomy_object->object_type)
289
+ ) {
290
+ return true;
291
+ }
292
+
293
+ return false;
294
+ }
295
+
296
+ protected function get_post_by_post_type($post_type, $result)
297
+ {
298
+ if (!isset($result) || !is_array($result))
299
+ return false;
300
+
301
+ for ($i = 0; $i < sizeof($result); $i++)
302
+ {
303
+ $post = $result[$i];
304
+
305
+ if ($post_type == $post->post_type)
306
+ return $post;
307
+ }
308
+
309
+ return false;
310
+ }
311
+
312
+ protected function sort_data_by($column = 'lastmod')
313
+ {
314
+ if (!isset($this->data[0][$column]))
315
+ return false;
316
+
317
+ // Obtain a list of columns
318
+ $lastmod = array();
319
+ for ($i = 0; $i < sizeof($this->data); $i++)
320
+ $lastmod[$i] = $this->data[$i][$column];
321
+
322
+ // Add $data as the last parameter, to sort by the common key
323
+ array_multisort($lastmod, SORT_DESC, $this->data);
324
+ }
325
+
326
+ protected function using_permalinks()
327
+ {
328
+ $perma_struct = get_option('permalink_structure');
329
+
330
+ return !empty($perma_struct);
331
+ }
332
+
333
+ /**
334
+ * Get term links without using any SQL queries and the cache.
335
+ */
336
+ protected function get_term_link($term, $taxonomy = '')
337
+ {
338
+ global $wp_rewrite;
339
+
340
+ $taxonomy = $term->taxonomy;
341
+ $termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
342
+ $slug = $term->slug;
343
+ $t = get_taxonomy($taxonomy);
344
+
345
+ if (empty($termlink))
346
+ {
347
+ if ('category' == $taxonomy)
348
+ $termlink = '?cat=' . $term->term_id;
349
+ elseif ($t->query_var)
350
+ $termlink = "?$t->query_var=$slug";
351
+ else
352
+ $termlink = "?taxonomy=$taxonomy&term=$slug";
353
+
354
+ $termlink = home_url($termlink);
355
+ }
356
+ else
357
+ {
358
+ if ($t->rewrite['hierarchical'] && !empty($term->parent))
359
+ {
360
+ $hierarchical_slugs = array();
361
+ $ancestors = get_ancestors($term->term_id, $taxonomy);
362
+
363
+ foreach ((array)$ancestors as $ancestor)
364
+ {
365
+ $ancestor_term = get_term($ancestor, $taxonomy);
366
+ $hierarchical_slugs[] = $ancestor_term->slug;
367
+ }
368
+
369
+ $hierarchical_slugs = array_reverse($hierarchical_slugs);
370
+ $hierarchical_slugs[] = $slug;
371
+ $termlink = str_replace("%$taxonomy%", implode('/', $hierarchical_slugs), $termlink);
372
+ }
373
+ else
374
+ {
375
+ $termlink = str_replace("%$taxonomy%", $slug, $termlink);
376
+ }
377
+
378
+ $termlink = home_url( user_trailingslashit($termlink, 'category') );
379
+ }
380
+
381
+ // Back Compat filters.
382
+ if ('post_tag' == $taxonomy)
383
+ $termlink = apply_filters('tag_link', $termlink, $term->term_id);
384
+ elseif ('category' == $taxonomy)
385
+ $termlink = apply_filters('category_link', $termlink, $term->term_id);
386
+
387
+ return apply_filters('term_link', $termlink, $term, $taxonomy);
388
+ }
389
+
390
+ protected function get_post_permalink($leavename = false, $sample = false)
391
+ {
392
+ global $wp_rewrite, $post;
393
+
394
+ if (is_wp_error($post))
395
+ return $post;
396
+
397
+ $post_link = $wp_rewrite->get_extra_permastruct($post->post_type);
398
+ $slug = $post->post_name;
399
+ $draft_or_pending = isset($post->post_status) && in_array($post->post_status, array('draft', 'pending', 'auto-draft'));
400
+ $post_type = get_post_type_object($post->post_type);
401
+
402
+ if (!empty($post_link) && (!$draft_or_pending || $sample))
403
+ {
404
+ if (!$leavename)
405
+ $post_link = str_replace("%$post->post_type%", $slug, $post_link);
406
+
407
+ $post_link = home_url(user_trailingslashit($post_link));
408
+ }
409
+ else
410
+ {
411
+ if ($post_type->query_var && (isset($post->post_status) && !$draft_or_pending))
412
+ $post_link = add_query_arg($post_type->query_var, $slug, '');
413
+ else
414
+ $post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
415
+
416
+ $post_link = home_url($post_link);
417
+ }
418
+
419
+ return apply_filters('post_type_link', $post_link, $post, $leavename, $sample);
420
+ }
421
+
422
+ protected function get_permalink($leavename = false)
423
+ {
424
+ global $post;
425
+
426
+ $rewritecode = array(
427
+ '%year%',
428
+ '%monthnum%',
429
+ '%day%',
430
+ '%hour%',
431
+ '%minute%',
432
+ '%second%',
433
+ $leavename? '' : '%postname%',
434
+ '%post_id%',
435
+ '%category%',
436
+ '%author%',
437
+ $leavename? '' : '%pagename%',
438
+ );
439
+
440
+ if (!isset($post) || !is_object($post))
441
+ return '';
442
+
443
+ $custom_post_types = get_post_types(array(
444
+ '_builtin' => false,
445
+ 'public' => true
446
+ ));
447
+
448
+ if (!isset($this->post_type))
449
+ $this->post_type = get_post_type_object($post->post_type);
450
+
451
+ if ('post' != $post->post_type && !in_array($post->post_type, $custom_post_types))
452
+ return '';
453
+
454
+ if (in_array($post->post_type, $custom_post_types))
455
+ {
456
+ if ($this->post_type->hierarchical)
457
+ {
458
+ wp_cache_add($post->ID, $post, 'posts');
459
+
460
+ return get_post_permalink($post->ID, $leavename);
461
+ }
462
+ else
463
+ return $this->get_post_permalink();
464
+ }
465
+
466
+ // In case module author doesn't initialize this variable
467
+ $permalink = empty($this->perma_struct) ? get_option('permalink_structure') : $this->perma_struct;
468
+ $permalink = apply_filters('pre_post_link', $permalink, $post, $leavename);
469
+
470
+ if ('' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')))
471
+ {
472
+ $unixtime = strtotime($post->post_date);
473
+ $category = '';
474
+
475
+ if (strpos($permalink, '%category%') !== false)
476
+ {
477
+ // If this post belongs to a category with a parent, we have to rely on WordPress to build our permalinks
478
+ // This can cause white page for sites that have a lot of posts, don't blame this plugin, blame WordPress ;)
479
+ if (empty($post->slug) || !empty($post->parent))
480
+ {
481
+ $cats = get_the_category($post->ID);
482
+
483
+ if ($cats)
484
+ {
485
+ usort($cats, '_usort_terms_by_ID'); // order by ID
486
+ $category = $cats[0]->slug;
487
+
488
+ if ($parent = $cats[0]->parent)
489
+ $category = get_category_parents($parent, false, '/', true) . $category;
490
+ }
491
+ }
492
+ else
493
+ $category = (strpos($permalink, '%category%') !== false) ? $post->slug : '';
494
+
495
+ if (empty($category))
496
+ {
497
+ $default_category = get_category( get_option( 'default_category' ) );
498
+ $category = is_wp_error($default_category) ? '' : $default_category->slug;
499
+ }
500
+ }
501
+ $author = '';
502
+
503
+ if (strpos($permalink, '%author%') !== false)
504
+ {
505
+ $authordata = get_userdata($post->post_author);
506
+ $author = $authordata->user_nicename;
507
+ }
508
+
509
+ $date = explode(' ', date('Y m d H i s', $unixtime));
510
+
511
+ $rewritereplace = array(
512
+ $date[0],
513
+ $date[1],
514
+ $date[2],
515
+ $date[3],
516
+ $date[4],
517
+ $date[5],
518
+ $post->post_name,
519
+ $post->ID,
520
+ $category,
521
+ $author,
522
+ $post->post_name
523
+ );
524
+
525
+ $permalink = home_url(str_replace($rewritecode, $rewritereplace, $permalink));
526
+ $permalink = user_trailingslashit($permalink, 'single');
527
+ }
528
+ else // if they're not using the fancy permalink option
529
+ $permalink = home_url('?p=' . $post->ID);
530
+
531
+ return apply_filters('post_link', $permalink, $post, $leavename);
532
+ }
533
+
534
+ /**
535
+ * Always call this function when you query for something.
536
+ *
537
+ * $query_str should be already escaped using either $wpdb->escape() or
538
+ * $wpdb->prepare().
539
+ */
540
+ protected function get_results($query_str)
541
+ {
542
+ global $bwp_gxs, $wpdb;
543
+
544
+ $start = !empty($this->url_sofar) ? $this->offset + (int) $this->url_sofar : $this->offset;
545
+ $end = (int) $bwp_gxs->options['input_sql_limit'];
546
+ $limit = $this->limit;
547
+
548
+ // @since 1.1.5 if we exceed the actual limit, limit $end to the
549
+ // correct limit
550
+ if ($this->url_sofar + $end > $limit)
551
+ $end = $limit - $this->url_sofar;
552
+
553
+ $query_str = trim($query_str);
554
+ $query_str .= ' LIMIT ' . $start . ',' . $end;
555
+
556
+ return $wpdb->get_results($query_str);
557
+ }
558
+
559
+ /**
560
+ * Always call this function when you query for something.
561
+ *
562
+ * $query_str should be similar to what WP_Query accepts.
563
+ */
564
+ protected function query_posts($query_str)
565
+ {
566
+ $this->circle += 1;
567
+
568
+ if (is_array($query_str))
569
+ {
570
+ $query_str['posts_per_page'] = (int) $bwp_gxs->options['input_sql_limit'];
571
+ $query_str['paged'] = $this->circle;
572
+ }
573
+ else if (is_string($query_str))
574
+ {
575
+ $query_str = trim($query_str);
576
+ $query_str .= '&posts_per_page=' . (int) $bwp_gxs->options['input_sql_limit'];
577
+ $query_str .= '&paged=' . $this->circle;
578
+ }
579
+
580
+ $query = new WP_Query($query_str);
581
+
582
+ return $query;
583
+ }
584
+
585
+ /**
586
+ * Init any properties that are used in building data
587
+ *
588
+ * This must be called after module has been set and right before building
589
+ * actual sitemap data
590
+ *
591
+ * @since 1.3.0
592
+ * @access protected
593
+ */
594
+ protected function init_properties()
595
+ {
596
+ // intentionally left blank
597
+ }
598
+
599
+ protected function generate_data()
600
+ {
601
+ return false;
602
+ }
603
+
604
+ protected function build_data()
605
+ {
606
+ global $bwp_gxs;
607
+
608
+ // @since 1.3.0 for post-based sitemaps, when splitting is enabled use
609
+ // global limit if split limit is empty
610
+ $split_limit = empty($bwp_gxs->options['input_split_limit_post'])
611
+ ? $bwp_gxs->options['input_item_limit']
612
+ : $bwp_gxs->options['input_split_limit_post'];
613
+
614
+ // use part limit or global item limit - @since 1.1.0
615
+ $this->limit = empty($this->part)
616
+ ? $bwp_gxs->options['input_item_limit']
617
+ : $split_limit;
618
+
619
+ // if this is a Google News sitemap, limit is 1000
620
+ // @see https://support.google.com/news/publisher/answer/74288?hl=en#sitemapguidelines
621
+ // so use 1000 if current limit is set higher
622
+ $this->limit = 'news' == $this->type && $this->limit > 1000
623
+ ? 1000 : $this->limit;
624
+
625
+ $this->offset = !empty($this->part)
626
+ ? ($this->part - 1) * $split_limit
627
+ : 0;
628
+
629
+ while ($this->url_sofar < $this->limit && false != $this->generate_data())
630
+ $this->url_sofar = sizeof($this->data);
631
+
632
+ // sort the data by preference
633
+ if (!empty($this->sort_column))
634
+ $this->sort_data_by($this->sort_column);
635
+ }
636
+
637
+ /**
638
+ * Generate sitemap data based on requested input and current module data
639
+ *
640
+ * This is meant to be called from main class. To remain back-compat with
641
+ * custom modules, this function must check whether data has already been
642
+ * generated.
643
+ *
644
+ * @since 1.3.0
645
+ * @access public
646
+ */
647
+ public function build_sitemap_data()
648
+ {
649
+ if (sizeof($this->data) > 0)
650
+ return true;
651
+
652
+ $this->init_properties();
653
+
654
+ $this->build_data();
655
+ }
656
+
657
+ public function set_current_time()
658
+ {
659
+ $this->now = current_time('timestamp');
660
+ }
661
+
662
+ public function set_sort_column($sort_column)
663
+ {
664
+ $this->sort_column = $sort_column;
665
+ }
666
+
667
+ public function set_module_data($module_data)
668
+ {
669
+ $this->module_data = $module_data;
670
+
671
+ $this->requested = !empty($module_data['sub_module'])
672
+ ? $module_data['sub_module']
673
+ : $module_data['module'];
674
+
675
+ $this->part = !empty($module_data['part']) ? (int) $module_data['part'] : 0;
676
+ }
677
+
678
+ public function get_data()
679
+ {
680
+ return $this->data;
681
+ }
682
+
683
+ public function get_type()
684
+ {
685
+ return $this->type;
686
+ }
687
+ }
includes/class-bwp-simple-gxs.php CHANGED
@@ -1,1519 +1,3547 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
- */
18
-
19
- if (!class_exists('BWP_FRAMEWORK'))
20
- require_once(dirname(__FILE__) . '/class-bwp-framework.php');
21
-
22
- class BWP_SIMPLE_GXS extends BWP_FRAMEWORK {
23
-
24
- /**
25
- * Debugging the plugin
26
- */
27
- var $debug = true, $logs = array('log' => array(), 'sitemap' => array());
28
-
29
- /**
30
- * Modules to load when generating sitemapindex
31
- */
32
- var $allowed_modules = array(), $requested_modules = array();
33
-
34
- /**
35
- * Directory to load modules from
36
- */
37
- var $module_directory = '';
38
-
39
- /**
40
- * The permalink structure for sitemap files
41
- */
42
- var $module_url = array();
43
-
44
- /**
45
- * Frequency & priority
46
- */
47
- var $frequency = array('always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never');
48
- var $priority = array('0.1' => 0.1, '0.2' => 0.2, '0.3' => 0.3, '0.4' => 0.4, '0.5' => 0.5, '0.6' => 0.6, '0.7' => 0.7, '0.8' => 0.8, '0.9' => 0.9, '1.0' => 1.0);
49
-
50
- /**
51
- * Other properties
52
- */
53
- var $post_types, $taxonomies, $terms, $cache_time, $module_data, $output, $output_num = 0, $num_log = 25;
54
- var $templates = array(), $module_map = array();
55
- var $sitemap_alias = array(), $use_permalink = true, $query_var_non_perma = '';
56
- var $ping_per_day = 100, $timeout = 3;
57
- var $xslt = '', $xslt_index = '';
58
- // @since 1.0.1
59
- var $build_data = array('time', 'mem', 'query');
60
-
61
- /**
62
- * Constructor
63
- */
64
- function __construct($version = '1.1.5')
65
- {
66
- // Plugin's title
67
- $this->plugin_title = 'BWP Google XML Sitemaps';
68
- // Plugin's version
69
- $this->set_version($version);
70
- $this->set_version('3.0', 'wp');
71
- // Basic version checking
72
- if (!$this->check_required_versions())
73
- return;
74
-
75
- // Default options
76
- $options = array(
77
- 'enable_cache' => 'yes',
78
- 'enable_cache_auto_gen' => 'yes',
79
- 'enable_gzip' => '',
80
- 'enable_php_clean' => 'yes',
81
- 'enable_xslt' => 'yes',
82
- 'enable_sitemap_date' => '',
83
- 'enable_sitemap_taxonomy' => 'yes',
84
- 'enable_sitemap_external' => '',
85
- 'enable_sitemap_split_post' => 'yes',
86
- 'enable_sitemap_author' => '',
87
- 'enable_sitemap_site' => 'yes',
88
- 'enable_stats' => 'yes',
89
- 'enable_credit' => 'yes',
90
- 'enable_ping' => 'yes',
91
- 'enable_ping_google' => 'yes',
92
- 'enable_ping_yahoo' => 'yes',
93
- 'enable_ping_bing' => 'yes',
94
- 'enable_ping_ask' => '',
95
- 'enable_log' => 'yes',
96
- 'enable_debug' => '',
97
- 'enable_robots' => 'yes',
98
- 'enable_global_robots' => '',
99
- 'enable_gmt' => 'yes',
100
- 'input_exclude_post_type' => '',
101
- 'input_exclude_taxonomy' => 'post_tag',
102
- 'input_cache_age' => 1,
103
- 'input_item_limit' => 5000,
104
- 'input_split_limit_post' => 5000,
105
- 'input_alt_module_dir' => $this->uni_path_sep(ABSPATH),
106
- 'input_oldest' => 7,
107
- 'input_sql_limit' => 1000,
108
- 'input_custom_xslt' => '',
109
- 'select_output_type' => 'concise',
110
- 'select_time_type' => 3600,
111
- 'select_oldest_type' => 16400,
112
- 'select_default_freq' => 'daily',
113
- 'select_default_pri' => 1.0,
114
- 'select_min_pri' => 0.1,
115
- 'input_cache_dir' => '',
116
- 'input_ping' => array(
117
- 'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap=%s',
118
- 'yahoo' => 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=%s',
119
- 'bing' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=%s',
120
- 'ask' => 'http://submissions.ask.com/ping?sitemap=%s'),
121
- 'input_sitemap_url' => '',
122
- 'input_sitemap_struct' => ''
123
- );
124
- // Super admin only options
125
- $this->site_options = array('enable_robots', 'enable_global_robots', 'enable_log', 'enable_debug', 'enable_ping', 'enable_ping_google', 'enable_ping_yahoo', 'enable_ping_bing', 'enable_ping_ask', 'enable_gzip', 'enable_php_clean', 'enable_cache', 'enable_cache_auto_gen', 'input_cache_age', 'input_alt_module_dir', 'input_sql_limit', 'input_cache_dir', 'select_time_type');
126
-
127
- $this->build_properties('BWP_GXS', 'bwp-simple-gxs', $options, 'BWP Google XML Sitemaps', dirname(dirname(__FILE__)) . '/bwp-simple-gxs.php', 'http://betterwp.net/wordpress-plugins/google-xml-sitemaps/', false);
128
-
129
- $this->add_option_key('BWP_GXS_STATS', 'bwp_gxs_stats', __('Sitemap Statistics', 'bwp-simple-gxs'));
130
- $this->add_option_key('BWP_GXS_OPTION_GENERATOR', 'bwp_gxs_generator', __('Sitemap Generator', 'bwp-simple-gxs'));
131
-
132
- define('BWP_GXS_LOG', 'bwp_gxs_log');
133
- define('BWP_GXS_PING', 'bwp_gxs_ping_data');
134
-
135
- $this->init();
136
- }
137
-
138
- function init_properties()
139
- {
140
- $this->module_directory = plugin_dir_path($this->plugin_file) . 'includes/modules/';
141
-
142
- $this->templates = array(
143
- 'sitemap' => "\n\t" . '<sitemap>' . "\n\t\t" . '<loc>%s</loc>%s' . "\n\t" . '</sitemap>',
144
- 'url' => "\n\t" . '<url>' . "\n\t\t" . '<loc>%1$s</loc>%2$s%3$s%4$s' . "\n\t" . '</url>',
145
- 'lastmod' => "\n\t\t" . '<lastmod>%s</lastmod>',
146
- 'changefreq' => "\n\t\t" . '<changefreq>%s</changefreq>',
147
- 'priority' => "\n\t\t" . '<priority>%.1f</priority>',
148
- 'xslt_style' => '',
149
- 'stats' => "\n" . '<!-- ' . __('This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed', 'bwp-simple-gxs') . ' -->'
150
- /*'stats_cached' => "\n" . '<!-- ' . __('Served from cache in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed', 'bwp-simple-gxs') . ' -->'*/
151
- );
152
-
153
- $this->init_gzip();
154
-
155
- $this->cache_time = (int) $this->options['input_cache_age'] * (int) $this->options['select_time_type'];
156
- $this->oldest_time = (int) $this->options['input_oldest'] * (int) $this->options['select_oldest_type'];
157
- $this->options['input_cache_dir'] = plugin_dir_path($this->plugin_file) . 'cache/';
158
- $this->options['input_cache_dir'] = $this->uni_path_sep($this->options['input_cache_dir']);
159
-
160
- $module_map = apply_filters('bwp_gxs_module_mapping', array());
161
- $this->module_map = wp_parse_args($module_map, array('post_format' => 'post_tag'));
162
-
163
- // Logs
164
- $this->logs = get_option(BWP_GXS_LOG);
165
- if (!$this->logs)
166
- $this->logs = array('log' => array(), 'sitemap' => array());
167
- foreach ($this->logs as $key => $log)
168
- if (is_array($log) && $this->num_log < sizeof($log))
169
- {
170
- $log = array_slice($log, (-1) * $this->num_log);
171
- $this->logs[$key] = $log;
172
- }
173
-
174
- // Sitemap based on permastruct
175
- $permalink = get_option('permalink_structure');
176
- if (!$permalink)
177
- {
178
- $this->use_permalink = false;
179
- $this->query_var_non_perma = apply_filters('bwp_gxs_query_var_non_perma', 'bwpsitemap');
180
- $this->options['input_sitemap_url'] = home_url() . '/?' . $this->query_var_non_perma . '=sitemapindex';
181
- $this->options['input_sitemap_struct'] = home_url() . '/?' . $this->query_var_non_perma . '=%s';
182
- }
183
- else
184
- {
185
- // If user is using index.php in their permalink structure, we will have to include it also
186
- $indexphp = (strpos($permalink, 'index.php') === false) ? '' : '/index.php';
187
- $this->options['input_sitemap_url'] = home_url() . $indexphp . '/sitemapindex.xml';
188
- $this->options['input_sitemap_struct'] = home_url() . $indexphp . '/%s.xml';
189
- }
190
-
191
- // No more than 50000 URLs per sitemap
192
- if (50000 < (int) $this->options['input_item_limit'])
193
- $this->options['input_item_limit'] = 50000;
194
-
195
- // Limit per split sitemap - @since 1.1.0
196
- // Not higher than 50000 URLs and must be >= SQL cycling limit
197
- if ($this->options['input_split_limit_post'] < $this->options['input_sql_limit'])
198
- $this->options['input_split_limit_post'] = $this->options['input_sql_limit'];
199
- if (50000 < (int) $this->options['input_split_limit_post'])
200
- $this->options['input_split_limit_post'] = 50000;
201
-
202
- // XSLT style sheet
203
- if ('yes' == $this->options['enable_xslt'])
204
- {
205
- // If the host the user is using is different from what we get from 'home' option, we need to use the host
206
- // so user won't see a style sheet error, which is most of the time mistaken as broken sitemaps - @since 1.1.0
207
- $user_host = strtolower($_SERVER['HTTP_HOST']);
208
- $blog_home = @parse_url(home_url());
209
- $blog_host = strtolower($blog_home['host']);
210
- $this->xslt = (!empty($this->options['input_custom_xslt'])) ? $this->options['input_custom_xslt'] : plugin_dir_url($this->plugin_file) . 'xsl/bwp-sitemap.xsl';
211
- $this->xslt = ($user_host == $blog_host) ? $this->xslt : str_replace($blog_host, $user_host, $this->xslt);
212
- add_action('init', array($this, 'late_init'), 99999);
213
- }
214
-
215
- // Some stats
216
- $this->build_stats['mem'] = memory_get_usage();
217
- }
218
-
219
- function late_init()
220
- {
221
- $this->xslt = apply_filters('bwp_gxs_xslt', $this->xslt);
222
- $this->xslt_index = (empty($this->xslt)) ? '' : str_replace('.xsl', 'index.xsl', $this->xslt);
223
- // Update from 1.1.4 to 1.1.5
224
- /*$db_options = get_option(BWP_GXS_OPTION_GENERATOR);
225
- if (!isset($db_options['enable_sitemap_site']))
226
- self::flush_rewrite_rules();*/
227
- }
228
-
229
- function enqueue_media()
230
- {
231
- if (is_admin())
232
- wp_enqueue_style('bwp-gxs-admin', BWP_GXS_CSS . '/bwp-simple-gxs.css');
233
- }
234
-
235
- function insert_query_vars($vars)
236
- {
237
- if (!$this->use_permalink)
238
- array_push($vars, $this->query_var_non_perma);
239
- else
240
- {
241
- array_push($vars, 'gxs_module');
242
- array_push($vars, 'gxs_sub_module');
243
- }
244
- return $vars;
245
- }
246
-
247
- function insert_rewrite_rules($rules)
248
- {
249
- // More compatible with blogs that are set up with sitemap.xml - @since 1.0.1
250
- $rewrite_rules = array(
251
- 'sitemap\.xml$' => 'index.php?gxs_module=sitemapindex',
252
- 'sitemapindex\.xml$' => 'index.php?gxs_module=sitemapindex',
253
- 'site\.xml$' => 'index.php?gxs_module=site',
254
- 'page\.xml$' => 'index.php?gxs_module=page',
255
- 'post\.xml$' => 'index.php?gxs_module=post',
256
- 'author\.xml$' => 'index.php?gxs_module=author',
257
- '([a-z0-9]+)_([a-z0-9_-]+)\.xml$' => 'index.php?gxs_module=$matches[1]&gxs_sub_module=$matches[2]'
258
- );
259
- // @since 1.0.3
260
- $custom_rules = apply_filters('bwp_gxs_rewrite_rules', array());
261
- $rules = array_merge($custom_rules, $rewrite_rules, $rules);
262
- return $rules;
263
- }
264
-
265
- private static function flush_rewrite_rules()
266
- {
267
- global $wp_rewrite;
268
- $wp_rewrite->flush_rules();
269
- }
270
-
271
- function add_hooks()
272
- {
273
- add_filter('rewrite_rules_array', array($this, 'insert_rewrite_rules'));
274
- add_filter('query_vars', array($this, 'insert_query_vars'));
275
- add_action('parse_request', array($this, 'request_sitemap'));
276
- if ('yes' == $this->options['enable_ping'])
277
- {
278
- add_action('draft_to_publish', array($this, 'ping'), 1000);
279
- add_action('new_to_publish', array($this, 'ping'), 1000);
280
- add_action('pending_to_publish', array($this, 'ping'), 1000);
281
- add_action('future_to_publish', array($this, 'ping'), 1000);
282
- }
283
- if ('yes' == $this->options['enable_robots'])
284
- {
285
- add_filter('robots_txt', array($this, 'do_robots'), 1000, 2);
286
- }
287
- }
288
-
289
- function install()
290
- {
291
- global $wp_rewrite;
292
- $wp_rewrite->flush_rules();
293
- }
294
-
295
- function uninstall()
296
- {
297
- global $wp_rewrite;
298
- $this->logs = array('log' => array(), 'sitemap' => array());
299
- $this->commit_logs();
300
- $wp_rewrite->flush_rules();
301
- }
302
-
303
- /**
304
- * Build the Menus
305
- */
306
- function build_menus()
307
- {
308
- add_menu_page(__('BWP Google XML Sitemaps', 'bwp-simple-gxs'), 'BWP GXS', BWP_GXS_CAPABILITY, BWP_GXS_STATS, array($this, 'build_option_pages'), BWP_GXS_IMAGES . '/icon_menu.png');
309
- // Sub menus
310
- add_submenu_page(BWP_GXS_STATS, __('BWP Google XML Sitemaps Statistics', 'bwp-simple-gxs'), __('Sitemap Statistics', 'bwp-simple-gxs'), BWP_GXS_CAPABILITY, BWP_GXS_STATS, array($this, 'build_option_pages'));
311
- add_submenu_page(BWP_GXS_STATS, __('BWP Google XML Sitemaps Generator', 'bwp-simple-gxs'), __('Sitemap Generator', 'bwp-simple-gxs'), BWP_GXS_CAPABILITY, BWP_GXS_OPTION_GENERATOR, array($this, 'build_option_pages'));
312
- }
313
-
314
- /**
315
- * Build the option pages
316
- *
317
- * Utilizes BWP Option Page Builder (@see BWP_OPTION_PAGE)
318
- */
319
- function build_option_pages()
320
- {
321
- if (!current_user_can(BWP_GXS_CAPABILITY))
322
- wp_die(__('You do not have sufficient permissions to access this page.'));
323
-
324
- // Init the class
325
- $page = $_GET['page'];
326
- $bwp_option_page = new BWP_OPTION_PAGE($page, $this->site_options);
327
-
328
- $options = array();
329
- $dynamic_options = array();
330
-
331
- if (!empty($page))
332
- {
333
- if ($page == BWP_GXS_STATS)
334
- {
335
- $bwp_option_page->set_current_tab(1);
336
-
337
- // Clear logs = @since 1.1.0
338
- if (isset($_POST['clear_log']) && !$this->is_normal_admin())
339
- {
340
- check_admin_referer($page);
341
- $this->logs = array('log' => array(), 'sitemap' => array());
342
- $this->commit_logs();
343
- $this->add_notice('<strong>' . __('Notice', 'bwp-simple-gxs') . ':</strong> ' . __("All logs have been cleared successfully!", 'bwp-simple-gxs'));
344
- }
345
-
346
- $form = array(
347
- 'items' => array('heading', 'heading', 'heading', 'heading', 'checkbox', 'section', 'heading', 'checkbox', 'checkbox'),
348
- 'item_labels' => array
349
- (
350
- __('What are Sitemaps?', 'bwp-simple-gxs'),
351
- __('Your sitemaps', 'bwp-simple-gxs'),
352
- __('Submit your sitemaps', 'bwp-simple-gxs'),
353
- __('Pinging search engines', 'bwp-simple-gxs'),
354
- __('Enable pinging functionality?', 'bwp-simple-gxs'),
355
- __('Enable pinging individual SE', 'bwp-simple-gxs'),
356
- __('Sitemap Generator\'s Log', 'bwp-simple-gxs'),
357
- __('Enable logging?', 'bwp-simple-gxs'),
358
- __('Enable debugging?', 'bwp-simple-gxs')
359
- ),
360
- 'item_names' => array('h1', 'h2', 'h4', 'h5', 'cb1', 'sec1', 'h3', 'cb2', 'cb3'),
361
- 'sec1' => array(
362
- array('checkbox', 'name' => 'cb4'),
363
- array('checkbox', 'name' => 'cb5'),
364
- array('checkbox', 'name' => 'cb6'),
365
- array('checkbox', 'name' => 'cb7')
366
- ),
367
- 'heading' => array(
368
- 'h1' => __('In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; <em>http://www.sitemaps.org/</em>', 'bwp-simple-gxs') . '<br /><br />' . __('This plugin helps you generate both Sitemap Index files as well as normal Sitemap files. A Sitemap Index, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemap files inside it.', 'bwp-simple-gxs'),
369
- 'h2' => __('<em>Basic information about all your sitemaps.</em>', 'bwp-simple-gxs'),
370
- 'h3' => __('<em>More detailed information about how your sitemaps are generated including <span style="color: #999999;">notices</span>, <span style="color: #FF0000;">errors</span> and <span style="color: #009900;">success messages</span>.</em>', 'bwp-simple-gxs'),
371
- 'h4' => sprintf(__('<em>Submit your sitemapindex to major search engines like <a href="%s" target="_blank">Google</a>, <a href="%s" target="_blank">Yahoo</a>, <a href="%s" target="_blank">Bing</a> or <a href="%s" target="_blank">Ask</a>.</em>', 'bwp-simple-gxs'), 'https://www.google.com/webmasters/tools/home?hl=en', 'https://siteexplorer.search.yahoo.com/mysites', 'http://www.bing.com/toolbox/webmasters/', 'http://about.ask.com/en/docs/about/webmasters.shtml#22'),
372
- 'h5' => __('<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>', 'bwp-simple-gxs')
373
- ),
374
- 'input' => array(
375
- ),
376
- 'checkbox' => array(
377
- 'cb1' => array(__('Selected SE below will be pinged when you publish new posts.', 'bwp-simple-gxs') => 'enable_ping'),
378
- 'cb2' => array(__('No additional load is needed so enabling this is recommended.', 'bwp-simple-gxs') => 'enable_log'),
379
- 'cb3' => array(__('Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules.', 'bwp-simple-gxs') => 'enable_debug'),
380
- 'cb4' => array(__('Google', 'bwp-simple-gxs') => 'enable_ping_google'),
381
- 'cb5' => array(sprintf(__('Yahoo &mdash; <a href="%s" target="_blank">important</a>', 'bwp-simple-gxs'), 'http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes/') => 'enable_ping_yahoo'),
382
- 'cb6' => array(__('Bing', 'bwp-simple-gxs') => 'enable_ping_bing'),
383
- 'cb7' => array(__('Ask.com', 'bwp-simple-gxs') => 'enable_ping_ask')
384
- ),
385
- 'container' => array(
386
- 'h4' => sprintf(__('After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href="%s">How-to</a> if you are interested.', 'bwp-simple-gxs'), 'http://help.yahoo.com/l/us/yahoo/smallbusiness/store/promote/sitemap/sitemap-06.html'),
387
- 'h3' => $this->get_logs(),
388
- 'h2' => $this->get_logs(true)
389
- )
390
- );
391
-
392
- // Add a clear log button - @since 1.1.0
393
- if (!$this->is_normal_admin())
394
- add_filter('bwp_option_submit_button', array($this, 'add_clear_log_button'));
395
-
396
- // Get the options
397
- $options = $bwp_option_page->get_options(array('enable_ping', 'enable_ping_google', 'enable_ping_yahoo', 'enable_ping_bing', 'enable_ping_ask', 'enable_log', 'enable_debug'), $this->options);
398
-
399
- // Get option from the database
400
- $options = $bwp_option_page->get_db_options($page, $options);
401
- $option_ignore = array('input_update_services');
402
- $option_formats = array();
403
- // [WPMS Compatible]
404
- $option_super_admin = $this->site_options;
405
- }
406
- else if ($page == BWP_GXS_OPTION_GENERATOR)
407
- {
408
- $bwp_option_page->set_current_tab(2);
409
-
410
- $form = array(
411
- 'items' => array('input', 'select', 'select', 'select', 'checkbox', 'checkbox', 'input', 'checkbox', 'checkbox', 'checkbox', 'checkbox', 'heading', 'checkbox', 'checkbox', 'checkbox', 'section', 'section', 'section', 'heading', 'input', 'input', 'heading', 'checkbox', 'checkbox', 'input', 'input'),
412
- 'item_labels' => array
413
- (
414
- __('Output no more than', 'bwp-simple-gxs'),
415
- __('Default change frequency', 'bwp-simple-gxs'),
416
- __('Default priority', 'bwp-simple-gxs'),
417
- __('Minimum priority', 'bwp-simple-gxs'),
418
- __('Use GMT for Last Modified date?', 'bwp-simple-gxs'),
419
- __('Style your sitemaps with an XSLT stylesheet?', 'bwp-simple-gxs'),
420
- __('Custom XSLT stylesheet URL', 'bwp-simple-gxs'),
421
- __('Show build stats in sitemaps?', 'bwp-simple-gxs'),
422
- __('Enable credit?', 'bwp-simple-gxs'),
423
- __('Enable Gzip?', 'bwp-simple-gxs'),
424
- __('Clean unexpected output before sitemap generation?', 'bwp-simple-gxs'),
425
- __('Sitemap Index Options', 'bwp-simple-gxs'),
426
- __('Automatically split post-based sitemaps into smaller sitemaps?', 'bwp-simple-gxs'),
427
- __('Add sitemapindex to individual blog\'s virtual robots.txt?', 'bwp-simple-gxs'),
428
- __('Add sitemapindex from all blogs within network to primary blog\'s virtual robots.txt?', 'bwp-simple-gxs'),
429
- __('In sitemapindex, include', 'bwp-simple-gxs'),
430
- __('Exclude following post types:', 'bwp-simple-gxs'),
431
- __('Exclude following taxonomies:', 'bwp-simple-gxs'),
432
- __('Module Options', 'bwp-simple-gxs'),
433
- __('Alternate module directory', 'bwp-simple-gxs'),
434
- __('Get no more than', 'bwp-simple-gxs'),
435
- __('Caching Options', 'bwp-simple-gxs'),
436
- __('Enable caching?', 'bwp-simple-gxs'),
437
- __('Enable auto cache re-generation?', 'bwp-simple-gxs'),
438
- __('Cached sitemaps will last for', 'bwp-simple-gxs'),
439
- __('Cached sitemaps are stored in (auto detected)', 'bwp-simple-gxs')
440
- ),
441
- 'item_names' => array('input_item_limit', 'select_default_freq', 'select_default_pri', 'select_min_pri', 'cb14', 'cb10', 'input_custom_xslt', 'cb3', 'cb6', 'cb4', 'cb15', 'h5', 'cb12', 'cb11', 'cb5', 'sec1', 'sec2', 'sec3', 'h4', 'input_alt_module_dir', 'input_sql_limit', 'h3', 'cb1', 'cb2', 'input_cache_age', 'input_cache_dir'),
442
- 'heading' => array(
443
- 'h3' => __('<em>Cache your sitemaps for better performance.</em>', 'bwp-simple-gxs'),
444
- 'h4' => sprintf(__('<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href="%s#using-modules">here</a>.</em>', 'bwp-simple-gxs'), $this->plugin_url),
445
- 'h5' => __('<em>Here you can change some settings that affect the default Sitemap Index file.</em>', 'bwp-simple-gxs')
446
- ),
447
- 'sec1' => array(
448
- array('checkbox', 'name' => 'cb7'),
449
- //array('checkbox', 'name' => 'cb8'),
450
- array('checkbox', 'name' => 'cb9'),
451
- array('checkbox', 'name' => 'cb13'),
452
- array('checkbox', 'name' => 'cb16'),
453
- array('checkbox', 'name' => 'cb17')
454
- ),
455
- 'sec2' => array(),
456
- 'sec3' => array(),
457
- 'select' => array(
458
- 'select_time_type' => array(
459
- __('second(s)', 'bwp-simple-gxs') => 1,
460
- __('minute(s)', 'bwp-simple-gxs') => 60,
461
- __('hour(s)', 'bwp-simple-gxs') => 3600,
462
- __('day(s)', 'bwp-simple-gxs') => 86400
463
- ),
464
- 'select_oldest_type' => array(
465
- __('second(s)', 'bwp-simple-gxs') => 1,
466
- __('minute(s)', 'bwp-simple-gxs') => 60,
467
- __('hour(s)', 'bwp-simple-gxs') => 3600,
468
- __('day(s)', 'bwp-simple-gxs') => 86400
469
- ),
470
- 'select_default_freq' => array(),
471
- 'select_default_pri' => $this->priority,
472
- 'select_min_pri' => $this->priority
473
- ),
474
- 'post' => array(
475
- 'select_default_freq' => sprintf('<a href="%s" target="_blank">' . __('read more', 'bwp-simple-gxs') . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions'),
476
- 'select_default_pri' => sprintf('<a href="%s" target="_blank">' . __('read more', 'bwp-simple-gxs') . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions'),
477
- 'select_min_pri' => sprintf('<a href="%s" target="_blank">' . __('read more', 'bwp-simple-gxs') . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions')
478
- ),
479
- 'checkbox' => array(
480
- 'cb1' => array(__('your sitemaps are generated and then cached to reduce unnecessary work.', 'bwp-simple-gxs') => 'enable_cache'),
481
- 'cb2' => array(__('when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while.', 'bwp-simple-gxs') . ' <input type="submit" class="button-secondary action" name="flush_cache" value="' . __('Flush the cache', 'bwp-simple-gxs') . '" />' => 'enable_cache_auto_gen'),
482
- 'cb3' => array(__('tell you useful information such as build time, memory usage, SQL queries, etc.', 'bwp-simple-gxs') => 'enable_stats'),
483
- 'cb4' => array(__('make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an error after enabling this, it\'s very likely that you have gzip active on your server already.', 'bwp-simple-gxs') => 'enable_gzip'),
484
- 'cb15' => array(__('only disable this when sitemaps appear in either blank page or plain text.', 'bwp-simple-gxs') => 'enable_php_clean'),
485
- 'cb5' => array(sprintf(__("If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex.xml</code> entries will be added to your primary blog's robots.txt, i.e. <code>%s</code>.", 'bwp-simple-gxs'), get_site_option('home') . '/robots.txt') => 'enable_global_robots'),
486
- 'cb7' => array(__("taxonomy archives' sitemaps, including custom taxonomies.", 'bwp-simple-gxs') => 'enable_sitemap_taxonomy'),
487
- //'cb8' => array(__("tag archives' sitemap.", 'bwp-simple-gxs') => 'enable_sitemap_tag'),
488
- 'cb9' => array(__("date archives' sitemaps.", 'bwp-simple-gxs') => 'enable_sitemap_date'),
489
- 'cb13' => array(__("external pages' sitemap. This allows you to add links to pages that do not belong to WordPress to the sitemap.", 'bwp-simple-gxs') => 'enable_sitemap_external'),
490
- 'cb6' => array(__('some copyrighted info is also added to your sitemaps. Thanks!', 'bwp-simple-gxs') => 'enable_credit'),
491
- 'cb10' => array(__('This will load the default style sheet provided by this plugin. You can set a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook.', 'bwp-simple-gxs') => 'enable_xslt'),
492
- 'cb11' => array(sprintf(__('If you\'re on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href="%s#toc-robots" target="_blank">documentation</a> for more info.', 'bwp-simple-gxs'), $this->plugin_url) => 'enable_robots'),
493
- 'cb12' => array(__('e.g. post1.xml, post2.xml, etc. And each sitemap will contain', 'bwp-simple-gxs') => 'enable_sitemap_split_post'),
494
- 'cb14' => array(__('If you disable this, make sure you also use <code>date_default_timezone_set</code> to correctly set up a timezone for your application.', 'bwp-simple-gxs') => 'enable_gmt'),
495
- 'cb16' => array(__('author archives\' sitemap.', 'bwp-simple-gxs') => 'enable_sitemap_author'),
496
- 'cb17' => array(__('site\'s home URL sitemap. For a multi-site installation of WordPress, this sitemap will list all domains within your network, not just the main blog. This also supports WPMU Domain Mapping plugin.', 'bwp-simple-gxs') => 'enable_sitemap_site')
497
- ),
498
- 'input' => array(
499
- 'input_item_limit' => array('size' => 5, 'label' => __('item(s) in one sitemap. You can not go over 50,000.', 'bwp-simple-gxs')),
500
- 'input_split_limit_post' => array('size' => 5, 'label' => __('item(s). Again , you can not go over 50,000.', 'bwp-simple-gxs')),
501
- 'input_alt_module_dir' => array('size' => 91, 'label' => __('Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead.', 'bwp-simple-gxs')),
502
- 'input_cache_dir' => array('size' => 91, 'disabled' => ' disabled="disabled"', 'label' => __('The cache directory must be writable (i.e. CHMOD to 755 or 777).', 'bwp-simple-gxs')),
503
- 'input_sql_limit' => array('size' => 5, 'label' => __('item(s) in one SQL query. This helps you avoid running too heavy queries.', 'bwp-simple-gxs')),
504
- 'input_oldest' => array('size' => 3, 'label' => '&mdash;'),
505
- 'input_cache_age' => array('size' => 5, 'label' => '&mdash;'),
506
- 'input_custom_xslt' => array('size' => 90, 'label' => __('expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use.', 'bwp-simple-gxs'))
507
- ),
508
- 'inline_fields' => array(
509
- 'input_cache_age' => array('select_time_type' => 'select'),
510
- 'cb12' => array('input_split_limit_post' => 'input')
511
- ),
512
- 'container' => array(
513
- 'input_item_limit' => sprintf(__('<em><strong>Note:</strong> If you encounter white page problem, please refer to the <a target="_blank" href="%s">FAQ section</a> to know how to change this limit appropriately to make this plugin work. Also note that, for post-based sitemaps, this option will be overridden by the limit you set in the Sitemap Index Options below.</em>', 'bwp-simple-gxs'), $this->plugin_url . 'faq/')
514
- )
515
- );
516
-
517
- foreach ($this->frequency as $freq)
518
- $changefreq[ucfirst($freq)] = $freq;
519
- $form['select']['select_default_freq'] = $changefreq;
520
-
521
- // Get the options
522
- $options = $bwp_option_page->get_options(array('input_item_limit', 'input_split_limit_post', 'input_alt_module_dir', 'input_cache_dir', 'input_sql_limit', 'input_cache_age', 'input_custom_xslt', 'input_exclude_post_type', 'input_exclude_taxonomy', 'enable_gmt', 'enable_robots', 'enable_xslt', 'enable_cache', 'enable_cache_auto_gen', 'enable_stats', 'enable_credit', 'enable_sitemap_split_post', 'enable_global_robots', 'enable_sitemap_date', 'enable_sitemap_taxonomy', 'enable_sitemap_external', 'enable_sitemap_author', 'enable_sitemap_site', 'enable_gzip', 'enable_php_clean', 'select_time_type', 'select_default_freq', 'select_default_pri', 'select_min_pri'), $this->options);
523
-
524
- // Get option from the database
525
- $options = $bwp_option_page->get_db_options($page, $options);
526
-
527
- // Get dynamic options
528
- if (isset($_POST['submit_' . $bwp_option_page->get_form_name()]))
529
- {
530
- check_admin_referer($page);
531
- $ept = array(); $etax = array();
532
- foreach ($_POST as $o => $v)
533
- {
534
- if (strpos($o, 'ept_') === 0)
535
- $ept[] = trim(str_replace('ept_', '', $o));
536
- else if (strpos($o, 'etax_') === 0)
537
- $etax[] = trim(str_replace('etax_', '', $o));
538
- }
539
- $options['input_exclude_post_type'] = implode(',', $ept);
540
- $options['input_exclude_taxonomy'] = implode(',', $etax);
541
- }
542
-
543
- // Build dynamic options
544
- $post_types = get_post_types(array('public' => true), 'objects');
545
- $taxonomies = get_taxonomies(array('public' => true), '');
546
- $exclude_options = array(
547
- 'post_types' => explode(',', $options['input_exclude_post_type']),
548
- 'taxonomies' => explode(',', $options['input_exclude_taxonomy'])
549
- );
550
- $dynamic_options = array();
551
- foreach ($post_types as $post_type)
552
- {
553
- if ('attachment' == $post_type->name)
554
- continue;
555
- $key = 'ept_' . $post_type->name;
556
- $form['sec2'][] = array('checkbox', 'name' => $key);
557
- $form['checkbox'][$key] = array(__($post_type->label) => $key);
558
- if (in_array($post_type->name, $exclude_options['post_types']))
559
- $dynamic_options[$key] = 'yes';
560
- else
561
- $dynamic_options[$key] = '';
562
- }
563
- foreach ($taxonomies as $taxonomy)
564
- {
565
- if ('post_format' == $taxonomy->name)
566
- continue;
567
- $key = 'etax_' . $taxonomy->name;
568
- $form['sec3'][] = array('checkbox', 'name' => $key);
569
- $form['checkbox'][$key] = array(__($taxonomy->label) => $key);
570
- if (in_array($taxonomy->name, $exclude_options['taxonomies']))
571
- $dynamic_options[$key] = 'yes';
572
- else
573
- $dynamic_options[$key] = '';
574
- }
575
-
576
- $option_formats = array('input_item_limit' => 'int', 'input_split_limit_post' => 'int', 'input_sql_limit' => 'int', 'input_cache_age' => 'int', 'select_time_type' => 'int');
577
- $option_ignore = array('input_cache_dir', 'input_exclude_post_type', 'input_exclude_taxonomy');
578
- // [WPMS Compatible]
579
- $option_super_admin = $this->site_options;
580
- }
581
- }
582
- // Flush the cache
583
- if (isset($_POST['flush_cache']) && !$this->is_normal_admin())
584
- {
585
- check_admin_referer($page);
586
- if ($deleted = $this->flush_cache())
587
- $this->add_notice('<strong>' . __('Notice', 'bwp-simple-gxs') . ':</strong> ' . sprintf(__("<strong>%d</strong> cached sitemaps have been flushed successfully!", 'bwp-simple-gxs'), $deleted));
588
- else
589
- $this->add_notice('<strong>' . __('Notice', 'bwp-simple-gxs') . ':</strong> ' . __("Could not delete any cached sitemaps. Please manually check the cache directory.", 'bwp-simple-gxs'));
590
- }
591
-
592
- // Get option from user input
593
- if (isset($_POST['submit_' . $bwp_option_page->get_form_name()]) && isset($options) && is_array($options))
594
- {
595
- check_admin_referer($page);
596
- $need_flushed = false;
597
- foreach ($options as $key => &$option)
598
- {
599
- $pre_option = $option;
600
- // Get rid of options that do not have a key
601
- if (preg_match('/^[0-9]+$/i', $key))
602
- {
603
- unset($options[$key]);
604
- continue;
605
- }
606
- // [WPMS Compatible]
607
- if ($this->is_normal_admin() && in_array($key, $option_super_admin))
608
- {}
609
- else if (in_array($key, $option_ignore))
610
- {}
611
- else
612
- {
613
- if (isset($_POST[$key]))
614
- $bwp_option_page->format_field($key, $option_formats);
615
- if (!isset($_POST[$key]))
616
- $option = '';
617
- else if (isset($option_formats[$key]) && 0 == $_POST[$key] && 'int' == $option_formats[$key])
618
- $option = 0;
619
- else if (isset($option_formats[$key]) && empty($_POST[$key]) && 'int' == $option_formats[$key])
620
- $option = $this->options_default[$key];
621
- else if (!empty($_POST[$key]))
622
- $option = trim(stripslashes($_POST[$key]));
623
- else
624
- $option = $this->options_default[$key];
625
- // Mark that we need to flush rewrite rules
626
- if (false !== strpos($key, 'enable_sitemap_') && $pre_option != $option)
627
- $need_flushed = true;
628
- }
629
- }
630
- update_option($page, $options);
631
- // Flush rewrite rules if needed
632
- if ($need_flushed)
633
- self::flush_rewrite_rules();
634
- // [WPMS Compatible]
635
- if (!$this->is_normal_admin())
636
- update_site_option($page, $options);
637
- }
638
-
639
- // [WPMS Compatible]
640
- if (!$this->is_multisite() && $page == BWP_GXS_OPTION_GENERATOR)
641
- $bwp_option_page->kill_html_fields($form, array(14));
642
- if ($this->is_normal_admin())
643
- {
644
- switch ($page)
645
- {
646
- case BWP_GXS_OPTION_GENERATOR:
647
- $bwp_option_page->kill_html_fields($form, array(9,10,13,14,18,19,20,21,22,23,24,25));
648
- break;
649
-
650
- case BWP_GXS_STATS:
651
- $bwp_option_page->kill_html_fields($form, array(3,4,5,6,7,8));
652
- add_filter('bwp_option_submit_button', create_function('', 'return "";'));
653
- break;
654
- }
655
- }
656
-
657
- if (!@file_exists($this->options['input_cache_dir']) || !@is_writable($this->options['input_cache_dir']))
658
- $this->add_notice('<strong>' . __('Warning') . ':</strong> ' . __("Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix).", 'bwp-simple-gxs'));
659
-
660
- // Assign the form and option array
661
- $bwp_option_page->init($form, $options + $dynamic_options, $this->form_tabs);
662
-
663
- // Build the option page
664
- echo $bwp_option_page->generate_html_form();
665
- }
666
-
667
- function add_clear_log_button($button)
668
- {
669
- $button = str_replace('</p>', ' <input type="submit" class="button-secondary action" name="clear_log" value="' . __('Clear All Logs', 'bwp-simple-gxs') . '" /></p>', $button);
670
- return $button;
671
- }
672
-
673
- function flush_cache()
674
- {
675
- $dir = trailingslashit($this->options['input_cache_dir']);
676
- $deleted = 0;
677
- if (is_dir($dir))
678
- {
679
- if ($dh = opendir($dir))
680
- {
681
- while (($file = readdir($dh)) !== false)
682
- {
683
- if (preg_match('/^gxs_[a-z0-9]+\.(xml|xml\.gz)$/i', $file))
684
- {
685
- @unlink($dir . $file);
686
- $deleted++;
687
- }
688
- }
689
- closedir($dh);
690
- }
691
- }
692
- return $deleted;
693
- }
694
-
695
- function get_options()
696
- {
697
- return $this->options;
698
- }
699
-
700
- function get_current_time()
701
- {
702
- return current_time('timestamp');
703
- }
704
-
705
- function format_header_time($time)
706
- {
707
- return gmdate('D, d M Y H:i:s \G\M\T', (int) $time);
708
- }
709
-
710
- function uni_path_sep($path = '')
711
- {
712
- return str_replace('\\', '/', $path);
713
- }
714
-
715
- function commit_logs()
716
- {
717
- update_option(BWP_GXS_LOG, $this->logs);
718
- }
719
-
720
- function do_log($message, $error = true, $sitemap = false)
721
- {
722
- $time = $this->get_current_time();
723
- $debug = ('yes' == $this->options['enable_debug']) ? __('(Debug is on)', 'bwp-simple-gxs') : '';
724
- if (!$sitemap && 'yes' == $this->options['enable_log'] && !empty($message))
725
- $this->logs['log'][] = array('log' => $message . ' ' . $debug, 'time' => $time, 'error' => $error);
726
- else if (!is_bool($sitemap))
727
- $this->logs['sitemap'][$sitemap] = array('time' => $time, 'url' => $sitemap);
728
- }
729
-
730
- function elog($message, $die = false, $errorCode = 503)
731
- {
732
- $this->do_log($message);
733
- if (true == $die && true == $this->debug)
734
- {
735
- $this->commit_logs();
736
- wp_die(__('<strong>BWP Google XML Sitemaps Error:</strong> ', 'bwp-simple-gxs') . $message, __('BWP Google XML Sitemaps Error', 'bwp-simple-gxs'), array('response' => $errorCode));
737
- }
738
- }
739
-
740
- function slog($message)
741
- {
742
- $this->do_log($message, false);
743
- }
744
-
745
- function nlog($message)
746
- {
747
- $this->do_log($message, 'notice');
748
- }
749
-
750
- function smlog($url)
751
- {
752
- $this->do_log('', false, $url);
753
- }
754
-
755
- function get_logs($sitemap = false)
756
- {
757
- $logs = (!$sitemap) ? $this->logs['log'] : $this->logs['sitemap'];
758
- if (!$logs || !is_array($logs) || 0 == sizeof($logs))
759
- return ($sitemap) ? sprintf(__('Nothing here... yet! Try submitting your <a href="%s">sitemapindex</a> first!', 'bwp-simple-gxs'), $this->options['input_sitemap_url']) : __('No log yet!', 'bwp-simple-gxs');
760
- if (!$sitemap)
761
- krsort($logs);
762
- else
763
- {
764
- $log_time = array();
765
- foreach ($logs as $key => $row)
766
- $log_time[$key] = $row['time'];
767
- array_multisort($log_time, SORT_DESC, $logs);
768
- }
769
- $log_str = (!$sitemap) ? '<li class="clear" style="margin-top: 5px; line-height: 1.7;"><span style="float: left; margin-right: 5px;">%s &mdash;</span> <span style="color: #%s;">%s</span></li>' : '<span style="margin-top: 5px; display: inline-block;">' . __('<a href="%s" target="_blank">%s</a> has been successfully built on <strong>%s</strong>.', 'bwp-simple-gxs') . '</span><br />';
770
- $output = '<ul class="bwp-gxs-log">' . "\n";
771
- foreach ($logs as $log)
772
- {
773
- if (isset($log['error']))
774
- {
775
- $color = (!is_bool($log['error']) && 'notice' == $log['error']) ? '999999' : '';
776
- if ('' == $color)
777
- $color = (!$log['error']) ? '009900' : 'FF0000';
778
- /* translators: date format, see http://php.net/date */
779
- $output .= sprintf($log_str, date(__('M j, Y : H:i:s', 'bwp-simple-gxs'), $log['time']), $color, $log['log']) . "\n";
780
- }
781
- else
782
- {
783
- // @since 1.1.5 - check for mapped domain
784
- global $wpdb, $blog_id;
785
- if (!empty($wpdb->dmtable) && !empty($wpdb->blogs) && $this->is_multisite())
786
- {
787
- $mapped_domain = $wpdb->get_var($wpdb->prepare('
788
- SELECT wpdm.domain as mapped_domain FROM ' . $wpdb->blogs . ' wpblogs
789
- INNER JOIN ' . $wpdb->dmtable . ' wpdm
790
- ON wpblogs.blog_id = wpdm.blog_id
791
- WHERE wpblogs.public = 1 AND wpblogs.spam = 0 AND wpblogs.deleted = 0 AND wpblogs.blog_id = %d', $blog_id));
792
- }
793
- // Default to the main site's scheme
794
- $home = @parse_url(home_url());
795
- $sitemap_struct = (!empty($mapped_domain)) ? str_replace($home['host'], str_replace(array('http', 'https'), '', $mapped_domain), $this->options['input_sitemap_struct']) : $this->options['input_sitemap_struct'];
796
- $output .= sprintf($log_str, sprintf($sitemap_struct, $log['url']), $log['url'], date(__('M j, Y : H:i:s', 'bwp-simple-gxs'), $log['time'])) . "\n";
797
- }
798
- }
799
-
800
- return $output . '</ul>' . "\n";
801
- }
802
-
803
- function format_label($label)
804
- {
805
- return str_replace(' ', '_', strtolower($label));
806
- }
807
-
808
- function do_robots($output, $public)
809
- {
810
- global $blog_id, $wpdb;
811
-
812
- if ('0' == $public)
813
- return $output;
814
-
815
- if ((defined('SUBDOMAIN_INSTALL') && true == SUBDOMAIN_INSTALL) || (isset($blog_id) && 1 == $blog_id))
816
- {
817
- $output .= "\n";
818
- $output .= 'Sitemap: ' . $this->options['input_sitemap_url'];
819
- $output .= "\n";
820
- }
821
- // Add all other sitemapindex within the network into the primary blog's robots.txt
822
- if ($this->is_multisite() && 'yes' == $this->options['enable_global_robots'] && isset($blog_id) && 1 == $blog_id)
823
- {
824
- $blogs = $wpdb->get_results("SELECT * FROM $wpdb->blogs WHERE public = 1 AND spam = 0 AND deleted = 0");
825
- foreach ($blogs as $blog)
826
- {
827
- if (1 == $blog->blog_id)
828
- continue;
829
- $scheme = is_ssl() ? 'https://' : 'http://';
830
- $path = rtrim($blog->path, '/');
831
- $output .= 'Sitemap: ' . str_replace(home_url(), $scheme . $blog->domain . $path, $this->options['input_sitemap_url']) . "\n";
832
- }
833
- $output .= "\n";
834
- }
835
- return $output;
836
- }
837
-
838
- /**
839
- * Redirect to correct domain
840
- *
841
- * This plugin generates sitemaps dynamically and exits before WordPress does any canonical redirection.
842
- * This function makes sure non-www domain is redirected and vice versa.
843
- * @since 1.0.1
844
- */
845
- function canonical_redirect($xml_slug)
846
- {
847
- $requested_url = is_ssl() ? 'https://' : 'http://';
848
- $requested_url .= $_SERVER['HTTP_HOST'];
849
- $requested_url .= $_SERVER['REQUEST_URI'];
850
- $original = @parse_url($requested_url);
851
- if (false === $original)
852
- return;
853
- // www.example.com vs example.com
854
- $user_home = @parse_url(home_url());
855
- if (!empty($user_home['host']))
856
- $host = $user_home['host'];
857
- if (strtolower($original['host']) == strtolower($host) ||
858
- (strtolower($original['host']) != 'www.' . strtolower($host) && 'www.' . strtolower($original['host']) != strtolower($host)))
859
- $host = $original['host'];
860
- else
861
- {
862
- wp_redirect(sprintf($this->options['input_sitemap_struct'], $xml_slug), 301);
863
- exit;
864
- }
865
- }
866
-
867
- /**
868
- * A convenient function to add wanted modules or sub modules
869
- *
870
- * When you filter the 'bwp_gxs_modules' hook it is recommended that you use this function.
871
- */
872
- function add_module($module = '', $sub_module = '')
873
- {
874
- if (empty($module))
875
- return false;
876
- // Make sure the names are well-formed
877
- $module = preg_replace('/[^a-z0-9-_\s]/ui', '', $module);
878
- $module = trim(str_replace(' ', '_', $module));
879
- $sub_module = preg_replace('/[^a-z0-9-_\s]/ui', '', $sub_module);
880
- $sub_module = trim(str_replace(' ', '_', $sub_module));
881
- if (empty($sub_module))
882
- $this->allowed_modules[$module] = array();
883
- if (!isset($this->allowed_modules[$module]) || !is_array($this->allowed_modules[$module]))
884
- $this->allowed_modules[$module] = array($sub_module);
885
- else if (!in_array($sub_module, $this->allowed_modules[$module]))
886
- $this->allowed_modules[$module][] = $sub_module;
887
- }
888
-
889
- /**
890
- * A convenient function to remove unwanted modules or sub modules
891
- *
892
- * When you filter the 'bwp_gxs_modules' hook it is recommended that you use this function.
893
- */
894
- function remove_module($module = '', $sub_module = '')
895
- {
896
- if (empty($module) || !isset($this->allowed_modules[$module]))
897
- return false;
898
- if (empty($sub_module))
899
- unset($this->allowed_modules[$module]);
900
- else
901
- {
902
- $module = trim($module);
903
- $sub_module = trim($sub_module);
904
- $temp = $this->allowed_modules[$module];
905
- foreach ($temp as $key => $subm)
906
- if ($sub_module == $subm)
907
- {
908
- unset($this->allowed_modules[$module][$key]);
909
- return false;
910
- }
911
- }
912
- }
913
-
914
- function allowed_modules()
915
- {
916
- $allowed_modules = array();
917
- $this->allowed_modules = &$allowed_modules;
918
- // Site home URL sitemap - @since 1.1.5
919
- if ('yes' == $this->options['enable_sitemap_site'])
920
- $this->add_module('site');
921
- // Module exclusion list
922
- $excluded_post_types = explode(',', $this->options['input_exclude_post_type']);
923
- $excluded_taxonomies = explode(',', $this->options['input_exclude_taxonomy']);
924
- // Add public post types to module list
925
- $post_types = $this->post_types = get_post_types(array('public' => true), 'objects');
926
- foreach ($this->post_types as $post_type)
927
- {
928
- // Page will have its own
929
- if ('page' != $post_type->name && !in_array($post_type->name, $excluded_post_types))
930
- $allowed_modules['post'][] = $post_type->name;
931
- }
932
- // Add pages to module list
933
- if (!in_array('page', $excluded_post_types))
934
- $allowed_modules['page'] = array('page');
935
- // Add archive pages to module list
936
- if ('yes' == $this->options['enable_sitemap_date'])
937
- $allowed_modules['archive'] = array('monthly', 'yearly');
938
- // Add taxonomies to module list
939
- $this->taxonomies = get_taxonomies(array('public' => true), '');
940
- if ('yes' == $this->options['enable_sitemap_taxonomy'])
941
- {
942
- foreach ($this->taxonomies as $taxonomy)
943
- if (!in_array($taxonomy->name, $excluded_taxonomies))
944
- $allowed_modules['taxonomy'][] = $taxonomy->name;
945
- }
946
- // Remove some unnecessary sitemap
947
- $this->remove_module('post', 'attachment');
948
- $this->remove_module('taxonomy', 'post_format');
949
- $this->remove_module('taxonomy', 'nav_menu');
950
- // Add / Remove modules based on users' preferences
951
- if ('yes' == $this->options['enable_sitemap_author'])
952
- $this->add_module('author');
953
- if ('yes' == $this->options['enable_sitemap_external'])
954
- $this->add_module('page', 'external');
955
- // Hook for a custom module list
956
- do_action('bwp_gxs_modules_built', $this->allowed_modules, $this->post_types, $this->taxonomies);
957
- return $this->allowed_modules;
958
- }
959
-
960
- function build_requested_modules($allowed)
961
- {
962
- $this->requested_modules = array();
963
- foreach ($allowed as $module_name => $module)
964
- {
965
- foreach ($module as $sub_module)
966
- {
967
- if (isset($this->post_types[$sub_module])) // Module is a post type
968
- {
969
- // @since 1.0.4 - do not use label anymore, ugh
970
- // $label = $this->format_label($this->post_types[$sub_module]->label);
971
- $label = $this->format_label($this->post_types[$sub_module]->name);
972
- if ('post' == $sub_module || 'page' == $sub_module || 'attachment' == $sub_module)
973
- $data = array($label, array('post' => $this->post_types[$sub_module]->name));
974
- else
975
- $data = array($module_name . '_' . $label, array('post' => $this->post_types[$sub_module]->name));
976
- $this->requested_modules[] = $data;
977
- }
978
- else if ('yes' == $this->options['enable_sitemap_taxonomy'] && isset($this->taxonomies[$sub_module])) // Module is a taxonomy
979
- {
980
- // $label = $this->format_label($this->taxonomies[$sub_module]->label);
981
- $label = $this->format_label($this->taxonomies[$sub_module]->name);
982
- $this->requested_modules[] = array($module_name . '_' . $label, array('taxonomy' => $sub_module));
983
- }
984
- /*else if ('term' == $module_name) // Module is a term {} */
985
- else if (!empty($sub_module))
986
- $this->requested_modules[] = array($module_name . '_' . $sub_module, array('archive' => $sub_module));
987
- else
988
- $this->requested_modules[] = array($module_name);
989
- }
990
- }
991
- }
992
-
993
- function convert_label(&$sub_module, $module)
994
- {
995
- if ('taxonomy' == $module)
996
- {
997
- foreach ($this->taxonomies as $taxonomy)
998
- if ($this->format_label($taxonomy->label) == $sub_module)
999
- $sub_module = $taxonomy->name;
1000
- }
1001
- else if ('post' == $module)
1002
- {
1003
- foreach ($this->post_types as $post_type)
1004
- if ($this->format_label($post_type->label) == $sub_module)
1005
- $sub_module = $post_type->name;
1006
- }
1007
- }
1008
-
1009
- function convert_module($module)
1010
- {
1011
- preg_match('/([a-z0-9]+)_([a-z0-9_-]+)$/iu', $module, $matches);
1012
- if (0 == sizeof($matches))
1013
- return false;
1014
- else
1015
- return $matches;
1016
- }
1017
-
1018
- function request_sitemap($wpquery)
1019
- {
1020
- // Currently requested module
1021
- if (isset($wpquery->query_vars['gxs_module']))
1022
- {
1023
- $module = $wpquery->query_vars['gxs_module'];
1024
- $sub_module = (isset($wpquery->query_vars['gxs_sub_module'])) ? $wpquery->query_vars['gxs_sub_module'] : '';
1025
- if (!empty($module))
1026
- $this->load_module($module, $sub_module);
1027
- }
1028
- else if (isset($wpquery->query_vars[$this->query_var_non_perma]))
1029
- {
1030
- $module = $wpquery->query_vars[$this->query_var_non_perma];
1031
- $parsed_module = $this->convert_module($module);
1032
- if ($parsed_module && is_array($parsed_module))
1033
- $this->load_module($parsed_module[1], $parsed_module[2]);
1034
- else
1035
- $this->load_module($module, '');
1036
- }
1037
- }
1038
-
1039
- function load_module($module, $sub_module)
1040
- {
1041
- // Assuming we fail, ugh!
1042
- $success = false;
1043
- // Remember to use $wpdb->prepare or $wpdb->escape when developing module
1044
- $module = stripslashes($module);
1045
- $sub_module = stripslashes($sub_module);
1046
- // Check whether or not splitting is enabled and the sub_module has a 'part' part,
1047
- // if so, remove it and pass a parameter to let the module knows that it must produce a split sitemap
1048
- $module_part = 0;
1049
- $module_virtual = '';
1050
- if ('yes' == $this->options['enable_sitemap_split_post'] && preg_match('/part([0-9]+)$/i', $sub_module, $matches))
1051
- {
1052
- $module_virtual = str_replace($matches[0], '', $sub_module);
1053
- $module_virtual = rtrim($module_virtual, '_');
1054
- $module_part = (int) $matches[1];
1055
- }
1056
- $true_sub_module = $sub_module;
1057
- $pre_module = $module;
1058
- $pre_module .= (!empty($sub_module)) ? '_' . $sub_module : '';
1059
- // @since 1.0.1 - Redirect to correct domain, with or without www
1060
- $this->canonical_redirect($pre_module);
1061
- // Allowed modules
1062
- $allowed_modules = $this->allowed_modules();
1063
- $this->build_requested_modules($allowed_modules);
1064
- // $this->convert_label($sub_module, $module);
1065
- if ('sitemapindex' != $module && isset($allowed_modules[$module]))
1066
- {
1067
- if (!empty($sub_module))
1068
- {
1069
- if (in_array($sub_module, $allowed_modules[$module]) || (empty($module_virtual) && !empty($module_part) && in_array($module, $allowed_modules[$module])) || (!empty($module_virtual) && in_array($module_virtual, $allowed_modules[$module])))
1070
- $module_key = $module . '_' . $sub_module;
1071
- else
1072
- $module_key = '';
1073
- }
1074
- else
1075
- $module_key = $module;
1076
- $module_name = str_replace($sub_module, $true_sub_module, $module_key);
1077
- }
1078
- else if ('sitemapindex' == $module)
1079
- {
1080
- $module_key = 'sitemapindex';
1081
- $module_name = 'sitemapindex';
1082
- }
1083
-
1084
- // Pass the real sub_module back
1085
- $sub_module = (!empty($module_part)) ? $module_virtual : $sub_module;
1086
-
1087
- if (empty($module_key))
1088
- {
1089
- $this->elog(sprintf(__('Requested module (<em>%s</em>) not found or not allowed.', 'bwp-simple-gxs'), $pre_module), true, 404);
1090
- $this->commit_logs();
1091
- // If debugging is not enabled, redirect to homepage
1092
- wp_redirect(home_url());
1093
- exit;
1094
- }
1095
-
1096
- // @since 1.0.1 - Start counting correct build time and queries
1097
- timer_start();
1098
- $this->build_stats['query'] = get_num_queries();
1099
-
1100
- // Don't let other instrusive plugins mess up our permalnks - @since 1.1.4
1101
- remove_filter('post_link', 'syndication_permalink', 1, 3);
1102
- remove_filter('page_link', 'suffusion_unlink_page', 10, 2);
1103
-
1104
- // If cache is enabled, we check the cache first
1105
- if ('yes' == $this->options['enable_cache'])
1106
- {
1107
- require_once(dirname(__FILE__) . '/class-bwp-gxs-cache.php');
1108
- $bwp_gxs_cache = new BWP_GXS_CACHE(array('module' => $module_key, 'module_name' => $module_name));
1109
- // If cache is ok, output the cached sitemap, only if debug is off
1110
- if ('yes' != $this->options['enable_debug'] && true == $bwp_gxs_cache->has_cache)
1111
- {
1112
- $this->send_header($bwp_gxs_cache->get_header());
1113
- $file = $bwp_gxs_cache->get_cache_file();
1114
- // Decompress the gz file only if the server or script is not already gzipping, and gzip is enabled
1115
- // This is to avoid double compression
1116
- if ('yes' == $this->options['enable_gzip'] && !self::is_gzipped())
1117
- readfile($file);
1118
- else
1119
- readgzfile($file);
1120
- // Get from cache successfully
1121
- $this->slog(sprintf(__('Successfully served a cached version of <em>%s.xml</em>.', 'bwp-simple-gxs'), $module_name), true);
1122
- $this->commit_logs();
1123
- exit;
1124
- }
1125
- }
1126
-
1127
- // If the user uses a custom module dir, also check that dir for usable module files
1128
- $custom_module_dir = (!empty($this->options['input_alt_module_dir']) && $this->options_default['input_alt_module_dir'] != $this->options['input_alt_module_dir']) ? trailingslashit($this->options['input_alt_module_dir']) : false;
1129
- $custom_module_dir = trailingslashit(apply_filters('bwp_gxs_module_dir', $custom_module_dir));
1130
- // Begin loading modules
1131
- require_once(dirname(__FILE__) . '/class-bwp-gxs-module.php');
1132
- if ('sitemapindex' != $module && isset($allowed_modules[$module]))
1133
- {
1134
- $sub_loaded = $mapped_sub_loaded = false;
1135
- if (!empty($sub_module) && in_array($sub_module, $allowed_modules[$module]))
1136
- {
1137
- // Try to load the mapped sub-module first
1138
- if (!empty($this->module_map[$sub_module]))
1139
- {
1140
- $module_file = $module . '_' . $this->module_map[$sub_module] . '.php';
1141
- $path_custom = ($custom_module_dir) ? $this->uni_path_sep($custom_module_dir . $module_file) : '';
1142
- $path = $this->uni_path_sep($this->module_directory . $module_file);
1143
- if (!empty($path_custom) && @file_exists($path_custom))
1144
- {
1145
- $module_key = $module . '_' . $this->module_map[$sub_module];
1146
- include_once($path_custom);
1147
- $mapped_sub_loaded = true;
1148
- $this->nlog(sprintf(__('Loaded a custom sub-module file: <strong>%s</strong>.', 'bwp-simple-gxs'), $module_file));
1149
- }
1150
- else if (@file_exists($path))
1151
- {
1152
- $module_key = $module . '_' . $this->module_map[$sub_module];
1153
- include_once($path);
1154
- $mapped_sub_loaded = true;
1155
- }
1156
- else // Don't fire a wp_die
1157
- $this->nlog(sprintf(__('Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead.', 'bwp-simple-gxs'), $module_file));
1158
- }
1159
- if (false == $mapped_sub_loaded)
1160
- {
1161
- $module_file = $module . '_' . $sub_module . '.php';
1162
- $path_custom = ($custom_module_dir) ? $this->uni_path_sep($custom_module_dir . $module_file) : '';
1163
- $path = $this->uni_path_sep($this->module_directory . $module_file);
1164
- if (!empty($path_custom) && @file_exists($path_custom))
1165
- {
1166
- include_once($path_custom);
1167
- $sub_loaded = true;
1168
- $this->nlog(sprintf(__('Loaded a custom sub-module file: <strong>%s</strong>.', 'bwp-simple-gxs'), $module_file));
1169
- }
1170
- else if (@file_exists($path))
1171
- {
1172
- include_once($path);
1173
- $sub_loaded = true;
1174
- }
1175
- else // Don't fire a wp_die
1176
- $this->nlog(sprintf(__('Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead.', 'bwp-simple-gxs'), $module_file));
1177
- }
1178
- }
1179
- if (false == $sub_loaded && false == $mapped_sub_loaded)
1180
- {
1181
- // Try loading the module
1182
- $module_file = $module . '.php';
1183
- $module_key = $module;
1184
- $path_custom = ($custom_module_dir) ? $this->uni_path_sep($custom_module_dir . $module_file) : '';
1185
- $path = $this->uni_path_sep($this->module_directory . $module_file);
1186
- if (!empty($path_custom) && @file_exists($path_custom))
1187
- {
1188
- include_once($path_custom);
1189
- $this->nlog(sprintf(__('Loaded a custom module file: <strong>%s</strong>.', 'bwp-simple-gxs'), $module_file));
1190
- }
1191
- else if (@file_exists($path))
1192
- include_once($path);
1193
- else
1194
- {
1195
- $error_log = sprintf(__('Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists.', 'bwp-simple-gxs'), $module_file);
1196
- $this->elog($error_log, true);
1197
- }
1198
- }
1199
-
1200
- $this->module_data = array('module' => $module, 'sub_module' => $sub_module, 'module_key' => $module_key, 'module_name' => $module_name, 'module_part' => $module_part);
1201
-
1202
- if (class_exists('BWP_GXS_MODULE_' . $module_key))
1203
- {
1204
- $class_name = 'BWP_GXS_MODULE_' . $module_key;
1205
- $the_module = new $class_name();
1206
- if ('url' == $the_module->type)
1207
- $success = $this->generate_sitemap($the_module->data);
1208
- else
1209
- $success = $this->generate_sitemap_index($the_module->data);
1210
- unset($the_module->data);
1211
- }
1212
- else
1213
- $this->elog(sprintf(__('There is no class named <strong>%s</strong> in the module file <strong>%s</strong>.', 'bwp-simple-gxs'), 'BWP_GXS_MODULE_' . strtoupper($module_key), $module_file), true);
1214
- }
1215
- else if ('sitemapindex' == $module)
1216
- {
1217
- $module_file = 'sitemapindex.php';
1218
- $path_custom = ($custom_module_dir) ? $this->uni_path_sep($custom_module_dir . $module_file) : '';
1219
- if (!empty($path_custom) && @file_exists($path_custom))
1220
- {
1221
- include_once($path_custom);
1222
- $this->nlog(sprintf(__('Loaded a custom sitemapindex module file: <strong>%s</strong>.', 'bwp-simple-gxs'), $module_file));
1223
- }
1224
- else
1225
- include_once(dirname(__FILE__) . '/modules/sitemapindex.php');
1226
- if (class_exists('BWP_GXS_MODULE_INDEX'))
1227
- {
1228
- $the_module = new BWP_GXS_MODULE_INDEX($this->requested_modules);
1229
- $success = $this->generate_sitemap_index($the_module->data);
1230
- unset($the_module->data);
1231
- }
1232
- }
1233
-
1234
- // Output succeeded
1235
- if (true == $success)
1236
- {
1237
- // Output additional stats
1238
- if ('yes' == $this->options['enable_stats'])
1239
- $this->sitemap_stats();
1240
- // Now cache the sitemap if we have to
1241
- if ('yes' == $this->options['enable_cache'] && true == $bwp_gxs_cache->cache_ok)
1242
- $bwp_gxs_cache->write_cache();
1243
- // Output the requested sitemap
1244
- $this->output_sitemap();
1245
- $this->slog(sprintf(__('Successfully generated <em>%s.xml</em> using module <em>%s</em>.', 'bwp-simple-gxs'), $module_name, $module_file), true);
1246
- $this->smlog($module_name);
1247
- $this->commit_logs();
1248
- exit;
1249
- }
1250
- else
1251
- $this->commit_logs();
1252
- }
1253
-
1254
- function send_header($header = array())
1255
- {
1256
- global $bwp_gxs_ob_start, $bwp_gxs_ob_level, $bwp_gxs_gzipped;
1257
-
1258
- // If debug is not enabled and gzip is not turned on in between,
1259
- // we try to clean all errors before sending new headers - @since 1.1.2
1260
- $clean_ok = ((int) $bwp_gxs_gzipped == (int) self::is_gzipped() && 'yes' == $this->options['enable_php_clean']) ? true : false;
1261
- $ob_contents = '';
1262
- if ($bwp_gxs_ob_start && @ob_get_level())
1263
- {
1264
- $ob_level = @ob_get_level() - $bwp_gxs_ob_level;
1265
- while ($ob_level > 0)
1266
- {
1267
- $ob_level -= 1;
1268
- $ob_contents .= ob_get_contents();
1269
- if ('yes' != $this->options['enable_debug'] && $clean_ok)
1270
- @ob_end_clean();
1271
- }
1272
- }
1273
-
1274
- // If there are some contents but we can't clean them, show a friendly error
1275
- if (!empty($ob_contents) && (!$clean_ok || 'yes' == $this->options['enable_debug']))
1276
- wp_die(__('<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of the time PHP errors) is preventing BWP GXS from showing any sitemap contents. Try disabling <code>WP_DEBUG</code> or this plugin\'s debug mode, whichever is on. All unexpected outputs should be shown just above this message. If you don\'t see any, contact me and I might be able to help.', 'bwp-simple-gxs'));
1277
-
1278
- if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
1279
- header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0');
1280
- else
1281
- header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
1282
-
1283
- $content_types = array('google' => 'text/xml', 'yahoo' => 'text/plain');
1284
-
1285
- $time = time();
1286
- $expires = $this->format_header_time($time + $this->cache_time);
1287
-
1288
- $default_headers = array(
1289
- 'lastmod' => $this->format_header_time($time),
1290
- 'expires' => $expires,
1291
- 'etag' => ''
1292
- );
1293
-
1294
- $header = wp_parse_args($header, $default_headers);
1295
-
1296
- header('Expires: ' . $header['expires']);
1297
- header('Last-Modified: ' . $header['lastmod']);
1298
- if (!empty($header['etag']))
1299
- header('Etag: ' . $header['etag']);
1300
- header('Accept-Ranges: bytes');
1301
- header('Content-Type: ' . $content_types['google'] . '; charset=UTF-8');
1302
- if ('yes' == $this->options['enable_gzip'])
1303
- header('Content-Encoding: ' . $this->check_gzip_type());
1304
-
1305
- // Everything's cool
1306
- status_header(200);
1307
-
1308
- return;
1309
- }
1310
-
1311
- public static function is_gzipped()
1312
- {
1313
- if (ini_get('zlib.output_compression') || ini_get('output_handler') == 'ob_gzhandler' || in_array('ob_gzhandler', @ob_list_handlers()))
1314
- return true;
1315
- return false;
1316
- }
1317
-
1318
- function init_gzip()
1319
- {
1320
- if (!$this->check_gzip() && 'yes' == $this->options['enable_gzip'])
1321
- $this->options['enable_gzip'] = 'no';
1322
- return;
1323
- }
1324
-
1325
- function check_gzip()
1326
- {
1327
- if (headers_sent())
1328
- return false;
1329
-
1330
- if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && ((strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)
1331
- || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false))
1332
- return true;
1333
- else
1334
- return false;
1335
- }
1336
-
1337
- function check_gzip_type()
1338
- {
1339
- if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false)
1340
- return 'gzip';
1341
- else if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false)
1342
- return 'x-gzip';
1343
-
1344
- return 'gzip';
1345
- }
1346
-
1347
- function ping()
1348
- {
1349
- $time = time();
1350
- $ping_data = get_option(BWP_GXS_PING);
1351
- if (!$ping_data || !is_array($ping_data))
1352
- $ping_data = array(
1353
- 'data_pinged' => array('google' => 0, 'yahoo' => 0, 'bing' => 0, 'ask' => 0),
1354
- 'data_last_pinged' => array('google' => 0, 'yahoo' => 0, 'bing' => 0, 'ask' => 0)
1355
- );
1356
- foreach ($this->options['input_ping'] as $key => $service)
1357
- {
1358
- if ('yes' == $this->options['enable_ping_' . $key])
1359
- {
1360
- // A day has gone, reset the count
1361
- if ($time - $ping_data['data_last_pinged'][$key] > 86400)
1362
- {
1363
- $ping_data['data_pinged'][$key] = 0;
1364
- $ping_data['data_last_pinged'][$key] = $time;
1365
- }
1366
- // Ping limit has not been reached
1367
- if ($this->ping_per_day > $ping_data['data_pinged'][$key])
1368
- {
1369
- $ping_data['data_pinged'][$key]++;
1370
- $url = sprintf($service, urlencode(str_replace('&', '&amp;', $this->options['input_sitemap_url'])));
1371
- $response = wp_remote_post($url, array('timeout' => $this->timeout));
1372
- if (is_wp_error($response))
1373
- {
1374
- $errno = $response->get_error_code();
1375
- $errorstr = $response->get_error_message();
1376
- $this->elog($errorstr);
1377
- }
1378
- else if (isset($response['response']))
1379
- {
1380
- $the_response = $response['response'];
1381
- if (empty($the_response['code']))
1382
- $this->elog(__('Unknown response code from search engines. Ping failed.', 'bwp-simple-gxs'));
1383
- else if (200 == (int) $the_response['code'])
1384
- $this->slog(sprintf(__('Pinged %s successfully!', 'bwp-simple-gxs'), ucfirst($key)));
1385
- else if (200 != (int) $the_response['code'])
1386
- {
1387
- $errno = $the_response['code'];
1388
- $errorstr = $the_response['message'];
1389
- $this->elog(sprintf(__('Error %s from %s', 'bwp-simple-gxs'), $errno, ucfirst($key)) . ': ' . $errorstr);
1390
- }
1391
- }
1392
- }
1393
- else
1394
- $this->elog(sprintf(__('Ping limit for today to %s has been reached, sorry!', 'bwp-simple-gxs'), ucfirst($key)));
1395
- }
1396
- }
1397
- // Update statistics
1398
- $this->commit_logs();
1399
- update_option(BWP_GXS_PING, $ping_data);
1400
- }
1401
-
1402
- function output_sitemap()
1403
- {
1404
- if ('yes' == $this->options['enable_gzip'])
1405
- {
1406
- $this->output = (!self::is_gzipped()) ? gzencode($this->output, 6) : $this->output;
1407
- $this->send_header();
1408
- echo $this->output;
1409
- }
1410
- else
1411
- {
1412
- $this->send_header();
1413
- echo $this->output;
1414
- }
1415
- }
1416
-
1417
- function check_output($output)
1418
- {
1419
- // If output is empty we log it so the user knows what's going on, but let the page load normally
1420
- if (empty($output) || 0 == sizeof($output))
1421
- {
1422
- $this->elog(sprintf(__('<em>%s.xml</em> does not have any item. The plugin has fired a 404 header to the search engine that requests it. You should check the module that generates that sitemap (<em>%s.php</em>).', 'bwp-simple-gxs'), $this->module_data['module_name'], $this->module_data['module_key']), true, 404);
1423
- return false;
1424
- }
1425
- else
1426
- return true;
1427
- }
1428
-
1429
- function sitemap_stats($type = '')
1430
- {
1431
- $time = timer_stop(0, 3);
1432
- $sql = get_num_queries() - $this->build_stats['query'];
1433
- $memory = size_format(memory_get_usage() - $this->build_stats['mem'], 2);
1434
- if (empty($type))
1435
- $this->output .= "\n" . sprintf($this->templates['stats'], $time, $memory, $sql, $this->output_num);
1436
- else
1437
- echo "\n" . sprintf($this->templates['stats_cached'], $time, $memory, $sql);
1438
- }
1439
-
1440
- function generate_url_item($url = '', $priority = 1.0, $freq = 'always', $lastmod = 0)
1441
- {
1442
- $freq = sprintf($this->templates['changefreq'], $freq);
1443
- $priority = str_replace(',', '.', sprintf($this->templates['priority'], $priority));
1444
- $lastmod = (!empty($lastmod)) ? sprintf($this->templates['lastmod'], $lastmod) : '';
1445
- if (!empty($url))
1446
- return sprintf($this->templates['url'], $url, $lastmod, $freq, $priority);
1447
- else
1448
- return '';
1449
- }
1450
-
1451
- function generate_sitemap_item($url = '', $lastmod = 0)
1452
- {
1453
- $lastmod = (!empty($lastmod)) ? sprintf($this->templates['lastmod'], $lastmod) : '';
1454
- if (!empty($url))
1455
- return sprintf($this->templates['sitemap'], $url, $lastmod);
1456
- else
1457
- return '';
1458
- }
1459
-
1460
- function credit()
1461
- {
1462
- $xml = '<!-- Generated by BWP Google XML Sitemaps ' . $this->get_version() . ' (c) 2011 Khang Minh - betterwp.net' . "\n";
1463
- $xml .=' Plugin homepage: ' . $this->plugin_url . ' -->' . "\n";
1464
- return $xml;
1465
- }
1466
-
1467
- function generate_sitemap($output = array())
1468
- {
1469
- $xml = '<' . '?xml version="1.0" encoding="UTF-8"?'.'>' . "\n";
1470
- $xml .= (!empty($this->xslt)) ? '<?xml-stylesheet type="text/xsl" href="' . $this->xslt . '"?>' . "\n\n" : '';
1471
- $xml .= '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n\t" . 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n\t" . 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"' . "\n\t" . 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
1472
- if ('yes' != $this->options['enable_xslt'] && 'yes' == $this->options['enable_credit'])
1473
- $xml .= $this->credit();
1474
-
1475
- if (!$this->check_output($output))
1476
- return false;
1477
-
1478
- foreach ($output as &$url)
1479
- {
1480
- $url['location'] = (!empty($url['location'])) ? $url['location'] : '';
1481
- $url['lastmod'] = (!empty($url['lastmod'])) ? $url['lastmod'] : '';
1482
- $url['freq'] = (isset($url['freq']) && in_array($url['freq'], $this->frequency)) ? $url['freq'] : $this->options['select_default_freq'];
1483
- $url['priority'] = (isset($url['priority']) && $url['priority'] <= 1 && $url['priority'] > 0) ? $url['priority'] : $this->options['select_default_pri'];
1484
- $xml .= $this->generate_url_item(htmlspecialchars($url['location']), $url['priority'], $url['freq'], $url['lastmod']);
1485
- $this->output_num++;
1486
- }
1487
-
1488
- $xml .= "\n" . '</urlset>';
1489
- $this->output = $xml;
1490
-
1491
- return true;
1492
- }
1493
-
1494
- function generate_sitemap_index($output = array())
1495
- {
1496
- $xml = '<' . '?xml version="1.0" encoding="UTF-8"?'.'>' . "\n";
1497
- $xml .= (!empty($this->xslt_index)) ? '<?xml-stylesheet type="text/xsl" href="' . $this->xslt_index . '"?>' . "\n\n" : '';
1498
- $xml .= '<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n\t" . 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n\t" . 'http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"' . "\n\t" . 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
1499
- if ('yes' != $this->options['enable_xslt'] && 'yes' == $this->options['enable_credit'])
1500
- $xml .= $this->credit();
1501
-
1502
- if (!$this->check_output($output))
1503
- return false;
1504
-
1505
- foreach ($output as &$sitemap)
1506
- {
1507
- $sitemap['location'] = (!empty($sitemap['location'])) ? $sitemap['location'] : '';
1508
- $sitemap['lastmod'] = (!empty($sitemap['lastmod'])) ? $sitemap['lastmod'] : '';
1509
- $xml .= $this->generate_sitemap_item(htmlspecialchars($sitemap['location']), $sitemap['lastmod']);
1510
- $this->output_num++;
1511
- }
1512
-
1513
- $xml .= "\n" . '</sitemapindex>';
1514
- $this->output = $xml;
1515
-
1516
- return true;
1517
- }
1518
- }
1519
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main Sitemap class that provides all logics.
4
+ *
5
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ *
20
+ * @author Khang Minh <contact@betterwp.net>
21
+ * @link http://betterwp.net/wordpress-plugins/google-xml-sitemaps/
22
+ * @link https://github.com/OddOneOut/Better-WordPress-Google-XML-Sitemaps
23
+ */
24
+
25
+ if (!class_exists('BWP_FRAMEWORK_IMPROVED'))
26
+ require_once(dirname(__FILE__) . '/class-bwp-framework-improved.php');
27
+
28
+ class BWP_SIMPLE_GXS extends BWP_FRAMEWORK_IMPROVED
29
+ {
30
+ /**
31
+ * Sitemap generation log
32
+ *
33
+ * @var array
34
+ */
35
+ public $logs = array(
36
+ 'log' => array(),
37
+ 'sitemap' => array()
38
+ );
39
+
40
+ /**
41
+ * Maximum number of log entries for Sitemap generation log
42
+ *
43
+ * @var integer
44
+ */
45
+ private $_log_limit = 25;
46
+
47
+ /**
48
+ * Whether generator log is empty
49
+ *
50
+ * @var bool
51
+ */
52
+ private $_is_log_empty = false;
53
+
54
+ /**
55
+ * Modules to load when generating sitemapindex
56
+ *
57
+ * @var array
58
+ */
59
+ public $modules = array(), $requested_modules = array();
60
+
61
+ /**
62
+ * Directories to load modules from
63
+ *
64
+ * @var string
65
+ */
66
+ public $module_directory = '', $custom_module_directory = '';
67
+
68
+ /**
69
+ * Whether sitemap is generated using a custom module file
70
+ *
71
+ * @var bool
72
+ */
73
+ private $_is_using_custom_module = false;
74
+
75
+ /**
76
+ * Mapping data for a module/sub-module
77
+ *
78
+ * @var array
79
+ */
80
+ public $module_map = array();
81
+
82
+ /**
83
+ * Url updating frequencies
84
+ *
85
+ * @var array
86
+ */
87
+ public $frequencies = array(
88
+ 'always',
89
+ 'hourly',
90
+ 'daily',
91
+ 'weekly',
92
+ 'monthly',
93
+ 'yearly',
94
+ 'never'
95
+ );
96
+
97
+ /**
98
+ * Url crawling priorties
99
+ *
100
+ * @var array
101
+ */
102
+ public $priorities = array(
103
+ '0.1' => 0.1,
104
+ '0.2' => 0.2,
105
+ '0.3' => 0.3,
106
+ '0.4' => 0.4,
107
+ '0.5' => 0.5,
108
+ '0.6' => 0.6,
109
+ '0.7' => 0.7,
110
+ '0.8' => 0.8,
111
+ '0.9' => 0.9,
112
+ '1.0' => 1.0
113
+ );
114
+
115
+ /**
116
+ * Urls to ping
117
+ *
118
+ * @var array
119
+ * @since 1.3.0
120
+ */
121
+ private $_ping_urls = array(
122
+ 'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap=%s',
123
+ 'bing' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=%s',
124
+ //'ask' => 'http://submissions.ask.com/ping?sitemap=%s'),
125
+ );
126
+
127
+ /**
128
+ * Name of the sitemap to ping with
129
+ *
130
+ * @var string
131
+ */
132
+ private $_ping_sitemap = 'sitemapindex';
133
+
134
+ /**
135
+ * Whether debug mode/debug extra mode is enabled
136
+ *
137
+ * @var bool
138
+ * @since 1.3.0
139
+ */
140
+ private $_debug = false, $_debug_extra = false;
141
+
142
+ /**
143
+ * The maximum number of times to ping per day for each SE
144
+ *
145
+ * @var int
146
+ */
147
+ public $pings_per_day = 100;
148
+
149
+ /**
150
+ * Timeout for ping request
151
+ *
152
+ * @var int
153
+ */
154
+ public $ping_timeout = 3;
155
+
156
+ /**
157
+ * A list of post type objects
158
+ *
159
+ * @var array
160
+ */
161
+ public $post_types;
162
+
163
+ /**
164
+ * A list of taxonomy objects
165
+ *
166
+ * @var array
167
+ */
168
+ public $taxonomies;
169
+
170
+ /**
171
+ * A list of term objects
172
+ *
173
+ * @var array
174
+ */
175
+ public $terms;
176
+
177
+ /**
178
+ * Sitemap templates
179
+ *
180
+ * @var array
181
+ */
182
+ public $templates = array();
183
+
184
+ /**
185
+ * Module data for a specific sitemap
186
+ *
187
+ * @var array
188
+ */
189
+ public $module_data = array();
190
+
191
+ /**
192
+ * Sitemap generation stats
193
+ *
194
+ * @var array
195
+ */
196
+ public $build_data = array(
197
+ 'time',
198
+ 'mem',
199
+ 'query'
200
+ );
201
+
202
+ /**
203
+ * Stylesheets for XML sitemaps
204
+ *
205
+ * @var string
206
+ */
207
+ public $xslt = '', $xslt_index = '';
208
+
209
+ /**
210
+ * Holds a sitemap's output
211
+ *
212
+ * @var string
213
+ */
214
+ public $output = '';
215
+
216
+ /**
217
+ * The number of urls found in a sitemap
218
+ *
219
+ * @var int
220
+ */
221
+ public $output_num = 0;
222
+
223
+ /**
224
+ * Holds the GXS cache class
225
+ *
226
+ * @var BWP_GXS_CACHE
227
+ */
228
+ public $cache = false;
229
+
230
+ /**
231
+ * Directory to store cached sitemap
232
+ *
233
+ * @var string
234
+ * @since 1.3.0
235
+ */
236
+ public $cache_directory = '';
237
+
238
+ /**
239
+ * Time to keep cached sitemap files
240
+ *
241
+ * @var integer
242
+ */
243
+ public $cache_time;
244
+
245
+ /**
246
+ * Whether to use friendly url for sitemap links
247
+ *
248
+ * @var bool
249
+ */
250
+ public $use_permalink = true;
251
+
252
+ /**
253
+ * Query variable to use when not using friendly urls
254
+ *
255
+ * @var string
256
+ */
257
+ public $query_var_non_perma = '';
258
+
259
+ /**
260
+ * Url to the sitemapindex file
261
+ *
262
+ * @var string
263
+ */
264
+ public $sitemap_url;
265
+
266
+ /**
267
+ * Sitemap url structure used to construct other sitemap files
268
+ *
269
+ * @var string
270
+ */
271
+ public $sitemap_url_struct;
272
+
273
+ /**
274
+ * Constructor
275
+ */
276
+ public function __construct($version = '1.3.0')
277
+ {
278
+ // Plugin's title
279
+ $this->plugin_title = 'Better WordPress Google XML Sitemaps';
280
+ // Plugin's version
281
+ $this->set_version($version);
282
+ // Plugin's language domain
283
+ $this->domain = 'bwp-simple-gxs';
284
+
285
+ // Basic version checking
286
+ if (!$this->check_required_versions())
287
+ return;
288
+
289
+ // Default options
290
+ $options = array(
291
+ 'enable_cache' => '', // @since 1.3.0 off by default
292
+ 'enable_cache_auto_gen' => 'yes',
293
+ 'enable_gzip' => '',
294
+ 'enable_xslt' => 'yes',
295
+ 'enable_sitemap_date' => '',
296
+ 'enable_sitemap_taxonomy' => 'yes',
297
+ 'enable_sitemap_external' => '',
298
+ 'enable_sitemap_split_post' => 'yes',
299
+ 'enable_sitemap_author' => '',
300
+ 'enable_sitemap_site' => 'yes',
301
+ 'enable_stats' => 'yes',
302
+ 'enable_credit' => 'yes',
303
+ 'enable_ping' => 'yes',
304
+ 'enable_ping_google' => 'yes',
305
+ 'enable_ping_bing' => 'yes',
306
+ //'enable_ping_ask' => '',
307
+ 'enable_log' => 'yes',
308
+ 'enable_debug' => '',
309
+ 'enable_debug_extra' => '', // @since 1.3.0
310
+ 'enable_robots' => 'yes',
311
+ 'enable_global_robots' => '',
312
+ 'enable_gmt' => 'yes',
313
+ // Google news options
314
+ 'enable_news_sitemap' => '',
315
+ 'enable_news_keywords' => '',
316
+ 'enable_news_ping' => '',
317
+ 'enable_news_multicat' => '',
318
+ 'select_news_lang' => 'en',
319
+ 'select_news_keyword_type' => 'cat',
320
+ 'select_news_cat_action' => 'inc',
321
+ 'select_news_cats' => '',
322
+ 'input_news_genres' => array(),
323
+ // End of Google news options
324
+ 'input_exclude_post_type' => '',
325
+ 'input_exclude_post_type_ping' => '', // @since 1.3.0
326
+ 'input_exclude_taxonomy' => 'post_tag',
327
+ 'input_cache_age' => 1,
328
+ 'input_item_limit' => 5000,
329
+ 'input_split_limit_post' => 0,
330
+ 'input_alt_module_dir' => '', // @since 1.3.0 default to empty
331
+ 'input_oldest' => 7,
332
+ 'input_sql_limit' => 1000,
333
+ 'input_custom_xslt' => '',
334
+ 'input_ping_limit' => 100, // @since 1.3.0 per day ping limit for each SE
335
+ 'select_output_type' => 'concise',
336
+ 'select_time_type' => 3600,
337
+ 'select_oldest_type' => 16400,
338
+ 'select_default_freq' => 'daily',
339
+ 'select_default_pri' => 1.0,
340
+ 'select_min_pri' => 0.1,
341
+ 'input_cache_dir' => '', // @since 1.3.0 make this editable and allow overriden using constant or filters
342
+ );
343
+
344
+ // super admin only options
345
+ $this->site_options = array(
346
+ 'enable_global_robots',
347
+ 'enable_log',
348
+ 'enable_debug',
349
+ 'enable_debug_extra',
350
+ 'enable_gzip',
351
+ 'enable_cache',
352
+ 'enable_cache_auto_gen',
353
+ 'input_cache_age',
354
+ 'input_alt_module_dir',
355
+ 'input_sql_limit',
356
+ 'input_cache_dir',
357
+ 'select_time_type'
358
+ );
359
+
360
+ $this->add_option_key('BWP_GXS_OPTION_GENERATOR', 'bwp_gxs_generator',
361
+ __('XML Sitemaps', $this->domain));
362
+ $this->add_option_key('BWP_GXS_GOOGLE_NEWS', 'bwp_gxs_google_news',
363
+ __('Google News Sitemap', $this->domain));
364
+ $this->add_option_key('BWP_GXS_STATS', 'bwp_gxs_stats',
365
+ __('Sitemap Log', $this->domain));
366
+
367
+ define('BWP_GXS_LOG', 'bwp_gxs_log');
368
+ define('BWP_GXS_PING', 'bwp_gxs_ping_data');
369
+
370
+ $this->build_properties('BWP_GXS', $this->domain, $options,
371
+ 'Better WordPress Google XML Sitemaps', dirname(dirname(__FILE__)) . '/bwp-simple-gxs.php',
372
+ 'http://betterwp.net/wordpress-plugins/google-xml-sitemaps/', false
373
+ );
374
+ }
375
+
376
+ protected function pre_init_properties()
377
+ {
378
+ $this->templates = array(
379
+ // Sitemap index
380
+ 'sitemap' => "\n\t" . '<sitemap>' . "\n\t\t" . '<loc>%s</loc>%s' . "\n\t" . '</sitemap>',
381
+ // Normal sitemap
382
+ 'url' => "\n\t" . '<url>' . "\n\t\t" . '<loc>%1$s</loc>%2$s%3$s%4$s' . "\n\t" . '</url>',
383
+ 'lastmod' => "\n\t\t" . '<lastmod>%s</lastmod>',
384
+ 'changefreq' => "\n\t\t" . '<changefreq>%s</changefreq>',
385
+ 'priority' => "\n\t\t" . '<priority>%.1f</priority>',
386
+ // Google News Sitemap
387
+ 'news' => "\n\t" . '<url>' . "\n\t\t" . '<loc>%1$s</loc>' . "\n\t\t" . '<news:news>%2$s%3$s%4$s%5$s%6$s' . "\n\t\t" . '</news:news>' . "\n\t" . '</url>',
388
+ 'news_publication' => "\n\t\t\t" . '<news:publication>%1$s%2$s</news:publication>',
389
+ 'news_name' => "\n\t\t\t\t" . '<news:name>%s</news:name>',
390
+ 'news_language' => "\n\t\t\t\t" . '<news:language>%s</news:language>',
391
+ 'news_genres' => "\n\t\t\t" . '<news:genres>%s</news:genres>',
392
+ 'news_pub_date' => "\n\t\t\t" . '<news:publication_date>%s</news:publication_date>',
393
+ 'news_title' => "\n\t\t\t" . '<news:title>%s</news:title>',
394
+ 'news_keywords' => "\n\t\t\t" . '<news:keywords>%s</news:keywords>',
395
+ // Misc
396
+ 'xslt_style' => '',
397
+ 'stats' => "\n" . '<!-- ' . __('This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed', $this->domain) . ' -->'
398
+ /*'stats_cached' => "\n" . '<!-- ' . __('Served from cache in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed', $this->domain) . ' -->'*/
399
+ );
400
+
401
+ $this->pings_per_day = (int) $this->options['input_ping_limit'];
402
+
403
+ // init debug and debug extra mode
404
+ $this->_init_debug();
405
+
406
+ // init sitemap log
407
+ $this->_init_logs();
408
+
409
+ // init xslt stylesheet
410
+ $this->_init_xslt_stylesheet();
411
+
412
+ // Some stats
413
+ $this->build_stats['mem'] = memory_get_usage();
414
+ }
415
+
416
+ protected function load_libraries()
417
+ {
418
+ require_once dirname(__FILE__) . '/common-functions.php';
419
+ require_once dirname(__FILE__) . '/class-bwp-gxs-cache.php';
420
+
421
+ $this->cache = new BWP_GXS_CACHE($this);
422
+ }
423
+
424
+ protected function pre_init_hooks()
425
+ {
426
+ add_filter('rewrite_rules_array', array($this, 'insert_rewrite_rules'), 9);
427
+ add_filter('query_vars', array($this, 'insert_query_vars'));
428
+ add_action('parse_request', array($this, 'request_sitemap'));
429
+
430
+ // check and update plugin db if needed, this is fired after init
431
+ add_action('bwp_gxs_init_upgrade', array($this, 'upgrade_plugin'), 10, 2);
432
+
433
+ if ('yes' == $this->options['enable_ping'])
434
+ {
435
+ // ping search engines with sitemapindex
436
+ // @see `wp_transition_post_status` in wp-includes/post.php
437
+ add_action('auto-draft_to_publish', array($this, 'ping'), 1000);
438
+ add_action('draft_to_publish', array($this, 'ping'), 1000);
439
+ add_action('new_to_publish', array($this, 'ping'), 1000);
440
+ add_action('pending_to_publish', array($this, 'ping'), 1000);
441
+ add_action('future_to_publish', array($this, 'ping'), 1000);
442
+ }
443
+
444
+ if ('yes' == $this->options['enable_news_ping'])
445
+ {
446
+ // enable ping for news sitemap
447
+ add_action('auto-draft_to_publish', array($this, 'ping_google_news'), 1000);
448
+ add_action('draft_to_publish', array($this, 'ping_google_news'), 1000);
449
+ add_action('new_to_publish', array($this, 'ping_google_news'), 1000);
450
+ add_action('pending_to_publish', array($this, 'ping_google_news'), 1000);
451
+ add_action('future_to_publish', array($this, 'ping_google_news'), 1000);
452
+ }
453
+
454
+ if ('yes' == $this->options['enable_robots'])
455
+ add_filter('robots_txt', array($this, 'do_robots'), 1000, 2);
456
+ }
457
+
458
+ protected function init_properties()
459
+ {
460
+ $this->cache_directory = $this->_get_cache_directory();
461
+ $this->cache_time = (int) $this->options['input_cache_age'] * (int) $this->options['select_time_type'];
462
+
463
+ // init directories where modules live
464
+ $this->_init_module_directories();
465
+
466
+ // certain modules can use other modules to build data
467
+ $module_map = apply_filters('bwp_gxs_module_mapping', array());
468
+ $this->module_map = wp_parse_args($module_map, array(
469
+ 'post_format' => 'post_tag'
470
+ ));
471
+
472
+ // init urls structure used for xml sitemap files
473
+ $this->_init_sitemap_urls();
474
+
475
+ // @since 1.3.0 allow the use of dynamic xslt stylesheet
476
+ $this->xslt = apply_filters('bwp_gxs_xslt', $this->xslt);
477
+ $this->xslt_index = empty($this->xslt) ? '' : substr_replace($this->xslt, 'index', -4, 0);
478
+ }
479
+
480
+ protected function enqueue_media()
481
+ {
482
+ if ($this->is_admin_page())
483
+ wp_enqueue_style('bwp-gxs-admin', BWP_GXS_CSS . '/bwp-simple-gxs.css');
484
+
485
+ if ($this->is_admin_page(BWP_GXS_OPTION_GENERATOR))
486
+ wp_enqueue_script('bwp-gxs-setting', BWP_GXS_JS . '/bwp-gxs.js');
487
+ }
488
+
489
+ public function insert_query_vars($vars)
490
+ {
491
+ if (!$this->use_permalink)
492
+ {
493
+ array_push($vars, $this->query_var_non_perma);
494
+ }
495
+ else
496
+ {
497
+ array_push($vars, 'gxs_module');
498
+ array_push($vars, 'gxs_sub_module');
499
+ }
500
+
501
+ return $vars;
502
+ }
503
+
504
+ public function insert_rewrite_rules($rules)
505
+ {
506
+ $rewrite_rules = array(
507
+ 'sitemap\.xml$' => 'index.php?gxs_module=sitemapindex',
508
+ 'sitemapindex\.xml$' => 'index.php?gxs_module=sitemapindex',
509
+ 'site\.xml$' => 'index.php?gxs_module=site',
510
+ 'page\.xml$' => 'index.php?gxs_module=page',
511
+ 'post\.xml$' => 'index.php?gxs_module=post',
512
+ 'author\.xml$' => 'index.php?gxs_module=author',
513
+ '([a-z0-9]+)_([a-z0-9_-]+)\.xml$' => 'index.php?gxs_module=$matches[1]&gxs_sub_module=$matches[2]'
514
+ );
515
+
516
+ // @since 1.0.3
517
+ $custom_rules = apply_filters('bwp_gxs_rewrite_rules', array());
518
+ $rules = array_merge($custom_rules, $rewrite_rules, $rules);
519
+
520
+ return $rules;
521
+ }
522
+
523
+ private function _get_cache_directory_from_constant()
524
+ {
525
+ return defined('BWP_GXS_CACHE_DIR') && BWP_GXS_CACHE_DIR != ''
526
+ ? trim(BWP_GXS_CACHE_DIR) : '';
527
+ }
528
+
529
+ private function _get_default_cache_directory()
530
+ {
531
+ return plugin_dir_path($this->plugin_file) . 'cache/';
532
+ }
533
+
534
+ /**
535
+ * Gets cache directory from constant, setting or filters (in that
536
+ * particular order)
537
+ *
538
+ * @since 1.3.0
539
+ * @access private
540
+ */
541
+ private function _get_cache_directory()
542
+ {
543
+ // get cache dir from constant
544
+ $cache_dir = $this->_get_cache_directory_from_constant();
545
+
546
+ // get cache dir from setting
547
+ $cache_dir = empty($cache_dir) ? trim($this->options['input_cache_dir']) : $cache_dir;
548
+
549
+ // get default cache dir
550
+ $cache_dir = empty($cache_dir) ? $this->_get_default_cache_directory() : $cache_dir;
551
+
552
+ // allow custom cache dirs using filters
553
+ return apply_filters('bwp_gxs_cache_dir', $cache_dir);
554
+ }
555
+
556
+ /**
557
+ * Set up the default module directory and a custom module directory if applicable
558
+ *
559
+ * @return void
560
+ * @since 1.3.0
561
+ * @access private
562
+ */
563
+ private function _init_module_directories()
564
+ {
565
+ $this->module_directory = plugin_dir_path($this->plugin_file) . 'includes/modules/';
566
+
567
+ $this->custom_module_directory = !empty($this->options['input_alt_module_dir'])
568
+ ? $this->options['input_alt_module_dir']
569
+ : false;
570
+
571
+ $this->custom_module_directory = trailingslashit(apply_filters('bwp_gxs_module_dir', $this->custom_module_directory));
572
+ }
573
+
574
+ /**
575
+ * Constructs a sitemap url (friendly or normal) based on provided slug
576
+ *
577
+ * @since 1.3.0
578
+ * @access public
579
+ * @return string
580
+ */
581
+ public function get_sitemap_url($slug)
582
+ {
583
+ if ($slug == 'sitemapindex')
584
+ {
585
+ return $this->sitemap_url;
586
+ }
587
+ else
588
+ {
589
+ return sprintf($this->sitemap_url_struct, $slug);
590
+ }
591
+ }
592
+
593
+ /**
594
+ * Inits sitemapindex url and sitemap structure
595
+ *
596
+ * @return void
597
+ * @since 1.3.0
598
+ * @access private
599
+ **/
600
+ private function _init_sitemap_urls()
601
+ {
602
+ $permalink = get_option('permalink_structure');
603
+
604
+ if (!$permalink)
605
+ {
606
+ // do not use friendly sitemap urls
607
+ $this->use_permalink = false;
608
+
609
+ $this->query_var_non_perma = apply_filters('bwp_gxs_query_var_non_perma', 'bwpsitemap');
610
+
611
+ // @todo recheck https
612
+ $this->sitemap_url = home_url() . '/?' . $this->query_var_non_perma . '=sitemapindex';
613
+ $this->sitemap_url_struct = home_url() . '/?' . $this->query_var_non_perma . '=%s';
614
+ }
615
+ else
616
+ {
617
+ // use friendly sitemap urls such as http://example.com/sitemapindex.xml
618
+ // If user is using index.php in their permalink structure, we will
619
+ // have to include it also
620
+ $indexphp = strpos($permalink, 'index.php') === false ? '' : '/index.php';
621
+
622
+ $this->sitemap_url = home_url() . $indexphp . '/sitemapindex.xml';
623
+ $this->sitemap_url_struct = home_url() . $indexphp . '/%s.xml';
624
+ }
625
+ }
626
+
627
+ /**
628
+ * Inits XSLT stylesheets used for sitemap's look and feel
629
+ *
630
+ * @return void
631
+ * @since 1.3.0
632
+ * @access private
633
+ **/
634
+ private function _init_xslt_stylesheet()
635
+ {
636
+ if ('yes' == $this->options['enable_xslt'])
637
+ {
638
+ // if the host the user is using is different from what we get from
639
+ // 'home' option, we need to use the host so user won't see a style
640
+ // sheet error, which is most of the time mistaken as broken
641
+ // sitemaps - @since 1.1.0
642
+ $user_host = strtolower($_SERVER['HTTP_HOST']);
643
+
644
+ $blog_home = @parse_url(home_url());
645
+ $blog_host = strtolower($blog_home['host']);
646
+
647
+ $this->xslt = !empty($this->options['input_custom_xslt'])
648
+ ? $this->options['input_custom_xslt']
649
+ : plugin_dir_url($this->plugin_file) . 'xsl/bwp-sitemap.xsl';
650
+
651
+ $this->xslt = strcmp($user_host, $blog_host) == 0
652
+ ? $this->xslt
653
+ : str_replace($blog_host, $user_host, $this->xslt);
654
+ }
655
+ }
656
+
657
+ /**
658
+ * Inits debug and debug extra mode
659
+ *
660
+ * @return void
661
+ * @since 1.3.0
662
+ * @access private
663
+ **/
664
+ private function _init_debug()
665
+ {
666
+ $this->_debug = $this->options['enable_debug'] == 'yes'
667
+ || $this->options['enable_debug_extra'] == 'yes' ? true : false;
668
+ $this->_debug_extra = $this->options['enable_debug_extra'] == 'yes' ? true : false;
669
+ }
670
+
671
+ /**
672
+ * Inits sitemap log property
673
+ *
674
+ * @since 1.3.0
675
+ * @access private
676
+ */
677
+ private function _init_logs()
678
+ {
679
+ $this->logs = get_option(BWP_GXS_LOG);
680
+
681
+ if (!$this->logs)
682
+ {
683
+ $this->logs = array(
684
+ 'log' => array(),
685
+ 'sitemap' => array()
686
+ );
687
+ }
688
+
689
+ if (sizeof($this->logs['log']) == 0)
690
+ $this->_is_log_empty = true;
691
+
692
+ foreach ($this->logs as $key => $log)
693
+ {
694
+ if ($key == 'sitemap')
695
+ // don't use log limit for sitemap log
696
+ continue;
697
+
698
+ if (is_array($log) && $this->_log_limit < sizeof($log))
699
+ {
700
+ // only keep latest log entries
701
+ $log = array_slice($log, (-1) * $this->_log_limit);
702
+ $this->logs[$key] = $log;
703
+ }
704
+ }
705
+ }
706
+
707
+ private static function _flush_rewrite_rules()
708
+ {
709
+ global $wp_rewrite;
710
+
711
+ $wp_rewrite->flush_rules();
712
+ }
713
+
714
+ public function install()
715
+ {
716
+ self::_flush_rewrite_rules();
717
+ }
718
+
719
+ public function uninstall()
720
+ {
721
+ $this->logs = array(
722
+ 'log' => array(),
723
+ 'sitemap' => array()
724
+ );
725
+
726
+ $this->commit_logs();
727
+
728
+ /* self::_flush_rewrite_rules(); */
729
+ }
730
+
731
+ public function upgrade_plugin($from, $to)
732
+ {
733
+ if (!$from || version_compare($from, '1.3.0', '<'))
734
+ {
735
+ // @since 1.3.0 default values of cache directory is empty
736
+ $options = get_option(BWP_GXS_OPTION_GENERATOR);
737
+ $options['input_cache_dir'] = '';
738
+ update_option(BWP_GXS_OPTION_GENERATOR, $options);
739
+ }
740
+ }
741
+
742
+ /**
743
+ * Build the Menus
744
+ */
745
+ protected function build_menus()
746
+ {
747
+ if (!empty($this->_menu_under_settings))
748
+ {
749
+ // use simple menu if instructed to
750
+ add_options_page(
751
+ __('BWP Google XML Sitemaps Statistics', $this->domain),
752
+ __('BWP XML Sitemaps', $this->domain),
753
+ BWP_GXS_CAPABILITY,
754
+ BWP_GXS_OPTION_GENERATOR,
755
+ array($this, 'build_option_pages')
756
+ );
757
+ add_options_page(
758
+ __('BWP Google News XML Sitemap', $this->domain),
759
+ __('BWP Google News Sitemap', $this->domain),
760
+ BWP_GXS_CAPABILITY,
761
+ BWP_GXS_GOOGLE_NEWS,
762
+ array($this, 'build_option_pages')
763
+ );
764
+ add_options_page(
765
+ __('BWP Google XML Sitemaps Generator', $this->domain),
766
+ __('BWP Sitemap Log', $this->domain),
767
+ BWP_GXS_CAPABILITY,
768
+ BWP_GXS_STATS,
769
+ array($this, 'build_option_pages')
770
+ );
771
+ }
772
+ else
773
+ {
774
+ add_menu_page(
775
+ __('Better WordPress Google XML Sitemaps', $this->domain),
776
+ 'BWP Sitemaps',
777
+ BWP_GXS_CAPABILITY,
778
+ BWP_GXS_OPTION_GENERATOR,
779
+ array($this, 'build_option_pages'),
780
+ BWP_GXS_IMAGES . '/icon_menu.png'
781
+ );
782
+ add_submenu_page(
783
+ BWP_GXS_OPTION_GENERATOR,
784
+ __('Better WordPress Google XML Sitemaps Statistics', $this->domain),
785
+ __('XML Sitemaps', $this->domain),
786
+ BWP_GXS_CAPABILITY,
787
+ BWP_GXS_OPTION_GENERATOR,
788
+ array($this, 'build_option_pages')
789
+ );
790
+ add_submenu_page(
791
+ BWP_GXS_OPTION_GENERATOR,
792
+ __('Better WordPress Google News XML Sitemap', $this->domain),
793
+ __('Google News Sitemap', $this->domain),
794
+ BWP_GXS_CAPABILITY,
795
+ BWP_GXS_GOOGLE_NEWS,
796
+ array($this, 'build_option_pages')
797
+ );
798
+ add_submenu_page(
799
+ BWP_GXS_OPTION_GENERATOR,
800
+ __('Better WordPress Google XML Sitemaps Generator', $this->domain),
801
+ __('Sitemap Log', $this->domain),
802
+ BWP_GXS_CAPABILITY,
803
+ BWP_GXS_STATS,
804
+ array($this, 'build_option_pages')
805
+ );
806
+ }
807
+ }
808
+
809
+ private function _add_checkboxes_to_form($for, $key_prefix, &$form, &$dynamic_options)
810
+ {
811
+ $options = $this->options;
812
+
813
+ $exclude_options = array(
814
+ 'post_types' => explode(',', $options['input_exclude_post_type']),
815
+ 'post_types_ping' => explode(',', $options['input_exclude_post_type_ping']),
816
+ 'taxonomies' => explode(',', $options['input_exclude_taxonomy'])
817
+ );
818
+
819
+ $excluded_post_types = $for == 'sec_post'
820
+ ? $exclude_options['post_types']
821
+ : $exclude_options['post_types_ping'];
822
+
823
+ switch ($for)
824
+ {
825
+ case 'sec_post':
826
+ case 'sec_post_ping':
827
+ $post_types = get_post_types(array('public' => true), 'objects');
828
+
829
+ foreach ($post_types as $post_type)
830
+ {
831
+ if ('attachment' == $post_type->name)
832
+ continue;
833
+
834
+ $key = $key_prefix . $post_type->name;
835
+
836
+ $form[$for][] = array('checkbox', 'name' => $key);
837
+ $form['checkbox'][$key] = array(__($post_type->label) => $key);
838
+
839
+ if (in_array($post_type->name, $excluded_post_types))
840
+ $dynamic_options[$key] = 'yes';
841
+ else
842
+ $dynamic_options[$key] = '';
843
+ }
844
+
845
+ break;
846
+
847
+ case 'sec_tax':
848
+ $taxonomies = get_taxonomies(array('public' => true), '');
849
+
850
+ foreach ($taxonomies as $taxonomy)
851
+ {
852
+ if ('post_format' == $taxonomy->name)
853
+ continue;
854
+
855
+ $key = $key_prefix . $taxonomy->name;
856
+
857
+ $form[$for][] = array('checkbox', 'name' => $key);
858
+ $form['checkbox'][$key] = array(__($taxonomy->label) => $key);
859
+
860
+ if (in_array($taxonomy->name, $exclude_options['taxonomies']))
861
+ $dynamic_options[$key] = 'yes';
862
+ else
863
+ $dynamic_options[$key] = '';
864
+ }
865
+
866
+ break;
867
+ }
868
+ }
869
+
870
+ /**
871
+ * Build the option pages
872
+ *
873
+ * Utilizes BWP Option Page Builder (@see BWP_OPTION_PAGE)
874
+ */
875
+ public function build_option_pages()
876
+ {
877
+ if (!current_user_can(BWP_GXS_CAPABILITY))
878
+ wp_die(__('You do not have sufficient permissions to access this page.'));
879
+
880
+ // Init the class
881
+ $page = $_GET['page'];
882
+ $bwp_option_page = new BWP_OPTION_PAGE($page, $this->site_options);
883
+
884
+ $options = array();
885
+ $dynamic_options = array();
886
+
887
+ if (!empty($page))
888
+ {
889
+ if ($page == BWP_GXS_OPTION_GENERATOR)
890
+ {
891
+ $bwp_option_page->set_current_tab(1);
892
+
893
+ if (!self::is_normal_admin())
894
+ {
895
+ // add flush cache buttons for super admins
896
+ // @todo allow normal admins to flush the cache as well,
897
+ // but only for sitemaps on their sites
898
+ add_filter('bwp_option_submit_button', array($this, 'add_flush_cache_buttons'));
899
+
900
+ if (isset($_POST['flush_cache']))
901
+ {
902
+ check_admin_referer($page);
903
+
904
+ $this->_admin_flush_cache();
905
+ }
906
+ }
907
+
908
+ // add a clear log button
909
+ add_filter('bwp_option_submit_button', array($this, 'add_clear_log_button'));
910
+
911
+ if (isset($_POST['clear_log']))
912
+ {
913
+ // clear all sitemap logs including sitemap generation log
914
+ // and sitemap item log
915
+ check_admin_referer($page);
916
+
917
+ $this->logs = array(
918
+ 'log' => array(),
919
+ 'sitemap' => array()
920
+ );
921
+
922
+ $this->commit_logs();
923
+
924
+ $this->add_notice(
925
+ '<strong>' . __('Notice', $this->domain) . ':</strong> '
926
+ . __('All logs have been cleared successfully!', $this->domain)
927
+ );
928
+ }
929
+
930
+ $form = array(
931
+ 'items' => array(
932
+ 'heading',
933
+ 'heading',
934
+ 'section',
935
+ 'section',
936
+ 'section',
937
+ 'heading',
938
+ 'input',
939
+ 'checkbox',
940
+ 'input',
941
+ 'heading',
942
+ 'select',
943
+ 'select',
944
+ 'select',
945
+ 'checkbox',
946
+ 'checkbox',
947
+ 'heading',
948
+ 'checkbox',
949
+ 'input',
950
+ 'checkbox',
951
+ 'checkbox',
952
+ 'heading',
953
+ 'checkbox',
954
+ 'checkbox',
955
+ 'heading',
956
+ 'checkbox',
957
+ 'section',
958
+ 'section',
959
+ 'input',
960
+ 'heading',
961
+ 'checkbox',
962
+ 'checkbox',
963
+ 'input',
964
+ 'input',
965
+ 'heading',
966
+ 'input',
967
+ 'input',
968
+ 'heading',
969
+ 'checkbox',
970
+ 'checkbox',
971
+ 'checkbox'
972
+ ),
973
+ 'item_labels' => array(
974
+ __('Your sitemaps', $this->domain),
975
+ __('Sitemaps to generate', $this->domain),
976
+ __('<strong>Enable</strong> following sitemaps', $this->domain),
977
+ __('For post-based sitemaps, <strong>disable</strong> following post types:', $this->domain),
978
+ __('For taxonomy-based sitemaps, <strong>disable</strong> following taxonomies:', $this->domain),
979
+ __('Item limits', $this->domain),
980
+ __('Global limit', $this->domain),
981
+ __('Split <strong>post-based</strong> sitemaps', $this->domain),
982
+ __('Split limit', $this->domain),
983
+ __('Default values & Formatting', $this->domain),
984
+ __('Default change frequency', $this->domain),
985
+ __('Default priority', $this->domain),
986
+ __('Minimum priority', $this->domain),
987
+ __('Use GMT for Last Modified date', $this->domain),
988
+ __('Compress sitemaps', $this->domain),
989
+ __('Look and Feel', $this->domain),
990
+ __('Make sitemaps look pretty', $this->domain),
991
+ __('Custom XSLT stylesheet URL', $this->domain),
992
+ __('Enable build stats', $this->domain),
993
+ __('Enable credit', $this->domain),
994
+ __('Virtual robots.txt', $this->domain),
995
+ __('Add a sitemapindex entry to blog\'s robots.txt', $this->domain),
996
+ __('Add sitemapindex entries from all blogs to primary blog\'s robots.txt', $this->domain),
997
+ __('Ping search engines', $this->domain),
998
+ __('Enable pinging', $this->domain),
999
+ __('Search engines to ping', $this->domain),
1000
+ __('<strong>Disable pinging</strong> for following post types:', $this->domain),
1001
+ __('Ping limit for each search engine', $this->domain),
1002
+ __('Caching', $this->domain),
1003
+ __('Enable caching', $this->domain),
1004
+ __('Enable auto cache re-generation', $this->domain),
1005
+ __('Cache expiry time', $this->domain),
1006
+ __('Cache directory', $this->domain),
1007
+ __('Sitemap modules', $this->domain),
1008
+ __('Database query limit', $this->domain),
1009
+ __('Custom module directory', $this->domain),
1010
+ htmlspecialchars(__('Sitemap log & debug', $this->domain)),
1011
+ __('Enable sitemap log', $this->domain),
1012
+ __('Enable debug mode', $this->domain),
1013
+ __('Enable debug extra mode', $this->domain)
1014
+ ),
1015
+ 'item_names' => array(
1016
+ 'heading_submit',
1017
+ 'heading_contents',
1018
+ 'sec_index',
1019
+ 'sec_post',
1020
+ 'sec_tax',
1021
+ 'heading_limit',
1022
+ 'input_item_limit',
1023
+ 'cb_enable_split',
1024
+ 'input_split_limit_post',
1025
+ 'heading_format',
1026
+ 'select_default_freq',
1027
+ 'select_default_pri',
1028
+ 'select_min_pri',
1029
+ 'cb14',
1030
+ 'cb_enable_gzip',
1031
+ 'heading_look',
1032
+ 'cb10',
1033
+ 'input_custom_xslt',
1034
+ 'cb3',
1035
+ 'cb6',
1036
+ 'heading_robot',
1037
+ 'cb_index_to_blog',
1038
+ 'cb_index_to_primary',
1039
+ 'heading_ping',
1040
+ 'cb_ping',
1041
+ 'cb_ping_list',
1042
+ 'sec_post_ping',
1043
+ 'input_ping_limit',
1044
+ 'heading_cache',
1045
+ 'cb_enable_cache',
1046
+ 'cb_enable_autogen',
1047
+ 'input_cache_age',
1048
+ 'input_cache_dir',
1049
+ 'heading_module',
1050
+ 'input_sql_limit',
1051
+ 'input_alt_module_dir',
1052
+ 'heading_debug',
1053
+ 'cb_log',
1054
+ 'cb_debug',
1055
+ 'cb_debug_extra'
1056
+ ),
1057
+ 'heading' => array(
1058
+ 'heading_submit' => '',
1059
+ 'heading_contents' => '<em>'
1060
+ . sprintf(
1061
+ __('Choose appropriate sitemaps to generate. '
1062
+ . 'For each sitemap, you can use filters to further '
1063
+ . '<a href="%s#exclude_items" target="_blank">exclude items</a> '
1064
+ . 'you do not need.', $this->domain),
1065
+ $this->plugin_url
1066
+ ) . '</em>',
1067
+ 'heading_limit' => '<em>'
1068
+ . __('Limit the number of items to output in one sitemap. ', $this->domain)
1069
+ . sprintf(__('Avoid setting too high limits, i.e. ones that your server '
1070
+ . 'can not handle. In such case, you might encounter white page error '
1071
+ . 'due to timeout or memory issue. '
1072
+ . 'Refer to this plugin\'s <a target="_blank" href="%s">FAQ section</a> for more info.', $this->domain),
1073
+ $this->plugin_url . 'faq/')
1074
+ . '</em>',
1075
+ 'heading_format' => '<em>'
1076
+ . __('Customize default values and some formating for your sitemaps. '
1077
+ . 'Default values are only used when valid ones can not '
1078
+ . 'be calculated.', $this->domain)
1079
+ . '</em>',
1080
+ 'heading_look' => '<em>'
1081
+ . __('Customize the look and feel of your sitemaps. '
1082
+ . 'Note that an XSLT stylesheet will NOT be used '
1083
+ . 'for the Google News Sitemap module '
1084
+ . 'regardless of any setting in this section.', $this->domain)
1085
+ . '</em>',
1086
+ 'heading_robot' => '<em>'
1087
+ . sprintf(__('WordPress generates a %svirtual robots.txt%s '
1088
+ . 'file for your blog by default. '
1089
+ . 'You can add links to sitemapindex files generated by this plugin '
1090
+ . 'to that robots.txt file using settings below.', $this->domain),
1091
+ !self::is_multisite() || self::is_subdomain_install()
1092
+ ? '<a href="' . home_url('robots.txt') . '" target="_blank">'
1093
+ : '',
1094
+ !self::is_multisite() || self::is_subdomain_install()
1095
+ ? '</a>'
1096
+ : '')
1097
+ . '</em>',
1098
+ 'heading_ping' => '<em>'
1099
+ . __('Whenever you post something new to your blog, '
1100
+ . 'you can <em>ping</em> search engines with your sitemapindex '
1101
+ . 'to tell them your blog just got updated.', $this->domain)
1102
+ . '</em>',
1103
+ 'heading_cache' => '<em>'
1104
+ . __('Cache your sitemaps for better performance. '
1105
+ . 'If you are still configuring the plugin it\'s best to '
1106
+ . 'disable caching or you might have to manually flush the cache '
1107
+ . 'for any changes to show up.', $this->domain)
1108
+ . '</em>',
1109
+ 'heading_module' => '<em>'
1110
+ . sprintf(__('Extend this plugin using customizable modules. '
1111
+ . 'More info <a href="%s#module_api">here</a>.', $this->domain),
1112
+ $this->plugin_url)
1113
+ . '</em>',
1114
+ 'heading_debug' => ''
1115
+ ),
1116
+ 'sec_index' => array(
1117
+ array('checkbox', 'name' => 'cb17'),
1118
+ array('checkbox', 'name' => 'cb7'),
1119
+ array('checkbox', 'name' => 'cb9'),
1120
+ array('checkbox', 'name' => 'cb16'),
1121
+ array('checkbox', 'name' => 'cb13')
1122
+ ),
1123
+ 'sec_post' => array(),
1124
+ 'sec_post_ping' => array(),
1125
+ 'sec_tax' => array(),
1126
+ 'cb_ping_list' => array(
1127
+ array('checkbox', 'name' => 'cb_ping_google'),
1128
+ array('checkbox', 'name' => 'cb_ping_bing')
1129
+ ),
1130
+ 'select' => array(
1131
+ 'select_time_type' => array(
1132
+ __('second(s)', $this->domain) => 1,
1133
+ __('minute(s)', $this->domain) => 60,
1134
+ __('hour(s)', $this->domain) => 3600,
1135
+ __('day(s)', $this->domain) => 86400
1136
+ ),
1137
+ 'select_oldest_type' => array(
1138
+ __('second(s)', $this->domain) => 1,
1139
+ __('minute(s)', $this->domain) => 60,
1140
+ __('hour(s)', $this->domain) => 3600,
1141
+ __('day(s)', $this->domain) => 86400
1142
+ ),
1143
+ 'select_default_freq' => array(),
1144
+ 'select_default_pri' => $this->priorities,
1145
+ 'select_min_pri' => $this->priorities
1146
+ ),
1147
+ 'post' => array(
1148
+ 'select_default_freq' => sprintf('<a href="%s" target="_blank">'
1149
+ . __('read more', $this->domain)
1150
+ . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions'),
1151
+ 'select_default_pri' => sprintf('<a href="%s" target="_blank">'
1152
+ . __('read more', $this->domain)
1153
+ . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions'),
1154
+ 'select_min_pri' => sprintf('<a href="%s" target="_blank">'
1155
+ . __('read more', $this->domain)
1156
+ . '</a>', 'http://sitemaps.org/protocol.php#xmlTagDefinitions')
1157
+ ),
1158
+ 'checkbox' => array(
1159
+ 'cb_enable_cache' => array(__('Your sitemaps are generated and then cached to reduce unnecessary work.', $this->domain) => 'enable_cache'),
1160
+ 'cb_enable_autogen' => array(__('Re-generate sitemap cache when expired. If you disable this, remember to manually flush the cache once in a while.', $this->domain) => 'enable_cache_auto_gen'),
1161
+ 'cb3' => array(__('print useful information such as build time, memory usage, SQL queries, etc.', $this->domain) => 'enable_stats'),
1162
+ 'cb_enable_gzip' => array(__('Use gzip to make sitemaps ~70% smaller. If you see an error after enabling this, it\'s very likely that you have gzip active on your server already.', $this->domain) => 'enable_gzip'),
1163
+ 'cb_index_to_primary' => array(sprintf(__('If you have for example 50 blogs, 50 sitemapindex entries will be added to your primary blog\'s <a href="%s" target="_blank">robots.txt</a>.', $this->domain), get_site_option('home') . '/robots.txt') => 'enable_global_robots'),
1164
+ 'cb7' => array(__('Taxonomy (including custom taxonomies).', $this->domain) => 'enable_sitemap_taxonomy'),
1165
+ 'cb9' => array(__('Date archives.', $this->domain) => 'enable_sitemap_date'),
1166
+ 'cb16' => array(__('Author archives.', $this->domain) => 'enable_sitemap_author'),
1167
+ 'cb13' => array(sprintf(__('External pages. More info <a href="%s#external_sitemap" target="_blank">here</a>.', $this->domain), $this->plugin_url) => 'enable_sitemap_external'),
1168
+ 'cb6' => array(__('some copyrighted info is also added to your sitemaps. Thanks!', $this->domain) => 'enable_credit'),
1169
+ 'cb10' => array(__('Default XSLT stylesheets will be used. Set your custom stylesheets below or filter the <code>bwp_gxs_xslt</code> hook.', $this->domain) => 'enable_xslt'),
1170
+ 'cb_index_to_blog' => array(sprintf(__('If you\'re on a Multi-site installation with <strong>Sub-domain</strong> enabled, each blog will have its own robots.txt. Blogs in <strong>sub-directory</strong> will not, however. Please read the <a href="%s#robots.txt" target="_blank">documentation</a> for more info.', $this->domain), $this->plugin_url) => 'enable_robots'),
1171
+ 'cb_enable_split' => array(__('Sitemaps like <code>post.xml</code> are split into <code>post_part1.xml</code>, <code>post_part2.xml</code>, etc. when limit reached.', $this->domain) => 'enable_sitemap_split_post'),
1172
+ 'cb14' => array(__('Disable this to use the local timezone setting in <em>Settings >> General</em>.', $this->domain) => 'enable_gmt'),
1173
+ 'cb17' => array(__('Site Address. For a multi-site installation of WordPress, this sitemap will list all appropriate blogs\' addresses within your network, not just the main blog\'s.', $this->domain) => 'enable_sitemap_site'),
1174
+ 'cb_ping' => array(__('Ping search engines when you publish new posts. By default all public posts are considered, unless explicitly disabled below.', $this->domain) => 'enable_ping'),
1175
+ 'cb_ping_google' => array(__('Google', $this->domain) => 'enable_ping_google'),
1176
+ 'cb_ping_bing' => array(__('Bing', $this->domain) => 'enable_ping_bing'),
1177
+ 'cb_log' => array(sprintf(__('No additional load is needed so enabling this is highly recommended. You can check the log <a href="%s">here</a>.', $this->domain), $this->get_admin_page(BWP_GXS_STATS)) => 'enable_log'),
1178
+ 'cb_debug' => array(__('When this is on, NO caching is used and <code>WP_DEBUG</code> is respected, useful when developing new modules.', $this->domain) => 'enable_debug'),
1179
+ 'cb_debug_extra' => array(sprintf(__('When this is on, NO headers are sent and sitemaps are NOT compressed, useful when debugging <em>Content Encoding Error</em>. More info <a href="%s#sitemap_log_debug" target="_blank">here</a>.', $this->domain), $this->plugin_url) => 'enable_debug_extra'),
1180
+ ),
1181
+ 'input' => array(
1182
+ 'input_item_limit' => array(
1183
+ 'size' => 5,
1184
+ 'label' => __('Maximum is <strong>50,000</strong>. '
1185
+ . 'This setting is applied to all sitemaps.', $this->domain)
1186
+ ),
1187
+ 'input_split_limit_post' => array(
1188
+ 'size' => 5,
1189
+ 'label' => __('Maximum is <strong>50,000</strong>. '
1190
+ . 'Set to 0 to use the Global limit.', $this->domain)
1191
+ ),
1192
+ 'input_custom_xslt' => array(
1193
+ 'size' => 91,
1194
+ 'label' => '<br />'
1195
+ . __('Expect an absolute URL, '
1196
+ . 'e.g. <code>http://example.com/my-stylesheet.xsl</code>. '
1197
+ . 'You must also have a stylesheet for the sitemapindex '
1198
+ . 'that can be accessed through the above URL, '
1199
+ . 'e.g. <code>my-stylesheet.xsl</code> and '
1200
+ . '<code>my-stylesheetindex.xsl</code>. '
1201
+ . 'Leave blank to use provided stylesheets.', $this->domain)
1202
+ ),
1203
+ 'input_alt_module_dir' => array(
1204
+ 'size' => 91,
1205
+ 'label' => '<br />'
1206
+ . __('Expect an absolute path to the directory '
1207
+ . 'where you put your custom modules '
1208
+ . '(e.g. <code>/home/mysite/public_html/gxs-modules/</code>). ', $this->domain)
1209
+ . '<br />'
1210
+ . __('Override a built-in module by having a module '
1211
+ . 'with the same filename in specified directory.', $this->domain)
1212
+ ),
1213
+ 'input_cache_dir' => array(
1214
+ 'size' => 91,
1215
+ 'disabled' => $this->_get_cache_directory_from_constant() ? ' disabled="disabled" ' : '',
1216
+ 'value' => $this->_get_cache_directory_from_constant() ? strtoupper(__('set via constant (BWP_GXS_CACHE_DIR)', $this->domain)) : null,
1217
+ 'label' => '<br />'
1218
+ . __('Expect an absolute path to a writable directory '
1219
+ . '(i.e. CHMOD to 755 or 777). ', $this->domain)
1220
+ . '<br />'
1221
+ . sprintf(__('Leave empty to use <code>%s</code>.', $this->domain),
1222
+ $this->_get_default_cache_directory())
1223
+ ),
1224
+ 'input_sql_limit' => array(
1225
+ 'size' => 5,
1226
+ 'label' => __('Only get this many items when querying from Database. '
1227
+ . 'This is to make sure we are not running too heavy queries.', $this->domain)
1228
+ ),
1229
+ 'input_oldest' => array(
1230
+ 'size' => 3,
1231
+ 'label' => '&mdash;'
1232
+ ),
1233
+ 'input_cache_age' => array(
1234
+ 'size' => 5,
1235
+ 'label' => '&mdash;'
1236
+ ),
1237
+ 'input_ping_limit' => array(
1238
+ 'size' => 5,
1239
+ 'label' => __('time(s) per day. Increase this limit if '
1240
+ . 'you publish a lot of posts in a single day.', $this->domain)
1241
+ ),
1242
+ ),
1243
+ 'inline_fields' => array(
1244
+ 'input_cache_age' => array('select_time_type' => 'select')
1245
+ ),
1246
+ 'inline' => array(
1247
+ 'cb_enable_autogen' => '<br /><br />'
1248
+ ),
1249
+ 'container' => array(
1250
+ 'heading_submit' => array(
1251
+ '<em>'
1252
+ . sprintf(__('Submit your <a href="%s" target="_blank">sitemapindex</a> '
1253
+ . 'to major search engines like <a href="%s" target="_blank">Google</a>, '
1254
+ . '<a href="%s" target="_blank">Bing</a>.', $this->domain),
1255
+ $this->sitemap_url,
1256
+ 'https://www.google.com/webmasters/tools/home?hl=en',
1257
+ 'http://www.bing.com/toolbox/webmasters/')
1258
+ . ' '
1259
+ . sprintf(__('Only the sitemapindex needs to be submitted '
1260
+ . 'as search engines will automatically recognize other included sitemaps. '
1261
+ . 'More info can be found <a href="%s">here</a>.', $this->domain),
1262
+ 'https://support.google.com/webmasters/answer/75712?hl=en&ref_topic=4581190')
1263
+ . '</em>',
1264
+ $this->get_logs(true)
1265
+ )
1266
+ ),
1267
+ 'role' => array(
1268
+ 'cb_enable_gzip' => 'superadmin',
1269
+ 'heading_cache' => 'superadmin',
1270
+ 'cb_enable_cache' => 'superadmin',
1271
+ 'cb_enable_autogen' => 'superadmin',
1272
+ 'cb_index_to_primary' => 'superadmin',
1273
+ 'input_cache_age' => 'superadmin',
1274
+ 'input_cache_dir' => 'superadmin',
1275
+ 'heading_module' => 'superadmin',
1276
+ 'input_sql_limit' => 'superadmin',
1277
+ 'input_alt_module_dir' => 'superadmin',
1278
+ 'heading_debug' => 'superadmin',
1279
+ 'cb_log' => 'superadmin',
1280
+ 'cb_debug' => 'superadmin',
1281
+ 'cb_debug_extra' => 'superadmin'
1282
+ ),
1283
+ 'env' => array(
1284
+ 'cb_index_to_primary' => 'multisite'
1285
+ )
1286
+ );
1287
+
1288
+ foreach ($this->frequencies as $freq)
1289
+ $changefreq[ucfirst($freq)] = $freq;
1290
+
1291
+ $form['select']['select_default_freq'] = $changefreq;
1292
+
1293
+ $options = $bwp_option_page->get_options(array(
1294
+ 'input_item_limit',
1295
+ 'input_split_limit_post',
1296
+ 'input_alt_module_dir',
1297
+ 'input_cache_dir',
1298
+ 'input_sql_limit',
1299
+ 'input_cache_age',
1300
+ 'input_custom_xslt',
1301
+ 'input_exclude_post_type',
1302
+ 'input_exclude_post_type_ping',
1303
+ 'input_exclude_taxonomy',
1304
+ 'input_ping_limit',
1305
+ 'enable_gmt',
1306
+ 'enable_xslt',
1307
+ 'enable_cache',
1308
+ 'enable_cache_auto_gen',
1309
+ 'enable_stats',
1310
+ 'enable_credit',
1311
+ 'enable_sitemap_split_post',
1312
+ 'enable_robots',
1313
+ 'enable_global_robots',
1314
+ 'enable_sitemap_date',
1315
+ 'enable_sitemap_taxonomy',
1316
+ 'enable_sitemap_external',
1317
+ 'enable_sitemap_author',
1318
+ 'enable_sitemap_site',
1319
+ 'enable_gzip',
1320
+ 'enable_ping',
1321
+ 'enable_ping_google',
1322
+ 'enable_ping_bing',
1323
+ 'enable_log',
1324
+ 'enable_debug',
1325
+ 'enable_debug_extra',
1326
+ 'select_time_type',
1327
+ 'select_default_freq',
1328
+ 'select_default_pri',
1329
+ 'select_min_pri'
1330
+ ), $this->options);
1331
+
1332
+ // get option from the database
1333
+ $options = $bwp_option_page->get_db_options($page, $options);
1334
+
1335
+ $option_formats = array(
1336
+ 'input_item_limit' => 'int',
1337
+ 'input_split_limit_post' => 'int',
1338
+ 'input_sql_limit' => 'int',
1339
+ 'input_cache_age' => 'int',
1340
+ 'input_ping_limit' => 'int',
1341
+ 'select_time_type' => 'int'
1342
+ );
1343
+
1344
+ $option_ignore = array(
1345
+ 'input_exclude_post_type',
1346
+ 'input_exclude_post_type_ping',
1347
+ 'input_exclude_taxonomy'
1348
+ );
1349
+
1350
+ $option_super_admin = $this->site_options;
1351
+ }
1352
+ elseif ($page == BWP_GXS_GOOGLE_NEWS)
1353
+ {
1354
+ $bwp_option_page->set_current_tab(2);
1355
+
1356
+ $form = array(
1357
+ 'items' => array(
1358
+ 'heading',
1359
+ 'checkbox',
1360
+ 'checkbox',
1361
+ 'select',
1362
+ 'checkbox',
1363
+ 'checkbox',
1364
+ 'select',
1365
+ 'heading',
1366
+ 'select'
1367
+ ),
1368
+ 'item_labels' => array
1369
+ (
1370
+ __('Add Google News Sitemap to your sitemapindex', $this->domain),
1371
+ __('Enable news sitemap', $this->domain),
1372
+ __('Enable keywords support', $this->domain),
1373
+ __('Get keywords from', $this->domain),
1374
+ __('Enable multi-category support', $this->domain),
1375
+ __('Ping search engines when a news article is published', $this->domain),
1376
+ __('News sitemap\'s language', $this->domain),
1377
+ __('News categories', $this->domain),
1378
+ __('The Google News sitemap will', $this->domain)
1379
+ ),
1380
+ 'item_names' => array(
1381
+ 'h1',
1382
+ 'cb1',
1383
+ 'cb2',
1384
+ 'select_news_keyword_type',
1385
+ 'cb4',
1386
+ 'cb3',
1387
+ 'select_news_lang',
1388
+ 'h2',
1389
+ 'select_news_cat_action'
1390
+ ),
1391
+ 'heading' => array(
1392
+ 'h1' => '<em>'
1393
+ . __('A Google News Sitemap is a file that '
1394
+ . 'allows you to control which content '
1395
+ . 'you submit to Google News. By creating and '
1396
+ . 'submitting a Google News Sitemap, you\'re able '
1397
+ . 'to help Google News discover and crawl your site\'s news articles '
1398
+ . '&mdash; http://support.google.com/', $this->domain)
1399
+ . '</em>',
1400
+ 'h2' => '<em>'
1401
+ . __('Below you will be able to choose what categories '
1402
+ . 'to use (or not use) in the news sitemap. '
1403
+ . 'You can also assign genres to a specific category.', $this->domain)
1404
+ . '</em>'
1405
+ ),
1406
+ 'post' => array(
1407
+ 'select_news_cat_action' => __('below selected categories in the news sitemap.', $this->domain)
1408
+ ),
1409
+ 'select' => array(
1410
+ 'select_news_lang' => array(
1411
+ /* http://www.loc.gov/standards/iso639-2/php/code_list.php */
1412
+ __('English', $this->domain) => 'en',
1413
+ __('Arabic', $this->domain) => 'ar',
1414
+ __('Chinese (simplified)', $this->domain) => 'zh-cn',
1415
+ __('Chinese (traditional)', $this->domain) => 'zh-tw',
1416
+ __('Dutch', $this->domain) => 'nl',
1417
+ __('French', $this->domain) => 'fr',
1418
+ __('German', $this->domain) => 'de',
1419
+ __('Hebrew', $this->domain) => 'he',
1420
+ __('Hindi', $this->domain) => 'hi',
1421
+ __('Italian', $this->domain) => 'it',
1422
+ __('Japanese', $this->domain) => 'ja',
1423
+ __('Norwegian', $this->domain) => 'no',
1424
+ __('Portuguese', $this->domain) => 'pt',
1425
+ __('Polish', $this->domain) => 'pl',
1426
+ __('Russian', $this->domain) => 'ru',
1427
+ __('Spanish', $this->domain) => 'es',
1428
+ __('Turkish', $this->domain) => 'tr',
1429
+ __('Vietnamese', $this->domain) => 'vi'
1430
+ ),
1431
+ 'select_news_cat_action' => array(
1432
+ __('include', $this->domain) => 'inc',
1433
+ __('exclude', $this->domain) => 'exc'
1434
+ ),
1435
+ 'select_news_keyword_type' => array(
1436
+ __('News categories', $this->domain) => 'cat',
1437
+ __('News tags', $this->domain) => 'tag'
1438
+ )
1439
+ ),
1440
+ 'input' => array(
1441
+ ),
1442
+ 'checkbox' => array(
1443
+ 'cb1' => array(sprintf(__('A <code>post_google_news.xml</code> sitemap will be added to the main <a href="%s" target="_blank">sitemapindex.xml</a>. It is strongly recommended that you take a look at <a href="%s" target="_blank">Google\'s guidelines</a> before enabling this feature.', $this->domain), $this->sitemap_url, 'https://support.google.com/news/publisher/answer/74288?hl=en#sitemapguidelines') => 'enable_news_sitemap'),
1444
+ 'cb2' => array(sprintf(__('More info <a href="%s" target="_blank">here</a>.', $this->domain), 'https://support.google.com/news/publisher/answer/116037?hl=en&ref_topic=4359874') => 'enable_news_keywords'),
1445
+ 'cb3' => array(__('This ping works separately from the sitemapindex ping, and only occurs when you publish an article in one of the news categories set below.', $this->domain) => 'enable_news_ping'),
1446
+ 'cb4' => array(__('Enable this if you have posts assigned to more than one categories.', $this->domain) => 'enable_news_multicat')
1447
+ ),
1448
+ 'inline_fields' => array(
1449
+ ),
1450
+ 'post' => array(
1451
+ ),
1452
+ 'container' => array(
1453
+ 'select_news_cat_action' => '',
1454
+ 'cb1' => '<em><strong>' . __('Note', $this->domain) . ':</strong> '
1455
+ . __('The Google News sitemap is an extension (or sub-module) of '
1456
+ . 'the <code>post.xml</code> sitemap, which means it also uses posts from '
1457
+ . 'the <strong>Post</strong> post type, but only from categories that are selected.', $this->domain)
1458
+ . '</em>'
1459
+ )
1460
+ );
1461
+
1462
+ // Get the options
1463
+ $options = $bwp_option_page->get_options(array(
1464
+ 'enable_news_sitemap',
1465
+ 'enable_news_ping',
1466
+ 'enable_news_keywords',
1467
+ 'enable_news_multicat',
1468
+ 'select_news_lang',
1469
+ 'select_news_keyword_type',
1470
+ 'select_news_cat_action',
1471
+ 'select_news_cats',
1472
+ 'input_news_genres'
1473
+ ), $this->options);
1474
+
1475
+ // Get option from the database
1476
+ $options = $bwp_option_page->get_db_options($page, $options);
1477
+
1478
+ $option_ignore = array(
1479
+ 'select_news_cats',
1480
+ 'input_news_genres'
1481
+ );
1482
+
1483
+ $option_formats = array();
1484
+
1485
+ $option_super_admin = $this->site_options;
1486
+ }
1487
+ elseif ($page == BWP_GXS_STATS)
1488
+ {
1489
+ $bwp_option_page->set_current_tab(3);
1490
+
1491
+ // no save changes button
1492
+ add_filter('bwp_option_submit_button', create_function('', 'return "";'));
1493
+
1494
+ if ($this->_is_log_empty || 'yes' != $this->options['enable_log'])
1495
+ {
1496
+ // no log is found, or logging is disabled, hide sidebar to save space
1497
+ add_filter('bwp_info_showable', create_function('', 'return "";'));
1498
+ }
1499
+
1500
+ $form = array(
1501
+ 'items' => array(
1502
+ 'heading',
1503
+ ),
1504
+ 'item_labels' => array
1505
+ (
1506
+ __('Sitemap Generator\'s Log', $this->domain),
1507
+ ),
1508
+ 'item_names' => array(
1509
+ 'h3',
1510
+ ),
1511
+ 'heading' => array(
1512
+ 'h3' => 'yes' == $this->options['enable_log']
1513
+ ? '<em>'
1514
+ . __('Below are details on how your sitemaps are generated '
1515
+ . 'including <span style="color: #999999;">notices</span>, '
1516
+ . '<span style="color: #FF0000;">errors</span> and '
1517
+ . '<span style="color: #009900;">success messages</span>.', $this->domain)
1518
+ . '</em>'
1519
+ : '<em>'
1520
+ . __('Logging is not currently enabled. '
1521
+ . 'You can enable this feature by checking '
1522
+ . '"Enable sitemap log" in <strong>XML Sitemaps >> Sitemap log & debug</strong>.', $this->domain)
1523
+ . '</em>',
1524
+ ),
1525
+ 'container' => array(
1526
+ 'h3' => 'yes' == $this->options['enable_log'] ? $this->get_logs() : '',
1527
+ )
1528
+ );
1529
+
1530
+ // get the options
1531
+ $options = array();
1532
+
1533
+ // get option from the database
1534
+ $options = $bwp_option_page->get_db_options($page, $options);
1535
+
1536
+ $option_ignore = array();
1537
+ $option_formats = array();
1538
+
1539
+ $option_super_admin = $this->site_options;
1540
+ }
1541
+ }
1542
+
1543
+ if ((isset($_POST['submit_' . $bwp_option_page->get_form_name()])
1544
+ || isset($_POST['save_flush_cache']))
1545
+ && isset($options) && is_array($options)
1546
+ ) {
1547
+ // basic security check
1548
+ check_admin_referer($page);
1549
+
1550
+ foreach ($options as $key => &$option)
1551
+ {
1552
+ if (in_array($key, $option_ignore)
1553
+ || (self::is_normal_admin() && in_array($key, $option_super_admin))
1554
+ ) {
1555
+ // this option should not be handled here
1556
+ // OR not a super admin, and this is a super-admin only setting
1557
+ continue;
1558
+ }
1559
+ else
1560
+ {
1561
+ if (isset($_POST[$key]))
1562
+ {
1563
+ // make sure inputs are in expected format
1564
+ $bwp_option_page->format_field($key, $option_formats);
1565
+ $option = trim(stripslashes($_POST[$key]));
1566
+ }
1567
+
1568
+ if (!isset($_POST[$key])
1569
+ && !isset($form['input'][$key]['disabled'])
1570
+ ) {
1571
+ // checkbox, exclude disabled input
1572
+ $option = '';
1573
+ }
1574
+ else if (isset($option_formats[$key])
1575
+ && 'int' == $option_formats[$key]
1576
+ && ('' === $_POST[$key] || 0 > $_POST[$key])
1577
+ ) {
1578
+ // expect integer but received empty string or negative integer
1579
+ $option = $this->options_default[$key];
1580
+ }
1581
+ }
1582
+ }
1583
+
1584
+ if ($page == BWP_GXS_OPTION_GENERATOR)
1585
+ {
1586
+ // handle dynamic options based on public post types and taxonomies
1587
+ $ept = array(); // exclude post types from sitemap
1588
+ $eppt = array(); // exclude post types from pinging
1589
+ $etax = array(); // exclude taxonomies from sitemap
1590
+
1591
+ foreach ($_POST as $o => $v)
1592
+ {
1593
+ if (strpos($o, 'ept_') === 0)
1594
+ $ept[] = trim(str_replace('ept_', '', $o));
1595
+ elseif (strpos($o, 'eppt_') === 0)
1596
+ $eppt[] = trim(str_replace('eppt_', '', $o));
1597
+ else if (strpos($o, 'etax_') === 0)
1598
+ $etax[] = trim(str_replace('etax_', '', $o));
1599
+ }
1600
+
1601
+ $options['input_exclude_post_type'] = implode(',', $ept);
1602
+ $options['input_exclude_post_type_ping'] = implode(',', $eppt);
1603
+ $options['input_exclude_taxonomy'] = implode(',', $etax);
1604
+
1605
+ // no more than 50000 URLs per sitemap
1606
+ $options['input_item_limit'] = 50000 < $options['input_item_limit']
1607
+ ? 50000 : $options['input_item_limit'];
1608
+
1609
+ $options['input_split_limit_post'] = 50000 < $options['input_split_limit_post']
1610
+ ? 50000 : $options['input_split_limit_post'];
1611
+ }
1612
+ elseif ($page == BWP_GXS_GOOGLE_NEWS)
1613
+ {
1614
+ // save google news categories and genres
1615
+ $news_cats = array();
1616
+ $news_genres = array();
1617
+
1618
+ $categories = get_categories(array('hide_empty' => 0));
1619
+
1620
+ foreach ($categories as $category)
1621
+ {
1622
+ if (!empty($_POST[$category->slug]))
1623
+ $news_cats[] = $category->term_id;
1624
+
1625
+ if (isset($_POST[$category->slug . '_genres'])
1626
+ && is_array($_POST[$category->slug . '_genres'])
1627
+ ) {
1628
+ $genres = $_POST[$category->slug . '_genres'];
1629
+ $genres_string = array();
1630
+
1631
+ foreach ($genres as $genre)
1632
+ $genres_string[] = trim($genre);
1633
+
1634
+ $news_genres['cat_' . $category->term_id] = implode(', ', $genres_string);
1635
+ }
1636
+ }
1637
+
1638
+ $options['select_news_cats'] = implode(',', $news_cats);
1639
+ $options['input_news_genres'] = $news_genres;
1640
+ }
1641
+
1642
+ // update per-blog options
1643
+ update_option($page, $options);
1644
+
1645
+ // if current user is super admin, allow him to update site-only
1646
+ // options - this is WPMS compatible
1647
+ if (!self::is_normal_admin())
1648
+ update_site_option($page, $options);
1649
+
1650
+ // refresh the options property to include updated options
1651
+ $this->options = array_merge($this->options, $options);
1652
+
1653
+ // show success messages when settings are saved
1654
+ $this->add_notice(__('All options have been saved.', $this->domain));
1655
+
1656
+ // flush cache if needed
1657
+ if (isset($_POST['save_flush_cache']))
1658
+ $this->_admin_flush_cache();
1659
+ }
1660
+
1661
+ if ($page == BWP_GXS_OPTION_GENERATOR)
1662
+ {
1663
+ // handle other non-POST actions for XML Sitemap setting page
1664
+
1665
+ // add dynamic checkboxes to the current form
1666
+ $this->_add_checkboxes_to_form('sec_post', 'ept_', $form, $dynamic_options);
1667
+ $this->_add_checkboxes_to_form('sec_post_ping', 'eppt_', $form, $dynamic_options);
1668
+ $this->_add_checkboxes_to_form('sec_tax', 'etax_', $form, $dynamic_options);
1669
+
1670
+ if ($this->options['enable_cache'] == 'yes')
1671
+ {
1672
+ // show a warning if caching is enabled but cache directory is
1673
+ // not writable
1674
+ $this->cache_directory = $this->_get_cache_directory();
1675
+
1676
+ if (!@file_exists($this->cache_directory) || !@is_writable($this->cache_directory))
1677
+ {
1678
+ $this->add_notice(
1679
+ '<strong>' . __('Warning') . ':</strong> '
1680
+ . sprintf(__('Cache directory (<code>%s</code>) does not exist or is not writable. '
1681
+ . 'Please try CHMODing it to either 755 or 777, or disable caching to hide '
1682
+ . 'this warning (not recommended).', $this->domain), $this->cache_directory)
1683
+ );
1684
+ }
1685
+ }
1686
+ }
1687
+ elseif ($page == BWP_GXS_GOOGLE_NEWS)
1688
+ {
1689
+ $form['container']['select_news_cat_action'] = $this->get_news_cats();
1690
+ }
1691
+
1692
+ // assign the form and option array
1693
+ $bwp_option_page->init($form, $options + $dynamic_options, $this->form_tabs);
1694
+
1695
+ // build the option page
1696
+ echo $bwp_option_page->generate_html_form();
1697
+ }
1698
+
1699
+ public function add_flush_cache_buttons($button)
1700
+ {
1701
+ $button = str_replace(
1702
+ '</p>',
1703
+ '&nbsp; <input type="submit" class="button-secondary action" name="save_flush_cache" '
1704
+ . 'value="' . __('Save Changes and Flush Cache', $this->domain) . '" />'
1705
+ . '&nbsp; <input type="submit" class="button-secondary action" name="flush_cache" '
1706
+ . 'value="' . __('Flush Cache', $this->domain) . '" /></p>',
1707
+ $button
1708
+ );
1709
+
1710
+ return $button;
1711
+ }
1712
+
1713
+ public function add_clear_log_button($button)
1714
+ {
1715
+ $button = str_replace(
1716
+ '</p>',
1717
+ '&nbsp; <input type="submit" class="button-secondary action" name="clear_log" value="'
1718
+ . __('Clear All Logs', $this->domain) . '" /></p>',
1719
+ $button
1720
+ );
1721
+
1722
+ return $button;
1723
+ }
1724
+
1725
+ public function flush_cache()
1726
+ {
1727
+ $deleted = 0;
1728
+ $dir = trailingslashit($this->options['input_cache_dir']);
1729
+
1730
+ if (is_dir($dir))
1731
+ {
1732
+ if ($dh = opendir($dir))
1733
+ {
1734
+ while (($file = readdir($dh)) !== false)
1735
+ {
1736
+ if (preg_match('/^gxs_[a-z0-9]+\.(xml|xml\.gz)$/i', $file))
1737
+ {
1738
+ @unlink($dir . $file);
1739
+ $deleted++;
1740
+ }
1741
+ }
1742
+
1743
+ closedir($dh);
1744
+ }
1745
+ }
1746
+
1747
+ return $deleted;
1748
+ }
1749
+
1750
+ public function get_options()
1751
+ {
1752
+ return $this->options;
1753
+ }
1754
+
1755
+ private static function _format_header_time($time)
1756
+ {
1757
+ return bwp_gxs_format_header_time($time);
1758
+ }
1759
+
1760
+ private static function _get_current_time()
1761
+ {
1762
+ return current_time('timestamp');
1763
+ }
1764
+
1765
+ /**
1766
+ * Flushes sitemap cache inside admin area
1767
+ *
1768
+ * @since 1.3.0
1769
+ * @access private
1770
+ */
1771
+ private function _admin_flush_cache()
1772
+ {
1773
+ if ($deleted = $this->flush_cache())
1774
+ {
1775
+ $this->add_notice(
1776
+ '<strong>' . __('Notice', $this->domain) . ':</strong> '
1777
+ . sprintf(
1778
+ __('<strong>%d</strong> cached sitemaps have '
1779
+ . 'been flushed successfully!', $this->domain),
1780
+ $deleted)
1781
+ );
1782
+
1783
+ return true;
1784
+ }
1785
+ else
1786
+ {
1787
+ $this->add_notice(
1788
+ '<strong>' . __('Notice', $this->domain) . ':</strong> '
1789
+ . __('Could not delete any cached sitemaps. '
1790
+ . 'Please manually check the cache directory.', $this->domain)
1791
+ );
1792
+
1793
+ return false;
1794
+ }
1795
+ }
1796
+
1797
+ /**
1798
+ * Normalize path separator in different environments
1799
+ *
1800
+ * @access private
1801
+ */
1802
+ private function _normalize_path_separator($path = '')
1803
+ {
1804
+ return str_replace('\\', '/', $path);
1805
+ }
1806
+
1807
+ /**
1808
+ * Displays sitemap generation error with an error code
1809
+ *
1810
+ * @since 1.3.0
1811
+ * @access private
1812
+ */
1813
+ private function _die($message, $error_code)
1814
+ {
1815
+ wp_die(__('<strong>BWP Google XML Sitemaps Error:</strong> ', $this->domain)
1816
+ . $message, __('BWP Google XML Sitemaps Error', $this->domain),
1817
+ array('response' => $error_code)
1818
+ );
1819
+ }
1820
+
1821
+ public function commit_logs()
1822
+ {
1823
+ update_option(BWP_GXS_LOG, $this->logs);
1824
+ }
1825
+
1826
+ public function do_log($message, $error = true, $sitemap = false)
1827
+ {
1828
+ /* _deprecated_function(__FUNCTION__, '1.3.0', 'BWP_SIMPLE_GXS::log_message'); */
1829
+ $this->log_message($message, $error, $sitemap);
1830
+ }
1831
+
1832
+ public function log_message($message, $error = true, $sitemap = false)
1833
+ {
1834
+ $time = self::_get_current_time();
1835
+
1836
+ $debug_message = $this->_debug_extra
1837
+ ? __('Debug extra was on', $this->domain)
1838
+ : __('Debug was on', $this->domain);
1839
+
1840
+ $debug = $this->_debug ? ' (' . $debug_message . ')' : '';
1841
+
1842
+ if (!$sitemap && 'yes' == $this->options['enable_log']
1843
+ && !empty($message)
1844
+ ) {
1845
+ $this->logs['log'][] = array(
1846
+ 'log' => $message . $debug,
1847
+ 'time' => $time,
1848
+ 'error' => $error
1849
+ );
1850
+ }
1851
+ elseif (!is_bool($sitemap))
1852
+ {
1853
+ $this->logs['sitemap'][$sitemap] = array(
1854
+ 'time' => $time,
1855
+ 'url' => $sitemap
1856
+ );
1857
+ }
1858
+ }
1859
+
1860
+ public function elog($message, $die = false, $error_code = 404)
1861
+ {
1862
+ $this->log_error($message, $die, $error_code);
1863
+ }
1864
+
1865
+ public function log_error($message, $die = false, $error_code = 404)
1866
+ {
1867
+ $this->log_message($message);
1868
+
1869
+ if (true == $die)
1870
+ {
1871
+ $this->commit_logs();
1872
+ $this->_die($message, $error_code);
1873
+ }
1874
+ }
1875
+
1876
+ public function slog($message)
1877
+ {
1878
+ $this->log_success($message);
1879
+ }
1880
+
1881
+ public function log_success($message)
1882
+ {
1883
+ $this->log_message($message, false);
1884
+ }
1885
+
1886
+ public function nlog($message)
1887
+ {
1888
+ $this->log_notice($message);
1889
+ }
1890
+
1891
+ public function log_notice($message)
1892
+ {
1893
+ $this->log_message($message, 'notice');
1894
+ }
1895
+
1896
+ public function smlog($url)
1897
+ {
1898
+ $this->log_sitemap($url);
1899
+ }
1900
+
1901
+ public function log_sitemap($url)
1902
+ {
1903
+ $this->log_message('', false, $url);
1904
+ }
1905
+
1906
+ public function get_sitemap_logs()
1907
+ {
1908
+ $logs = $this->logs['sitemap'];
1909
+
1910
+ if (!$logs || !is_array($logs) || 0 == sizeof($logs))
1911
+ return false;
1912
+
1913
+ $return = array();
1914
+
1915
+ foreach ($logs as $log)
1916
+ $return[$log['url']] = $log['time'];
1917
+
1918
+ return $return;
1919
+ }
1920
+
1921
+ public function get_logs($sitemap = false)
1922
+ {
1923
+ $logs = !$sitemap ? $this->logs['log'] : $this->logs['sitemap'];
1924
+
1925
+ if (!$logs || !is_array($logs) || 0 == sizeof($logs))
1926
+ {
1927
+ return $sitemap
1928
+ ? '<em>' . __('It appears that no sitemap has been generated yet, '
1929
+ . 'or you have recently cleared the sitemap log.', $this->domain)
1930
+ . '</em>'
1931
+ : strtoupper(__('No log yet!', $this->domain)) . "\n";
1932
+ }
1933
+
1934
+ $log_class = !$sitemap ? 'bwp-gxs-log bwp-gxs-log-big' : 'bwp-gxs-log bwp-gxs-log-small';
1935
+ $log_str = !$sitemap
1936
+ ? '<li class="bwp-clear" style="margin-top: 5px; line-height: 1.7;">'
1937
+ . '<span style="float: left; margin-right: 5px;">%s &mdash;</span> '
1938
+ . '<span style="color: #%s;">%s</span></li>'
1939
+ : '<span style="margin-top: 5px; display: inline-block;">'
1940
+ . __('<a href="%s" target="_blank">%s</a> was generated on <strong>%s</strong>.', $this->domain)
1941
+ . '</span><br />';
1942
+
1943
+ $output = $sitemap
1944
+ ? '<span style="display:inline-block; margin-bottom: 7px;"><em>'
1945
+ . __('Below you can find a list of generated sitemaps:', $this->domain)
1946
+ . '</em></span>'
1947
+ . '<br />'
1948
+ : '';
1949
+
1950
+ $output .= '<ul class="' . $log_class . '">' . "\n";
1951
+
1952
+ if (!$sitemap)
1953
+ {
1954
+ krsort($logs);
1955
+ }
1956
+ else
1957
+ {
1958
+ $log_time = array();
1959
+
1960
+ foreach ($logs as $key => $row)
1961
+ $log_time[$key] = $row['time'];
1962
+
1963
+ array_multisort($log_time, SORT_DESC, $logs);
1964
+ }
1965
+
1966
+ foreach ($logs as $log)
1967
+ {
1968
+ if (isset($log['error']))
1969
+ {
1970
+ $color = !is_bool($log['error']) && 'notice' == $log['error'] ? '999999' : '';
1971
+
1972
+ if ('' == $color)
1973
+ $color = (!$log['error']) ? '009900' : 'FF0000';
1974
+
1975
+ /* translators: date format, see http://php.net/date */
1976
+ $output .= sprintf($log_str,
1977
+ date(__('M j, Y : H:i:s', $this->domain), $log['time']),
1978
+ $color, $log['log']) . "\n";
1979
+ }
1980
+ else
1981
+ {
1982
+ // @since 1.1.5 - check for mapped domain
1983
+ global $wpdb, $blog_id;
1984
+
1985
+ if (!empty($wpdb->dmtable) && !empty($wpdb->blogs) && self::is_multisite())
1986
+ {
1987
+ // @todo 1.3.0 recheck whether this is needed
1988
+ $mapped_domain = $wpdb->get_var($wpdb->prepare('
1989
+ SELECT wpdm.domain as mapped_domain
1990
+ FROM ' . $wpdb->blogs . ' wpblogs
1991
+ LEFT JOIN ' . $wpdb->dmtable . ' wpdm
1992
+ ON wpblogs.blog_id = wpdm.blog_id AND wpdm.active = 1
1993
+ WHERE wpblogs.public = 1 AND wpblogs.spam = 0
1994
+ AND wpblogs.deleted = 0 AND wpblogs.blog_id = %d', $blog_id
1995
+ ));
1996
+ }
1997
+
1998
+ // @todo default to the main site's scheme
1999
+ $home = @parse_url(home_url());
2000
+
2001
+ $sitemap_struct = !empty($mapped_domain)
2002
+ ? str_replace($home['host'],
2003
+ str_replace(array('http', 'https'), '', $mapped_domain),
2004
+ $this->sitemap_url_struct)
2005
+ : $this->sitemap_url_struct;
2006
+
2007
+ $sitemap_struct = sprintf($sitemap_struct, $log['url']);
2008
+
2009
+ $output .= sprintf($log_str,
2010
+ $sitemap_struct,
2011
+ $log['url'],
2012
+ date(__('M j, Y : H:i:s', $this->domain),
2013
+ $log['time'])) . "\n";
2014
+ }
2015
+ }
2016
+
2017
+ return $output . '</ul>' . "\n";
2018
+ }
2019
+
2020
+ public function do_robots($output, $public)
2021
+ {
2022
+ global $blog_id, $wpdb;
2023
+
2024
+ if ('0' == $public)
2025
+ return $output;
2026
+
2027
+ if (self::is_subdomain_install() || (isset($blog_id) && 1 == $blog_id))
2028
+ {
2029
+ $output .= "\n";
2030
+ $output .= 'Sitemap: ' . $this->sitemap_url;
2031
+ $output .= "\n";
2032
+ }
2033
+
2034
+ // add all other sitemapindex within the network into the primary
2035
+ // blog's robots.txt, including mapped domains
2036
+ if (self::is_multisite() && 'yes' == $this->options['enable_global_robots']
2037
+ && isset($blog_id) && 1 == $blog_id
2038
+ ) {
2039
+ $blogs = empty($wpdb->dmtable)
2040
+ ? $wpdb->get_results("
2041
+ SELECT *
2042
+ FROM $wpdb->blogs
2043
+ WHERE public = 1
2044
+ AND spam = 0
2045
+ AND deleted = 0")
2046
+ : $wpdb->get_results('
2047
+ SELECT
2048
+ wpdm.domain as mapped_domain,
2049
+ wpblogs.*
2050
+ FROM ' . $wpdb->blogs . ' wpblogs
2051
+ LEFT JOIN ' . $wpdb->dmtable . ' wpdm
2052
+ ON wpblogs.blog_id = wpdm.blog_id
2053
+ AND wpdm.active = 1
2054
+ WHERE wpblogs.public = 1
2055
+ AND wpblogs.spam = 0
2056
+ AND wpblogs.deleted = 0');
2057
+
2058
+ $num_sites = 0;
2059
+
2060
+ foreach ($blogs as $blog)
2061
+ {
2062
+ if (1 == $blog->blog_id)
2063
+ continue;
2064
+
2065
+ $scheme = is_ssl() ? 'https://' : 'http://';
2066
+ $path = rtrim($blog->path, '/');
2067
+
2068
+ // @since 1.3.0 allow mapped domains
2069
+ // @see https://support.google.com/webmasters/answer/75712?hl=en&ref_topic=4581190
2070
+ $blog_domain = empty($blog->mapped_domain)
2071
+ ? $blog->domain . $path
2072
+ : $blog->mapped_domain;
2073
+
2074
+ if (!empty($blog_domain))
2075
+ {
2076
+ $output .= 'Sitemap: ' . str_replace(home_url(),
2077
+ $scheme . $blog_domain,
2078
+ $this->sitemap_url) . "\n";
2079
+
2080
+ $num_sites++;
2081
+ }
2082
+ }
2083
+
2084
+ if (!empty($num_sites))
2085
+ $output .= "\n";
2086
+ }
2087
+
2088
+ return $output;
2089
+ }
2090
+
2091
+ private function get_news_cats()
2092
+ {
2093
+ // News categories
2094
+ $news_cats = explode(',', $this->options['select_news_cats']);
2095
+ $categories = get_categories(array('hide_empty' => 0));
2096
+
2097
+ // News genres
2098
+ $news_genres = $this->options['input_news_genres'];
2099
+
2100
+ // Genres taken from here: http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=93992
2101
+ $genres = array(
2102
+ 'PressRelease',
2103
+ 'Satire',
2104
+ 'Blog',
2105
+ 'OpEd',
2106
+ 'Opinion',
2107
+ 'UserGenerated'
2108
+ );
2109
+
2110
+ $return = '<table class="bwp-table">' . "\n";
2111
+ $return .= '<thead>' . "\n"
2112
+ . '<tr><th><span>#</span></th><th><span>'
2113
+ . __('Category\'s name', $this->domain) . '</span></th><th>'
2114
+ . sprintf(__('<span>Genres used for this category</span>'
2115
+ . ' (more info <a href="%s" target="_blank">here</a>)', $this->domain),
2116
+ 'http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=93992')
2117
+ . '</th></tr>' . "\n"
2118
+ . '</thead>';
2119
+ $return .= '<tbody>' . "\n";
2120
+
2121
+ foreach ($categories as $category)
2122
+ {
2123
+ $return .= '<tr>' . "\n";
2124
+
2125
+ $genres_cbs = '';
2126
+
2127
+ foreach ($genres as $genre)
2128
+ {
2129
+ $checked = '';
2130
+
2131
+ if (isset($news_genres['cat_' . $category->term_id]))
2132
+ {
2133
+ $genres_ary = explode(', ', $news_genres['cat_' . $category->term_id]);
2134
+ $checked = in_array($genre, $genres_ary) ? ' checked="checked" ' : '';
2135
+ }
2136
+
2137
+ $genres_cbs .= '<input type="checkbox" '
2138
+ . 'name="' . esc_attr($category->slug) . '_genres[]" '
2139
+ . 'value="' . $genre . '"' . $checked . '/> '
2140
+ . $genre . ' &nbsp;&nbsp;&nbsp;&nbsp;';
2141
+ }
2142
+
2143
+ $checked = in_array($category->term_id, $news_cats) ? ' checked="checked" ' : '';
2144
+
2145
+ $return .= '<td><input type="checkbox" name="' . esc_attr($category->slug) . '" '
2146
+ . 'value="' . esc_attr($category->slug) . '"' . $checked . ' /></td>' . "\n"
2147
+ . '<td class="bwp_gxs_news_cat_td">' . esc_html($category->name) . '</td>' . "\n"
2148
+ . '<td>' . $genres_cbs . '</td>' . "\n";
2149
+
2150
+ $return .= '</tr>' . "\n";
2151
+ }
2152
+
2153
+ $return .= '</tbody>' . "\n";
2154
+ $return .= '</table>' . "\n";
2155
+
2156
+ return $return;
2157
+
2158
+ }
2159
+
2160
+ /**
2161
+ * Redirect to correct domain
2162
+ *
2163
+ * This plugin generates sitemaps dynamically and exits before WordPress
2164
+ * does any canonical redirection. This function makes sure non-www domain
2165
+ * is redirected and vice versa.
2166
+ *
2167
+ * @since 1.0.1
2168
+ * @access private
2169
+ */
2170
+ private function _canonical_redirect($sitemap_name)
2171
+ {
2172
+ $requested_url = is_ssl() ? 'https://' : 'http://';
2173
+ $requested_url .= $_SERVER['HTTP_HOST'];
2174
+ $requested_url .= $_SERVER['REQUEST_URI'];
2175
+
2176
+ $original = @parse_url($requested_url);
2177
+ if (false === $original)
2178
+ return;
2179
+
2180
+ // www.example.com vs example.com
2181
+ $user_home = @parse_url(home_url());
2182
+ if (!empty($user_home['host']))
2183
+ $host = $user_home['host'];
2184
+ else
2185
+ return;
2186
+
2187
+ if (strtolower($original['host']) == strtolower($host)
2188
+ || (strtolower($original['host']) != 'www.' . strtolower($host)
2189
+ && 'www.' . strtolower($original['host']) != strtolower($host))
2190
+ ) {
2191
+ $host = $original['host'];
2192
+ }
2193
+ else
2194
+ {
2195
+ wp_redirect(sprintf($this->sitemap_url_struct, $sitemap_name), 301);
2196
+ exit;
2197
+ }
2198
+ }
2199
+
2200
+ /**
2201
+ * A convenient function to add wanted modules or sub modules
2202
+ *
2203
+ * When you filter the 'bwp_gxs_modules' hook it is recommended that you
2204
+ * use this function.
2205
+ *
2206
+ * @access public
2207
+ */
2208
+ public function add_module($module, $sub_module = '')
2209
+ {
2210
+ // Make sure the names are well-formed
2211
+ $module = preg_replace('/[^a-z0-9-_\s]/ui', '', $module);
2212
+ $module = trim(str_replace(' ', '_', $module));
2213
+
2214
+ $sub_module = preg_replace('/[^a-z0-9-_\s]/ui', '', $sub_module);
2215
+ $sub_module = trim(str_replace(' ', '_', $sub_module));
2216
+
2217
+ if (empty($sub_module))
2218
+ {
2219
+ if (!isset($this->modules[$module]))
2220
+ {
2221
+ $this->modules[$module] = array();
2222
+ }
2223
+
2224
+ return;
2225
+ }
2226
+
2227
+ if (!isset($this->modules[$module])
2228
+ || !is_array($this->modules[$module])
2229
+ ) {
2230
+ $this->modules[$module] = array($sub_module);
2231
+ }
2232
+ else if (!in_array($sub_module, $this->modules[$module]))
2233
+ {
2234
+ $this->modules[$module][] = $sub_module;
2235
+ }
2236
+ }
2237
+
2238
+ /**
2239
+ * A convenient function to remove unwanted modules or sub modules
2240
+ *
2241
+ * When you filter the 'bwp_gxs_modules' hook it is recommended that you use this function.
2242
+ *
2243
+ * @access public
2244
+ */
2245
+ public function remove_module($module = '', $sub_module = '')
2246
+ {
2247
+ if (empty($module) || !isset($this->modules[$module]))
2248
+ return false;
2249
+
2250
+ if (empty($sub_module))
2251
+ {
2252
+ unset($this->modules[$module]);
2253
+ }
2254
+ else
2255
+ {
2256
+ $module = trim($module);
2257
+ $sub_module = trim($sub_module);
2258
+ $temp = $this->modules[$module];
2259
+
2260
+ foreach ($temp as $key => $subm)
2261
+ {
2262
+ if ($sub_module == $subm)
2263
+ {
2264
+ unset($this->modules[$module][$key]);
2265
+ return false;
2266
+ }
2267
+ }
2268
+ }
2269
+ }
2270
+
2271
+ /**
2272
+ * Builds a list of sitemap modules that can be generated
2273
+ *
2274
+ * @access private
2275
+ */
2276
+ private function _build_sitemap_modules()
2277
+ {
2278
+ $modules = array();
2279
+ $this->modules = &$modules;
2280
+
2281
+ // site home URL sitemap - @since 1.1.5
2282
+ if ('yes' == $this->options['enable_sitemap_site'])
2283
+ $this->add_module('site');
2284
+
2285
+ // module exclusion list
2286
+ $excluded_post_types = explode(',', $this->options['input_exclude_post_type']);
2287
+ $excluded_taxonomies = explode(',', $this->options['input_exclude_taxonomy']);
2288
+
2289
+ // add public post types to module list
2290
+ $this->post_types = get_post_types(
2291
+ array('public' => true), 'objects'
2292
+ );
2293
+
2294
+ foreach ($this->post_types as $post_type)
2295
+ {
2296
+ // Page will have its own
2297
+ if ('page' != $post_type->name && !in_array($post_type->name, $excluded_post_types))
2298
+ $modules['post'][] = $post_type->name;
2299
+ }
2300
+
2301
+ // google News module, @since 1.2.0
2302
+ if ('yes' == $this->options['enable_news_sitemap'])
2303
+ $this->add_module('post', 'google_news');
2304
+
2305
+ // add pages to module list
2306
+ if (!in_array('page', $excluded_post_types))
2307
+ $modules['page'] = array('page');
2308
+
2309
+ // add archive pages to module list
2310
+ if ('yes' == $this->options['enable_sitemap_date'])
2311
+ $modules['archive'] = array('monthly', 'yearly');
2312
+
2313
+ // add taxonomies to module list
2314
+ $this->taxonomies = get_taxonomies(array('public' => true), '');
2315
+ if ('yes' == $this->options['enable_sitemap_taxonomy'])
2316
+ {
2317
+ foreach ($this->taxonomies as $taxonomy)
2318
+ {
2319
+ if (!in_array($taxonomy->name, $excluded_taxonomies))
2320
+ $modules['taxonomy'][] = $taxonomy->name;
2321
+ }
2322
+ }
2323
+
2324
+ // remove some unnecessary sitemaps
2325
+ $this->remove_module('post', 'attachment');
2326
+ $this->remove_module('taxonomy', 'post_format');
2327
+ $this->remove_module('taxonomy', 'nav_menu');
2328
+
2329
+ // add / Remove modules based on users' preferences
2330
+ if ('yes' == $this->options['enable_sitemap_author'])
2331
+ $this->add_module('author');
2332
+
2333
+ if ('yes' == $this->options['enable_sitemap_external'])
2334
+ $this->add_module('page', 'external');
2335
+
2336
+ // hook for a custom module list
2337
+ do_action('bwp_gxs_modules_built', $this->modules, $this->post_types, $this->taxonomies);
2338
+
2339
+ return $this->modules;
2340
+ }
2341
+
2342
+ private function _prepare_sitemap_modules()
2343
+ {
2344
+ $modules = $this->modules;
2345
+ $this->requested_modules = array();
2346
+
2347
+ foreach ($modules as $module => $sub_modules)
2348
+ {
2349
+ if (sizeof($sub_modules) == 0)
2350
+ {
2351
+ $this->requested_modules[] = array(
2352
+ 'module' => $module,
2353
+ 'sub_module' => '',
2354
+ 'module_name' => $module
2355
+ );
2356
+
2357
+ continue;
2358
+ }
2359
+
2360
+ foreach ($sub_modules as $sub_module)
2361
+ {
2362
+ $module_name = $module . '_' . $sub_module;
2363
+
2364
+ if (isset($this->post_types[$sub_module]))
2365
+ {
2366
+ // this is a post type module
2367
+ if ('post' == $sub_module || 'page' == $sub_module || 'attachment' == $sub_module)
2368
+ $module_name = $module;
2369
+ }
2370
+ else if ('google_news' == $sub_module)
2371
+ {
2372
+ // this is the google news sitemap module
2373
+ }
2374
+ else if ('yes' == $this->options['enable_sitemap_taxonomy']
2375
+ && isset($this->taxonomies[$sub_module])
2376
+ ) {
2377
+ // this is a taxonomy sitemap module
2378
+ }
2379
+ else if (!empty($sub_module))
2380
+ {
2381
+ // any sitemap module that has a sub-module
2382
+ }
2383
+
2384
+ $this->requested_modules[] = array(
2385
+ 'module' => $module,
2386
+ 'sub_module' => $sub_module,
2387
+ 'module_name' => $module_name
2388
+ );
2389
+ }
2390
+ }
2391
+ }
2392
+
2393
+ /**
2394
+ * Gets module label to display in friendly log message
2395
+ *
2396
+ * This function needs updating whenever a new sitemap type (new module) is
2397
+ * registered.
2398
+ *
2399
+ * @since 1.3.0
2400
+ * @access private
2401
+ */
2402
+ private function _get_module_label($module, $sub_module)
2403
+ {
2404
+ if ($module == 'post')
2405
+ {
2406
+ if ($sub_module == 'google_news')
2407
+ {
2408
+ return sprintf(
2409
+ __('Google news posts that are published within last 48 hours '
2410
+ . '(as per <a href="%s" target="_blank">Google\'s guidelines</a>)', $this->domain),
2411
+ 'https://support.google.com/news/publisher/answer/74288?hl=en#sitemapguidelines'
2412
+ );
2413
+ }
2414
+
2415
+ if (empty($sub_module))
2416
+ return __('Post');
2417
+
2418
+ return $this->post_types[$sub_module]->labels->singular_name;
2419
+ }
2420
+ elseif ($module == 'page')
2421
+ {
2422
+ if ($sub_module == 'external')
2423
+ return __('External page', $this->domain);
2424
+
2425
+ return __('Page');
2426
+ }
2427
+ elseif ($module == 'taxonomy')
2428
+ {
2429
+ return $this->taxonomies[$sub_module]->labels->singular_name;
2430
+ }
2431
+ elseif ($module == 'archive')
2432
+ {
2433
+ return __('Date archive', $this->domain);
2434
+ }
2435
+ elseif ($module == 'author')
2436
+ {
2437
+ return __('Author archive', $this->domain);
2438
+ }
2439
+
2440
+ return false;
2441
+ }
2442
+
2443
+ private static function _get_modules_from_query_var($module)
2444
+ {
2445
+ preg_match('/([a-z0-9]+)_([a-z0-9_-]+)$/iu', $module, $matches);
2446
+
2447
+ if (0 == sizeof($matches))
2448
+ return false;
2449
+ else
2450
+ return $matches;
2451
+ }
2452
+
2453
+ /**
2454
+ * Serves sitemap when needed using correct sitemap module
2455
+ *
2456
+ * @access public
2457
+ */
2458
+ public function request_sitemap($wp_query)
2459
+ {
2460
+ if (isset($wp_query->query_vars['gxs_module']))
2461
+ {
2462
+ // friendly sitemap url is used
2463
+ // sitemap module and sub-module are separated into two different
2464
+ // query variables
2465
+ $module = $wp_query->query_vars['gxs_module'];
2466
+ $sub_module = isset($wp_query->query_vars['gxs_sub_module'])
2467
+ ? $wp_query->query_vars['gxs_sub_module'] : '';
2468
+
2469
+ if (!empty($module))
2470
+ $this->_load_sitemap_module($module, $sub_module);
2471
+ }
2472
+ else if (isset($wp_query->query_vars[$this->query_var_non_perma]))
2473
+ {
2474
+ // non-friendly sitemap url is used, i.e. http://example.com/?bwpsitemap=xxx
2475
+ $sitemap_name = $wp_query->query_vars[$this->query_var_non_perma];
2476
+ $modules = self::_get_modules_from_query_var($sitemap_name);
2477
+
2478
+ if ($modules && is_array($modules))
2479
+ $this->_load_sitemap_module($modules[1], $modules[2]);
2480
+ else
2481
+ $this->_load_sitemap_module($sitemap_name);
2482
+ }
2483
+ }
2484
+
2485
+ /**
2486
+ * Checks whether requested sitemap is a BWP sitemap
2487
+ *
2488
+ * @since 1.3.0
2489
+ * @access private
2490
+ */
2491
+ private static function _is_bwp_sitemap($sitemap_name)
2492
+ {
2493
+ $third_party_sitemaps = array(
2494
+ 'sitemap_index',
2495
+ 'post_tag-sitemap'
2496
+ );
2497
+
2498
+ if (in_array($sitemap_name, $third_party_sitemaps))
2499
+ return false;
2500
+
2501
+ return true;
2502
+ }
2503
+
2504
+ /**
2505
+ * Inits building some sitemap generation stats
2506
+ *
2507
+ * @since 1.3.0
2508
+ * @access private
2509
+ */
2510
+ private function _init_stats()
2511
+ {
2512
+ // track sitemap generation time
2513
+ timer_start();
2514
+
2515
+ // number of queries used to generate a sitemap
2516
+ $this->build_stats['query'] = get_num_queries();
2517
+ }
2518
+
2519
+ /**
2520
+ * Inits the sitemap generation process
2521
+ *
2522
+ * @since 1.3.0
2523
+ * @access private
2524
+ */
2525
+ private function _init_sitemap_generation()
2526
+ {
2527
+ if (!$this->_debug)
2528
+ {
2529
+ // don't let error reporting messes up sitemap generation when
2530
+ // debug is off
2531
+ error_reporting(0);
2532
+ }
2533
+
2534
+ $this->_init_stats();
2535
+
2536
+ // don't let other instrusive plugins mess up our permalnks - @since 1.1.4
2537
+ remove_filter('post_link', 'syndication_permalink', 1, 3);
2538
+ remove_filter('page_link', 'suffusion_unlink_page', 10, 2);
2539
+ }
2540
+
2541
+ private function _load_sitemap_from_cache($module_name, $sitemap_name)
2542
+ {
2543
+ if ('yes' != $this->options['enable_cache'] || $this->_debug)
2544
+ {
2545
+ // cache is not enabled or debug is enabled
2546
+ return false;
2547
+ }
2548
+
2549
+ $cache_status = $this->cache->get_cache_status($module_name, $sitemap_name);
2550
+
2551
+ if (!$cache_status)
2552
+ {
2553
+ // cache is invalid
2554
+ return false;
2555
+ }
2556
+ else if ($cache_status == '304')
2557
+ {
2558
+ // http cache can be used, we don't need to output anything except
2559
+ // for some headers
2560
+ $this->_send_headers(array_merge(
2561
+ array('status' => 304), $this->cache->get_headers()
2562
+ ));
2563
+ }
2564
+ else if ($cache_status == '200')
2565
+ {
2566
+ // file cache is ok, output the cached sitemap
2567
+ $this->_send_headers($this->cache->get_headers());
2568
+
2569
+ $cache_file = $this->cache->get_cache_file();
2570
+
2571
+ if ($this->_is_gzip_ok() && !self::is_gzipped())
2572
+ {
2573
+ // when server or script is not already gzipping, and gzip is
2574
+ // allowed, we simply read the cached file without any
2575
+ // additional compression because cached sitemap files are
2576
+ // stored as gzipped files.
2577
+ readfile($cache_file);
2578
+ }
2579
+ else
2580
+ {
2581
+ // if we can't use a gzipped file, decompress before reading it
2582
+ readgzfile($cache_file);
2583
+ }
2584
+ }
2585
+
2586
+ if (in_array($cache_status, array('200', '304')))
2587
+ {
2588
+ $this->log_success(sprintf(
2589
+ __('Successfully served a cached version of <em>%s.xml</em>.', $this->domain)
2590
+ , $sitemap_name));
2591
+
2592
+ $this->commit_logs();
2593
+
2594
+ return true;
2595
+ }
2596
+ }
2597
+
2598
+ /**
2599
+ * Puts the current sitemap output in cache
2600
+ *
2601
+ * @return bool|string bool cache file could not be written or read
2602
+ * string cache file's modification timestamp
2603
+ * @since 1.3.0
2604
+ * @access private
2605
+ */
2606
+ private function _cache_sitemap()
2607
+ {
2608
+ if ('yes' != $this->options['enable_cache'] || $this->_debug)
2609
+ {
2610
+ // cache is not enabled or debug is enabled
2611
+ return false;
2612
+ }
2613
+
2614
+ if (!@is_writable($this->cache_directory))
2615
+ {
2616
+ $this->log_error(sprintf(
2617
+ __('Cache directory <strong>%s</strong> is not writable, '
2618
+ . 'no cache file was created.' , $this->domain),
2619
+ $this->cache_directory
2620
+ ));
2621
+
2622
+ return false;
2623
+ }
2624
+
2625
+ $lastmod = $this->cache->write_cache($this->output);
2626
+
2627
+ if (!$lastmod)
2628
+ {
2629
+ $this->log_error(sprintf(
2630
+ __('Could not write sitemap file to cache directory <strong>%s</strong>' , $this->domain),
2631
+ $this->cache_directory));
2632
+
2633
+ return false;
2634
+ }
2635
+
2636
+ return $lastmod;
2637
+ }
2638
+
2639
+ /**
2640
+ * Gets correct module file to generate a sitemap
2641
+ *
2642
+ * @access private
2643
+ */
2644
+ private function _get_module_file($module_name, $sitemap_name, $is_submodule = false)
2645
+ {
2646
+ $module_dir = trailingslashit($this->module_directory);
2647
+ $custom_module_dir = $this->custom_module_directory
2648
+ ? trailingslashit($this->custom_module_directory)
2649
+ : '';
2650
+
2651
+ $module_file = ''; // path to module file
2652
+ $module_filename = $module_name . '.php'; // filename of the module
2653
+
2654
+ if (!empty($custom_module_dir)
2655
+ && @file_exists($custom_module_dir . $module_filename)
2656
+ ) {
2657
+ // a module file exists at custom module directory
2658
+ $module_file = $custom_module_dir . $module_filename;
2659
+
2660
+ $this->log_notice(sprintf(
2661
+ __('<em>%s.xml</em> will be served using module file <em>%s</em> '
2662
+ . 'in the custom module directory.', $this->domain)
2663
+ , $sitemap_name, $module_filename));
2664
+
2665
+ $this->_is_using_custom_module = true;
2666
+ }
2667
+ else if (@file_exists($module_dir . $module_filename))
2668
+ {
2669
+ // use module at default module directory
2670
+ $module_file = $module_dir . $module_filename;
2671
+ }
2672
+ else
2673
+ {
2674
+ if ($is_submodule)
2675
+ {
2676
+ // sub-module file is missing, use parent module file instead
2677
+ $this->log_notice(sprintf(
2678
+ __('<em>%s.xml</em> will be served using module file <em>%s</em>.', $this->domain)
2679
+ , $sitemap_name, preg_replace('/_.*(\.[a-z]+)/ui', '$1', $module_filename)));
2680
+ }
2681
+ else
2682
+ {
2683
+ // no module available, log an error
2684
+ $error_log = sprintf(
2685
+ __('<strong>%s</strong> can not be served because of '
2686
+ . 'a missing module file: <strong>%s</strong>.', $this->domain)
2687
+ , $sitemap_name, $module_filename);
2688
+
2689
+ // issue a WP die with a 500 internal server error response code
2690
+ $this->log_error($error_log, true, 500);
2691
+ }
2692
+ }
2693
+
2694
+ return $module_file;
2695
+ }
2696
+
2697
+ /**
2698
+ * Locates correct sitemap module to serve requested sitemap
2699
+ *
2700
+ * @access private
2701
+ */
2702
+ private function _load_sitemap_module($module, $sub_module = '')
2703
+ {
2704
+ $success = false; // can we successfully serve the sitemap?
2705
+ $module_found = false; // do we have a sitemap module as requested
2706
+ $module_loaded = false;
2707
+
2708
+ $module = stripslashes($module);
2709
+ $sub_module = stripslashes($sub_module);
2710
+ $part = 0;
2711
+ $module_name = ''; // the final module name used to generate requested sitemap
2712
+
2713
+ // a full sitemap name consists of a module and a sub-module including
2714
+ // any split part (`_part1`, `_part2`, etc.) if any
2715
+ $sitemap_name = !empty($sub_module) ? $module . '_' . $sub_module : $module;
2716
+
2717
+ if (!self::_is_bwp_sitemap($sitemap_name))
2718
+ {
2719
+ // not a BWP sitemap, return this handle to WordPress
2720
+ return false;
2721
+ }
2722
+
2723
+ // make sure we're on the canonical domain to avoid styling issue
2724
+ $this->_canonical_redirect($sitemap_name);
2725
+
2726
+ if ('yes' == $this->options['enable_sitemap_split_post']
2727
+ && (preg_match('/_part([0-9]+)$/i', $sub_module, $matches)
2728
+ || preg_match('/part([0-9]+)$/i', $sub_module, $matches))
2729
+ ) {
2730
+ // Check whether or not splitting is enabled and the sub_module has a
2731
+ // 'part' part, if so we strip the part from sub-module name
2732
+ $sub_module = str_replace($matches[0], '', $sub_module);
2733
+
2734
+ // save the requested part for later use
2735
+ $part = (int) $matches[1];
2736
+ }
2737
+
2738
+ $modules = $this->_build_sitemap_modules();
2739
+
2740
+ if ('sitemapindex' != $sitemap_name && isset($modules[$module]))
2741
+ {
2742
+ // the currently requested sitemap is not the sitemapindex, and a
2743
+ // sitemap module is available
2744
+ $module_found = true;
2745
+
2746
+ if (!empty($sub_module))
2747
+ {
2748
+ // a sub-module is being requested, and found
2749
+ if (in_array($sub_module, $modules[$module]))
2750
+ $module_name = $module . '_' . $sub_module;
2751
+ else
2752
+ $module_found = false;
2753
+ }
2754
+ else
2755
+ {
2756
+ $module_name = $module;
2757
+ }
2758
+ }
2759
+ else if ('sitemapindex' == $sitemap_name)
2760
+ {
2761
+ // this is the sitemapindex, use sitemapindex sitemap module
2762
+ $module_found = true;
2763
+ $module_name = 'sitemapindex';
2764
+ }
2765
+
2766
+ if (!$module_found)
2767
+ {
2768
+ // no module is available to handle requested sitemap
2769
+ $message = sprintf(
2770
+ __('Requested sitemap (<em>%s.xml</em>) '
2771
+ . 'was not found or not enabled.', $this->domain),
2772
+ $sitemap_name
2773
+ );
2774
+
2775
+ // @since 1.3.0 log a notice instead of an error
2776
+ $this->log_notice($message);
2777
+ $this->commit_logs();
2778
+
2779
+ // @since 1.3.0 return this handle to WordPress
2780
+ return false;
2781
+ }
2782
+
2783
+ $this->_init_sitemap_generation();
2784
+
2785
+ if ($this->_load_sitemap_from_cache($module_name, $sitemap_name))
2786
+ {
2787
+ // if sitemap can be loaded from cache, no need to do anything else
2788
+ exit;
2789
+ }
2790
+
2791
+ // load the base module so other modules can extend it
2792
+ require_once dirname(__FILE__) . '/class-bwp-gxs-module.php';
2793
+
2794
+ // global module data for later use
2795
+ $this->module_data = array(
2796
+ 'module' => $module,
2797
+ 'sub_module' => $sub_module,
2798
+ 'module_key' => $module_name, // leave this for back-compat
2799
+ 'module_name' => $module_name, // @since 1.3.0 this is the same as module_key
2800
+ 'module_part' => $part, // leave this for back-compat
2801
+ 'part' => $part,
2802
+ 'sitemap_name' => $sitemap_name // @since 1.3.0 this is the actual sitemap name
2803
+ );
2804
+
2805
+ if ('sitemapindex' != $sitemap_name)
2806
+ {
2807
+ // generating a regular sitemap
2808
+ $module_file = ''; // path to module file
2809
+
2810
+ if (!empty($sub_module))
2811
+ {
2812
+ // try generating the sitemap using a sub-module
2813
+ if (!empty($this->module_map[$sub_module]))
2814
+ {
2815
+ // this module is mapped to use another module, no need to
2816
+ // update global module data
2817
+ $module_name = $module . '_' . $this->module_map[$sub_module];
2818
+ }
2819
+
2820
+ $module_file = $this->_get_module_file($module_name, $sitemap_name, true);
2821
+ }
2822
+
2823
+ if (empty($module_file))
2824
+ {
2825
+ // try again with parent module, no need to update global module data
2826
+ $module_name = $module;
2827
+ $module_file = $this->_get_module_file($module_name, $sitemap_name);
2828
+ }
2829
+
2830
+ if (empty($module_file))
2831
+ {
2832
+ // no luck, let WordPress handles this page
2833
+ // reach here if gxs debug is off
2834
+ return false;
2835
+ }
2836
+
2837
+ include_once $module_file;
2838
+
2839
+ $class_name = 'BWP_GXS_MODULE_' . str_replace('-', '_', $module_name);
2840
+
2841
+ if (class_exists($class_name))
2842
+ {
2843
+ $module_object = new $class_name();
2844
+
2845
+ $module_object->set_module_data($this->module_data);
2846
+ $module_object->set_current_time();
2847
+ $module_object->build_sitemap_data();
2848
+
2849
+ $module_data = $module_object->get_data();
2850
+
2851
+ switch ($module_object->get_type())
2852
+ {
2853
+ case 'url':
2854
+ $success = $this->_generate_sitemap($module_data);
2855
+ break;
2856
+ case 'news':
2857
+ $success = $this->_generate_news_sitemap($module_data);
2858
+ break;
2859
+ case 'index':
2860
+ $success = $this->_generate_sitemap_index($module_data);
2861
+ break;
2862
+ }
2863
+
2864
+ $module_loaded = true;
2865
+ }
2866
+ }
2867
+ else if ('sitemapindex' == $sitemap_name)
2868
+ {
2869
+ $module_file = $this->_get_module_file($module_name, $sitemap_name);
2870
+
2871
+ include_once $module_file;
2872
+
2873
+ $class_name = 'BWP_GXS_MODULE_INDEX';
2874
+
2875
+ if (class_exists($class_name))
2876
+ {
2877
+ $this->_prepare_sitemap_modules(); // this should fill $this->requested_modules
2878
+
2879
+ $module_object = new $class_name($this->requested_modules);
2880
+
2881
+ $module_object->set_module_data($this->module_data);
2882
+ $module_object->set_current_time();
2883
+ $module_object->build_sitemap_data();
2884
+
2885
+ $success = $this->_generate_sitemap_index($module_object->get_data());
2886
+
2887
+ $module_loaded = true;
2888
+ }
2889
+ }
2890
+
2891
+ $module_filename = $module_name . '.php';
2892
+
2893
+ if (!$module_loaded)
2894
+ {
2895
+ // required module class can not be found so not loaded, this
2896
+ // should issue a WP die with 500 internal server error response code
2897
+ $this->log_error(
2898
+ sprintf(__('There is no class named <strong>%s</strong> '
2899
+ . 'in the module file <strong>%s</strong>.', $this->domain),
2900
+ $class_name,
2901
+ $module_filename),
2902
+ true, 500
2903
+ );
2904
+ }
2905
+
2906
+ if ($success == true)
2907
+ {
2908
+ // sitemap has been generated and is valid
2909
+ $this->_append_sitemap_stats();
2910
+
2911
+ $lastmod = $this->_cache_sitemap();
2912
+ $lastmod = $lastmod ? $lastmod : time();
2913
+ $expires = self::_format_header_time($lastmod + $this->cache_time);
2914
+
2915
+ // send proper headers
2916
+ $this->_send_headers(array(
2917
+ 'lastmod' => self::_format_header_time($lastmod),
2918
+ 'expires' => $expires,
2919
+ 'etag' => md5($expires . bwp_gxs_get_filename($sitemap_name))
2920
+ ));
2921
+
2922
+ // display the requested sitemap
2923
+ $this->_display_sitemap();
2924
+
2925
+ $success_message = $this->_is_using_custom_module
2926
+ ? __('Successfully generated <em>%s.xml</em> using custom module file <em>%s</em>.', $this->domain)
2927
+ : __('Successfully generated <em>%s.xml</em> using module file <em>%s</em>.', $this->domain);
2928
+
2929
+ $this->log_success(sprintf($success_message, $sitemap_name, $module_filename));
2930
+
2931
+ $this->log_sitemap($sitemap_name);
2932
+
2933
+ $this->commit_logs();
2934
+
2935
+ exit;
2936
+ }
2937
+ else
2938
+ {
2939
+ // @since 1.3.0 commit logs and issue a WP die with 500 internal
2940
+ // server response code
2941
+ $this->commit_logs();
2942
+
2943
+ $this->log_error(sprintf(
2944
+ __('An unknown error occurred when generating <em>%s</em> '
2945
+ . 'using module file <em>%s</em>. Try again later.', $this->domain),
2946
+ $sitemap_name, $module_filename), true, 500);
2947
+
2948
+ exit;
2949
+ }
2950
+ }
2951
+
2952
+ private function _send_headers($headers = array())
2953
+ {
2954
+ if (headers_sent($filename, $linenum))
2955
+ {
2956
+ // @since 1.3.0 if headers have already been sent, we can't send
2957
+ // these headers anymore so stop here but log an error
2958
+ $this->log_error(sprintf(
2959
+ __('<em>%s.xml</em> was successfully generated but '
2960
+ . 'could not be served properly because some '
2961
+ . 'headers have already been sent '
2962
+ . '(something was printed on line <strong>%s</strong> '
2963
+ . 'in file <strong>%s</strong>).', $this->domain),
2964
+ $this->module_data['sitemap_name'],
2965
+ $linenum,
2966
+ $filename
2967
+ ));
2968
+
2969
+ return false;
2970
+ }
2971
+
2972
+ if ($this->_debug_extra)
2973
+ {
2974
+ // @since 1.3.0 when debug extra is turned on no headers should
2975
+ // be sent. Sitemap will be displayed as raw text output to avoid
2976
+ // Content Encoding Error. The raw text output can then be used to
2977
+ // find the cause of the encoding error.
2978
+ return false;
2979
+ }
2980
+
2981
+ $content_types = array(
2982
+ 'google' => 'text/xml',
2983
+ 'yahoo' => 'text/plain'
2984
+ );
2985
+
2986
+ $default_headers = array(
2987
+ 'status' => 200,
2988
+ 'vary' => 'Accept-Encoding'
2989
+ );
2990
+
2991
+ $headers = wp_parse_args($headers, $default_headers);
2992
+
2993
+ if ($this->_debug || $this->options['enable_cache'] != 'yes')
2994
+ {
2995
+ // if debug is on, or caching is not enabled, send no cache headers
2996
+ nocache_headers();
2997
+ }
2998
+ else
2999
+ {
3000
+ // otherwise send proper cache headers
3001
+ header('Cache-Control: max-age=' . (int) $this->cache_time);
3002
+ header('Expires: ' . $headers['expires']);
3003
+
3004
+ if (!empty($headers['etag']))
3005
+ header('Etag: ' . $headers['etag']);
3006
+ }
3007
+
3008
+ if ($headers['status'] == 200)
3009
+ {
3010
+ // some headers are only needed when sending a 200 OK response
3011
+ if (!$this->_debug && $this->options['enable_cache'] == 'yes')
3012
+ {
3013
+ // only send a last modified header if debug is NOT on, and
3014
+ // caching is enabled
3015
+ header('Last-Modified: ' . $headers['lastmod']);
3016
+ }
3017
+
3018
+ header('Accept-Ranges: bytes');
3019
+ header('Content-Type: ' . $content_types['google'] . '; charset=UTF-8');
3020
+
3021
+ if ($this->_is_gzip_ok())
3022
+ header('Content-Encoding: ' . self::_get_gzip_type());
3023
+ }
3024
+
3025
+ header('Vary: ' . $headers['vary']);
3026
+
3027
+ status_header($headers['status']);
3028
+
3029
+ return true;
3030
+ }
3031
+
3032
+ private function _display_sitemap()
3033
+ {
3034
+ // compress the output using gzip if needed, but only if no active
3035
+ // compressor is active
3036
+ if ($this->_is_gzip_ok() && !self::is_gzipped())
3037
+ echo gzencode($this->output, 6);
3038
+ else
3039
+ echo $this->output;
3040
+ }
3041
+
3042
+ public static function is_gzipped()
3043
+ {
3044
+ if (ini_get('zlib.output_compression')
3045
+ || ini_get('output_handler') == 'ob_gzhandler'
3046
+ || in_array('ob_gzhandler', @ob_list_handlers()))
3047
+ {
3048
+ return true;
3049
+ }
3050
+
3051
+ return false;
3052
+ }
3053
+
3054
+ private function _is_gzip_ok()
3055
+ {
3056
+ if ($this->options['enable_gzip'] != 'yes')
3057
+ return false;
3058
+
3059
+ if (headers_sent() || $this->_debug_extra)
3060
+ // headers sent or debug extra is on, which means we could not send
3061
+ // the encoding header, so gzip is not allowed
3062
+ return false;
3063
+
3064
+ if (!empty($_SERVER['HTTP_ACCEPT_ENCODING'])
3065
+ && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false
3066
+ || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false)
3067
+ ) {
3068
+ return true;
3069
+ }
3070
+ else
3071
+ {
3072
+ return false;
3073
+ }
3074
+ }
3075
+
3076
+ private static function _get_gzip_type()
3077
+ {
3078
+ if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false)
3079
+ return 'gzip';
3080
+ else if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false)
3081
+ return 'x-gzip';
3082
+
3083
+ return 'gzip';
3084
+ }
3085
+
3086
+ private function _append_sitemap_stats()
3087
+ {
3088
+ if ('yes' != $this->options['enable_stats'])
3089
+ return false;
3090
+
3091
+ $this->output .= $this->_get_sitemap_stats();
3092
+ }
3093
+
3094
+ private function _get_sitemap_stats($type = '')
3095
+ {
3096
+ $time = timer_stop(0, 3);
3097
+ $sql = get_num_queries() - $this->build_stats['query'];
3098
+ $memory = size_format(memory_get_usage() - $this->build_stats['mem'], 2);
3099
+
3100
+ if (empty($type))
3101
+ return "\n" . sprintf($this->templates['stats'], $time, $memory, $sql, $this->output_num);
3102
+ else
3103
+ echo "\n" . sprintf($this->templates['stats_cached'], $time, $memory, $sql);
3104
+ }
3105
+
3106
+ private static function _is_local($url)
3107
+ {
3108
+ static $blog_url;
3109
+
3110
+ if (empty($blog_url))
3111
+ {
3112
+ $home_url = home_url();
3113
+ $blog_url = @parse_url($home_url);
3114
+ }
3115
+
3116
+ $url = @parse_url($url);
3117
+ if (false === $url)
3118
+ return false;
3119
+
3120
+ if (isset($url['scheme']))
3121
+ {
3122
+ // if scheme is set for the url being checked, the url should be
3123
+ // local only when it shares the same host with blog's url
3124
+
3125
+ // normalize all the hosts before comparing
3126
+ $url_host = str_replace('https://', 'http://', $url['host']);
3127
+ $blog_host = str_replace('https://', 'http://', $blog_url['host']);
3128
+
3129
+ // according to sitemap protocol the host must be exactly the same
3130
+ // @see http://www.sitemaps.org/protocol.html#location
3131
+ if (0 <> strcmp($url_host, $blog_host))
3132
+ return false;
3133
+
3134
+ return true;
3135
+ }
3136
+ else
3137
+ return true;
3138
+ }
3139
+
3140
+ private static function _is_url_valid($url)
3141
+ {
3142
+ $url = trim($url);
3143
+
3144
+ if ('#' == $url || 0 !== strpos($url, 'http') || !self::_is_local($url))
3145
+ return false;
3146
+
3147
+ return true;
3148
+ }
3149
+
3150
+ private function _check_output($output)
3151
+ {
3152
+ if (empty($output) || 0 == sizeof($output))
3153
+ {
3154
+ // If output is empty we log it so the user knows what's going on,
3155
+ // and should die accordingly
3156
+ $error_message = sprintf(
3157
+ __('<em>%s.xml</em> does not have any item.', $this->domain),
3158
+ $this->module_data['sitemap_name']
3159
+ );
3160
+
3161
+ $module_label = $this->_get_module_label($this->module_data['module'], $this->module_data['sub_module']);
3162
+ $module_guide = 'google_news' != $this->module_data['sub_module']
3163
+ ? __('Enable/disable sitemaps via <em>BWP Sitemaps >> XML Sitemaps >> Sitemaps to generate</em>.', $this->domain)
3164
+ : '';
3165
+
3166
+ $error_message_admin_module = $module_label && current_user_can('manage_options')
3167
+ ? ' ' . sprintf(
3168
+ __('There are no public <em>%s</em>.', $this->domain)
3169
+ . " $module_guide",
3170
+ $module_label)
3171
+ : ' ' . $module_guide;
3172
+
3173
+ $error_message_admin = $this->module_data['sitemap_name'] == 'sitemapindex'
3174
+ ? ' ' . __('Please make sure that you have at least one sitemap enabled '
3175
+ . 'in <em>BWP Sitemaps >> XML Sitemaps >> Sitemaps to generate</em>.', $this->domain)
3176
+ : $error_message_admin_module;
3177
+
3178
+ // issue a WP die with 404 not found response code
3179
+ $this->log_error($error_message . $error_message_admin, true, 404);
3180
+ }
3181
+ else
3182
+ {
3183
+ return true;
3184
+ }
3185
+ }
3186
+
3187
+ private function _generate_sitemap_item($url, $priority = 1.0, $freq = 'always', $lastmod = 0)
3188
+ {
3189
+ $freq = sprintf($this->templates['changefreq'], $freq);
3190
+ $priority = str_replace(',', '.', sprintf($this->templates['priority'], $priority));
3191
+ $lastmod = !empty($lastmod) ? sprintf($this->templates['lastmod'], $lastmod) : '';
3192
+
3193
+ if (!empty($url))
3194
+ return sprintf($this->templates['url'], $url, $lastmod, $freq, $priority);
3195
+ else
3196
+ return '';
3197
+ }
3198
+
3199
+ private function _generate_sitemapindex_item($url = '', $lastmod = 0)
3200
+ {
3201
+ $lastmod = !empty($lastmod) ? sprintf($this->templates['lastmod'], $lastmod) : '';
3202
+
3203
+ if (!empty($url))
3204
+ return sprintf($this->templates['sitemap'], $url, $lastmod);
3205
+ else
3206
+ return '';
3207
+ }
3208
+
3209
+ private function _generate_news_sitemap_item($loc = '', $name = '', $lang = 'en',
3210
+ $genres = '', $pub_date = '', $title = '', $keywords = '')
3211
+ {
3212
+ $name = sprintf($this->templates['news_name'], $name);
3213
+ $lang = sprintf($this->templates['news_language'], $lang);
3214
+ $news_pub = sprintf($this->templates['news_publication'], $name, $lang);
3215
+
3216
+ $genres = !empty($genres) ? sprintf($this->templates['news_genres'], $genres) : '';
3217
+ $pub_date = sprintf($this->templates['news_pub_date'], $pub_date);
3218
+ $title = sprintf($this->templates['news_title'], $title);
3219
+
3220
+ $keywords = !empty($keywords) ? sprintf($this->templates['news_keywords'], $keywords) : '';
3221
+
3222
+ return sprintf($this->templates['news'], $loc, $news_pub, $genres, $pub_date, $title, $keywords);
3223
+ }
3224
+
3225
+ private function _get_credit()
3226
+ {
3227
+ $credit = '<!-- Generated by BWP Google XML Sitemaps ' . $this->get_version()
3228
+ . ' (c) 2014 Khang Minh - betterwp.net' . "\n";
3229
+
3230
+ $credit .= ' Plugin homepage: ' . $this->plugin_url . ' -->' . "\n";
3231
+
3232
+ return $credit;
3233
+ }
3234
+
3235
+ private function _generate_sitemap($urls)
3236
+ {
3237
+ if (!$this->_check_output($urls))
3238
+ return false;
3239
+
3240
+ $xml = '<' . '?xml version="1.0" encoding="UTF-8"?'.'>' . "\n";
3241
+ $xml .= !empty($this->xslt)
3242
+ ? '<?xml-stylesheet type="text/xsl" href="' . $this->xslt . '"?>' . "\n\n"
3243
+ : '';
3244
+ $xml .= '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
3245
+ . "\n\t" . 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9'
3246
+ . "\n\t" . 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"'
3247
+ . "\n\t" . 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
3248
+
3249
+ if ('yes' != $this->options['enable_xslt'] && 'yes' == $this->options['enable_credit'])
3250
+ $xml .= $this->_get_credit();
3251
+
3252
+ foreach ($urls as &$url)
3253
+ {
3254
+ $url['location'] = !empty($url['location']) ? $url['location'] : '';
3255
+
3256
+ if (empty($url['location']) || !self::_is_url_valid($url['location']))
3257
+ // location is empty or it is not valid for a sitemap
3258
+ continue;
3259
+
3260
+ $url['lastmod'] = !empty($url['lastmod']) ? $url['lastmod'] : '';
3261
+
3262
+ $url['freq'] = isset($url['freq'])
3263
+ && in_array($url['freq'], $this->frequencies)
3264
+ ? $url['freq']
3265
+ : $this->options['select_default_freq'];
3266
+
3267
+ $url['priority'] = isset($url['priority'])
3268
+ && $url['priority'] <= 1 && $url['priority'] > 0
3269
+ ? $url['priority']
3270
+ : $this->options['select_default_pri'];
3271
+
3272
+ $xml .= $this->_generate_sitemap_item(
3273
+ htmlspecialchars($url['location']), $url['priority'],
3274
+ $url['freq'], $url['lastmod']
3275
+ );
3276
+
3277
+ $this->output_num++;
3278
+ }
3279
+
3280
+ if (!$this->_check_output($this->output_num))
3281
+ return false;
3282
+
3283
+ $xml .= "\n" . '</urlset>';
3284
+
3285
+ $this->output = $xml;
3286
+
3287
+ return true;
3288
+ }
3289
+
3290
+ private function _generate_news_sitemap($urls)
3291
+ {
3292
+ if (!$this->_check_output($urls))
3293
+ return false;
3294
+
3295
+ $xml = '<' . '?xml version="1.0" encoding="UTF-8"?'.'>' . "\n";
3296
+ $xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"'
3297
+ . "\n\t" . 'xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"'
3298
+ . "\n\t" . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
3299
+ . "\n\t" . 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'
3300
+ . "\n\t" . 'http://www.google.com/schemas/sitemap-news/0.9 http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">'
3301
+ . "\n";
3302
+
3303
+ if ('yes' == $this->options['enable_credit'])
3304
+ $xml .= $this->_get_credit();
3305
+
3306
+ foreach ($urls as &$url)
3307
+ {
3308
+ $url['location'] = !empty($url['location']) ? $url['location'] : '';
3309
+
3310
+ if (empty($url['location']) || !self::_is_url_valid($url['location']))
3311
+ // location is empty or it is not valid for a sitemap
3312
+ continue;
3313
+
3314
+ $url['name'] = !empty($url['name'])
3315
+ ? htmlspecialchars($url['name'])
3316
+ : apply_filters('bwp_gxs_news_name', htmlspecialchars(get_bloginfo('name')));
3317
+
3318
+ $url['language'] = $this->options['select_news_lang'];
3319
+ $url['genres'] = !empty($url['genres']) ? $url['genres'] : '';
3320
+
3321
+ $url['pub_date'] = !empty($url['pub_date']) ? $url['pub_date'] : '';
3322
+ $url['title'] = !empty($url['title']) ? htmlspecialchars($url['title']) : '';
3323
+ $url['keywords'] = !empty($url['keywords']) ? htmlspecialchars($url['keywords']) : '';
3324
+
3325
+ $xml .= $this->_generate_news_sitemap_item(
3326
+ htmlspecialchars($url['location']),
3327
+ $url['name'],
3328
+ $url['language'],
3329
+ $url['genres'],
3330
+ $url['pub_date'],
3331
+ $url['title'],
3332
+ $url['keywords']
3333
+ );
3334
+
3335
+ $this->output_num++;
3336
+ }
3337
+
3338
+ if (!$this->_check_output($this->output_num))
3339
+ return false;
3340
+
3341
+ $xml .= "\n" . '</urlset>';
3342
+
3343
+ $this->output = $xml;
3344
+
3345
+ return true;
3346
+ }
3347
+
3348
+ private function _generate_sitemap_index($sitemaps)
3349
+ {
3350
+ if (!$this->_check_output($sitemaps))
3351
+ return false;
3352
+
3353
+ $xml = '<' . '?xml version="1.0" encoding="UTF-8"?'.'>' . "\n";
3354
+ $xml .= !empty($this->xslt_index)
3355
+ ? '<?xml-stylesheet type="text/xsl" href="' . $this->xslt_index . '"?>' . "\n\n"
3356
+ : '';
3357
+ $xml .= '<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
3358
+ . "\n\t" . 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9'
3359
+ . "\n\t" . 'http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"'
3360
+ . "\n\t" . 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
3361
+
3362
+ if ('yes' != $this->options['enable_xslt'] && 'yes' == $this->options['enable_credit'])
3363
+ $xml .= $this->_get_credit();
3364
+
3365
+ foreach ($sitemaps as &$sitemap)
3366
+ {
3367
+ $sitemap['location'] = !empty($sitemap['location']) ? $sitemap['location'] : '';
3368
+ $sitemap['lastmod'] = !empty($sitemap['lastmod']) ? $sitemap['lastmod'] : '';
3369
+
3370
+ $xml .= $this->_generate_sitemapindex_item(
3371
+ htmlspecialchars($sitemap['location']), $sitemap['lastmod']
3372
+ );
3373
+
3374
+ $this->output_num++;
3375
+ }
3376
+
3377
+ $xml .= "\n" . '</sitemapindex>';
3378
+
3379
+ $this->output = $xml;
3380
+
3381
+ return true;
3382
+ }
3383
+
3384
+ private function _is_post_pingable($post)
3385
+ {
3386
+ $post_types = get_post_types(array('public' => true));
3387
+
3388
+ if (!in_array($post->post_type, $post_types))
3389
+ {
3390
+ // not a public post type, no pinging
3391
+ return false;
3392
+ }
3393
+
3394
+ if (!empty($post->post_password))
3395
+ {
3396
+ // password-protected post, no pinging
3397
+ return false;
3398
+ }
3399
+
3400
+ $excluded_post_types = explode(',', $this->options['input_exclude_post_type']);
3401
+
3402
+ if (in_array($post->post_type, $excluded_post_types))
3403
+ {
3404
+ // sitemap for this post type is not enabled, no pinging
3405
+ return false;
3406
+ }
3407
+
3408
+ $excluded_post_types_from_ping = explode(',', $this->options['input_exclude_post_type_ping']);
3409
+
3410
+ if (in_array($post->post_type, $excluded_post_types_from_ping))
3411
+ {
3412
+ // pinging for this post type is disabled explicitly
3413
+ return false;
3414
+ }
3415
+
3416
+ // otherwise pinging is allowed
3417
+ return true;
3418
+ }
3419
+
3420
+ public function ping_google_news($post)
3421
+ {
3422
+ if (empty($post->ID))
3423
+ return;
3424
+
3425
+ // only carry out the ping if this post is in a news category
3426
+ $is_news = 'inc' == $this->options['select_news_cat_action'] ? false : true;
3427
+ $news_cats = explode(',', $this->options['select_news_cats']);
3428
+ $categories = get_the_category($post->ID);
3429
+
3430
+ foreach ($categories as $cat)
3431
+ {
3432
+ if (in_array($cat->term_id, $news_cats))
3433
+ {
3434
+ $is_news = 'inc' == $this->options['select_news_cat_action']
3435
+ ? true : false;
3436
+
3437
+ break;
3438
+ }
3439
+ }
3440
+
3441
+ if ($is_news)
3442
+ {
3443
+ $this->_ping_sitemap = 'post_google_news';
3444
+ $this->ping($post);
3445
+ }
3446
+ }
3447
+
3448
+ public function ping($post)
3449
+ {
3450
+ $time = self::_get_current_time();
3451
+ $ping_data = get_option(BWP_GXS_PING);
3452
+
3453
+ if (!$ping_data || !is_array($ping_data)
3454
+ || isset($ping_data['data_pinged']['yahoo'])
3455
+ || isset($ping_data['data_pinged']['ask'])
3456
+ ) {
3457
+ // remove old data from yahoo and ask, to be removed in 1.4.0
3458
+ $ping_data = array(
3459
+ 'data_pinged' => array('google' => 0, 'bing' => 0),
3460
+ 'data_last_pinged' => array('google' => 0, 'bing' => 0)
3461
+ );
3462
+ }
3463
+
3464
+ if (!$this->_is_post_pingable($post))
3465
+ {
3466
+ // this post is not suitable for pinging
3467
+ return false;
3468
+ }
3469
+
3470
+ foreach ($this->_ping_urls as $key => $service)
3471
+ {
3472
+ if ('yes' == $this->options['enable_ping_' . $key])
3473
+ {
3474
+ if ($time - $ping_data['data_last_pinged'][$key] > 86400)
3475
+ {
3476
+ // a day has gone, reset the count
3477
+ $ping_data['data_pinged'][$key] = 0;
3478
+ $ping_data['data_last_pinged'][$key] = $time;
3479
+ }
3480
+
3481
+ if ($this->pings_per_day > $ping_data['data_pinged'][$key])
3482
+ {
3483
+ // ping limit has not been reached
3484
+ $ping_data['data_pinged'][$key]++;
3485
+
3486
+ $url = sprintf($service, urlencode(str_replace('&', '&amp;', sprintf(
3487
+ $this->sitemap_url_struct,
3488
+ $this->_ping_sitemap)
3489
+ )));
3490
+
3491
+ $response = wp_remote_post($url,
3492
+ array('timeout' => $this->ping_timeout)
3493
+ );
3494
+
3495
+ if (is_wp_error($response))
3496
+ {
3497
+ $errno = $response->get_error_code();
3498
+ $errorstr = $response->get_error_message();
3499
+
3500
+ $this->log_error($errorstr);
3501
+ }
3502
+ else if (isset($response['response']))
3503
+ {
3504
+ $the_response = $response['response'];
3505
+
3506
+ if (empty($the_response['code']))
3507
+ {
3508
+ $this->log_error(__('Unknown response code from search engines. Ping failed.', $this->domain));
3509
+ }
3510
+ else if (200 == $the_response['code'])
3511
+ {
3512
+ $this->log_success(sprintf(
3513
+ __('Pinged <em>%s</em> with <em>%s</em> successfully!', $this->domain), ucfirst($key),
3514
+ $this->_ping_sitemap . '.xml')
3515
+ );
3516
+ }
3517
+ else
3518
+ {
3519
+ $errno = $the_response['code'];
3520
+ $errorstr = $the_response['message'];
3521
+
3522
+ $this->log_error(sprintf(
3523
+ __('<strong>Error %s</strong> from <em>%s</em>.', $this->domain), $errno, ucfirst($key))
3524
+ . ': ' . $errorstr
3525
+ );
3526
+ }
3527
+ }
3528
+ }
3529
+ else
3530
+ {
3531
+ // ping limit reached for this particular search engine,
3532
+ // log an appropriate error message
3533
+ $this->log_error(sprintf(
3534
+ __('Ping limit for today to <em>%s</em> has been reached, '
3535
+ . 'consider increasing the ping limit via '
3536
+ . '<em>XML Sitemaps >> Ping search engines >> "Ping limit for each search engine"</em>', $this->domain),
3537
+ ucfirst($key))
3538
+ );
3539
+ }
3540
+ }
3541
+ }
3542
+
3543
+ update_option(BWP_GXS_PING, $ping_data);
3544
+
3545
+ $this->commit_logs();
3546
+ }
3547
+ }
includes/common-functions.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function bwp_gxs_get_filename($sitemap_name)
4
+ {
5
+ global $bwp_gxs;
6
+
7
+ // cache filename, use gz all the time to save space
8
+ // @todo save both .xml version and .xml.gz version
9
+ // append home_url to be WPMS compatible
10
+ $filename = 'gxs_' . md5($sitemap_name . '_' . home_url());
11
+ $filename .= '.xml.gz';
12
+
13
+ return trailingslashit($bwp_gxs->cache_directory) . $filename;
14
+ }
15
+
16
+ function bwp_gxs_format_header_time($time)
17
+ {
18
+ return gmdate('D, d M Y H:i:s \G\M\T', (int) $time);
19
+ }
includes/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // White page
3
+ ?>
includes/modules/archive.php CHANGED
@@ -1,66 +1,81 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_ARCHIVE extends BWP_GXS_MODULE {
8
-
9
- var $requested = '';
10
-
11
- function __construct()
12
- {
13
- global $bwp_gxs;
14
-
15
- $this->set_current_time();
16
- $this->requested = $bwp_gxs->module_data['sub_module'];
17
- $this->build_data();
18
- }
19
-
20
- function generate_data()
21
- {
22
- global $wpdb;
23
-
24
- $requested = $this->requested;
25
-
26
- if ('monthly' == $requested)
27
- $latest_post_query = '
28
- SELECT YEAR(post_date) AS year, MONTH(post_date) as month, COUNT(ID) as posts, comment_count, post_modified
29
- FROM ' . $wpdb->posts . "
30
- WHERE post_status = 'publish' AND post_type <> 'page'" . '
31
- GROUP BY YEAR(post_date), MONTH(post_date)
32
- ORDER BY post_modified DESC';
33
- else
34
- $latest_post_query = '
35
- SELECT YEAR(post_date) AS year, COUNT(ID) as posts, comment_count, post_modified
36
- FROM ' . $wpdb->posts . "
37
- WHERE post_status = 'publish' AND post_type <> 'page'" . '
38
- GROUP BY YEAR(post_date)
39
- ORDER BY post_modified DESC';
40
-
41
- $latest_posts = $this->get_results($latest_post_query);
42
-
43
- if (!isset($latest_posts) || 0 == sizeof($latest_posts))
44
- return false;
45
-
46
- $data = array();
47
- for ($i = 0; $i < sizeof($latest_posts); $i++)
48
- {
49
- $post = $latest_posts[$i];
50
- $data = $this->init_data($data);
51
- if ('monthly' == $requested)
52
- $data['location'] = get_month_link($post->year, $post->month);
53
- else if ('yearly' == $requested)
54
- $data['location'] = get_year_link($post->year);
55
- $data['lastmod'] = $this->format_lastmod(strtotime($post->post_modified));
56
- $data['freq'] = $this->cal_frequency($post);
57
- $data['priority'] = $this->cal_priority($post, $data['freq']);
58
- $this->data[] = $data;
59
- }
60
-
61
- unset($latest_posts);
62
-
63
- return true;
64
- }
65
- }
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_ARCHIVE extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ // @since 1.3.0 this is left blank
13
+ }
14
+
15
+ protected function generate_data()
16
+ {
17
+ global $wpdb;
18
+
19
+ $requested = $this->requested;
20
+
21
+ if ('monthly' == $requested)
22
+ {
23
+ $latest_post_query = '
24
+ SELECT
25
+ YEAR(post_date) as year,
26
+ MONTH(post_date) as month,
27
+ MAX(post_modified) as post_modified,
28
+ MAX(post_modified_gmt) as post_modified_gmt,
29
+ MAX(comment_count) as comment_count
30
+ FROM ' . $wpdb->posts . "
31
+ WHERE post_status = 'publish'
32
+ AND post_password = ''
33
+ AND post_type = 'post'" . '
34
+ GROUP BY year, month
35
+ ORDER BY post_modified DESC';
36
+ }
37
+ else
38
+ {
39
+ $latest_post_query = '
40
+ SELECT
41
+ YEAR(post_date) as year,
42
+ MAX(post_modified) as post_modified,
43
+ MAX(post_modified_gmt) as post_modified_gmt,
44
+ MAX(comment_count) as comment_count
45
+ FROM ' . $wpdb->posts . "
46
+ WHERE post_status = 'publish'
47
+ AND post_password = ''
48
+ AND post_type <> 'page'" . '
49
+ GROUP BY year
50
+ ORDER BY post_modified DESC';
51
+ }
52
+
53
+ $latest_posts = $this->get_results($latest_post_query);
54
+
55
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
56
+ return false;
57
+
58
+ $data = array();
59
+
60
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
61
+ {
62
+ $post = $latest_posts[$i];
63
+ $data = $this->init_data($data);
64
+
65
+ if ('monthly' == $requested)
66
+ $data['location'] = get_month_link($post->year, $post->month);
67
+ else if ('yearly' == $requested)
68
+ $data['location'] = get_year_link($post->year);
69
+
70
+ $data['lastmod'] = $this->get_lastmod($post);
71
+ $data['freq'] = $this->cal_frequency($post);
72
+ $data['priority'] = $this->cal_priority($post, $data['freq']);
73
+
74
+ $this->data[] = $data;
75
+ }
76
+
77
+ unset($latest_posts);
78
+
79
+ return true;
80
+ }
81
+ }
includes/modules/author.php CHANGED
@@ -1,59 +1,75 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_AUTHOR extends BWP_GXS_MODULE {
8
-
9
- function __construct()
10
- {
11
- $this->set_current_time();
12
- $this->build_data();
13
- }
14
-
15
- function generate_data()
16
- {
17
- global $wpdb, $bwp_gxs;
18
-
19
- // An array of what roles to include in sitemap
20
- $roles = array('administrator', 'editor', 'author');
21
- // The SQL query
22
- $author_sql = 'SELECT wp_u.ID, wp_u.user_nicename, MAX(wp_p.post_modified) as lastmod, wp_um.meta_value as role
23
- FROM ' . $wpdb->users . ' wp_u
24
- INNER JOIN ' . $wpdb->usermeta . ' wp_um
25
- ON wp_um.user_id = wp_u.ID
26
- INNER JOIN ' . $wpdb->posts . ' wp_p
27
- ON wp_p.post_author = wp_u.ID' . "
28
- WHERE wp_p.post_status = 'publish' AND wp_um.meta_key = '" . $wpdb->prefix . "capabilities'" . '
29
- GROUP BY wp_u.ID, wp_u.user_nicename, wp_um.meta_value
30
- ORDER BY lastmod DESC';
31
- // Get all authors
32
- $authors = $this->get_results($author_sql);
33
-
34
- if (!isset($authors) || 0 == sizeof($authors))
35
- return false;
36
-
37
- $data = array();
38
- for ($i = 0; $i < sizeof($authors); $i++)
39
- {
40
- // If user is not considered an author, pass
41
- $author = $authors[$i];
42
- $data = $this->init_data($data);
43
- $role = maybe_unserialize($author->role);
44
- $role = array_keys($role);
45
- if (!in_array($role[0], $roles))
46
- continue;
47
- $data['location'] = get_author_posts_url($author->ID, $author->user_nicename);
48
- $data['lastmod'] = $this->format_lastmod(strtotime($author->lastmod));
49
- $data['freq'] = $this->cal_frequency(NULL, $author->lastmod);
50
- $data['priority'] = $this->cal_priority(NULL, $data['freq']);
51
- $this->data[] = $data;
52
- }
53
-
54
- unset($authors);
55
-
56
- return true;
57
- }
58
- }
59
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_AUTHOR extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ // @since 1.3.0 this method is empty
13
+ }
14
+
15
+ protected function generate_data()
16
+ {
17
+ global $wpdb, $bwp_gxs;
18
+
19
+ // an array of what roles to include in sitemap
20
+ $roles = array(
21
+ 'administrator',
22
+ 'editor',
23
+ 'author',
24
+ 'contributor'
25
+ );
26
+
27
+ $author_sql = '
28
+ SELECT
29
+ u.ID,
30
+ u.user_nicename,
31
+ MAX(p.post_modified) as lastmod,
32
+ um.meta_value as role
33
+ FROM ' . $wpdb->users . ' u
34
+ INNER JOIN ' . $wpdb->usermeta . ' um
35
+ ON um.user_id = u.ID
36
+ INNER JOIN ' . $wpdb->posts . ' p
37
+ ON p.post_author = u.ID' . "
38
+ WHERE p.post_status = 'publish'
39
+ AND um.meta_key = '" . $wpdb->prefix . "capabilities'" . '
40
+ GROUP BY
41
+ u.ID,
42
+ u.user_nicename,
43
+ um.meta_value
44
+ ORDER BY lastmod DESC';
45
+
46
+ $authors = $this->get_results($author_sql);
47
+
48
+ if (!isset($authors) || 0 == sizeof($authors))
49
+ return false;
50
+
51
+ $data = array();
52
+
53
+ for ($i = 0; $i < sizeof($authors); $i++)
54
+ {
55
+ $data = $this->init_data($data);
56
+
57
+ $author = $authors[$i];
58
+ $role = maybe_unserialize($author->role);
59
+ $role = array_keys($role);
60
+
61
+ $data['location'] = !in_array($role[0], $roles)
62
+ ? '' : get_author_posts_url($author->ID, $author->user_nicename);
63
+
64
+ $data['lastmod'] = $this->get_lastmod($author);
65
+ $data['freq'] = $this->cal_frequency(false, $data['lastmod']);
66
+ $data['priority'] = $this->cal_priority(false, $data['freq']);
67
+
68
+ $this->data[] = $data;
69
+ }
70
+
71
+ unset($authors);
72
+
73
+ return true;
74
+ }
75
+ }
includes/modules/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // silence
includes/modules/page.php CHANGED
@@ -1,54 +1,67 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_PAGE extends BWP_GXS_MODULE {
8
-
9
- function __construct()
10
- {
11
- global $bwp_gxs;
12
-
13
- $this->set_current_time();
14
- $this->part = $bwp_gxs->module_data['module_part'];
15
- $this->build_data();
16
- }
17
-
18
- function generate_data()
19
- {
20
- global $wpdb, $bwp_gxs, $post;
21
-
22
- $sql_where = apply_filters('bwp_gxs_post_where', '', 'page');
23
-
24
- $latest_post_query = '
25
- SELECT * FROM ' . $wpdb->posts . " wposts
26
- WHERE wposts.post_status = 'publish' AND wposts.post_type = 'page' $sql_where" . '
27
- ORDER BY wposts.post_modified DESC';
28
-
29
- $latest_posts = $this->get_results($latest_post_query);
30
-
31
- if (!isset($latest_posts) || 0 == sizeof($latest_posts))
32
- return false;
33
-
34
- $data = array();
35
- for ($i = 0; $i < sizeof($latest_posts); $i++)
36
- {
37
- $post = $latest_posts[$i];
38
- $data = $this->init_data($data);
39
- wp_cache_add($post->ID, $post, 'posts');
40
- $data['location'] = get_permalink();
41
- $data['lastmod'] = $this->format_lastmod(strtotime($post->post_modified));
42
- $data['freq'] = $this->cal_frequency($post);
43
- $data['priority'] = $this->cal_priority($post, $data['freq']);
44
- $this->data[] = $data;
45
- }
46
-
47
- // Probably save some memory ;)
48
- unset($latest_posts);
49
-
50
- // Always return true if we can get here, otherwise you're stuck at the SQL cycling limit
51
- return true;
52
- }
53
- }
54
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_PAGE extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ // @since 1.3.0 this is left blank
13
+ }
14
+
15
+ protected function generate_data()
16
+ {
17
+ global $wpdb, $post;
18
+
19
+ $sql_where = apply_filters('bwp_gxs_post_where', '', 'page');
20
+ $sql_where = str_replace('wposts', 'p', $sql_where);
21
+
22
+ $latest_post_query = '
23
+ SELECT *
24
+ FROM ' . $wpdb->posts . " p
25
+ WHERE p.post_status = 'publish'
26
+ AND p.post_password = ''
27
+ AND p.post_type = 'page' $sql_where" . '
28
+ ORDER BY p.post_modified DESC';
29
+
30
+ $latest_posts = $this->get_results($latest_post_query);
31
+
32
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
33
+ return false;
34
+
35
+ $using_permalinks = $this->using_permalinks();
36
+
37
+ $data = array();
38
+
39
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
40
+ {
41
+ $post = $latest_posts[$i];
42
+ $data = $this->init_data($data);
43
+
44
+ if ($using_permalinks && empty($post->post_name))
45
+ {
46
+ $data['location'] = '';
47
+ }
48
+ else
49
+ {
50
+ wp_cache_add($post->ID, $post, 'posts');
51
+ $data['location'] = get_permalink();
52
+ }
53
+
54
+ $data['lastmod'] = $this->get_lastmod($post);
55
+ $data['freq'] = $this->cal_frequency($post);
56
+ $data['priority'] = $this->cal_priority($post, $data['freq']);
57
+
58
+ $this->data[] = $data;
59
+ }
60
+
61
+ unset($latest_posts);
62
+
63
+ // always return true if we can get here,
64
+ // otherwise we're stuck in a SQL cycling loop
65
+ return true;
66
+ }
67
+ }
includes/modules/page_external.php CHANGED
@@ -1,43 +1,52 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_PAGE_EXTERNAL extends BWP_GXS_MODULE {
8
-
9
- function __construct()
10
- {
11
- global $bwp_gxs;
12
-
13
- $this->set_current_time();
14
- $this->build_data();
15
- }
16
-
17
- function build_data()
18
- {
19
- global $wpdb, $bwp_gxs;
20
-
21
- // The structure of your external pages should be like the below sample item
22
- // array('location' => '', 'lastmod' => '', 'priority' => '')
23
- // Frequency will be calculated based on lastmod
24
- $sample_pages = array(
25
- array('location' => home_url('a-page-not-belong-to-wordpress.html'), 'lastmod' => '06/02/2011', 'priority' => '1.0'),
26
- array('location' => home_url('another-page-not-belong-to-wordpress.html'), 'lastmod' => '05/02/2011', 'priority' => '0.8')
27
- );
28
- $external_pages = (array) apply_filters('bwp_gxs_external_pages', $sample_pages);
29
-
30
- $data = array();
31
- for ($i = 0; $i < sizeof($external_pages); $i++)
32
- {
33
- $page = $external_pages[$i];
34
- $data = $this->init_data($data);
35
- $data['location'] = $page['location'];
36
- $data['lastmod'] = $this->format_lastmod(strtotime($page['lastmod']));
37
- $data['freq'] = $this->cal_frequency(NULL, $page['lastmod']);
38
- $data['priority'] = $page['priority'];
39
- $this->data[] = $data;
40
- }
41
- }
42
- }
43
- ?>
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_PAGE_EXTERNAL extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ // @since 1.3.0 this method is empty
13
+ }
14
+
15
+ protected function build_data()
16
+ {
17
+ global $wpdb, $bwp_gxs;
18
+
19
+ // The structure of your external pages should be like the below sample item
20
+ // array('location' => '', 'lastmod' => '', 'priority' => '')
21
+ // Frequency will be calculated based on lastmod
22
+ $sample_pages = array(
23
+ array(
24
+ 'location' => home_url('a-page-not-belong-to-wordpress.html'),
25
+ 'lastmod' => '06/02/2011',
26
+ 'priority' => '1.0'
27
+ ),
28
+ array(
29
+ 'location' => home_url('another-page-not-belong-to-wordpress.html'),
30
+ 'lastmod' => '05/02/2011',
31
+ 'priority' => '0.8'
32
+ )
33
+ );
34
+
35
+ $external_pages = (array) apply_filters('bwp_gxs_external_pages', $sample_pages);
36
+
37
+ $data = array();
38
+
39
+ for ($i = 0; $i < sizeof($external_pages); $i++)
40
+ {
41
+ $page = $external_pages[$i];
42
+ $data = $this->init_data($data);
43
+
44
+ $data['location'] = $page['location'];
45
+ $data['lastmod'] = $this->format_lastmod(strtotime($page['lastmod']));
46
+ $data['freq'] = $this->cal_frequency(false, $page['lastmod']);
47
+ $data['priority'] = $page['priority'];
48
+
49
+ $this->data[] = $data;
50
+ }
51
+ }
52
+ }
includes/modules/post.php CHANGED
@@ -1,113 +1,162 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- *
6
- * You can take this as a sample module, it is documented rather well ;)
7
- */
8
-
9
- class BWP_GXS_MODULE_POST extends BWP_GXS_MODULE {
10
-
11
- // Declare all properties you need for your modules here
12
- var $requested;
13
-
14
- function __construct()
15
- {
16
- global $bwp_gxs;
17
- // Give your properties value here
18
- // $this->set_current_time() should always be called, it will allow you to use $this->now (the current Unix Timestamp).
19
- $this->set_current_time();
20
- // $bwp_gxs->module_data hold four things, but you only need to take note of 'sub_module' and 'module_key'
21
- // For example when you are browsing to http://example.com/taxonomy_category.xml
22
- // $bwp_gxs->module_data['sub_module'] is 'category' (the singular name) and $bwp_gxs->module_data['module_key'] is
23
- // 'taxonomy_category' (also singular). If you have a custom module for taxonomy_category, you must name your class
24
- // BWP_GXS_MODULE_TAXONOMY_CATEGORY and save the file as taxonomy_category.php (similar to taxonomy_post_tag.php).
25
- // If no custom post type is requested, use the default post type
26
- $this->requested = (!empty($bwp_gxs->module_data['sub_module'])) ? $bwp_gxs->module_data['sub_module'] : 'post';
27
- // module_part let you determine whether or not to build a post sitemap as part of a large post sitemap. If this value is
28
- // greater than 0, for example 2, or 3 it means that we are building part 2, or part 3 of that large sitemap, and we
29
- // will have to modify our SQL query accordingly - @since 1.1.0
30
- $this->part = $bwp_gxs->module_data['module_part'];
31
- // Get the permalink this website uses, apply to normal posts
32
- $this->perma_struct = get_option('permalink_structure');
33
- // See if the current post_type is a hierarchical one or not
34
- $this->post_type = get_post_type_object($this->requested);
35
- // Always call this to start building data
36
- // If you want to make use of SQL cycling (a method to reduce heavy queries), don't use build_data() like other modules.
37
- // Just call it here and use function generate_data() to build actual data, just like below. Use SQL cycling when
38
- // you are dealing with post-based sitemaps.
39
- $this->build_data();
40
- }
41
-
42
- /**
43
- * This is the main function that generates our data.
44
- *
45
- * Since we are dealing with heavy queries here, it's better that you use
46
- * generate_data() which will get called by build_data(). This way you will query for no more than
47
- * the SQL limit configurable in this plugin's option page.
48
- * If you happen to use LIMIT in your SQL statement for other reasons then use build_data() instead.
49
- */
50
- function generate_data()
51
- {
52
- global $wpdb, $bwp_gxs, $post;
53
-
54
- $requested = $this->requested;
55
-
56
- // Can be something like: ` AND wposts.ID NOT IN (1,2,3,4) `
57
- $sql_where = apply_filters('bwp_gxs_post_where', '', $requested);
58
-
59
- // A standard custom query to fetch posts from database, sorted by their lastmod
60
- // You can use any type of queries for your modules
61
- // If $requested is 'post' and this site uses %category% in permalink structure,
62
- // we will have to use a complex SQL query so this plugin can scale up to millions of posts.
63
- if ('post' == $requested && strpos($this->perma_struct, '%category%') !== false)
64
- $latest_post_query = '
65
- SELECT * FROM ' . $wpdb->term_relationships . ' wprel
66
- INNER JOIN ' . $wpdb->posts . ' wposts
67
- ON wprel.object_id = wposts.ID' . "
68
- AND wposts.post_status = 'publish'" . '
69
- INNER JOIN ' . $wpdb->term_taxonomy . ' wptax
70
- ON wprel.term_taxonomy_id = wptax.term_taxonomy_id' . "
71
- AND wptax.taxonomy = 'category'" . '
72
- , ' . $wpdb->terms . ' wpterms
73
- WHERE wptax.term_id = wpterms.term_id '
74
- . "$sql_where" . '
75
- GROUP BY wposts.ID
76
- ORDER BY wposts.post_modified DESC';
77
- else
78
- $latest_post_query = '
79
- SELECT * FROM ' . $wpdb->posts . " wposts
80
- WHERE wposts.post_status = 'publish' AND wposts.post_type = %s $sql_where" . '
81
- ORDER BY wposts.post_modified DESC';
82
- // Use $this->get_results instead of $wpdb->get_results, remember to escape your query
83
- // using $wpdb->prepare or $wpdb->escape, @see http://codex.wordpress.org/Function_Reference/wpdb_Class
84
- $latest_posts = $this->get_results($wpdb->prepare($latest_post_query, $requested));
85
- // This check helps you stop the cycling sooner
86
- // It basically means if there is nothing to loop through anymore we return false so the cycling can stop.
87
- if (!isset($latest_posts) || 0 == sizeof($latest_posts))
88
- return false;
89
-
90
- // Always init your $data
91
- $data = array();
92
- for ($i = 0; $i < sizeof($latest_posts); $i++)
93
- {
94
- $post = $latest_posts[$i];
95
- // Init your $data with the previous item's data. This makes sure no item is mal-formed.
96
- $data = $this->init_data($data);
97
- // @since 1.1.0 - get permalink independently, as we don't need caching or some complicated stuff
98
- $data['location'] = $this->get_permalink();
99
- $data['lastmod'] = $this->format_lastmod(strtotime($post->post_modified));
100
- $data['freq'] = $this->cal_frequency($post);
101
- $data['priority'] = $this->cal_priority($post, $data['freq']);
102
- // Pass data back to the plugin to handle
103
- $this->data[] = $data;
104
- }
105
-
106
- // Probably save some memory ;)
107
- unset($latest_posts);
108
-
109
- // Always return true if we can get here, otherwise you're stuck at the SQL cycling limit
110
- return true;
111
- }
112
- }
113
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ *
7
+ * You can take this as a sample module, it is documented rather well ;)
8
+ */
9
+
10
+ class BWP_GXS_MODULE_POST extends BWP_GXS_MODULE
11
+ {
12
+ public function __construct()
13
+ {
14
+ // $this->set_current_time() should always be called, it will allow you
15
+ // to use $this->now (the current Unix Timestamp).
16
+ // @since 1.3.0 this is called from main class
17
+ /* $this->set_current_time(); */
18
+
19
+ // $this->module_data hold four things, but you only need to take
20
+ // note of 'sub_module' and 'module_name'. For example when you are
21
+ // browsing to http://example.com/taxonomy_category.xml
22
+ // $this->module_data['sub_module'] is 'category' (the singular
23
+ // name) and $this->module_data['module_name'] is 'taxonomy_category'
24
+ // (also singular). If you have a custom module for taxonomy_category,
25
+ // you must name your class BWP_GXS_MODULE_TAXONOMY_CATEGORY and save
26
+ // the file as taxonomy_category.php (same goes for taxonomy_post_tag.php).
27
+ // If no custom post type is requested, use the default post type
28
+ // @since 1.3.0 this is set in main class
29
+ /* $this->requested = !empty($this->module_data['sub_module']) */
30
+ /* ? $this->module_data['sub_module'] : 'post'; */
31
+
32
+ // $this->module_data['part'] let you determine whether or not to build
33
+ // a post sitemap as part of a large post sitemap. If this value is
34
+ // greater than 0, for example 2, or 3 it means that we are building
35
+ // part 2, or part 3 of that large sitemap, and we will have to modify
36
+ // our SQL query accordingly - @since BWP GXS 1.1.0
37
+ // @since 1.3.0 this is set in main class
38
+ /* $this->part = $bwp_gxs->module_data['module_part']; */
39
+
40
+ // properties that are not dependent on module data can be initiated here,
41
+ // otherwise must be initiated using ::init_module_properties method
42
+ $this->perma_struct = get_option('permalink_structure');
43
+
44
+ // @since 1.3.0 no need to manually call this anymore
45
+ /* $this->build_data(); */
46
+ }
47
+
48
+ protected function init_module_properties()
49
+ {
50
+ $this->post_type = get_post_type_object($this->requested);
51
+ }
52
+
53
+ /**
54
+ * This is the main function that generates our data.
55
+ *
56
+ * Since we are dealing with heavy queries here, it's better that you use
57
+ * generate_data() which will get called by build_data(). This way you will
58
+ * query for no more than the SQL limit configurable in this plugin's
59
+ * option page. If you happen to use LIMIT in your SQL statement for other
60
+ * reasons then use build_data() instead.
61
+ */
62
+ protected function generate_data()
63
+ {
64
+ global $wpdb, $bwp_gxs, $post;
65
+
66
+ $requested = $this->requested;
67
+
68
+ // @since 1.3.0 use a different filter hook that expects an array instead
69
+ $excluded_posts = apply_filters('bwp_gxs_excluded_posts', array(), $requested);
70
+ $exclude_post_sql = sizeof($excluded_posts) > 0
71
+ ? ' AND p.ID NOT IN (' . implode(',', $excluded_posts) . ') '
72
+ : '';
73
+
74
+ // @since 1.3.0 this should be used to add other things to the SQL
75
+ // instead of excluding posts
76
+ $sql_where = apply_filters('bwp_gxs_post_where', '', $requested);
77
+ $sql_where = str_replace('wposts', 'p', $sql_where); // @since 1.3.0 use a different alias for post table
78
+
79
+ if ('post' == $requested && strpos($this->perma_struct, '%category%') !== false)
80
+ {
81
+ // If $requested is 'post' and this site uses %category% in
82
+ // permalink structure, we will have to use a complex SQL query so
83
+ // this plugin can scale up to millions of posts.
84
+ // @since 1.3.0 do not fetch posts that are password-protected
85
+ $latest_post_query = '
86
+ SELECT *
87
+ FROM ' . $wpdb->term_relationships . ' tr
88
+ INNER JOIN ' . $wpdb->posts . ' p
89
+ ON tr.object_id = p.ID' . "
90
+ AND p.post_status = 'publish'
91
+ AND p.post_password = ''" . '
92
+ INNER JOIN ' . $wpdb->term_taxonomy . ' tt
93
+ ON tr.term_taxonomy_id = tt.term_taxonomy_id' . "
94
+ AND tt.taxonomy = 'category'" . '
95
+ , ' . $wpdb->terms . ' t
96
+ WHERE tt.term_id = t.term_id '
97
+ . "$exclude_post_sql"
98
+ . "$sql_where" . '
99
+ GROUP BY p.ID
100
+ ORDER BY p.post_modified DESC';
101
+ }
102
+ else
103
+ {
104
+ // @since 1.3.0 do not fetch posts that are password-protected
105
+ $latest_post_query = '
106
+ SELECT *
107
+ FROM ' . $wpdb->posts . " p
108
+ WHERE p.post_status = 'publish'
109
+ AND p.post_password = ''
110
+ AND p.post_type = %s
111
+ $exclude_post_sql
112
+ $sql_where" . '
113
+ ORDER BY p.post_modified DESC';
114
+ }
115
+
116
+ // Use $this->get_results instead of $wpdb->get_results, remember to
117
+ // escape your query using $wpdb->prepare or $wpdb->escape, @see
118
+ // http://codex.wordpress.org/Function_Reference/wpdb_Class
119
+ $latest_posts = $this->get_results($wpdb->prepare($latest_post_query, $requested));
120
+
121
+ // This check helps you stop the cycling sooner. It basically means if
122
+ // there is nothing to loop through anymore we return false so the
123
+ // cycling can stop.
124
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
125
+ return false;
126
+
127
+ $using_permalinks = $this->using_permalinks();
128
+
129
+ // always init your $data
130
+ $data = array();
131
+
132
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
133
+ {
134
+ $post = $latest_posts[$i];
135
+
136
+ // init your $data with the previous item's data. This makes sure
137
+ // no item is mal-formed.
138
+ $data = $this->init_data($data);
139
+
140
+ // @since 1.1.0 - get permalink independently, as we don't need
141
+ // caching or some complicated stuff. If permalink is being used,
142
+ // yet postname is missing, ignore this item
143
+ if ($using_permalinks && empty($post->post_name))
144
+ $data['location'] = '';
145
+ else
146
+ $data['location'] = $this->get_permalink();
147
+
148
+ $data['lastmod'] = $this->get_lastmod($post);
149
+ $data['freq'] = $this->cal_frequency($post);
150
+ $data['priority'] = $this->cal_priority($post, $data['freq']);
151
+
152
+ // Pass data back to the plugin to handle
153
+ $this->data[] = $data;
154
+ }
155
+
156
+ unset($latest_posts);
157
+
158
+ // always return true if we can get here, otherwise you're stuck in a
159
+ // SQL cycling loop
160
+ return true;
161
+ }
162
+ }
includes/modules/post_attachment.php CHANGED
@@ -1,4 +1,3 @@
1
- <?php
2
- echo 'Intentionally left blank.';
3
- exit;
4
- ?>
1
+ <?php
2
+ echo 'Intentionally left blank.';
3
+ exit;
 
includes/modules/post_google_news.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_POST_GOOGLE_NEWS extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ $this->type = 'news';
13
+ $this->perma_struct = get_option('permalink_structure');
14
+ }
15
+
16
+ /**
17
+ * Process the posts if Multi-cat mode is enabled
18
+ */
19
+ private static function process_posts($posts, $news_cats, $news_cat_action)
20
+ {
21
+ // This $post array surely contains duplicate posts (fortunately they
22
+ // are already sorted) let's group 'em
23
+ $ord_num = 0;
24
+
25
+ $excluded_cats = 'inc' == $news_cat_action ? array() : explode(',', $news_cats);
26
+
27
+ $processed_posts = array();
28
+
29
+ for ($i = 0; $i < sizeof($posts); $i++)
30
+ {
31
+ $post = $posts[$i];
32
+
33
+ if ($ord_num == $post->ID)
34
+ {
35
+ $cur_position = sizeof($processed_posts) - 1;
36
+
37
+ // nothing to do, continue
38
+ if ($cur_position < 0)
39
+ continue;
40
+
41
+ $current_post = $processed_posts[$cur_position];
42
+
43
+ // not correct post, continue
44
+ if ($current_post->ID != $ord_num)
45
+ continue;
46
+
47
+ // users choose to exclude cats, and this $post is assigned to
48
+ // one of those excluded cats
49
+ if (in_array($post->term_id, $excluded_cats)
50
+ || in_array($current_post->terms[0], $excluded_cats)
51
+ ) {
52
+ array_pop($processed_posts);
53
+ }
54
+ else
55
+ {
56
+ if (!in_array($post->term_id, $current_post->terms))
57
+ $current_post->terms[] = $post->term_id;
58
+
59
+ if (!in_array($post->name, $current_post->term_names))
60
+ $current_post->term_names[] = $post->name;
61
+ }
62
+
63
+ }
64
+ else
65
+ {
66
+ $post->terms = array($post->term_id);
67
+ $post->term_names = array($post->name);
68
+
69
+ $processed_posts[] = $post;
70
+
71
+ $ord_num = $post->ID;
72
+ }
73
+ }
74
+
75
+ return $processed_posts;
76
+ }
77
+
78
+ private static function news_time()
79
+ {
80
+ return gmdate('Y-m-d H:i:s', time() + get_option('gmt_offset') * 3600 - 48 * 3600);
81
+ }
82
+
83
+ protected function generate_data()
84
+ {
85
+ global $wpdb, $post, $bwp_gxs;
86
+
87
+ $keywords_map = apply_filters('bwp_gxs_news_keyword_map', array(
88
+ // This is an array to map foreign categories to its English counterpart
89
+ // Use category title (name) as the key
90
+ // Below is an example:
91
+ // '電視台' => 'television',
92
+ // '名人'=> 'celebrities'
93
+ ));
94
+
95
+ // @see http://www.google.com/support/news_pub/bin/answer.py?answer=74288
96
+ $time = self::news_time();
97
+ $lang = $bwp_gxs->options['select_news_lang'];
98
+
99
+ $news_genres = $bwp_gxs->options['input_news_genres'];
100
+ $news_cats = $bwp_gxs->options['select_news_cats'];
101
+ $news_cat_action = $bwp_gxs->options['select_news_cat_action'];
102
+
103
+ if ($news_cat_action == 'inc' && empty($news_cats))
104
+ {
105
+ // if we have to look for news post in certain categories, but
106
+ // news category list is empty, nothing to do. This should stop the
107
+ // SQL cycling btw.
108
+ return false;
109
+ }
110
+
111
+ $cat_query = ' AND t.term_id NOT IN (' . $news_cats . ')';
112
+ $cat_query = $news_cat_action == 'inc'
113
+ ? str_replace('NOT IN', 'IN', $cat_query) : $cat_query;
114
+ $cat_query = $news_cat_action != 'inc'
115
+ && $bwp_gxs->options['enable_news_multicat'] == 'yes'
116
+ ? '' : $cat_query;
117
+
118
+ $group_by = empty($bwp_gxs->options['enable_news_multicat'])
119
+ ? ' GROUP BY p.ID' : '';
120
+
121
+ $latest_post_query = '
122
+ SELECT *
123
+ FROM ' . $wpdb->term_relationships . ' tr
124
+ INNER JOIN ' . $wpdb->posts . ' p
125
+ ON tr.object_id = p.ID' . "
126
+ AND p.post_status = 'publish'
127
+ AND p.post_password = ''" . '
128
+ INNER JOIN ' . $wpdb->term_taxonomy . ' tt
129
+ ON tr.term_taxonomy_id = tt.term_taxonomy_id' . "
130
+ AND tt.taxonomy = 'category'" . '
131
+ , ' . $wpdb->terms . ' t
132
+ WHERE tt.term_id = t.term_id
133
+ AND p.post_date > %s' .
134
+ $cat_query . $group_by . '
135
+ ORDER BY p.post_date DESC';
136
+
137
+ $latest_posts = $this->get_results($wpdb->prepare($latest_post_query, $time));
138
+
139
+ if ('yes' == $bwp_gxs->options['enable_news_multicat'])
140
+ {
141
+ // if Multi-cat mode is enabled we will need to process fetched posts
142
+ $latest_posts = self::process_posts($latest_posts, $news_cats, $news_cat_action);
143
+ }
144
+
145
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
146
+ return false;
147
+
148
+ $using_permalinks = $this->using_permalinks();
149
+
150
+ $genres_cache = array();
151
+
152
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
153
+ {
154
+ $post = $latest_posts[$i];
155
+
156
+ $data = array();
157
+
158
+ // @since 1.1.0 - get permalink independently, as we don't need
159
+ // caching or some complicated stuff
160
+ if ($using_permalinks && empty($post->post_name))
161
+ $data['location'] = '';
162
+ else
163
+ $data['location'] = $this->get_permalink();
164
+
165
+ $data['language'] = $lang;
166
+
167
+ if (isset($post->terms))
168
+ {
169
+ // multi-cat support for genres
170
+ $genres_cache_key = md5(implode('|', $post->terms));
171
+
172
+ if (!isset($genres_cache[$genres_cache_key])
173
+ || !is_array($genres_cache[$genres_cache_key])
174
+ ) {
175
+ $genres_cache[$genres_cache_key] = array();
176
+
177
+ foreach ($post->terms as $term_id)
178
+ {
179
+ $cur_genres = !empty($news_genres['cat_' . $term_id])
180
+ ? explode(', ', $news_genres['cat_' . $term_id])
181
+ : '';
182
+
183
+ if (is_array($cur_genres)) :
184
+ foreach ($cur_genres as $cur_genre)
185
+ if (!in_array($cur_genre, $genres_cache[$genres_cache_key]))
186
+ $genres_cache[$genres_cache_key][] = $cur_genre;
187
+ endif;
188
+ }
189
+ }
190
+
191
+ $data['genres'] = implode(', ', $genres_cache[$genres_cache_key]);
192
+ }
193
+ else
194
+ {
195
+ $data['genres'] = !empty($news_genres['cat_' . $post->term_id])
196
+ ? $news_genres['cat_' . $post->term_id]
197
+ : '';
198
+ }
199
+
200
+ $data['pub_date'] = $bwp_gxs->options['enable_gmt']
201
+ ? $this->format_lastmod(strtotime($post->post_date_gmt), false)
202
+ : $this->format_lastmod(strtotime($post->post_date));
203
+
204
+ $data['title'] = $post->post_title;
205
+
206
+ // multi-cat support for news categories as keywords
207
+ if ('cat' == $bwp_gxs->options['select_news_keyword_type'] && isset($post->term_names))
208
+ {
209
+ $keywords = array();
210
+
211
+ foreach ($post->term_names as $term_name)
212
+ $keywords[] = (!empty($keywords_map[$term_name])) ? trim($keywords_map[$term_name]) : $term_name;
213
+
214
+ $keywords = implode(', ', $keywords);
215
+ }
216
+ else if ('tag' == $bwp_gxs->options['select_news_keyword_type'])
217
+ {
218
+ // temporary support for news tags as keywords
219
+ $keywords = array();
220
+ $tags = get_the_tags($post->ID);
221
+
222
+ if (is_array($tags)) :
223
+ foreach (get_the_tags($post->ID) as $tag)
224
+ {
225
+ $keywords[] = !empty($keywords_map[$tag->name])
226
+ ? trim($keywords_map[$tag->name])
227
+ : $tag->name;
228
+ }
229
+ endif;
230
+
231
+ $keywords = implode(', ', $keywords);
232
+ }
233
+ else
234
+ {
235
+ $keywords = !empty($keywords_map[$post->name])
236
+ ? trim($keywords_map[$post->name])
237
+ : $post->name;
238
+ }
239
+
240
+ $data['keywords'] = 'yes' == $bwp_gxs->options['enable_news_keywords']
241
+ ? $keywords : '';
242
+
243
+ $this->data[] = $data;
244
+ }
245
+
246
+ // always return true if we can get here, otherwise you're stuck in a
247
+ // SQL cycling loop
248
+ return true;
249
+ }
250
+ }
includes/modules/post_most_popular.php CHANGED
@@ -1,71 +1,83 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- *
6
- * This is a sample custom module. Some if about the module developer here would be nice!
7
- */
8
-
9
- class BWP_GXS_MODULE_POST_MOST_POPULAR extends BWP_GXS_MODULE {
10
-
11
- function __construct()
12
- {
13
- // Give your properties value here
14
- // $this->set_current_time() should always be called, it will allow you to use $this->now (the current Unix Timestamp).
15
- $this->set_current_time();
16
- $this->perma_struct = get_option('permalink_structure');
17
- // Always call this to start building data
18
- // If you want to make use of SQL cycling (a method to reduce heavy queries), don't use build_data() like other modules.
19
- // Just call it here and use function generate_data() to build actual data, just like below. Use SQL cycling when
20
- // you are dealing with post-based sitemaps.
21
- $this->build_data();
22
- }
23
-
24
- /**
25
- * This is the main function that generates our data.
26
- *
27
- * Since we are dealing with heavy queries here, it's better that you use
28
- * generate_data() which will get called by build_data(). This way you will query for no more than
29
- * the SQL limit configurable in this plugin's option page.
30
- * If you happen to use LIMIT in your SQL statement for other reasons then use build_data() instead.
31
- */
32
- function generate_data()
33
- {
34
- global $wpdb, $bwp_gxs, $post;
35
-
36
- $latest_post_query = '
37
- SELECT * FROM ' . $wpdb->posts . "
38
- WHERE post_status = 'publish' AND post_type = 'post' AND comment_count > 2" . '
39
- ORDER BY comment_count, post_modified DESC';
40
-
41
- // Use $this->get_results instead of $wpdb->get_results, remember to escape your query
42
- // using $wpdb->prepare or $wpdb->escape, @see http://codex.wordpress.org/Function_Reference/wpdb_Class
43
- $latest_posts = $this->get_results($latest_post_query);
44
-
45
- // This check helps you stop the cycling sooner
46
- // It basically means if there is nothing to loop through anymore we return false so the cycling can stop.
47
- if (!isset($latest_posts) || 0 == sizeof($latest_posts))
48
- return false;
49
-
50
- // Always init your $data
51
- $data = array();
52
- for ($i = 0; $i < sizeof($latest_posts); $i++)
53
- {
54
- $post = $latest_posts[$i];
55
- // Init your $data with the previous item's data. This makes sure no item is mal-formed.
56
- $data = $this->init_data($data);
57
- $data['location'] = get_permalink();
58
- $data['lastmod'] = $this->format_lastmod(strtotime($post->post_modified));
59
- $data['freq'] = $this->cal_frequency($post);
60
- $data['priority'] = $this->cal_priority($post, $data['freq']);
61
- $this->data[] = $data;
62
- }
63
-
64
- // Probably save some memory ;)
65
- unset($latest_posts);
66
-
67
- // Always return true if we can get here, otherwise you're stuck at the SQL cycling limit
68
- return true;
69
- }
70
- }
71
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ *
7
+ * This is a sample custom module. Some if about the module developer here
8
+ * would be nice!
9
+ */
10
+
11
+ class BWP_GXS_MODULE_POST_MOST_POPULAR extends BWP_GXS_MODULE
12
+ {
13
+ public function __construct()
14
+ {
15
+ $this->perma_struct = get_option('permalink_structure');
16
+ }
17
+
18
+ protected function init_module_properties()
19
+ {
20
+ $this->post_type = get_post_type_object($this->requested);
21
+ }
22
+
23
+ /**
24
+ * This is the main function that generates our data.
25
+ *
26
+ * Since we are dealing with heavy queries here, it's better that you use
27
+ * generate_data() which will get called by build_data(). This way you will
28
+ * query for no more than the SQL limit configurable in this plugin's
29
+ * option page. If you happen to use LIMIT in your SQL statement for other
30
+ * reasons then use build_data() instead.
31
+ */
32
+ protected function generate_data()
33
+ {
34
+ global $wpdb, $bwp_gxs, $post;
35
+
36
+ $latest_post_query = '
37
+ SELECT *
38
+ FROM ' . $wpdb->posts . "
39
+ WHERE post_status = 'publish'
40
+ AND post_type = 'post'
41
+ AND comment_count > 2" . '
42
+ ORDER BY comment_count, post_modified DESC';
43
+
44
+ // Use $this->get_results instead of $wpdb->get_results, remember to
45
+ // escape your query using $wpdb->prepare or $wpdb->escape,
46
+ // @see http://codex.wordpress.org/Function_Reference/wpdb_Class
47
+ $latest_posts = $this->get_results($latest_post_query);
48
+
49
+ // This check helps you stop the cycling sooner. It basically means if
50
+ // there is nothing to loop through anymore we return false so the
51
+ // cycling can stop.
52
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
53
+ return false;
54
+
55
+ $using_permalinks = $this->using_permalinks();
56
+
57
+ // always init your $data
58
+ $data = array();
59
+
60
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
61
+ {
62
+ $post = $latest_posts[$i];
63
+ $data = $this->init_data($data);
64
+
65
+ if ($using_permalinks && empty($post->post_name))
66
+ $data['location'] = '';
67
+ else
68
+ $data['location'] = get_permalink();
69
+
70
+ $data['lastmod'] = $this->get_lastmod($post);
71
+ $data['freq'] = $this->cal_frequency($post);
72
+ $data['priority'] = $this->cal_priority($post, $data['freq']);
73
+
74
+ $this->data[] = $data;
75
+ }
76
+
77
+ unset($latest_posts);
78
+
79
+ // always return true if we can get here, otherwise you're stuck in the
80
+ // SQL cycling loop
81
+ return true;
82
+ }
83
+ }
includes/modules/site.php CHANGED
@@ -1,76 +1,121 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_SITE extends BWP_GXS_MODULE {
8
-
9
- function __construct()
10
- {
11
- $this->set_current_time();
12
- $this->build_data();
13
- }
14
-
15
- function generate_data()
16
- {
17
- global $wpdb, $blog_id;
18
-
19
- // If this is simply not a multisite installation, or a multisite installation, but not on main site,
20
- // just show the lonely domain
21
- if (empty($wpdb->blogs) || (!empty($blog_id) && 1 < $blog_id))
22
- {
23
- $last_mod = $wpdb->get_var('SELECT post_modified FROM ' . $wpdb->posts . " WHERE post_status = 'publish' ORDER BY post_modified DESC");
24
- $data = array();
25
- $data['location'] = trailingslashit(home_url());
26
- $data['lastmod'] = $this->format_lastmod(strtotime($last_mod));
27
- $data['freq'] = apply_filters('bwp_gxs_freq_site', $this->cal_frequency(NULL, $last_mod), $blog_id);
28
- $data['freq'] = ('always' == $data['freq']) ? 'hourly' : $data['freq'];
29
- $data['priority'] = 1;
30
- $this->data[] = $data;
31
- return false;
32
- }
33
- else if (isset($blog_id) && 1 == $blog_id)
34
- {
35
- if (!empty($wpdb->dmtable))
36
- // If domain mapping is active
37
- $blog_sql = 'SELECT wpblogs.*, wpdm.domain as mapped_domain FROM ' . $wpdb->blogs . ' wpblogs
38
- LEFT JOIN ' . $wpdb->dmtable . ' wpdm
39
- ON wpblogs.blog_id = wpdm.blog_id
40
- WHERE wpblogs.public = 1 AND wpblogs.spam = 0 AND wpblogs.deleted = 0';
41
- else
42
- // Otherwise
43
- $blog_sql = 'SELECT * FROM ' . $wpdb->blogs . ' WHERE public = 1 AND spam = 0 AND deleted = 0';
44
-
45
- // Get all blogs
46
- $blogs = $this->get_results($blog_sql);
47
-
48
- if (!isset($blogs) || 0 == sizeof($blogs))
49
- return false;
50
-
51
- $data = array();
52
- for ($i = 0; $i < sizeof($blogs); $i++)
53
- {
54
- $blog = $blogs[$i];
55
- $data = $this->init_data($data);
56
- // Get the correct domain
57
- $scheme = is_ssl() ? 'https://' : 'http://';
58
- $path = $blog->path;
59
- $data['location'] = (empty($blog->mapped_domain)) ? $scheme . $blog->domain . $path : $scheme . str_replace(array('http', 'https'), '', $blog->mapped_domain) . '/';
60
- $data['lastmod'] = $this->format_lastmod(strtotime($blog->last_updated));
61
- $data['freq'] = apply_filters('bwp_gxs_freq_site', $this->cal_frequency(NULL, $blog->last_updated), $blog->blog_id);
62
- $data['freq'] = ('always' == $data['freq']) ? 'hourly' : $data['freq'];
63
- // Always give primary blog a priority of 1
64
- $data['priority'] = (0 == $i) ? 1 : $this->cal_priority(NULL, $data['freq']);
65
- $this->data[] = $data;
66
- }
67
-
68
- unset($blogs);
69
-
70
- return true;
71
- }
72
- else
73
- return false;
74
- }
75
- }
76
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ */
6
+
7
+ class BWP_GXS_MODULE_SITE extends BWP_GXS_MODULE
8
+ {
9
+ public function __construct()
10
+ {
11
+ // @since 1.3.0 this method is empty
12
+ }
13
+
14
+ protected function generate_data()
15
+ {
16
+ global $wpdb, $blog_id;
17
+
18
+ if (!BWP_SIMPLE_GXS::is_multisite()
19
+ || BWP_SIMPLE_GXS::is_subdomain_install()
20
+ || (!empty($blog_id) && $blog_id > 1)
21
+ ) {
22
+ // if this is not a multisite installation,
23
+ // OR a subdomain multisite installation,
24
+ // OR not on main site, just show the lonely domain
25
+ $last_post = $wpdb->get_row('
26
+ SELECT
27
+ post_date, post_date_gmt,
28
+ post_modified, post_modified_gmt
29
+ FROM ' . $wpdb->posts . "
30
+ WHERE post_status = 'publish'
31
+ AND post_password = ''
32
+ ORDER BY post_modified DESC
33
+ LIMIT 1"
34
+ );
35
+
36
+ $data = array();
37
+
38
+ $data['location'] = trailingslashit(home_url());
39
+ $data['lastmod'] = $this->get_lastmod($last_post);
40
+
41
+ $data['freq'] = apply_filters('bwp_gxs_freq_site',
42
+ $this->cal_frequency(false, $data['lastmod']), $blog_id
43
+ );
44
+ $data['freq'] = 'always' == $data['freq'] ? 'hourly' : $data['freq'];
45
+
46
+ $data['priority'] = 1;
47
+
48
+ $this->data[] = $data;
49
+
50
+ // no SQL cycling needed
51
+ return false;
52
+ }
53
+ else if (isset($blog_id) && 1 == $blog_id)
54
+ {
55
+ if (!empty($wpdb->dmtable))
56
+ {
57
+ // if domain mapping is active, we only get blogs that don't
58
+ // have their domains mapped as this sitemap can only contains
59
+ // links on the same domain @see http://www.sitemaps.org/protocol.html#locdef
60
+ $blog_sql = '
61
+ SELECT
62
+ b.*
63
+ FROM ' . $wpdb->blogs . ' b
64
+ LEFT JOIN ' . $wpdb->dmtable . ' dm
65
+ ON b.blog_id = dm.blog_id
66
+ AND dm.active = 1
67
+ WHERE b.public = 1
68
+ AND b.spam = 0
69
+ AND b.deleted = 0' . "
70
+ AND (b.blog_id = 1 OR b.path <> '/')" . '
71
+ AND dm.id is NULL';
72
+ }
73
+ else
74
+ {
75
+ $blog_sql = '
76
+ SELECT *
77
+ FROM ' . $wpdb->blogs . '
78
+ WHERE public = 1
79
+ AND spam = 0
80
+ AND deleted = 0' . "
81
+ AND (blog_id = 1 OR path <> '/')";
82
+ }
83
+
84
+ $blogs = $this->get_results($blog_sql);
85
+
86
+ if (!isset($blogs) || 0 == sizeof($blogs))
87
+ return false;
88
+
89
+ $data = array();
90
+
91
+ for ($i = 0; $i < sizeof($blogs); $i++)
92
+ {
93
+ $blog = $blogs[$i];
94
+
95
+ $data = $this->init_data($data);
96
+
97
+ $scheme = is_ssl() ? 'https://' : 'http://';
98
+ $path = $blog->path;
99
+
100
+ $data['location'] = $scheme . $blog->domain . $path;
101
+ $data['lastmod'] = $this->format_lastmod(strtotime($blog->last_updated));
102
+
103
+ $data['freq'] = apply_filters('bwp_gxs_freq_site',
104
+ $this->cal_frequency(false, $blog->last_updated), $blog->blog_id
105
+ );
106
+ $data['freq'] = 'always' == $data['freq'] ? 'hourly' : $data['freq'];
107
+
108
+ // always give primary blog a priority of 1
109
+ $data['priority'] = 0 == $i ? 1 : $this->cal_priority(false, $data['freq']);
110
+
111
+ $this->data[] = $data;
112
+ }
113
+
114
+ unset($blogs);
115
+
116
+ return true;
117
+ }
118
+ else
119
+ return false;
120
+ }
121
+ }
includes/modules/sitemapindex.php CHANGED
@@ -1,143 +1,186 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- */
6
-
7
- class BWP_GXS_MODULE_INDEX extends BWP_GXS_MODULE {
8
-
9
- // Declare all properties you need for your modules here
10
- var $requested_modules = array();
11
-
12
- function __construct($requested)
13
- {
14
- // Give your properties value here
15
- $this->set_current_time();
16
- $this->requested_modules = $requested;
17
- // Always call this to start building data
18
- $this->build_data();
19
- }
20
-
21
- /**
22
- * This is the main function that generates our data.
23
- *
24
- * If your module deals with heavy queries, for example selecting all posts from the database,
25
- * you should not use build_data() directly but rather use generate_data(). Open term.php for more details.
26
- */
27
- function build_data()
28
- {
29
- global $wpdb, $bwp_gxs;
30
-
31
- // A better limit for sites that have posts with same last modified date - @since 1.0.2
32
- $limit = sizeof(get_post_types(array('public' => true))) + 1000;
33
-
34
- $latest_post_query = '
35
- SELECT *
36
- FROM
37
- (
38
- SELECT post_type, max(post_modified) AS mpmd
39
- FROM ' . $wpdb->posts . "
40
- WHERE post_status = 'publish'" . '
41
- GROUP BY post_type
42
- ) AS f
43
- INNER JOIN ' . $wpdb->posts . ' AS s ON s.post_type = f.post_type
44
- AND s.post_modified = f.mpmd
45
- LIMIT ' . (int) $limit;
46
- $latest_posts = $wpdb->get_results($latest_post_query);
47
-
48
- if (!isset($latest_posts) || !is_array($latest_posts) || 0 == sizeof($latest_posts))
49
- return false;
50
-
51
- // Build a temporary array holding post type and their latest modified date, sorted by post_modified
52
- foreach ($latest_posts as $a_post)
53
- $temp_posts[$a_post->post_type] = $this->format_lastmod(strtotime($a_post->post_modified));
54
- arsort($temp_posts);
55
- $prime_lastmod = current($temp_posts);
56
-
57
- // Determine whether or not to split post-based sitemaps - @since 1.1.0
58
- $post_count_array = array();
59
- if ('yes' == $bwp_gxs->options['enable_sitemap_split_post'])
60
- {
61
- $post_count_query = '
62
- SELECT COUNT(ID) as total, post_type
63
- FROM ' . $wpdb->posts . "
64
- WHERE post_status = 'publish'" . '
65
- GROUP BY post_type
66
- ';
67
- $post_counts = $wpdb->get_results($post_count_query);
68
- // Make the result array friendly
69
- foreach ($post_counts as $count)
70
- $post_count_array[$count->post_type] = $count->total;
71
- unset($post_counts);
72
- unset($count);
73
- }
74
-
75
- $taxonomies = $bwp_gxs->taxonomies;
76
-
77
- $data = array();
78
- foreach ($this->requested_modules as $item)
79
- {
80
- $data = $this->init_data($data);
81
- $data['location'] = $this->get_xml_link($item[0]);
82
- $passed = false; // Whether or not to pass data back at the end
83
- if ('site' == $item[0])
84
- {
85
- // Site home URL sitemap - @since 1.1.5
86
- $data['lastmod'] = $prime_lastmod;
87
- }
88
- else if (isset($item[1]))
89
- {
90
- if (isset($item[1]['post']))
91
- {
92
- $the_post = $this->get_post_by_post_type($item[1]['post'], $latest_posts);
93
- if ($the_post)
94
- {
95
- // If we have a matching post_type and the total number of posts reach the split limit,
96
- // we will split this post sitemap accordingly
97
- if ('yes' == $bwp_gxs->options['enable_sitemap_split_post'] && sizeof($post_count_array) > 0 && isset($post_count_array[$the_post->post_type]) && $post_count_array[$the_post->post_type] > $bwp_gxs->options['input_split_limit_post'])
98
- {
99
- $num_part = floor($post_count_array[$the_post->post_type] / $bwp_gxs->options['input_split_limit_post']) + 1;
100
- if (1 < $num_part)
101
- {
102
- $data['location'] = $this->get_xml_link($item[0] . '_part1');
103
- $data['lastmod'] = $this->format_lastmod(strtotime($the_post->post_modified));
104
- $this->data[] = $data;
105
- $time_step = round(7776000 / $num_part);
106
- $time_step = (20000 > $time_step) ? 20000 : $time_step;
107
- for ($i = 2; $i <= $num_part; $i++)
108
- {
109
- $part_data['location'] = $this->get_xml_link($item[0] . '_part' . $i);
110
- // Reduce the lastmod for about 1 month
111
- $part_data['lastmod'] = $this->format_lastmod(strtotime($the_post->post_modified) - $i * $time_step);
112
- $this->data[] = $part_data;
113
- }
114
- $passed = true;
115
- }
116
- else
117
- $data['lastmod'] = $this->format_lastmod(strtotime($the_post->post_modified));
118
- }
119
- else
120
- $data['lastmod'] = $this->format_lastmod(strtotime($the_post->post_modified));
121
- }
122
- }
123
- else if (isset($item[1]['taxonomy']))
124
- {
125
- foreach ($temp_posts as $post_type => $modified_time)
126
- {
127
- if ($this->post_type_uses($post_type, $taxonomies[$item[1]['taxonomy']]))
128
- $data['lastmod'] = $this->format_lastmod(strtotime($modified_time));
129
- }
130
- }
131
- else if (isset($item[1]['archive']))
132
- $data['lastmod'] = $prime_lastmod;
133
- }
134
- // Just in case something went wrong - @since 1.0.2
135
- if (empty($data['lastmod']))
136
- $data['lastmod'] = $prime_lastmod;
137
- // Pass data back to the plugin
138
- if (false == $passed)
139
- $this->data[] = $data;
140
- }
141
- }
142
- }
143
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_INDEX extends BWP_GXS_MODULE
9
+ {
10
+ protected $requested_modules = array();
11
+
12
+ public function __construct($requested)
13
+ {
14
+ // this contains a list of all sitemaps that need to be included in the
15
+ // sitemapindex, along with their data
16
+ $this->requested_modules = $requested;
17
+
18
+ // @since 1.3.0 get sitemap log to populate sitemaps' last modified date data
19
+ global $bwp_gxs;
20
+ $this->sitemap_logs = $bwp_gxs->get_sitemap_logs();
21
+ }
22
+
23
+ /**
24
+ * Get a sitemap's last modified date using either the log or filesystem
25
+ *
26
+ * @since 1.3.0
27
+ */
28
+ private function _get_sitemap_lastmod($sitemap_name)
29
+ {
30
+ if (!empty($this->sitemap_logs[$sitemap_name]))
31
+ {
32
+ // there's a log entry in db, take last modified date from it in
33
+ // Unix timestamp format
34
+ return $this->sitemap_logs[$sitemap_name];
35
+ }
36
+
37
+ $sitemap_file = bwp_gxs_get_filename($sitemap_name);
38
+
39
+ if ($filemtime = @filemtime($sitemap_file))
40
+ {
41
+ // if we can get a last modified Unix timestamp from the
42
+ // filesystem, use that one as a last resort
43
+ return $filemtime;
44
+ }
45
+
46
+ // all fail, no lastmod should be display
47
+ return false;
48
+ }
49
+
50
+ /**
51
+ * This is the main function that generates our data.
52
+ *
53
+ * If your module deals with heavy queries, for example selecting all posts
54
+ * from the database, you should not use build_data() directly but rather
55
+ * use generate_data(). @see post.php for more details.
56
+ */
57
+ protected function build_data()
58
+ {
59
+ global $wpdb, $bwp_gxs;
60
+
61
+ $post_count_array = array();
62
+
63
+ if ('yes' == $bwp_gxs->options['enable_sitemap_split_post'])
64
+ {
65
+ // @since 1.3.0 build a list of post IDs that we need to exclude so
66
+ // that we can correctly split post-based sitemaps
67
+ $excluded_posts = array();
68
+ $post_types = get_post_types(array('public' => true));
69
+
70
+ foreach ($post_types as $post_type_name)
71
+ {
72
+ $excluded_posts = array_merge(
73
+ $excluded_posts,
74
+ apply_filters('bwp_gxs_excluded_posts', array(), $post_type_name)
75
+ );
76
+ }
77
+
78
+ $exclude_post_sql = sizeof($excluded_posts) > 0
79
+ ? ' AND p.ID NOT IN (' . implode(',', $excluded_posts) . ') '
80
+ : '';
81
+
82
+ // we need to split post-based sitemaps
83
+ $post_count_query = '
84
+ SELECT
85
+ COUNT(p.ID) as total,
86
+ p.post_type
87
+ FROM ' . $wpdb->posts . " p
88
+ WHERE p.post_status = 'publish'
89
+ $exclude_post_sql
90
+ AND p.post_password = ''" . '
91
+ GROUP BY p.post_type
92
+ ';
93
+
94
+ $post_counts = $wpdb->get_results($post_count_query);
95
+
96
+ foreach ($post_counts as $count)
97
+ $post_count_array[$count->post_type] = $count->total;
98
+
99
+ unset($post_counts);
100
+ unset($count);
101
+ }
102
+
103
+ $data = array();
104
+
105
+ foreach ($this->requested_modules as $item)
106
+ {
107
+ // all sitemap should have the regular sitemap names, unless
108
+ // appended with part numbers (i.e. `partxxx`)
109
+ $module_name = $item['module_name'];
110
+ $sitemap_name = $module_name;
111
+
112
+ $passed = false; // whether this item's data has already been passed back
113
+
114
+ $data = $this->init_data($data);
115
+ $data['location'] = $this->get_sitemap_url($module_name);
116
+
117
+ $custom_modules = array(
118
+ 'post_google_news',
119
+ 'page_external'
120
+ );
121
+
122
+ if (in_array($item['module'], array('post', 'page'))
123
+ && !in_array($module_name, $custom_modules)
124
+ ) {
125
+ // handle normal post-based sitemaps, including the somewhat
126
+ // special 'page' sitemap, but excluding any custom modules,
127
+ // i.e. modules that are registered under post-based sitemap but
128
+ // should not be checked for splitting functionalty
129
+ $post_type = $item['sub_module'];
130
+
131
+ if (empty($post_count_array[$post_type]))
132
+ {
133
+ // @since 1.3.0 if this post sitemap does not any item,
134
+ // ignore it completely
135
+ continue;
136
+ }
137
+
138
+ $split_limit = empty($bwp_gxs->options['input_split_limit_post'])
139
+ ? $bwp_gxs->options['input_item_limit']
140
+ : $bwp_gxs->options['input_split_limit_post'];
141
+
142
+ if ('yes' == $bwp_gxs->options['enable_sitemap_split_post']
143
+ && $post_count_array[$post_type] > $split_limit
144
+ ) {
145
+ // if we have a matching post_type and the total number
146
+ // of posts reach the split limit, we will split this
147
+ // post sitemap accordingly
148
+ $num_part = ceil($post_count_array[$post_type] / $split_limit);
149
+ $num_part = (int) $num_part;
150
+
151
+ if (1 < $num_part)
152
+ {
153
+ // more than one parts, split this post-based sitemap
154
+ for ($i = 1; $i <= $num_part; $i++)
155
+ {
156
+ // append part number to sitemap name
157
+ $sitemap_name = $module_name . '_part' . $i;
158
+ $data['location'] = $this->get_sitemap_url($sitemap_name);
159
+
160
+ $lastmod = $this->_get_sitemap_lastmod($sitemap_name);
161
+ $data['lastmod'] = $lastmod ? $this->format_lastmod($lastmod) : '';
162
+ $data['lastmod'] = apply_filters('bwp_gxs_sitemap_lastmod', $data['lastmod'], $lastmod, $item, $i);
163
+
164
+ $this->data[] = $data;
165
+ }
166
+
167
+ $passed = true;
168
+ }
169
+ }
170
+ }
171
+
172
+ if (false == $passed)
173
+ {
174
+ // only do this if data has not been passed back already
175
+ // @since 1.3.0 use the correct mechanism to determine last
176
+ // modified date for a sitemap file.
177
+ $lastmod = $this->_get_sitemap_lastmod($sitemap_name);
178
+
179
+ $data['lastmod'] = $lastmod ? $this->format_lastmod($lastmod) : '';
180
+ $data['lastmod'] = apply_filters('bwp_gxs_sitemap_lastmod', $data['lastmod'], $lastmod, $item, 0);
181
+
182
+ $this->data[] = $data;
183
+ }
184
+ }
185
+ }
186
+ }
includes/modules/taxonomy.php CHANGED
@@ -1,94 +1,121 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2011 Khang Minh <betterwp.net>
4
- * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
- * Taxonomy Linear Mode
6
- */
7
-
8
- class BWP_GXS_MODULE_TAXONOMY extends BWP_GXS_MODULE {
9
-
10
- function __construct()
11
- {
12
- $this->set_current_time();
13
- $this->build_data('lastmod');
14
- }
15
-
16
- function generate_data()
17
- {
18
- global $wpdb, $bwp_gxs;
19
-
20
- $requested = $bwp_gxs->module_data['sub_module'];
21
-
22
- $latest_post_query = '
23
- SELECT MAX(wposts.post_modified) as post_modified, MAX(wposts.comment_count) as comment_count, wptax.term_id FROM ' . $wpdb->term_relationships . ' wprel
24
- INNER JOIN ' . $wpdb->posts . ' wposts
25
- ON wprel.object_id = wposts.ID
26
- INNER JOIN ' . $wpdb->term_taxonomy . ' wptax
27
- ON wprel.term_taxonomy_id = wptax.term_taxonomy_id' . "
28
- WHERE wposts.post_status = 'publish'" . '
29
- AND wptax.taxonomy = %s
30
- AND wptax.count > 0
31
- GROUP BY wptax.term_id
32
- ORDER BY wptax.term_id DESC';
33
- $latest_posts = $this->get_results($wpdb->prepare($latest_post_query, $requested));
34
-
35
- if (!isset($latest_posts) || 0 == sizeof($latest_posts))
36
- return false;
37
-
38
- $term_query = '
39
- SELECT t.*, tt.*
40
- FROM ' . $wpdb->terms . ' AS t
41
- INNER JOIN ' . $wpdb->term_taxonomy . ' AS tt
42
- ON t.term_id = tt.term_id
43
- WHERE tt.taxonomy = %s AND tt.count > 0
44
- ORDER BY t.term_id DESC';
45
- $terms = $this->get_results($wpdb->prepare($term_query, $requested));
46
-
47
- if (!isset($terms) || 0 == sizeof($terms))
48
- return false;
49
-
50
- // Can be something like array('cat1', 'cat2', 'cat3')
51
- $exclude_terms = (array) apply_filters('bwp_gxs_term_exclude', array(''), $requested);
52
- // Build an array with term_id as key
53
- $term2post = array();
54
- for ($i = 0; $i < sizeof($latest_posts); $i++)
55
- {
56
- $post = $latest_posts[$i];
57
- if (!empty($post->term_id) && !isset($term2post[$post->term_id]))
58
- $term2post[$post->term_id] = $post;
59
- unset($post);
60
- }
61
-
62
- $data = array();
63
- for ($i = 0; $i < sizeof($terms); $i++)
64
- {
65
- $term = $terms[$i];
66
- if (in_array($term->slug, $exclude_terms))
67
- continue;
68
- $data = $this->init_data($data);
69
- $data['location'] = $this->get_term_link($term, $requested);
70
- if (isset($term2post[$term->term_id]))
71
- {
72
- $post = $term2post[$term->term_id];
73
- $data['lastmod'] = $this->format_lastmod(strtotime($post->post_modified));
74
- $data['freq'] = $this->cal_frequency($post);
75
- $data['priority'] = $this->cal_priority($post, $data['freq']);
76
- }
77
- else
78
- {
79
- $data['freq'] = $this->cal_frequency('', $data['lastmod']);
80
- $data['priority'] = $this->cal_priority('', $data['freq']);
81
- }
82
- $this->data[] = $data;
83
- unset($post);
84
- unset($term);
85
- }
86
-
87
- unset($latest_posts);
88
- unset($term2post);
89
- unset($terms);
90
-
91
- return true;
92
- }
93
- }
94
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 Khang Minh <betterwp.net>
4
+ * @license http://www.gnu.org/licenses/gpl.html GNU GENERAL PUBLIC LICENSE
5
+ * @package BWP Google XML Sitemaps
6
+ */
7
+
8
+ class BWP_GXS_MODULE_TAXONOMY extends BWP_GXS_MODULE
9
+ {
10
+ public function __construct()
11
+ {
12
+ // @since 1.3.0 use ::set_sort_column to set the appropriate column to
13
+ // sort data by
14
+ $this->set_sort_column('lastmod');
15
+ }
16
+
17
+ protected function generate_data()
18
+ {
19
+ global $wpdb, $bwp_gxs;
20
+
21
+ $requested = $this->requested;
22
+
23
+ // @since 1.3.0 do not fetch posts that are password-protected
24
+ $latest_post_query = '
25
+ SELECT
26
+ MAX(p.post_modified) as post_modified,
27
+ MAX(p.post_modified_gmt) as post_modified_gmt,
28
+ MAX(p.comment_count) as comment_count,
29
+ tt.term_id
30
+ FROM ' . $wpdb->term_relationships . ' tr
31
+ INNER JOIN ' . $wpdb->posts . ' p
32
+ ON tr.object_id = p.ID
33
+ INNER JOIN ' . $wpdb->term_taxonomy . ' tt
34
+ ON tr.term_taxonomy_id = tt.term_taxonomy_id' . "
35
+ WHERE p.post_status = 'publish'
36
+ AND p.post_password = ''" . '
37
+ AND tt.taxonomy = %s
38
+ AND tt.count > 0
39
+ GROUP BY tt.term_id
40
+ ORDER BY tt.term_id DESC';
41
+
42
+ $latest_posts = $this->get_results($wpdb->prepare($latest_post_query, $requested));
43
+
44
+ if (!isset($latest_posts) || 0 == sizeof($latest_posts))
45
+ return false;
46
+
47
+ $term_query = '
48
+ SELECT t.*, tt.*
49
+ FROM ' . $wpdb->terms . ' as t
50
+ INNER JOIN ' . $wpdb->term_taxonomy . ' as tt
51
+ ON t.term_id = tt.term_id
52
+ WHERE tt.taxonomy = %s
53
+ AND tt.count > 0
54
+ ORDER BY t.term_id DESC';
55
+
56
+ $terms = $this->get_results($wpdb->prepare($term_query, $requested));
57
+
58
+ if (!isset($terms) || 0 == sizeof($terms))
59
+ return false;
60
+
61
+ // can be something like array('cat1', 'cat2', 'cat3')
62
+ // @deprecated 1.3.0
63
+ $exclude_terms = (array) apply_filters('bwp_gxs_term_exclude', array(), $requested);
64
+ // @since 1.3.0 use `bwp_gxs_excluded_terms` instead
65
+ $exclude_terms = (array) apply_filters('bwp_gxs_excluded_terms', $exclude_terms, $requested);
66
+
67
+ // build an array with term_id as key
68
+ $term2post = array();
69
+
70
+ for ($i = 0; $i < sizeof($latest_posts); $i++)
71
+ {
72
+ $post = $latest_posts[$i];
73
+
74
+ if (!empty($post->term_id) && !isset($term2post[$post->term_id]))
75
+ $term2post[$post->term_id] = $post;
76
+
77
+ unset($post);
78
+ }
79
+
80
+ $data = array();
81
+
82
+ for ($i = 0; $i < sizeof($terms); $i++)
83
+ {
84
+ $term = $terms[$i];
85
+
86
+ if (in_array($term->slug, $exclude_terms))
87
+ continue;
88
+
89
+ $data = $this->init_data($data);
90
+
91
+ $data['location'] = $this->get_term_link($term, $requested);
92
+
93
+ if (isset($term2post[$term->term_id]))
94
+ {
95
+ // this term has at least one post
96
+ $post = $term2post[$term->term_id];
97
+
98
+ $data['lastmod'] = $this->get_lastmod($post);
99
+ $data['freq'] = $this->cal_frequency($post);
100
+ $data['priority'] = $this->cal_priority($post, $data['freq']);
101
+ }
102
+ else
103
+ {
104
+ // this term does not have any post, no lastmod can be generated
105
+ $data['freq'] = $this->cal_frequency();
106
+ $data['priority'] = $this->cal_priority(false, $data['freq']);
107
+ }
108
+
109
+ $this->data[] = $data;
110
+
111
+ unset($post);
112
+ unset($term);
113
+ }
114
+
115
+ unset($latest_posts);
116
+ unset($term2post);
117
+ unset($terms);
118
+
119
+ return true;
120
+ }
121
+ }
index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // White page
3
+ ?>
js/bwp-gxs.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($){
2
+ function toggle_split_limit() {
3
+ var shown = $('#enable_sitemap_split_post').prop('checked') ? true : false;
4
+ var $i = $('#input_split_limit_post').parents('.bwp-clear');
5
+
6
+ $i.toggle(shown);
7
+ }
8
+
9
+ toggle_split_limit();
10
+
11
+ $('#enable_sitemap_split_post').on('change', function() {
12
+ toggle_split_limit();
13
+ });
14
+ });
languages/bwp-simple-gxs-es_ES.mo ADDED
Binary file
languages/bwp-simple-gxs-es_ES.po ADDED
@@ -0,0 +1,1035 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: BWP Google XML Sitemaps\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-03 20:10+0700\n"
6
+ "PO-Revision-Date: 2013-11-04 15:26+0100\n"
7
+ "Last-Translator: ruben <info@usitility.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "Language: ES_es\n"
16
+ "X-Generator: Poedit 1.5.4\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: includes/class-bwp-framework.php:177
20
+ #, php-format
21
+ msgid ""
22
+ "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</"
23
+ "strong> or higher. The plugin will not function until you update your "
24
+ "software. Please deactivate this plugin."
25
+ msgstr ""
26
+ "%s requiere WordPress <strong>%s</strong> o superior y PHP <strong>%s</"
27
+ "strong> o superior. El plugin no funcionará hasta que no actualices tu "
28
+ "software. Por favor, desactiva el plugin."
29
+
30
+ #: includes/class-bwp-framework.php:188
31
+ msgid "Development Log"
32
+ msgstr "Log de Desarrollo"
33
+
34
+ #: includes/class-bwp-framework.php:188
35
+ msgid "Frequently Asked Questions"
36
+ msgstr "Preguntas Más Frecuentes"
37
+
38
+ #: includes/class-bwp-framework.php:188
39
+ msgid "FAQ"
40
+ msgstr "Preguntas frecuentes"
41
+
42
+ #: includes/class-bwp-framework.php:188
43
+ msgid "Got a problem? Send me a feedback!"
44
+ msgstr "¿Tienes algún problema? !Mánda un comentario!"
45
+
46
+ #: includes/class-bwp-framework.php:188
47
+ msgid "Contact"
48
+ msgstr "Contacto"
49
+
50
+ #: includes/class-bwp-framework.php:195
51
+ msgid ""
52
+ "You can buy me some special coffees if you appreciate my work, thank you!"
53
+ msgstr ""
54
+ "Puedes comprarme algñun cafe especial si aprecias mi trabajo, !Gracias!"
55
+
56
+ #: includes/class-bwp-framework.php:209
57
+ msgid "Donate to "
58
+ msgstr "Donar a"
59
+
60
+ #: includes/class-bwp-framework.php:211
61
+ msgid "One cup $5.00"
62
+ msgstr "Una taza $5.00"
63
+
64
+ #: includes/class-bwp-framework.php:212
65
+ msgid "Two cups $10.00"
66
+ msgstr "Dos tazas $10"
67
+
68
+ #: includes/class-bwp-framework.php:213
69
+ msgid "Five cups! $25.00"
70
+ msgstr "Cinco tazas! $25"
71
+
72
+ #: includes/class-bwp-framework.php:214
73
+ msgid "One LL-cup!!! $50.00"
74
+ msgstr "Una Taza ExtraGrande!!! $50"
75
+
76
+ #: includes/class-bwp-framework.php:215
77
+ msgid "... or any amount!"
78
+ msgstr "... o cualquier cantidad!"
79
+
80
+ #: includes/class-bwp-framework.php:230
81
+ msgid "Latest updates from BetterWP.net!"
82
+ msgstr "¡Ultimas actualizaciones de BetterWP.net!"
83
+
84
+ #: includes/class-bwp-framework.php:231
85
+ msgid "Follow me on Twitter!"
86
+ msgstr "¡Sígueme en Twitter!"
87
+
88
+ #: includes/class-bwp-framework.php:240
89
+ #, php-format
90
+ msgid "You are using version %s!"
91
+ msgstr "Estás usando la versión %s!"
92
+
93
+ #: includes/class-bwp-framework.php:385
94
+ msgid "Settings"
95
+ msgstr "Configuración"
96
+
97
+ #: includes/class-bwp-gxs-cache.php:34
98
+ #, php-format
99
+ msgid "Cache directory (\"%s\") does not exist or is not writable."
100
+ msgstr "El directorio (\"%s\") no existe o no se puede escribir en él."
101
+
102
+ #: includes/class-bwp-gxs-cache.php:56
103
+ #, php-format
104
+ msgid ""
105
+ "Cache file for module <em>%s</em> is not found and will be built right away."
106
+ msgstr ""
107
+ "Fichero Caché para el módulo <em>%s</em> no ha sido encontrado y será "
108
+ "generado de inmediato."
109
+
110
+ #: includes/class-bwp-gxs-cache.php:108 includes/class-bwp-simple-gxs.php:1341
111
+ #, php-format
112
+ msgid "Successfully served a cached version of <em>%s.xml</em>."
113
+ msgstr ""
114
+ "Se ha servido satisfactoriamente una versión cacheada de <em>%s.xml</em>."
115
+
116
+ #: includes/class-bwp-simple-gxs.php:141 includes/class-bwp-simple-gxs.php:347
117
+ #: includes/class-bwp-simple-gxs.php:354
118
+ msgid "Sitemap Statistics"
119
+ msgstr "Estadísticas de Sitemap"
120
+
121
+ #: includes/class-bwp-simple-gxs.php:142 includes/class-bwp-simple-gxs.php:348
122
+ #: includes/class-bwp-simple-gxs.php:355
123
+ msgid "Sitemap Generator"
124
+ msgstr "Generador de Sitemap"
125
+
126
+ #: includes/class-bwp-simple-gxs.php:143 includes/class-bwp-simple-gxs.php:349
127
+ #: includes/class-bwp-simple-gxs.php:356
128
+ msgid "News Sitemap"
129
+ msgstr "Nuevo Sitemap"
130
+
131
+ #: includes/class-bwp-simple-gxs.php:174
132
+ #, php-format
133
+ msgid ""
134
+ "This sitemap was originally generated in %s second(s) (Memory usage: %s) - "
135
+ "%s queries - %s URL(s) listed"
136
+ msgstr ""
137
+ "Este sitemap fue originalmente generado en %s segundo(s) (Uso de Memoria: "
138
+ "%s) - %s consultas - %s URL(s) listadas"
139
+
140
+ #: includes/class-bwp-simple-gxs.php:347 includes/class-bwp-simple-gxs.php:354
141
+ msgid "BWP Google XML Sitemaps Statistics"
142
+ msgstr "BWP Google XML Sitemaps Estadísticas"
143
+
144
+ #: includes/class-bwp-simple-gxs.php:348 includes/class-bwp-simple-gxs.php:355
145
+ msgid "BWP Google XML Sitemaps Generator"
146
+ msgstr "BWP Google XML Sitemaps Generador"
147
+
148
+ #: includes/class-bwp-simple-gxs.php:349 includes/class-bwp-simple-gxs.php:356
149
+ msgid "BWP Google News XML Sitemap"
150
+ msgstr "BWP Google Sitemap de Noticias XML"
151
+
152
+ #: includes/class-bwp-simple-gxs.php:353
153
+ msgid "BWP Google XML Sitemaps"
154
+ msgstr "BWP Google XML Sitemaps"
155
+
156
+ #: includes/class-bwp-simple-gxs.php:368
157
+ msgid "You do not have sufficient permissions to access this page."
158
+ msgstr "No tienes permisos suficientes para acceder a esta página."
159
+
160
+ #: includes/class-bwp-simple-gxs.php:389 includes/class-bwp-simple-gxs.php:736
161
+ #: includes/class-bwp-simple-gxs.php:738
162
+ msgid "Notice"
163
+ msgstr "Noticia"
164
+
165
+ #: includes/class-bwp-simple-gxs.php:389
166
+ msgid "All logs have been cleared successfully!"
167
+ msgstr "Todos los logs se han limpiado con éxito!"
168
+
169
+ #: includes/class-bwp-simple-gxs.php:396
170
+ msgid "What are Sitemaps?"
171
+ msgstr "¿Qué son los Sitemap?"
172
+
173
+ #: includes/class-bwp-simple-gxs.php:397
174
+ msgid "Your sitemaps"
175
+ msgstr "Tus sitemaps"
176
+
177
+ #: includes/class-bwp-simple-gxs.php:398
178
+ msgid "Submit your sitemaps"
179
+ msgstr "Envía tus sitemaps"
180
+
181
+ #: includes/class-bwp-simple-gxs.php:399
182
+ msgid "Pinging search engines"
183
+ msgstr "Motores de búsqueda"
184
+
185
+ #: includes/class-bwp-simple-gxs.php:400
186
+ msgid "Enable pinging functionality?"
187
+ msgstr "¿Activar funcionalidad de ping?"
188
+
189
+ #: includes/class-bwp-simple-gxs.php:401
190
+ msgid "Enable pinging individual SE"
191
+ msgstr "Activar ping a MB individuales"
192
+
193
+ #: includes/class-bwp-simple-gxs.php:402
194
+ msgid "Sitemap Generator's Log"
195
+ msgstr "Log de Sitemap Generator"
196
+
197
+ #: includes/class-bwp-simple-gxs.php:403
198
+ msgid "Enable logging?"
199
+ msgstr "¿Habilitar registro?"
200
+
201
+ #: includes/class-bwp-simple-gxs.php:404
202
+ msgid "Enable debugging?"
203
+ msgstr "¿Habilitar la Depuración?"
204
+
205
+ #: includes/class-bwp-simple-gxs.php:413
206
+ msgid ""
207
+ "In its simplest form, a Sitemap is an XML file that lists URLs for a site "
208
+ "along with additional metadata about each URL (when it was last updated, how "
209
+ "often it usually changes, and how important it is, relative to other URLs in "
210
+ "the site) so that search engines can more intelligently crawl the site "
211
+ "&mdash; <em>http://www.sitemaps.org/</em>"
212
+ msgstr ""
213
+ "En su forma más sencilla, un Sitemap es un fichero XML que lista URLs de un "
214
+ "sitio junto con metadatos adicionales sobre cada URL (cuando fue la última "
215
+ "actualización, con que frecuencia cambia, y cuan importante es en relación "
216
+ "con otras URLs del sitio) por lo que los motores de búsqueda pueden rastrear "
217
+ "de forma más inteligente el sitio &mdash; <em>http://www.sitemaps.org/</em>"
218
+
219
+ #: includes/class-bwp-simple-gxs.php:413
220
+ msgid ""
221
+ "This plugin helps you generate both Sitemap Index files as well as normal "
222
+ "Sitemap files. A Sitemap Index, as its name suggests, is one kind of "
223
+ "sitemaps that allows you to group multiple sitemap files inside it."
224
+ msgstr ""
225
+ "Este plugin te ayuda a generar tanto ficheros Index de Sitemap como ficheros "
226
+ "normales de Sitemap. Un Index de Sitemap es un tipo de sitemap que te "
227
+ "permite agrupar múltiples ficheros sitemap dentro de él."
228
+
229
+ #: includes/class-bwp-simple-gxs.php:414
230
+ msgid "<em>Basic information about all your sitemaps.</em>"
231
+ msgstr "<em>Información básica sobre todos tus sitemaps.</em>"
232
+
233
+ #: includes/class-bwp-simple-gxs.php:415
234
+ msgid ""
235
+ "<em>More detailed information about how your sitemaps are generated "
236
+ "including <span style=\"color: #999999;\">notices</span>, <span style="
237
+ "\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;"
238
+ "\">success messages</span>.</em>"
239
+ msgstr ""
240
+ "<em>Más información detallada sobre como tus sitemaps han sido generados "
241
+ "incluyendo <span style=\"color: #999999;\">noticias</span>, <span style="
242
+ "\"color: #FF0000;\">errores</span> and <span style=\"color: #009900;"
243
+ "\">mensajes satisfactorios</span>.</em>"
244
+
245
+ #: includes/class-bwp-simple-gxs.php:416
246
+ #, php-format
247
+ msgid ""
248
+ "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" "
249
+ "target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or "
250
+ "<a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
251
+ msgstr ""
252
+ "<em>Enviar tu sitemapindex a los principales motores de búsqueda como <a "
253
+ "href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank"
254
+ "\">Bing</a> o <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
255
+
256
+ #: includes/class-bwp-simple-gxs.php:417
257
+ msgid ""
258
+ "<em>Now when you post something new to your blog, you can <em>ping</em> "
259
+ "those search engines to tell them your blog just got updated. Pinging could "
260
+ "be less effective than you think it is but you should enable such feature "
261
+ "anyway.</em>"
262
+ msgstr ""
263
+ "<em>Ahora, cada vez que escribas algo nuevo en tu blog, podraás hacer "
264
+ "<em>ping</em> a los motores de búsqueda e informarles de que tu blog ha sido "
265
+ "actualizado. Hacer Ping puede ser menos efectivo de lo que piensas, pero aun "
266
+ "así deberías habilitar esta característica.</em>"
267
+
268
+ #: includes/class-bwp-simple-gxs.php:422
269
+ msgid "Selected SE below will be pinged when you publish new posts."
270
+ msgstr ""
271
+ "Lo MB seleccionados abajo serán informados (Ping) cuando publiques nuevas "
272
+ "entradas."
273
+
274
+ #: includes/class-bwp-simple-gxs.php:423
275
+ msgid "No additional load is needed so enabling this is recommended."
276
+ msgstr ""
277
+ "\"Sin carga adicional\" es necesario, por lo que habilitarlo está recomendado"
278
+
279
+ #: includes/class-bwp-simple-gxs.php:424
280
+ msgid ""
281
+ "Minor errors will be printed on screen. Also, when debug is on, no caching "
282
+ "is used, useful when you develop new modules."
283
+ msgstr ""
284
+ "Pequeños errores serán mostrados en pantalla. También, si la depuración "
285
+ "(debug) está activa, no se usará la caché, lo cual es útil cuando "
286
+ "desarrollas nuevos módulos."
287
+
288
+ #: includes/class-bwp-simple-gxs.php:425
289
+ msgid "Google"
290
+ msgstr "Google"
291
+
292
+ #: includes/class-bwp-simple-gxs.php:426
293
+ msgid "Bing"
294
+ msgstr "Bing"
295
+
296
+ #: includes/class-bwp-simple-gxs.php:427
297
+ msgid "Ask.com"
298
+ msgstr "Ask.com"
299
+
300
+ #: includes/class-bwp-simple-gxs.php:430
301
+ #, php-format
302
+ msgid ""
303
+ "After you activate this plugin, all sitemaps should be available right away. "
304
+ "The next step is to submit the sitemapindex to major search engines. You "
305
+ "only need the <strong>sitemapindex</strong> and nothing else, those search "
306
+ "engines will automatically recognize other included sitemaps. You can read a "
307
+ "small <a href=\"%s\">How-to</a> if you are interested."
308
+ msgstr ""
309
+ "Después de activar este plugin, todos los sitemaps estarán disponibles de "
310
+ "inmediato. El siguiente paso es enviar el sitemapindex a los principales "
311
+ "motores de búsqueda. Solo necesitas el <strong>sitemapindex</strong> y nada "
312
+ "más, los motores de búsqueda reconocerán los sitemaps incluidos dentro de "
313
+ "él. Puedes leer un pequeño <a href=\"%s\">Manual</a> si estás interesado."
314
+
315
+ #: includes/class-bwp-simple-gxs.php:458
316
+ msgid "Output no more than"
317
+ msgstr "Mostrar no más de"
318
+
319
+ #: includes/class-bwp-simple-gxs.php:459
320
+ msgid "Default change frequency"
321
+ msgstr "Frecuencia de cambio por defecto"
322
+
323
+ #: includes/class-bwp-simple-gxs.php:460
324
+ msgid "Default priority"
325
+ msgstr "Prioridad por defecto"
326
+
327
+ #: includes/class-bwp-simple-gxs.php:461
328
+ msgid "Minimum priority"
329
+ msgstr "Prioridad mínima"
330
+
331
+ #: includes/class-bwp-simple-gxs.php:462
332
+ msgid "Use GMT for Last Modified date?"
333
+ msgstr "¿Usar GMT para la Última Fecha de modificación?"
334
+
335
+ #: includes/class-bwp-simple-gxs.php:463
336
+ msgid "Style your sitemaps with an XSLT stylesheet?"
337
+ msgstr "¿Dar estilo a tus sitemaps con una hoja de estilos XSLT?"
338
+
339
+ #: includes/class-bwp-simple-gxs.php:464
340
+ msgid "Custom XSLT stylesheet URL"
341
+ msgstr "URL para la hoja de estilo XSLT"
342
+
343
+ #: includes/class-bwp-simple-gxs.php:465
344
+ msgid "Show build stats in sitemaps?"
345
+ msgstr "¿Ver las estadísticas de construcción en los sitemaps?"
346
+
347
+ #: includes/class-bwp-simple-gxs.php:466
348
+ msgid "Enable credit?"
349
+ msgstr "¿Activar crédito?"
350
+
351
+ #: includes/class-bwp-simple-gxs.php:467
352
+ msgid "Enable Gzip?"
353
+ msgstr "¿Activar Gzip?"
354
+
355
+ #: includes/class-bwp-simple-gxs.php:468
356
+ msgid "Clean unexpected output before sitemap generation?"
357
+ msgstr "¿Limpiar la salida inesperada antes de que se genere el sitemap?"
358
+
359
+ #: includes/class-bwp-simple-gxs.php:469
360
+ msgid "Sitemap Index Options"
361
+ msgstr "Opciones del Index Sitemap"
362
+
363
+ #: includes/class-bwp-simple-gxs.php:470
364
+ msgid "Automatically split post-based sitemaps into smaller sitemaps?"
365
+ msgstr ""
366
+ "¿Dividir automáticamente los sitemaps de entradas en sitemaps más pequeños?"
367
+
368
+ #: includes/class-bwp-simple-gxs.php:471
369
+ msgid "Add sitemapindex to individual blog's virtual robots.txt?"
370
+ msgstr ""
371
+ "¿Añadir sitemapindex al fichero robots.txt de los blog virtuales "
372
+ "individuales?"
373
+
374
+ #: includes/class-bwp-simple-gxs.php:472
375
+ msgid ""
376
+ "Add sitemapindex from all blogs within network to primary blog's virtual "
377
+ "robots.txt?"
378
+ msgstr ""
379
+ "¿Añadir sitemapindex de todos los blogs pertenecientes a la red, al fichero "
380
+ "robots.txt del blog virtual primario?"
381
+
382
+ #: includes/class-bwp-simple-gxs.php:473
383
+ msgid "In sitemapindex, include"
384
+ msgstr "En sitemapindex, incluir"
385
+
386
+ #: includes/class-bwp-simple-gxs.php:474
387
+ msgid "Exclude following post types:"
388
+ msgstr "Excluir los siguientes tipos de entradas:"
389
+
390
+ #: includes/class-bwp-simple-gxs.php:475
391
+ msgid "Exclude following taxonomies:"
392
+ msgstr "Excluir las siguientes taxonomías:"
393
+
394
+ #: includes/class-bwp-simple-gxs.php:476
395
+ msgid "Module Options"
396
+ msgstr "Opciones del Módulo"
397
+
398
+ #: includes/class-bwp-simple-gxs.php:477
399
+ msgid "Alternate module directory"
400
+ msgstr "Directorio alternativo del módulo"
401
+
402
+ #: includes/class-bwp-simple-gxs.php:478
403
+ msgid "Get no more than"
404
+ msgstr "No recibir más de"
405
+
406
+ #: includes/class-bwp-simple-gxs.php:479
407
+ msgid "Caching Options"
408
+ msgstr "Opciones de Caché"
409
+
410
+ #: includes/class-bwp-simple-gxs.php:480
411
+ msgid "Enable caching?"
412
+ msgstr "¿Habilitar caché?"
413
+
414
+ #: includes/class-bwp-simple-gxs.php:481
415
+ msgid "Enable auto cache re-generation?"
416
+ msgstr "¿Habilitar auto regeneración de la caché?"
417
+
418
+ #: includes/class-bwp-simple-gxs.php:482
419
+ msgid "Cached sitemaps will last for"
420
+ msgstr "El sitemap estará en caché durante"
421
+
422
+ #: includes/class-bwp-simple-gxs.php:483
423
+ msgid "Cached sitemaps are stored in (auto detected)"
424
+ msgstr "Lo sitemap cacheados serán almacenados en (autodetectados)"
425
+
426
+ #: includes/class-bwp-simple-gxs.php:487
427
+ msgid "<em>Cache your sitemaps for better performance.</em>"
428
+ msgstr "<em>Cachea tu sitemap para un mejor rendimiento.</em>"
429
+
430
+ #: includes/class-bwp-simple-gxs.php:488
431
+ #, php-format
432
+ msgid ""
433
+ "<em>This plugin uses modules to build sitemap data so it is recommended that "
434
+ "you extend this plugin using modules rather than hooks. Some of the settings "
435
+ "below only affect modules extending the base module class. Read more about "
436
+ "using modules <a href=\"%s#using-modules\">here</a>.</em>"
437
+ msgstr ""
438
+ "<em>Este plugin hace uso de módulos para construir los datos del sitemap, "
439
+ "por lo que es recomendable que extiendas este plugin haciendo uso de módulos "
440
+ "y no de ganchos (hooks). Algunas de las configuraciones de abajo solo "
441
+ "afectan a los módulos que han extendido de la clase básica módulo. Lee más "
442
+ "sobre el uso de módulos <a href=\"%s#using-modules\">aquí</a>.</em>"
443
+
444
+ #: includes/class-bwp-simple-gxs.php:489
445
+ msgid ""
446
+ "<em>Here you can change some settings that affect the default Sitemap Index "
447
+ "file.</em>"
448
+ msgstr ""
449
+ "<em>Aquí puedes cambiar algunas configuraciones que afectan al fichero por "
450
+ "defecto Sitemap Index.</em>"
451
+
452
+ #: includes/class-bwp-simple-gxs.php:503 includes/class-bwp-simple-gxs.php:509
453
+ msgid "second(s)"
454
+ msgstr "segundo(s)"
455
+
456
+ #: includes/class-bwp-simple-gxs.php:504 includes/class-bwp-simple-gxs.php:510
457
+ msgid "minute(s)"
458
+ msgstr "minuto(s)"
459
+
460
+ #: includes/class-bwp-simple-gxs.php:505 includes/class-bwp-simple-gxs.php:511
461
+ msgid "hour(s)"
462
+ msgstr "hora(s)"
463
+
464
+ #: includes/class-bwp-simple-gxs.php:506 includes/class-bwp-simple-gxs.php:512
465
+ msgid "day(s)"
466
+ msgstr "día(s)"
467
+
468
+ #: includes/class-bwp-simple-gxs.php:519 includes/class-bwp-simple-gxs.php:520
469
+ #: includes/class-bwp-simple-gxs.php:521
470
+ msgid "read more"
471
+ msgstr "Leer más"
472
+
473
+ #: includes/class-bwp-simple-gxs.php:524
474
+ msgid "your sitemaps are generated and then cached to reduce unnecessary work."
475
+ msgstr ""
476
+ "tu sitemaps han sido generados y cacheados para reducir el trabajo "
477
+ "innecesario."
478
+
479
+ #: includes/class-bwp-simple-gxs.php:525
480
+ msgid ""
481
+ "when a cached sitemap expires, this plugin will try to generate the cache "
482
+ "again. If you disable this, remember to manually flush the cache once in a "
483
+ "while."
484
+ msgstr ""
485
+ "cuando la caché de un sitemap caduca, este plugin intentará generar la caché "
486
+ "de nuevo. Si desactivas esto, recuerda el limpiar la caché manualmente de "
487
+ "vez en cuando."
488
+
489
+ #: includes/class-bwp-simple-gxs.php:525
490
+ msgid "Flush the cache"
491
+ msgstr "Vaciar la caché"
492
+
493
+ #: includes/class-bwp-simple-gxs.php:526
494
+ msgid ""
495
+ "tell you useful information such as build time, memory usage, SQL queries, "
496
+ "etc."
497
+ msgstr ""
498
+ "te muestra información útil como tiempo de construcción, uso de memoria, "
499
+ "consultas SQL, etc."
500
+
501
+ #: includes/class-bwp-simple-gxs.php:527
502
+ #, php-format
503
+ msgid ""
504
+ "make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an "
505
+ "error after enabling this, it's very likely that you have gzip active on "
506
+ "your server already."
507
+ msgstr ""
508
+ "reduce tu sitemap ~ 70% más pequeño. <strong>Importante:</strong> si ves "
509
+ "un error después de activar esto, es muy probable que ya tengas activado "
510
+ "gzip en tu servidor."
511
+
512
+ #: includes/class-bwp-simple-gxs.php:528
513
+ msgid ""
514
+ "only disable this when sitemaps appear in either blank page or plain text."
515
+ msgstr ""
516
+ "solo deshabiliat esto cuando los sitemaps aparecen en blanco o con texto "
517
+ "plano."
518
+
519
+ #: includes/class-bwp-simple-gxs.php:529
520
+ #, php-format
521
+ msgid ""
522
+ "If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex."
523
+ "xml</code> entries will be added to your primary blog's robots.txt, i.e. "
524
+ "<code>%s</code>."
525
+ msgstr ""
526
+ "Si te gusta 50 blogs, 50 entradas <code>Sitemap: http://ejemplo.com/"
527
+ "sitemapindex.xml</code> serán agregadas al fichero robots.txt de tu blog "
528
+ "principal, ej: <code>%s</code>."
529
+
530
+ #: includes/class-bwp-simple-gxs.php:530
531
+ msgid "taxonomy archives' sitemaps, including custom taxonomies."
532
+ msgstr ""
533
+ "sitemap de los archivos de taxonomía, incluyendo taxonomías personalizadas."
534
+
535
+ #: includes/class-bwp-simple-gxs.php:532
536
+ msgid "date archives' sitemaps."
537
+ msgstr "Archivos de datos de los sitemaps."
538
+
539
+ #: includes/class-bwp-simple-gxs.php:533
540
+ msgid ""
541
+ "external pages' sitemap. This allows you to add links to pages that do not "
542
+ "belong to WordPress to the sitemap."
543
+ msgstr ""
544
+ "sitemap de páginas externas. Esto permite agregar enlaces ha páginas que no "
545
+ "pertenecen al sitemap de WordPress."
546
+
547
+ #: includes/class-bwp-simple-gxs.php:534
548
+ msgid "some copyrighted info is also added to your sitemaps. Thanks!"
549
+ msgstr ""
550
+ "alguna información relativa al copyright será agregara a tus sitemaps. "
551
+ "¡Gracias!"
552
+
553
+ #: includes/class-bwp-simple-gxs.php:535
554
+ msgid ""
555
+ "This will load the default style sheet provided by this plugin. You can set "
556
+ "a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook."
557
+ msgstr ""
558
+ "Esto cargará la hoja de estilos por defecto de este plugin. Podrás usar una "
559
+ "hoja de estilos personalizada más abajo o usar el gancho (hook) "
560
+ "<code>bwp_gxs_xslt</code>."
561
+
562
+ #: includes/class-bwp-simple-gxs.php:536
563
+ #, php-format
564
+ msgid ""
565
+ "If you're on a Multi-site installation with Sub-domain enabled, each site "
566
+ "will have its own robots.txt, sites in sub-directory will not. Please read "
567
+ "the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more "
568
+ "info."
569
+ msgstr ""
570
+ "Si estás usando una instalación de Multi-Sitio con subdominios activados, "
571
+ "cada sitio tendrá su robots.txt, mientras que los sitios en subdirectorios "
572
+ "no lo tendrán. Por favor lee la <a href=\"%s#toc-robots\" target=\"_blank"
573
+ "\">documentación</a> para más información."
574
+
575
+ #: includes/class-bwp-simple-gxs.php:537
576
+ msgid "e.g. post1.xml, post2.xml, etc. And each sitemap will contain"
577
+ msgstr "ej: post1.xml, post2.xml, etc. Y cada sitemap contendrá"
578
+
579
+ #: includes/class-bwp-simple-gxs.php:538
580
+ msgid ""
581
+ "If you disable this, make sure you also use <code>date_default_timezone_set</"
582
+ "code> to correctly set up a timezone for your application."
583
+ msgstr ""
584
+ "Si desactivas esto, asegúrate de que usas <code>date_default_timezone_set</"
585
+ "code> para configurar correctamente la zona horaria de tu aplicación."
586
+
587
+ #: includes/class-bwp-simple-gxs.php:539
588
+ msgid "author archives' sitemap."
589
+ msgstr "archivos de autor de sitemap"
590
+
591
+ #: includes/class-bwp-simple-gxs.php:540
592
+ msgid ""
593
+ "site's home URL sitemap. For a multi-site installation of WordPress, this "
594
+ "sitemap will list all domains within your network, not just the main blog. "
595
+ "This also supports WPMU Domain Mapping plugin."
596
+ msgstr ""
597
+ "URL del sitemap principal. Para instalaciones multi-sitio de WordPress, este "
598
+ "sitemap listará todos los dominios dentro de tu red, no solo el blog "
599
+ "principal. Esto también soporta el plugin WPMU Domain Mapping."
600
+
601
+ #: includes/class-bwp-simple-gxs.php:543
602
+ msgid "item(s) in one sitemap. You can not go over 50,000."
603
+ msgstr "item(s) en un sitemap. No pueden ser más de 50.000."
604
+
605
+ #: includes/class-bwp-simple-gxs.php:544
606
+ msgid "item(s). Again , you can not go over 50,000."
607
+ msgstr "item(s). De nuevo, no pueden ser más de 50.000."
608
+
609
+ #: includes/class-bwp-simple-gxs.php:545
610
+ msgid ""
611
+ "Input a full path to the directory where you put your own modules (e.g. "
612
+ "<code>/home/mysite/public_html/gxs-modules/</code>), you can also override a "
613
+ "built-in module by having a module with the same filename in this directory. "
614
+ "A filter is also available if you would like to use PHP instead."
615
+ msgstr ""
616
+ "Introduce la ruta completa del directorio donde están tus módulos, (ej: "
617
+ "<code>/home/misitio/public_html/gxs-modules/</code>), también puedes "
618
+ "sobreescribir un modulo pre-construido, poniendo en este directorio un "
619
+ "fichero con el mismo nombre del modulo original. Puedes utilizar un filtro "
620
+ "si quieres usar PHP en su lugar."
621
+
622
+ #: includes/class-bwp-simple-gxs.php:546
623
+ msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
624
+ msgstr ""
625
+ "El directorio caché debe tener permisos de escritura (ej: CHMOD 755 o 777)."
626
+
627
+ #: includes/class-bwp-simple-gxs.php:547
628
+ msgid ""
629
+ "item(s) in one SQL query. This helps you avoid running too heavy queries."
630
+ msgstr ""
631
+ "item(s) en una consulta SQL. Esto te ayuda a evitar consultas demasiado "
632
+ "pesadas."
633
+
634
+ #: includes/class-bwp-simple-gxs.php:550
635
+ msgid ""
636
+ "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet."
637
+ "xsl</code>. You must also have a style sheet for the sitemapindex that can "
638
+ "be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and "
639
+ "<code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish "
640
+ "to use."
641
+ msgstr ""
642
+ "se esperaba una URL absoluta, ej: <code>http://ejemplo.com/mi-stylesheet."
643
+ "xsl</code>. Debes tener una hoja de estilos para el sitemapindex que sea "
644
+ "accesible mediante la URL anterior, ej: <code>mi-stylesheet.xsl</code> y "
645
+ "<code>mi-stylesheetindex.xsl</code>). Por favor, déjalo en blanco si no lo "
646
+ "quieres usar."
647
+
648
+ #: includes/class-bwp-simple-gxs.php:557
649
+ #, php-format
650
+ msgid ""
651
+ "<em><strong>Note:</strong> If you encounter white page problem, please refer "
652
+ "to the <a target=\"_blank\" href=\"%s\">FAQ section</a> to know how to "
653
+ "change this limit appropriately to make this plugin work. Also note that, "
654
+ "for post-based sitemaps, this option will be overridden by the limit you set "
655
+ "in the Sitemap Index Options below.</em>"
656
+ msgstr ""
657
+ "<em><strong>Nota:</strong> Si encuentras un problema de página en blanco, "
658
+ "por favor visita <a target=\"_blank\" href=\"%s\">sección de preguntas "
659
+ "frecuente</a> para saber como cambiar adecuadamente este límite para hacer "
660
+ "que el plugin funcione. Ten en cuenta, que para los sitemaps basados en "
661
+ "post, esta opción será sobreescrita por el limite introducido en la casilla "
662
+ "de más abajo de Opciones de Sitemap Index</em>"
663
+
664
+ #: includes/class-bwp-simple-gxs.php:659
665
+ msgid "What is a Google News Sitemap?"
666
+ msgstr "¿Qué es un Sitemap de Noticias Google?"
667
+
668
+ #: includes/class-bwp-simple-gxs.php:660
669
+ msgid "Enable this module?"
670
+ msgstr "¿Activar este módulo?"
671
+
672
+ #: includes/class-bwp-simple-gxs.php:661
673
+ msgid "Enable Multi-category Mode?"
674
+ msgstr "¿Habilitar el Modo Multi-categoriía?"
675
+
676
+ #: includes/class-bwp-simple-gxs.php:662
677
+ msgid "Ping Search Engines when you publish a news article?"
678
+ msgstr ""
679
+ "¿Hacer ping a los Motores de Búsqueda cuando publiques un nuevo artículo?"
680
+
681
+ #: includes/class-bwp-simple-gxs.php:663
682
+ msgid "Use keywords in News Sitemap?"
683
+ msgstr "¿Utilizar palabras claves en los Sitemap de Noticias?"
684
+
685
+ #: includes/class-bwp-simple-gxs.php:664
686
+ msgid "News Sitemap's language"
687
+ msgstr "Idioma del Sitemap de Noticias"
688
+
689
+ #: includes/class-bwp-simple-gxs.php:665
690
+ msgid "News Categories"
691
+ msgstr "Categorías de Noticias"
692
+
693
+ #: includes/class-bwp-simple-gxs.php:666
694
+ msgid "This module will"
695
+ msgstr "Este módulo hará"
696
+
697
+ #: includes/class-bwp-simple-gxs.php:670
698
+ msgid ""
699
+ "A Google News Sitemap is a file that allows you to control which content you "
700
+ "submit to Google News. By creating and submitting a Google News Sitemap, "
701
+ "you're able to help Google News discover and crawl your site's articles "
702
+ "&mdash; <em>http://support.google.com/</em>"
703
+ msgstr ""
704
+ "Un Sitemap de Noticias Google es un fichero que te permite controlar que "
705
+ "contenido envías a Goole Noticias. Creando y enviando un Sitemap de Noticias "
706
+ "Google, podrás ayudar a Google Noticias a que descubra y rastree los "
707
+ "artículos de tu sitio &mdash; <em>http://support.google.com/</em>"
708
+
709
+ #: includes/class-bwp-simple-gxs.php:671
710
+ msgid ""
711
+ "<em>Below you will be able to choose what categories to use (or not use) in "
712
+ "the news sitemap. You can also assign genres to a specific category.</em>"
713
+ msgstr ""
714
+ "<em>Abajo podrás elegir que categorías usar (o no usar) e el sitemap de "
715
+ "noticias. También podrás asignar géneros a una categoría específica.</em>"
716
+
717
+ #: includes/class-bwp-simple-gxs.php:674
718
+ msgid "below selected categories in the news sitemap."
719
+ msgstr "categorías seleccionadas más abajo en el sitemap de noticias."
720
+
721
+ #: includes/class-bwp-simple-gxs.php:679
722
+ msgid "English"
723
+ msgstr "Inglés"
724
+
725
+ #: includes/class-bwp-simple-gxs.php:680
726
+ msgid "French"
727
+ msgstr "Francés"
728
+
729
+ #: includes/class-bwp-simple-gxs.php:681
730
+ msgid "Spanish"
731
+ msgstr "Español"
732
+
733
+ #: includes/class-bwp-simple-gxs.php:682
734
+ msgid "German"
735
+ msgstr "Alemán"
736
+
737
+ #: includes/class-bwp-simple-gxs.php:683
738
+ msgid "Portuguese"
739
+ msgstr "Portugués"
740
+
741
+ #: includes/class-bwp-simple-gxs.php:684
742
+ msgid "Polish"
743
+ msgstr "Polaco"
744
+
745
+ #: includes/class-bwp-simple-gxs.php:685
746
+ msgid "Norwegian"
747
+ msgstr "Noruego"
748
+
749
+ #: includes/class-bwp-simple-gxs.php:686
750
+ msgid "Dutch"
751
+ msgstr "Holandés"
752
+
753
+ #: includes/class-bwp-simple-gxs.php:687
754
+ msgid "Italian"
755
+ msgstr "Italiano"
756
+
757
+ #: includes/class-bwp-simple-gxs.php:688
758
+ msgid "Vietnamese"
759
+ msgstr "Vietnamita "
760
+
761
+ #: includes/class-bwp-simple-gxs.php:689
762
+ msgid "Simplified Chinese"
763
+ msgstr "Chino simplificado"
764
+
765
+ #: includes/class-bwp-simple-gxs.php:692
766
+ msgid "include"
767
+ msgstr "Incluir"
768
+
769
+ #: includes/class-bwp-simple-gxs.php:693
770
+ msgid "exclude"
771
+ msgstr "excluir"
772
+
773
+ #: includes/class-bwp-simple-gxs.php:696
774
+ msgid "news categories"
775
+ msgstr "categorías de noticias"
776
+
777
+ #: includes/class-bwp-simple-gxs.php:697
778
+ msgid "news tags"
779
+ msgstr "etiquetas de noticias"
780
+
781
+ #: includes/class-bwp-simple-gxs.php:703
782
+ msgid ""
783
+ "A new <code>post_google_news.xml</code> sitemap will be added to the main "
784
+ "<code>sitemapindex.xml</code>."
785
+ msgstr ""
786
+ "Un nuevo <code>post_google_news.xml</code> sitemap se agregará al fichero "
787
+ "<code>sitemapindex.xml</code>."
788
+
789
+ #: includes/class-bwp-simple-gxs.php:704
790
+ msgid "Keywords are derived from"
791
+ msgstr "Las palabras claves derivan de"
792
+
793
+ #: includes/class-bwp-simple-gxs.php:705
794
+ msgid ""
795
+ "This ping works separately from the sitemapindex ping, and only occurs when "
796
+ "you publish an article in one of the news categories set below."
797
+ msgstr ""
798
+ "Este ping funciona separadamente del sitemapindex ping, y se ejecuta "
799
+ "únicamente cuando publicas un artículo en una de las categorías de noticias "
800
+ "seleccionadas abajo."
801
+
802
+ #: includes/class-bwp-simple-gxs.php:706
803
+ msgid ""
804
+ "This mode is meant for News Blogs that have posts assigned to more than one "
805
+ "categories. It is an advanced feature and should only be enabled if you do "
806
+ "have similar blogs."
807
+ msgstr ""
808
+ "Este modo es para los Blogs de Noticias que tiene posts asignados a más de "
809
+ "una categoría. Esta es una opción avanzada y solo debe ser activada si "
810
+ "tienes un blog similar."
811
+
812
+ #: includes/class-bwp-simple-gxs.php:712
813
+ msgid ""
814
+ ". Do <strong>NOT</strong> use news tags if your news sitemap contains a lot "
815
+ "of posts as it can be very inefficient to do so. This will be improved in "
816
+ "future versions."
817
+ msgstr ""
818
+ ". <strong>NO</strong> uses tags de noticias si tu sitemap de noticias "
819
+ "contiene muchos posts, ya que esto puede ser muy ineficiente. Esto se "
820
+ "mejorará en versiones futuras."
821
+
822
+ #: includes/class-bwp-simple-gxs.php:736
823
+ #, php-format
824
+ msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
825
+ msgstr ""
826
+ "<strong>%d</strong> los sitemaps cacheados han sido borrados correctamente!"
827
+
828
+ #: includes/class-bwp-simple-gxs.php:738
829
+ msgid ""
830
+ "Could not delete any cached sitemaps. Please manually check the cache "
831
+ "directory."
832
+ msgstr ""
833
+ "No se ha podido borrar ningún sitemap cacheado. Por favor, comprueba "
834
+ "manualmente el directorio caché."
835
+
836
+ #: includes/class-bwp-simple-gxs.php:787
837
+ msgid "All options have been saved."
838
+ msgstr "Todas las opciones han sido guardadas."
839
+
840
+ #: includes/class-bwp-simple-gxs.php:809
841
+ msgid "Warning"
842
+ msgstr "Aviso"
843
+
844
+ #: includes/class-bwp-simple-gxs.php:809
845
+ msgid ""
846
+ "Cache directory does not exist or is not writable. Please read more about "
847
+ "directory permission <a href='http://www.zzee.com/solutions/unix-permissions."
848
+ "shtml'>here</a> (Unix)."
849
+ msgstr ""
850
+ "El directorio caché no existe o no tiene permisos de escritura. Lee más "
851
+ "acerca de los permisos de directorio <a href='http://www.zzee.com/solutions/"
852
+ "unix-permissions.shtml'>aquí</a> (Unix)."
853
+
854
+ #: includes/class-bwp-simple-gxs.php:820
855
+ msgid "Clear All Logs"
856
+ msgstr "Limpiar todos los registros"
857
+
858
+ #: includes/class-bwp-simple-gxs.php:874
859
+ msgid "(Debug is on)"
860
+ msgstr "(Debug está activado)"
861
+
862
+ #: includes/class-bwp-simple-gxs.php:887
863
+ msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
864
+ msgstr "<strong>BWP Google XML Sitemaps Error:</strong> "
865
+
866
+ #: includes/class-bwp-simple-gxs.php:887
867
+ msgid "BWP Google XML Sitemaps Error"
868
+ msgstr "BWP Google XML Sitemaps Error"
869
+
870
+ #: includes/class-bwp-simple-gxs.php:910
871
+ #, php-format
872
+ msgid ""
873
+ "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> "
874
+ "first!"
875
+ msgstr ""
876
+ "Nada por aquí... de momento! Primero intenta enviar tu <a href=\"%s"
877
+ "\">sitemapindex</a>!"
878
+
879
+ #: includes/class-bwp-simple-gxs.php:910
880
+ msgid "No log yet!"
881
+ msgstr "Aún no hay log"
882
+
883
+ #: includes/class-bwp-simple-gxs.php:921
884
+ #, php-format
885
+ msgid ""
886
+ "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on "
887
+ "<strong>%s</strong>."
888
+ msgstr ""
889
+ "<a href=\"%s\" target=\"_blank\">%s</a> ha sido construido "
890
+ "satisfactoriamente <strong>%s</strong>."
891
+
892
+ #: includes/class-bwp-simple-gxs.php:932 includes/class-bwp-simple-gxs.php:949
893
+ msgid "M j, Y : H:i:s"
894
+ msgstr "j M, Y : H:i:s"
895
+
896
+ #: includes/class-bwp-simple-gxs.php:1018
897
+ msgid "Category's name"
898
+ msgstr "Nombre de la categoría"
899
+
900
+ #: includes/class-bwp-simple-gxs.php:1018
901
+ #, php-format
902
+ msgid ""
903
+ "<span>Genres used for this category</span> (more info <a href=\"%s\" target="
904
+ "\"_blank\">here</a>)"
905
+ msgstr ""
906
+ "<span>Géneros usados para esta categoría</span> (más informaciín <a href=\"%s"
907
+ "\" target=\"_blank\">aquí</a>)"
908
+
909
+ #: includes/class-bwp-simple-gxs.php:1309
910
+ #, php-format
911
+ msgid "Requested module (<em>%s</em>) not found or not allowed."
912
+ msgstr "Modulo requerido (<em>%s</em>) no encontrado o no permitido."
913
+
914
+ #: includes/class-bwp-simple-gxs.php:1368
915
+ #: includes/class-bwp-simple-gxs.php:1389
916
+ #, php-format
917
+ msgid "Loaded a custom sub-module file: <strong>%s</strong>."
918
+ msgstr "Cargado un fichero personalizado de sub-modulo: <strong>%s</strong>."
919
+
920
+ #: includes/class-bwp-simple-gxs.php:1377
921
+ #, php-format
922
+ msgid ""
923
+ "Mapped sub-module file: <strong>%s</strong> is not available in both default "
924
+ "and custom module directory. The plugin will now try loading the requested "
925
+ "sub-module instead."
926
+ msgstr ""
927
+ "Fichero Mapeado de sub-modulo: <strong>%s</strong> no está disponible en el "
928
+ "directorio default ni en el de modulos personalizados. El plugin va a "
929
+ "intentar cargar el sub-modulo requerido en su lugar."
930
+
931
+ #: includes/class-bwp-simple-gxs.php:1397
932
+ #, php-format
933
+ msgid ""
934
+ "Sub-module file: <strong>%s</strong> is not available in both default and "
935
+ "custom module directory. The plugin will now try loading the parent module "
936
+ "instead."
937
+ msgstr ""
938
+ "Fichero Sub-módulo: <strong>%s</strong> no está disponible en el directorio "
939
+ "default ni en el de modulos personalizados. El plugin va a intentar cargar "
940
+ "el módulo padre en su lugar."
941
+
942
+ #: includes/class-bwp-simple-gxs.php:1411
943
+ #, php-format
944
+ msgid "Loaded a custom module file: <strong>%s</strong>."
945
+ msgstr "Cargado un fichero de módulo personalizado: <strong>%s</strong>."
946
+
947
+ #: includes/class-bwp-simple-gxs.php:1417
948
+ #, php-format
949
+ msgid ""
950
+ "Could not load module file: <strong>%s</strong> in both default and custom "
951
+ "module directory. Please recheck if that module file exists."
952
+ msgstr ""
953
+ "No se puede cargar el fichero del módulo: <strong>%s</strong> en el "
954
+ "directorio default ni en el de módulos personalizados. Por favor, comprueba "
955
+ "que este módulo existe."
956
+
957
+ #: includes/class-bwp-simple-gxs.php:1437
958
+ #, php-format
959
+ msgid ""
960
+ "There is no class named <strong>%s</strong> in the module file <strong>%s</"
961
+ "strong>."
962
+ msgstr ""
963
+ "No existe una clase llamada <strong>%s</strong> en el fichero del módulo "
964
+ "<strong>%s</strong>."
965
+
966
+ #: includes/class-bwp-simple-gxs.php:1446
967
+ #, php-format
968
+ msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
969
+ msgstr ""
970
+ "Cargado un fichero personalizado de módulo sitemapindex: <strong>%s</strong>."
971
+
972
+ #: includes/class-bwp-simple-gxs.php:1469
973
+ #, php-format
974
+ msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
975
+ msgstr ""
976
+ "Se ha generado satisfactoriamente <em>%s.xml</em> usando el módulo <em>%s</"
977
+ "em>."
978
+
979
+ #: includes/class-bwp-simple-gxs.php:1500
980
+ msgid ""
981
+ "<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of "
982
+ "the time PHP errors) is preventing BWP GXS from showing any sitemap "
983
+ "contents. Try disabling <code>WP_DEBUG</code> or this plugin's debug mode, "
984
+ "whichever is on. All unexpected outputs should be shown just above this "
985
+ "message. If you don't see any, contact me and I might be able to help."
986
+ msgstr ""
987
+ "<strong>Mensaje de BWP Google XML Sitemap:</strong> Una salida inesperada "
988
+ "(normalmente por errores PHP) está evitando que BWP GXS muestre el contenido "
989
+ "del sitemap, Intenta desactivando <code>WP_DEBUG</code> o el modo debug de "
990
+ "este plugin, si es que está activo. Todos las salidas inesperadas serán "
991
+ "mostradas justo debajo de este mensaje. Si no ves ninguna, contacta conmigo "
992
+ "y te echaré una mano."
993
+
994
+ #: includes/class-bwp-simple-gxs.php:1630
995
+ msgid "Unknown response code from search engines. Ping failed."
996
+ msgstr ""
997
+ "Código de respuesta desconocido de los motores de búsqueda. Fallo al hacer "
998
+ "Ping."
999
+
1000
+ #: includes/class-bwp-simple-gxs.php:1632
1001
+ #, php-format
1002
+ msgid "Pinged %s with %s successfully!"
1003
+ msgstr "Se ha hecho Ping %s con %s satisfactoriamente!"
1004
+
1005
+ #: includes/class-bwp-simple-gxs.php:1637
1006
+ #, php-format
1007
+ msgid "Error %s from %s"
1008
+ msgstr "Error %s desde %s"
1009
+
1010
+ #: includes/class-bwp-simple-gxs.php:1642
1011
+ #, php-format
1012
+ msgid "Ping limit for today to %s has been reached, sorry!"
1013
+ msgstr "El limite de Ping para hoy de %s ha sido alcanzado, lo sentimos!"
1014
+
1015
+ #: includes/class-bwp-simple-gxs.php:1670
1016
+ #, php-format
1017
+ msgid ""
1018
+ "<em>%s.xml</em> does not have any item. You can fix this easily by excluding "
1019
+ "any post types / terms you do not use in <em>Sitemap Generator</em> tab "
1020
+ "within your admin area. If you still see this error, consider checking the "
1021
+ "module that generates this sitemap (<em>%s.php</em>)."
1022
+ msgstr ""
1023
+ "<em>%s.xml</em> no contiene ningún item. Puedes solucionar esto fácilmente "
1024
+ "excluyendo cualquier tipo de post / término que no uses en la pestaña de "
1025
+ "<em>Sitemap Generator</em> dentro del área de administración. Si continuar "
1026
+ "viendo este error, considera revisar el módulo que genera este sitemap (<em>"
1027
+ "%s.php</em>)."
1028
+
1029
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:80
1030
+ msgid "Plugin Configurations"
1031
+ msgstr "Configuraciones de Plugin"
1032
+
1033
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:398
1034
+ msgid "Save Changes"
1035
+ msgstr "Guardar cambios"
languages/bwp-simple-gxs-ms_MY.mo CHANGED
Binary file
languages/bwp-simple-gxs-ms_MY.po CHANGED
@@ -2,12 +2,12 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: BWP Google XML Sitemaps(Malay Translation)\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-04-15 03:56+0700\n"
6
- "PO-Revision-Date: 2011-04-19 10:00+0700\n"
7
  "Last-Translator: \n"
8
  "Language-Team: <darkcry3r@gmail.com>\n"
9
  "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
  "X-Poedit-Basepath: .\n"
@@ -17,25 +17,74 @@ msgstr ""
17
  "X-Poedit-Country: MALAYSIA\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
- #: includes/class-bwp-framework.php:172
21
  #, php-format
22
  msgid "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin."
23
  msgstr "%s memerlukan WordPress <strong>%s</strong> atau yang terbaharu dan PHP <strong>%s</strong> atau yang terbaharu . Plugin ini tidak akan berfungsi sehingga anda menaiktaraf perisian. Sila nyahaktifkan plugin ini."
24
 
25
- #: includes/class-bwp-framework.php:181
26
- msgid "log"
27
- msgstr "log"
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- #: includes/class-bwp-framework.php:186
30
- msgid "You can buy me some coffees if you appreciate my work, thank you!"
 
 
 
 
 
31
  msgstr "Anda boleh menderma jika anda hargai kerja saya, terima kasih!"
32
 
 
 
 
 
33
  #: includes/class-bwp-framework.php:211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  #, php-format
35
  msgid "You are using version %s!"
36
  msgstr "Anda menggunakan versi %s!"
37
 
38
- #: includes/class-bwp-framework.php:343
39
  msgid "Settings"
40
  msgstr "Tetapan"
41
 
@@ -49,439 +98,696 @@ msgstr "Direktori cache (\"%s\") tidak wujud atau tidak boleh dibaca."
49
  msgid "Cache file for module <em>%s</em> is not found and will be built right away."
50
  msgstr "Fail cache untuk modul <em>%s</em> tidak dijumpai dan akan dibina segera."
51
 
52
- #: includes/class-bwp-gxs-cache.php:106
53
- #: includes/class-bwp-simple-gxs.php:859
54
  #, php-format
55
  msgid "Successfully served a cached version of <em>%s.xml</em>."
56
  msgstr "Berjaya melayan versi cache untuk <em>%s.xml</em>."
57
 
58
- #: includes/class-bwp-simple-gxs.php:119
59
- #: includes/class-bwp-simple-gxs.php:259
 
60
  msgid "Sitemap Statistics"
61
  msgstr "Statistik Pelan Tapak"
62
 
63
- #: includes/class-bwp-simple-gxs.php:120
64
- #: includes/class-bwp-simple-gxs.php:260
 
65
  msgid "Sitemap Generator"
66
  msgstr "Penghasilan Pelan Tapak"
67
 
68
- #: includes/class-bwp-simple-gxs.php:139
 
 
 
 
 
 
 
69
  #, php-format
70
  msgid "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
71
  msgstr "Peta tapak ini asalnya telah dihasilkan selama %s saat (Penggunaan memori: %s) - %s maklumat - %s URL(s) telah disenaraikan"
72
 
73
- #: includes/class-bwp-simple-gxs.php:257
74
- msgid "BWP Google XML Sitemaps"
75
- msgstr "Pelan Tapak Google XML BWP "
76
-
77
- #: includes/class-bwp-simple-gxs.php:259
78
  msgid "BWP Google XML Sitemaps Statistics"
79
  msgstr "Statistik Pelan Tapak Google XML BWP "
80
 
81
- #: includes/class-bwp-simple-gxs.php:260
 
82
  msgid "BWP Google XML Sitemaps Generator"
83
  msgstr "Penghasilan Pelan Tapak Google XML BWP"
84
 
85
- #: includes/class-bwp-simple-gxs.php:271
 
 
 
 
 
 
 
 
 
 
86
  msgid "You do not have sufficient permissions to access this page."
87
  msgstr "Anda tidak mempunyai cukup kebenaran untuk mengakses muka ini."
88
 
89
- #: includes/class-bwp-simple-gxs.php:289
 
 
 
 
 
 
 
 
 
 
90
  msgid "What are Sitemaps?"
91
  msgstr "Apa itu Pelan tapak?"
92
 
93
- #: includes/class-bwp-simple-gxs.php:290
94
  msgid "Your sitemaps"
95
  msgstr "Pelan tapak anda"
96
 
97
- #: includes/class-bwp-simple-gxs.php:291
98
  msgid "Submit your sitemaps"
99
  msgstr "Serah pelan tapak anda"
100
 
101
- #: includes/class-bwp-simple-gxs.php:292
102
  msgid "Pinging search engines"
103
  msgstr "Penghantaran ke enjin carian"
104
 
105
- #: includes/class-bwp-simple-gxs.php:293
106
  msgid "Enable pinging functionality?"
107
  msgstr "Benarkan keberkesanan penghantaran? "
108
 
109
- #: includes/class-bwp-simple-gxs.php:294
110
  msgid "Enable pinging individual SE"
111
  msgstr "Benarkan penghantaran SE individu"
112
 
113
- #: includes/class-bwp-simple-gxs.php:295
114
  msgid "Sitemap Generator's Log"
115
  msgstr "Log Penghasilan Pelan Tapak"
116
 
117
- #: includes/class-bwp-simple-gxs.php:296
118
  msgid "Enable logging?"
119
  msgstr "Benarkan log?"
120
 
121
- #: includes/class-bwp-simple-gxs.php:297
122
  msgid "Enable debugging?"
123
  msgstr "Benarkan debugging?"
124
 
125
- #: includes/class-bwp-simple-gxs.php:307
126
- msgid "In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; http://www.sitemaps.org/"
 
127
  msgstr "Dalam erti kata mudah, sebuah pelan tapak adalah fail XML yang mengandungi senarai URL untuk halaman bersama-sama dengan metadata tambahan tentang setiap URL (saat terakhir dikemaskinikan, seberapa kerap perubahan biasanya, dan betapa pentingnya, berkait rapat dengan URL lain di tapak ) jadi enjin carian akan lebih berkesan mencari tapak tersebut - http://www.sitemaps.org/"
128
 
129
- #: includes/class-bwp-simple-gxs.php:308
 
 
 
 
130
  msgid "<em>Basic information about all your sitemaps.</em>"
131
  msgstr "<em>Maklumat asas tentang keseluruhan pelan tapak anda.</em>"
132
 
133
- #: includes/class-bwp-simple-gxs.php:309
134
  msgid "<em>More detailed information about how your sitemaps are generated including <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;\">success messages</span>.</em>"
135
  msgstr "<em>Maklumat lebih lanjut tentang bagaimana pelan tapak anda telah dihasilkan termasuk <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">ralat</span> dan juga <span style=\"color: #009900;\">mesej berjaya</span>.</em>"
136
 
137
- #: includes/class-bwp-simple-gxs.php:310
138
- #, php-format
139
- msgid "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
140
  msgstr "<em>Hantar indeks pelan tapak anda kepada enjin carian biasa seperti <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> atau <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
141
 
142
- #: includes/class-bwp-simple-gxs.php:311
143
  msgid "<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>"
144
  msgstr "<em>Sekarang apabila anda menghantar sesuatu yang baru pada blog anda, anda boleh <em>menguji</em> enjin carian untuk memberitahu mereka bahawa blog anda baru dikemaskinikan. Penghantaran mungkin kurang efektif dari yang anda fikir tetapi anda harus juga benarkan fungsi ini.</em>"
145
 
146
- #: includes/class-bwp-simple-gxs.php:316
147
  msgid "Selected SE below will be pinged when you publish new posts."
148
  msgstr "SE yang dipilih dibawah akan dihantar apabila anda menerbitkan pos baharu."
149
 
150
- #: includes/class-bwp-simple-gxs.php:317
151
  msgid "No additional load is needed so enabling this is recommended."
152
  msgstr "Tiada beban tambahan diperlukan jadi membenarkan ini adalah digalakkan."
153
 
154
- #: includes/class-bwp-simple-gxs.php:318
155
  msgid "Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules."
156
  msgstr "Ralat kecil akan dicetak pada skrin. Juga, apabila debug diaktifkan, tiada caching akan digunakan, berguna apabila anda mengembangkan modul baharu."
157
 
158
- #: includes/class-bwp-simple-gxs.php:319
159
  msgid "Google"
160
  msgstr "Google"
161
 
162
- #: includes/class-bwp-simple-gxs.php:320
163
- #, php-format
164
- msgid "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
165
- msgstr "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">penting</a>"
166
-
167
- #: includes/class-bwp-simple-gxs.php:321
168
  msgid "Bing"
169
  msgstr "Bing"
170
 
171
- #: includes/class-bwp-simple-gxs.php:322
172
  msgid "Ask.com"
173
  msgstr "Ask.com"
174
 
175
- #: includes/class-bwp-simple-gxs.php:325
176
  #, php-format
177
  msgid "After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href=\"%s\">How-to</a> if you are interested."
178
  msgstr "Apabila anda aktifkan plugin ini, semua pelan tapak sepatutnya sudah berada. Langkah seterusnya ialah dengan menghantar indeks pelan tapak kepada enjin carian. Anda cuma perlu <strong>indeks pelan tapak</strong> dan selain itu, enjin carian secara automatik mengenalpasti pelan tapak yang lain. Anda boleh merujuk <a href=\"%s\">Langkah-langkah</a> jika anda berminat."
179
 
180
- #: includes/class-bwp-simple-gxs.php:349
181
  msgid "Output no more than"
182
  msgstr "Output tidak lebih dari"
183
 
184
- #: includes/class-bwp-simple-gxs.php:350
185
  msgid "Default change frequency"
186
  msgstr "Ubah frekuensi lalai"
187
 
188
- #: includes/class-bwp-simple-gxs.php:351
189
  msgid "Default priority"
190
  msgstr "Keutamaan lalai"
191
 
192
- #: includes/class-bwp-simple-gxs.php:352
193
  msgid "Minimum priority"
194
  msgstr "Keutamaan minimum"
195
 
196
- #: includes/class-bwp-simple-gxs.php:353
197
- msgid "Add sitemapindex to WordPress's virtual robots.txt?"
198
- msgstr "Tambah indeks pelan tapak kepada WordPress's robots.txt?"
199
-
200
- #: includes/class-bwp-simple-gxs.php:354
201
- msgid "In sitemapindex, include"
202
- msgstr "Di dalam indeks pelan tapak, termasuk"
203
 
204
- #: includes/class-bwp-simple-gxs.php:355
205
  msgid "Style your sitemaps with an XSLT stylesheet?"
206
  msgstr "Ubah pelan tapak anda dengan gaya lembar XSLT?"
207
 
208
- #: includes/class-bwp-simple-gxs.php:356
209
  msgid "Custom XSLT stylesheet URL"
210
  msgstr "URL gaya lembar XSLT yang diubah"
211
 
212
- #: includes/class-bwp-simple-gxs.php:357
213
  msgid "Show build stats in sitemaps?"
214
  msgstr "Papar status bina dalam pelan tapak?"
215
 
216
- #: includes/class-bwp-simple-gxs.php:358
217
  msgid "Enable credit?"
218
  msgstr "Paparkan penghargaan?"
219
 
220
- #: includes/class-bwp-simple-gxs.php:359
221
  msgid "Enable Gzip?"
222
  msgstr "Benarkan Gzip?"
223
 
224
- #: includes/class-bwp-simple-gxs.php:360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  msgid "Module Options"
226
  msgstr "Tetapan modul"
227
 
228
- #: includes/class-bwp-simple-gxs.php:361
229
  msgid "Alternate module directory"
230
  msgstr "Direktori pengganti modul"
231
 
232
- #: includes/class-bwp-simple-gxs.php:362
233
  msgid "Get no more than"
234
  msgstr "Dapat tidak lebih daripada"
235
 
236
- #: includes/class-bwp-simple-gxs.php:363
237
  msgid "Caching Options"
238
  msgstr "Tetapan Caching"
239
 
240
- #: includes/class-bwp-simple-gxs.php:364
241
  msgid "Enable caching?"
242
  msgstr "Benarkan caching?"
243
 
244
- #: includes/class-bwp-simple-gxs.php:365
245
  msgid "Enable auto cache re-generation?"
246
  msgstr "Benarkan auto cache di-generasi?"
247
 
248
- #: includes/class-bwp-simple-gxs.php:366
249
  msgid "Cached sitemaps will last for"
250
  msgstr "Pelan tapak yang di-cache-kan akan bertahan selama"
251
 
252
- #: includes/class-bwp-simple-gxs.php:367
253
  msgid "Cached sitemaps are stored in (auto detected)"
254
  msgstr "Pelan tapak yang di-cache-kan akan disimpan di dalam (auto carian)"
255
 
256
- #: includes/class-bwp-simple-gxs.php:371
257
  msgid "<em>Cache your sitemaps for better performance.</em>"
258
  msgstr "<em>Cache pelan tapak anda untuk prestasi yang memberangsangkan.</em>"
259
 
260
- #: includes/class-bwp-simple-gxs.php:372
261
  #, php-format
262
  msgid "<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href=\"%s#using-modules\">here</a>.</em>"
263
  msgstr "<em>Plugin ini menggunakan modul untuk membina data pelan tapak jadi digalakkan untuk anda mengembangkan plugin ini menggunakan modul-modul berbanding dikait. Salah satu daripada tetapan dibawah hanya mempengaruhi dalam memperluas kelas modul asas.Lebih lanjut tentang penggunaan modul <a href=\"%s#using-modules\">disini</a>.</em>"
264
 
265
- #: includes/class-bwp-simple-gxs.php:382
266
- #: includes/class-bwp-simple-gxs.php:388
 
 
 
 
267
  msgid "second(s)"
268
  msgstr "saat"
269
 
270
- #: includes/class-bwp-simple-gxs.php:383
271
- #: includes/class-bwp-simple-gxs.php:389
272
  msgid "minute(s)"
273
  msgstr "minit"
274
 
275
- #: includes/class-bwp-simple-gxs.php:384
276
- #: includes/class-bwp-simple-gxs.php:390
277
  msgid "hour(s)"
278
  msgstr "jam"
279
 
280
- #: includes/class-bwp-simple-gxs.php:385
281
- #: includes/class-bwp-simple-gxs.php:391
282
  msgid "day(s)"
283
  msgstr "hari"
284
 
285
- #: includes/class-bwp-simple-gxs.php:398
286
- #: includes/class-bwp-simple-gxs.php:399
287
- #: includes/class-bwp-simple-gxs.php:400
288
  msgid "read more"
289
  msgstr "lebih lanjut"
290
 
291
- #: includes/class-bwp-simple-gxs.php:403
292
  msgid "your sitemaps are generated and then cached to reduce unnecessary work."
293
  msgstr "pelan tapak anda telah dihasilkan dan kemudian di-cache-kan untuk mengurangkan kerja yang diperlukan."
294
 
295
- #: includes/class-bwp-simple-gxs.php:404
296
  msgid "when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while."
297
  msgstr "apabila cache pelan tapak luput, plugin ini akan cuba untuk menghasilkan cache lagi. Jika anda tidak membenarkan ini, waspada untuk membuang cache secara manual sekali sekala."
298
 
299
- #: includes/class-bwp-simple-gxs.php:404
300
  msgid "Flush the cache"
301
  msgstr "Buang cache"
302
 
303
- #: includes/class-bwp-simple-gxs.php:405
304
  msgid "tell you useful information such as build time, memory usage, SQL queries, etc."
305
  msgstr "beritahu anda maklumat seperti masa bina, pengunaan memori, maklumat SQL dan lain-lain."
306
 
307
- #: includes/class-bwp-simple-gxs.php:406
308
  #, php-format
309
- msgid "make your sitemaps ~ 70% smaller."
310
- msgstr "membuat pelan tapak anda 70% lebih kecil."
311
 
312
- #: includes/class-bwp-simple-gxs.php:407
313
- msgid "static pages' sitemap."
314
- msgstr "pelan tapak muka statik."
 
 
 
 
 
315
 
316
- #: includes/class-bwp-simple-gxs.php:408
317
  msgid "taxonomy archives' sitemaps, including custom taxonomies."
318
  msgstr "menamakan arkib pelan tapak, termasuk yang diubahsuai."
319
 
320
- #: includes/class-bwp-simple-gxs.php:409
321
- msgid "tag archives' sitemaps."
322
- msgstr "Lekat arkib pelan tapak."
323
-
324
- #: includes/class-bwp-simple-gxs.php:410
325
  msgid "date archives' sitemaps."
326
  msgstr "tarikh arkib pelan tapak."
327
 
328
- #: includes/class-bwp-simple-gxs.php:411
 
 
 
 
329
  msgid "some copyrighted info is also added to your sitemaps. Thanks!"
330
  msgstr "sedikit maklumat hakcipta juga akan ditambah pada pelan tapak anda. Terima kasih! "
331
 
332
- #: includes/class-bwp-simple-gxs.php:412
333
- msgid "This will load the default stylesheet provided by this plugin. You can set a custom stylesheet below or filter the <code>bwp_gxs_xslt</code> hook."
 
334
  msgstr "Ini akan menambah gaya lembar lalai yang dibekalkan dengan plugin ini. Anda boleh menetapkan gaya lembar yang diubahsuai di bawah atau dengan menapis <code>bwp_gxs_xslt</code>."
335
 
336
- #: includes/class-bwp-simple-gxs.php:413
337
  #, php-format
338
  msgid "If you're on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more info."
339
  msgstr "Jika anda di dalam Multi-tapak pemasangan dengan Sub-domain digunakan, setiap tapak akan ada setiap robot.txt sendiri, manakala tapak di dalam sub- direktori adalah sebaliknya. Sila rujuk <a href=\"%s#toc-robots\" target=\"_blank\">dokumentasi</a> untuk maklumat terperinci."
340
 
341
- #: includes/class-bwp-simple-gxs.php:416
342
- msgid "item(s) in one sitemap. Actually, 5000 would be more ideal. You can not go over 50,000, though."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  msgstr "item di dalam satu pelan tapak. Akan tetapi, 5000 adalah lebih sesuai. Anda tidak boleh melebihi 50,000, walaubagaimanapun."
344
 
345
- #: includes/class-bwp-simple-gxs.php:417
 
 
 
 
346
  msgid "Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead."
347
  msgstr "Masuk ruang penuh untuk direktori dimana anda meletak modul anda sendiri (contoh <code>/home/mysite/public_html/gxs-modules/</code>), anda juga boleh melebih-naik modul yang terbina dengan mendapat nama modul fail yang sama di dalam direktori. Penapis juga tersedia jika anda mahu menggunakan PHP."
348
 
349
- #: includes/class-bwp-simple-gxs.php:418
350
  msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
351
  msgstr "Cache direktori harus boleh ditulis (i.e. CHMOD to 755 or 777)."
352
 
353
- #: includes/class-bwp-simple-gxs.php:419
354
  msgid "item(s) in one SQL query. This helps you avoid running too heavy queries."
355
  msgstr "item-item di dalam satu maklumat SQL. Ini membantu anda untuk menghindar dari menggunakan maklumat terlalu banyak."
356
 
357
- #: includes/class-bwp-simple-gxs.php:422
358
  msgid "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use."
359
  msgstr "jangkaan untuk menjadi URL tetap, contohnya <code>http://example.com/my-stylesheet.xsl</code>. Anda juga harus mempunyai gaya lembar untuk indeks pelan tapak yang mana boleh di akses melalui URL di atas, contohnya <code>my-stylesheet.xsl</code> dan <code>my-stylesheetindex.xsl</code>). Sila tinggalkan kosong sekiranya anda tidak berhasrat untuk menggunakannya."
360
 
361
- #: includes/class-bwp-simple-gxs.php:449
362
- #: includes/class-bwp-simple-gxs.php:451
363
- msgid "Notice"
364
- msgstr "Notis"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
- #: includes/class-bwp-simple-gxs.php:449
 
 
 
 
 
 
 
 
 
 
 
 
367
  #, php-format
368
  msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
369
  msgstr "<strong>%d</strong> pelan tapak yang di-cache-kan telah di buang!"
370
 
371
- #: includes/class-bwp-simple-gxs.php:451
372
  msgid "Could not delete any cached sitemaps. Please manually check the cache directory."
373
  msgstr "Tidak boleh buang mana-mana pelan tapak yang telah di-cache-kan. Sila rujuk cache direktori secara manual."
374
 
375
- #: includes/class-bwp-simple-gxs.php:503
 
 
 
 
376
  msgid "Warning"
377
  msgstr "Amaran"
378
 
379
- #: includes/class-bwp-simple-gxs.php:503
380
  msgid "Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix)."
381
  msgstr "Direktori cache tidak wujud atau tidak boleh dibaca. Sila rujuk direktori berkenaan kebenaran <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>disini</a> (Unix)."
382
 
383
- #: includes/class-bwp-simple-gxs.php:557
 
 
 
 
384
  msgid "(Debug is on)"
385
  msgstr "(Debug dibuka)"
386
 
387
- #: includes/class-bwp-simple-gxs.php:570
388
  msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
389
  msgstr "<strong>Google XML Pelan tapak BWP Ralat:</strong>"
390
 
391
- #: includes/class-bwp-simple-gxs.php:570
392
  msgid "BWP Google XML Sitemaps Error"
393
  msgstr "Google XML Pelan tapak BWP Ralat"
394
 
395
- #: includes/class-bwp-simple-gxs.php:593
396
  #, php-format
397
  msgid "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> first!"
398
  msgstr "Tiada disini...lagi! Cuba hantar <a href=\"%s\">indeks pelan tapak</a> anda dahulu!"
399
 
400
- #: includes/class-bwp-simple-gxs.php:593
401
  msgid "No log yet!"
402
  msgstr "Tiada log lagi!"
403
 
404
- #: includes/class-bwp-simple-gxs.php:603
405
- #, php-format
406
- msgid "%s"
407
- msgstr "%s"
408
-
409
- #: includes/class-bwp-simple-gxs.php:603
410
  #, php-format
411
  msgid "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on <strong>%s</strong>."
412
  msgstr "<a href=\"%s\" target=\"_blank\">%s</a> telah berjaya dibina <strong>%s</strong>."
413
 
414
- #: includes/class-bwp-simple-gxs.php:613
415
- #: includes/class-bwp-simple-gxs.php:616
416
  msgid "M j, Y : H:i:s"
417
  msgstr "M j, Y : H:i:s"
418
 
419
- #: includes/class-bwp-simple-gxs.php:836
 
 
 
 
 
 
 
 
 
420
  #, php-format
421
  msgid "Requested module (<em>%s</em>) not found or not allowed."
422
  msgstr "Modul yang diminta (<em>%s</em>) tidak dijumpai atau tidak dibenarkan."
423
 
424
- #: includes/class-bwp-simple-gxs.php:886
425
- #: includes/class-bwp-simple-gxs.php:906
426
  #, php-format
427
  msgid "Loaded a custom sub-module file: <strong>%s</strong>."
428
  msgstr "Lain-lain fail sub-modul telah dibekalkan: <strong>%s</strong>."
429
 
430
- #: includes/class-bwp-simple-gxs.php:895
431
  #, php-format
432
  msgid "Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead."
433
  msgstr "Fail sub-module yang dikategorikan: <strong>%s</strong> tidak terdapat di dalam kedua-dua lalai dan lain-lain direktori modul. Plugin sekarang akan cuba untuk menggunakan sub-modul."
434
 
435
- #: includes/class-bwp-simple-gxs.php:914
436
  #, php-format
437
  msgid "Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead."
438
  msgstr "Fail sub-modul: <strong>%s</strong> tidak terdapat di dalam kedua-dua lalai dan juga lain-lain direktori modul. Plugin akan cuba menggunakan modul utama."
439
 
440
- #: includes/class-bwp-simple-gxs.php:927
441
  #, php-format
442
  msgid "Loaded a custom module file: <strong>%s</strong>."
443
  msgstr "Menggunakan lain-lain fail modul: <strong>%s</strong>."
444
 
445
- #: includes/class-bwp-simple-gxs.php:933
446
  #, php-format
447
  msgid "Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists."
448
  msgstr "Tidak boleh menggunakan fail modul: <strong>%s</strong> di kedua-dua lalai dan juga lain-lain direktori modul. Sila semak semula jika fail modul itu wujud."
449
 
450
- #: includes/class-bwp-simple-gxs.php:951
451
  #, php-format
452
  msgid "There is no class named <strong>%s</strong> in the module file <strong>%s</strong>."
453
  msgstr "Tiada kelas dinamakan <strong>%s</strong> di dalam fail modul <strong>%s</strong>."
454
 
455
- #: includes/class-bwp-simple-gxs.php:960
456
  #, php-format
457
  msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
458
  msgstr "Menggunakan lain-lain fail modul indeks pelan tapak: <strong>%s</strong>."
459
 
460
- #: includes/class-bwp-simple-gxs.php:980
461
  #, php-format
462
  msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
463
  msgstr "Berjaya menghasilkan <em>%s.xml</em> menggunakan modul <em>%s</em>."
464
 
465
- #: includes/class-bwp-simple-gxs.php:1090
466
- #, php-format
467
- msgid "Pinged %s successfully!"
 
 
 
 
 
 
 
 
468
  msgstr "Penghantaran berjaya %s !"
469
 
470
- #: includes/class-bwp-simple-gxs.php:1096
 
 
 
 
 
471
  #, php-format
472
  msgid "Ping limit for today to %s has been reached, sorry!"
473
  msgstr "Had menghantar untuk hari ini kepada %s telah dicapai, maaf!"
474
 
475
- #: includes/class-bwp-simple-gxs.php:1124
476
- #, php-format
477
- msgid "<em>%s.xml</em> does not have any item. The plugin has fired a 404 header to the search engine that requests it. You should check the module that generates that sitemap (<em>%s.php</em>)."
478
  msgstr "<em>%s.xml</em> tiada apa-apa item. Plugin telah membuang permulaan 404 kepada enjian carian yang memintanya. Anda seharusnya meninjau modul yang menghasilkan pelan tapak itu (<em>%s.php</em>)."
479
 
480
- #: includes/bwp-option-page/includes/class-bwp-option-page.php:74
481
  msgid "Plugin Configurations"
482
  msgstr "Tetapan Plugin"
483
 
484
- #: includes/bwp-option-page/includes/class-bwp-option-page.php:391
485
  msgid "Save Changes"
486
  msgstr "Simpan Perubahan"
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: BWP Google XML Sitemaps(Malay Translation)\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-03 20:10+0700\n"
6
+ "PO-Revision-Date: 2012-04-03 20:10+0700\n"
7
  "Last-Translator: \n"
8
  "Language-Team: <darkcry3r@gmail.com>\n"
9
  "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
  "X-Poedit-Basepath: .\n"
17
  "X-Poedit-Country: MALAYSIA\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
+ #: includes/class-bwp-framework.php:177
21
  #, php-format
22
  msgid "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin."
23
  msgstr "%s memerlukan WordPress <strong>%s</strong> atau yang terbaharu dan PHP <strong>%s</strong> atau yang terbaharu . Plugin ini tidak akan berfungsi sehingga anda menaiktaraf perisian. Sila nyahaktifkan plugin ini."
24
 
25
+ #: includes/class-bwp-framework.php:188
26
+ msgid "Development Log"
27
+ msgstr ""
28
+
29
+ #: includes/class-bwp-framework.php:188
30
+ msgid "Frequently Asked Questions"
31
+ msgstr ""
32
+
33
+ #: includes/class-bwp-framework.php:188
34
+ msgid "FAQ"
35
+ msgstr ""
36
+
37
+ #: includes/class-bwp-framework.php:188
38
+ msgid "Got a problem? Send me a feedback!"
39
+ msgstr ""
40
 
41
+ #: includes/class-bwp-framework.php:188
42
+ msgid "Contact"
43
+ msgstr ""
44
+
45
+ #: includes/class-bwp-framework.php:195
46
+ #, fuzzy
47
+ msgid "You can buy me some special coffees if you appreciate my work, thank you!"
48
  msgstr "Anda boleh menderma jika anda hargai kerja saya, terima kasih!"
49
 
50
+ #: includes/class-bwp-framework.php:209
51
+ msgid "Donate to "
52
+ msgstr ""
53
+
54
  #: includes/class-bwp-framework.php:211
55
+ msgid "One cup $5.00"
56
+ msgstr ""
57
+
58
+ #: includes/class-bwp-framework.php:212
59
+ msgid "Two cups $10.00"
60
+ msgstr ""
61
+
62
+ #: includes/class-bwp-framework.php:213
63
+ msgid "Five cups! $25.00"
64
+ msgstr ""
65
+
66
+ #: includes/class-bwp-framework.php:214
67
+ msgid "One LL-cup!!! $50.00"
68
+ msgstr ""
69
+
70
+ #: includes/class-bwp-framework.php:215
71
+ msgid "... or any amount!"
72
+ msgstr ""
73
+
74
+ #: includes/class-bwp-framework.php:230
75
+ msgid "Latest updates from BetterWP.net!"
76
+ msgstr ""
77
+
78
+ #: includes/class-bwp-framework.php:231
79
+ msgid "Follow me on Twitter!"
80
+ msgstr ""
81
+
82
+ #: includes/class-bwp-framework.php:240
83
  #, php-format
84
  msgid "You are using version %s!"
85
  msgstr "Anda menggunakan versi %s!"
86
 
87
+ #: includes/class-bwp-framework.php:385
88
  msgid "Settings"
89
  msgstr "Tetapan"
90
 
98
  msgid "Cache file for module <em>%s</em> is not found and will be built right away."
99
  msgstr "Fail cache untuk modul <em>%s</em> tidak dijumpai dan akan dibina segera."
100
 
101
+ #: includes/class-bwp-gxs-cache.php:108
102
+ #: includes/class-bwp-simple-gxs.php:1341
103
  #, php-format
104
  msgid "Successfully served a cached version of <em>%s.xml</em>."
105
  msgstr "Berjaya melayan versi cache untuk <em>%s.xml</em>."
106
 
107
+ #: includes/class-bwp-simple-gxs.php:141
108
+ #: includes/class-bwp-simple-gxs.php:347
109
+ #: includes/class-bwp-simple-gxs.php:354
110
  msgid "Sitemap Statistics"
111
  msgstr "Statistik Pelan Tapak"
112
 
113
+ #: includes/class-bwp-simple-gxs.php:142
114
+ #: includes/class-bwp-simple-gxs.php:348
115
+ #: includes/class-bwp-simple-gxs.php:355
116
  msgid "Sitemap Generator"
117
  msgstr "Penghasilan Pelan Tapak"
118
 
119
+ #: includes/class-bwp-simple-gxs.php:143
120
+ #: includes/class-bwp-simple-gxs.php:349
121
+ #: includes/class-bwp-simple-gxs.php:356
122
+ #, fuzzy
123
+ msgid "News Sitemap"
124
+ msgstr "Apa itu Pelan tapak?"
125
+
126
+ #: includes/class-bwp-simple-gxs.php:174
127
  #, php-format
128
  msgid "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
129
  msgstr "Peta tapak ini asalnya telah dihasilkan selama %s saat (Penggunaan memori: %s) - %s maklumat - %s URL(s) telah disenaraikan"
130
 
131
+ #: includes/class-bwp-simple-gxs.php:347
132
+ #: includes/class-bwp-simple-gxs.php:354
 
 
 
133
  msgid "BWP Google XML Sitemaps Statistics"
134
  msgstr "Statistik Pelan Tapak Google XML BWP "
135
 
136
+ #: includes/class-bwp-simple-gxs.php:348
137
+ #: includes/class-bwp-simple-gxs.php:355
138
  msgid "BWP Google XML Sitemaps Generator"
139
  msgstr "Penghasilan Pelan Tapak Google XML BWP"
140
 
141
+ #: includes/class-bwp-simple-gxs.php:349
142
+ #: includes/class-bwp-simple-gxs.php:356
143
+ #, fuzzy
144
+ msgid "BWP Google News XML Sitemap"
145
+ msgstr "Pelan Tapak Google XML BWP "
146
+
147
+ #: includes/class-bwp-simple-gxs.php:353
148
+ msgid "BWP Google XML Sitemaps"
149
+ msgstr "Pelan Tapak Google XML BWP "
150
+
151
+ #: includes/class-bwp-simple-gxs.php:368
152
  msgid "You do not have sufficient permissions to access this page."
153
  msgstr "Anda tidak mempunyai cukup kebenaran untuk mengakses muka ini."
154
 
155
+ #: includes/class-bwp-simple-gxs.php:389
156
+ #: includes/class-bwp-simple-gxs.php:736
157
+ #: includes/class-bwp-simple-gxs.php:738
158
+ msgid "Notice"
159
+ msgstr "Notis"
160
+
161
+ #: includes/class-bwp-simple-gxs.php:389
162
+ msgid "All logs have been cleared successfully!"
163
+ msgstr ""
164
+
165
+ #: includes/class-bwp-simple-gxs.php:396
166
  msgid "What are Sitemaps?"
167
  msgstr "Apa itu Pelan tapak?"
168
 
169
+ #: includes/class-bwp-simple-gxs.php:397
170
  msgid "Your sitemaps"
171
  msgstr "Pelan tapak anda"
172
 
173
+ #: includes/class-bwp-simple-gxs.php:398
174
  msgid "Submit your sitemaps"
175
  msgstr "Serah pelan tapak anda"
176
 
177
+ #: includes/class-bwp-simple-gxs.php:399
178
  msgid "Pinging search engines"
179
  msgstr "Penghantaran ke enjin carian"
180
 
181
+ #: includes/class-bwp-simple-gxs.php:400
182
  msgid "Enable pinging functionality?"
183
  msgstr "Benarkan keberkesanan penghantaran? "
184
 
185
+ #: includes/class-bwp-simple-gxs.php:401
186
  msgid "Enable pinging individual SE"
187
  msgstr "Benarkan penghantaran SE individu"
188
 
189
+ #: includes/class-bwp-simple-gxs.php:402
190
  msgid "Sitemap Generator's Log"
191
  msgstr "Log Penghasilan Pelan Tapak"
192
 
193
+ #: includes/class-bwp-simple-gxs.php:403
194
  msgid "Enable logging?"
195
  msgstr "Benarkan log?"
196
 
197
+ #: includes/class-bwp-simple-gxs.php:404
198
  msgid "Enable debugging?"
199
  msgstr "Benarkan debugging?"
200
 
201
+ #: includes/class-bwp-simple-gxs.php:413
202
+ #, fuzzy
203
+ msgid "In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; <em>http://www.sitemaps.org/</em>"
204
  msgstr "Dalam erti kata mudah, sebuah pelan tapak adalah fail XML yang mengandungi senarai URL untuk halaman bersama-sama dengan metadata tambahan tentang setiap URL (saat terakhir dikemaskinikan, seberapa kerap perubahan biasanya, dan betapa pentingnya, berkait rapat dengan URL lain di tapak ) jadi enjin carian akan lebih berkesan mencari tapak tersebut - http://www.sitemaps.org/"
205
 
206
+ #: includes/class-bwp-simple-gxs.php:413
207
+ msgid "This plugin helps you generate both Sitemap Index files as well as normal Sitemap files. A Sitemap Index, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemap files inside it."
208
+ msgstr ""
209
+
210
+ #: includes/class-bwp-simple-gxs.php:414
211
  msgid "<em>Basic information about all your sitemaps.</em>"
212
  msgstr "<em>Maklumat asas tentang keseluruhan pelan tapak anda.</em>"
213
 
214
+ #: includes/class-bwp-simple-gxs.php:415
215
  msgid "<em>More detailed information about how your sitemaps are generated including <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;\">success messages</span>.</em>"
216
  msgstr "<em>Maklumat lebih lanjut tentang bagaimana pelan tapak anda telah dihasilkan termasuk <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">ralat</span> dan juga <span style=\"color: #009900;\">mesej berjaya</span>.</em>"
217
 
218
+ #: includes/class-bwp-simple-gxs.php:416
219
+ #, fuzzy, php-format
220
+ msgid "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
221
  msgstr "<em>Hantar indeks pelan tapak anda kepada enjin carian biasa seperti <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> atau <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
222
 
223
+ #: includes/class-bwp-simple-gxs.php:417
224
  msgid "<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>"
225
  msgstr "<em>Sekarang apabila anda menghantar sesuatu yang baru pada blog anda, anda boleh <em>menguji</em> enjin carian untuk memberitahu mereka bahawa blog anda baru dikemaskinikan. Penghantaran mungkin kurang efektif dari yang anda fikir tetapi anda harus juga benarkan fungsi ini.</em>"
226
 
227
+ #: includes/class-bwp-simple-gxs.php:422
228
  msgid "Selected SE below will be pinged when you publish new posts."
229
  msgstr "SE yang dipilih dibawah akan dihantar apabila anda menerbitkan pos baharu."
230
 
231
+ #: includes/class-bwp-simple-gxs.php:423
232
  msgid "No additional load is needed so enabling this is recommended."
233
  msgstr "Tiada beban tambahan diperlukan jadi membenarkan ini adalah digalakkan."
234
 
235
+ #: includes/class-bwp-simple-gxs.php:424
236
  msgid "Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules."
237
  msgstr "Ralat kecil akan dicetak pada skrin. Juga, apabila debug diaktifkan, tiada caching akan digunakan, berguna apabila anda mengembangkan modul baharu."
238
 
239
+ #: includes/class-bwp-simple-gxs.php:425
240
  msgid "Google"
241
  msgstr "Google"
242
 
243
+ #: includes/class-bwp-simple-gxs.php:426
 
 
 
 
 
244
  msgid "Bing"
245
  msgstr "Bing"
246
 
247
+ #: includes/class-bwp-simple-gxs.php:427
248
  msgid "Ask.com"
249
  msgstr "Ask.com"
250
 
251
+ #: includes/class-bwp-simple-gxs.php:430
252
  #, php-format
253
  msgid "After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href=\"%s\">How-to</a> if you are interested."
254
  msgstr "Apabila anda aktifkan plugin ini, semua pelan tapak sepatutnya sudah berada. Langkah seterusnya ialah dengan menghantar indeks pelan tapak kepada enjin carian. Anda cuma perlu <strong>indeks pelan tapak</strong> dan selain itu, enjin carian secara automatik mengenalpasti pelan tapak yang lain. Anda boleh merujuk <a href=\"%s\">Langkah-langkah</a> jika anda berminat."
255
 
256
+ #: includes/class-bwp-simple-gxs.php:458
257
  msgid "Output no more than"
258
  msgstr "Output tidak lebih dari"
259
 
260
+ #: includes/class-bwp-simple-gxs.php:459
261
  msgid "Default change frequency"
262
  msgstr "Ubah frekuensi lalai"
263
 
264
+ #: includes/class-bwp-simple-gxs.php:460
265
  msgid "Default priority"
266
  msgstr "Keutamaan lalai"
267
 
268
+ #: includes/class-bwp-simple-gxs.php:461
269
  msgid "Minimum priority"
270
  msgstr "Keutamaan minimum"
271
 
272
+ #: includes/class-bwp-simple-gxs.php:462
273
+ msgid "Use GMT for Last Modified date?"
274
+ msgstr ""
 
 
 
 
275
 
276
+ #: includes/class-bwp-simple-gxs.php:463
277
  msgid "Style your sitemaps with an XSLT stylesheet?"
278
  msgstr "Ubah pelan tapak anda dengan gaya lembar XSLT?"
279
 
280
+ #: includes/class-bwp-simple-gxs.php:464
281
  msgid "Custom XSLT stylesheet URL"
282
  msgstr "URL gaya lembar XSLT yang diubah"
283
 
284
+ #: includes/class-bwp-simple-gxs.php:465
285
  msgid "Show build stats in sitemaps?"
286
  msgstr "Papar status bina dalam pelan tapak?"
287
 
288
+ #: includes/class-bwp-simple-gxs.php:466
289
  msgid "Enable credit?"
290
  msgstr "Paparkan penghargaan?"
291
 
292
+ #: includes/class-bwp-simple-gxs.php:467
293
  msgid "Enable Gzip?"
294
  msgstr "Benarkan Gzip?"
295
 
296
+ #: includes/class-bwp-simple-gxs.php:468
297
+ msgid "Clean unexpected output before sitemap generation?"
298
+ msgstr ""
299
+
300
+ #: includes/class-bwp-simple-gxs.php:469
301
+ #, fuzzy
302
+ msgid "Sitemap Index Options"
303
+ msgstr "Penghasilan Pelan Tapak"
304
+
305
+ #: includes/class-bwp-simple-gxs.php:470
306
+ msgid "Automatically split post-based sitemaps into smaller sitemaps?"
307
+ msgstr ""
308
+
309
+ #: includes/class-bwp-simple-gxs.php:471
310
+ #, fuzzy
311
+ msgid "Add sitemapindex to individual blog's virtual robots.txt?"
312
+ msgstr "Tambah indeks pelan tapak kepada WordPress's robots.txt?"
313
+
314
+ #: includes/class-bwp-simple-gxs.php:472
315
+ #, fuzzy
316
+ msgid "Add sitemapindex from all blogs within network to primary blog's virtual robots.txt?"
317
+ msgstr "Tambah indeks pelan tapak kepada WordPress's robots.txt?"
318
+
319
+ #: includes/class-bwp-simple-gxs.php:473
320
+ msgid "In sitemapindex, include"
321
+ msgstr "Di dalam indeks pelan tapak, termasuk"
322
+
323
+ #: includes/class-bwp-simple-gxs.php:474
324
+ msgid "Exclude following post types:"
325
+ msgstr ""
326
+
327
+ #: includes/class-bwp-simple-gxs.php:475
328
+ msgid "Exclude following taxonomies:"
329
+ msgstr ""
330
+
331
+ #: includes/class-bwp-simple-gxs.php:476
332
  msgid "Module Options"
333
  msgstr "Tetapan modul"
334
 
335
+ #: includes/class-bwp-simple-gxs.php:477
336
  msgid "Alternate module directory"
337
  msgstr "Direktori pengganti modul"
338
 
339
+ #: includes/class-bwp-simple-gxs.php:478
340
  msgid "Get no more than"
341
  msgstr "Dapat tidak lebih daripada"
342
 
343
+ #: includes/class-bwp-simple-gxs.php:479
344
  msgid "Caching Options"
345
  msgstr "Tetapan Caching"
346
 
347
+ #: includes/class-bwp-simple-gxs.php:480
348
  msgid "Enable caching?"
349
  msgstr "Benarkan caching?"
350
 
351
+ #: includes/class-bwp-simple-gxs.php:481
352
  msgid "Enable auto cache re-generation?"
353
  msgstr "Benarkan auto cache di-generasi?"
354
 
355
+ #: includes/class-bwp-simple-gxs.php:482
356
  msgid "Cached sitemaps will last for"
357
  msgstr "Pelan tapak yang di-cache-kan akan bertahan selama"
358
 
359
+ #: includes/class-bwp-simple-gxs.php:483
360
  msgid "Cached sitemaps are stored in (auto detected)"
361
  msgstr "Pelan tapak yang di-cache-kan akan disimpan di dalam (auto carian)"
362
 
363
+ #: includes/class-bwp-simple-gxs.php:487
364
  msgid "<em>Cache your sitemaps for better performance.</em>"
365
  msgstr "<em>Cache pelan tapak anda untuk prestasi yang memberangsangkan.</em>"
366
 
367
+ #: includes/class-bwp-simple-gxs.php:488
368
  #, php-format
369
  msgid "<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href=\"%s#using-modules\">here</a>.</em>"
370
  msgstr "<em>Plugin ini menggunakan modul untuk membina data pelan tapak jadi digalakkan untuk anda mengembangkan plugin ini menggunakan modul-modul berbanding dikait. Salah satu daripada tetapan dibawah hanya mempengaruhi dalam memperluas kelas modul asas.Lebih lanjut tentang penggunaan modul <a href=\"%s#using-modules\">disini</a>.</em>"
371
 
372
+ #: includes/class-bwp-simple-gxs.php:489
373
+ msgid "<em>Here you can change some settings that affect the default Sitemap Index file.</em>"
374
+ msgstr ""
375
+
376
+ #: includes/class-bwp-simple-gxs.php:503
377
+ #: includes/class-bwp-simple-gxs.php:509
378
  msgid "second(s)"
379
  msgstr "saat"
380
 
381
+ #: includes/class-bwp-simple-gxs.php:504
382
+ #: includes/class-bwp-simple-gxs.php:510
383
  msgid "minute(s)"
384
  msgstr "minit"
385
 
386
+ #: includes/class-bwp-simple-gxs.php:505
387
+ #: includes/class-bwp-simple-gxs.php:511
388
  msgid "hour(s)"
389
  msgstr "jam"
390
 
391
+ #: includes/class-bwp-simple-gxs.php:506
392
+ #: includes/class-bwp-simple-gxs.php:512
393
  msgid "day(s)"
394
  msgstr "hari"
395
 
396
+ #: includes/class-bwp-simple-gxs.php:519
397
+ #: includes/class-bwp-simple-gxs.php:520
398
+ #: includes/class-bwp-simple-gxs.php:521
399
  msgid "read more"
400
  msgstr "lebih lanjut"
401
 
402
+ #: includes/class-bwp-simple-gxs.php:524
403
  msgid "your sitemaps are generated and then cached to reduce unnecessary work."
404
  msgstr "pelan tapak anda telah dihasilkan dan kemudian di-cache-kan untuk mengurangkan kerja yang diperlukan."
405
 
406
+ #: includes/class-bwp-simple-gxs.php:525
407
  msgid "when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while."
408
  msgstr "apabila cache pelan tapak luput, plugin ini akan cuba untuk menghasilkan cache lagi. Jika anda tidak membenarkan ini, waspada untuk membuang cache secara manual sekali sekala."
409
 
410
+ #: includes/class-bwp-simple-gxs.php:525
411
  msgid "Flush the cache"
412
  msgstr "Buang cache"
413
 
414
+ #: includes/class-bwp-simple-gxs.php:526
415
  msgid "tell you useful information such as build time, memory usage, SQL queries, etc."
416
  msgstr "beritahu anda maklumat seperti masa bina, pengunaan memori, maklumat SQL dan lain-lain."
417
 
418
+ #: includes/class-bwp-simple-gxs.php:527
419
  #, php-format
420
+ msgid "make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an error after enabling this, it's very likely that you have gzip active on your server already."
421
+ msgstr ""
422
 
423
+ #: includes/class-bwp-simple-gxs.php:528
424
+ msgid "only disable this when sitemaps appear in either blank page or plain text."
425
+ msgstr ""
426
+
427
+ #: includes/class-bwp-simple-gxs.php:529
428
+ #, php-format
429
+ msgid "If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex.xml</code> entries will be added to your primary blog's robots.txt, i.e. <code>%s</code>."
430
+ msgstr ""
431
 
432
+ #: includes/class-bwp-simple-gxs.php:530
433
  msgid "taxonomy archives' sitemaps, including custom taxonomies."
434
  msgstr "menamakan arkib pelan tapak, termasuk yang diubahsuai."
435
 
436
+ #: includes/class-bwp-simple-gxs.php:532
 
 
 
 
437
  msgid "date archives' sitemaps."
438
  msgstr "tarikh arkib pelan tapak."
439
 
440
+ #: includes/class-bwp-simple-gxs.php:533
441
+ msgid "external pages' sitemap. This allows you to add links to pages that do not belong to WordPress to the sitemap."
442
+ msgstr ""
443
+
444
+ #: includes/class-bwp-simple-gxs.php:534
445
  msgid "some copyrighted info is also added to your sitemaps. Thanks!"
446
  msgstr "sedikit maklumat hakcipta juga akan ditambah pada pelan tapak anda. Terima kasih! "
447
 
448
+ #: includes/class-bwp-simple-gxs.php:535
449
+ #, fuzzy
450
+ msgid "This will load the default style sheet provided by this plugin. You can set a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook."
451
  msgstr "Ini akan menambah gaya lembar lalai yang dibekalkan dengan plugin ini. Anda boleh menetapkan gaya lembar yang diubahsuai di bawah atau dengan menapis <code>bwp_gxs_xslt</code>."
452
 
453
+ #: includes/class-bwp-simple-gxs.php:536
454
  #, php-format
455
  msgid "If you're on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more info."
456
  msgstr "Jika anda di dalam Multi-tapak pemasangan dengan Sub-domain digunakan, setiap tapak akan ada setiap robot.txt sendiri, manakala tapak di dalam sub- direktori adalah sebaliknya. Sila rujuk <a href=\"%s#toc-robots\" target=\"_blank\">dokumentasi</a> untuk maklumat terperinci."
457
 
458
+ #: includes/class-bwp-simple-gxs.php:537
459
+ msgid "e.g. post1.xml, post2.xml, etc. And each sitemap will contain"
460
+ msgstr ""
461
+
462
+ #: includes/class-bwp-simple-gxs.php:538
463
+ msgid "If you disable this, make sure you also use <code>date_default_timezone_set</code> to correctly set up a timezone for your application."
464
+ msgstr ""
465
+
466
+ #: includes/class-bwp-simple-gxs.php:539
467
+ #, fuzzy
468
+ msgid "author archives' sitemap."
469
+ msgstr "tarikh arkib pelan tapak."
470
+
471
+ #: includes/class-bwp-simple-gxs.php:540
472
+ msgid "site's home URL sitemap. For a multi-site installation of WordPress, this sitemap will list all domains within your network, not just the main blog. This also supports WPMU Domain Mapping plugin."
473
+ msgstr ""
474
+
475
+ #: includes/class-bwp-simple-gxs.php:543
476
+ #, fuzzy
477
+ msgid "item(s) in one sitemap. You can not go over 50,000."
478
  msgstr "item di dalam satu pelan tapak. Akan tetapi, 5000 adalah lebih sesuai. Anda tidak boleh melebihi 50,000, walaubagaimanapun."
479
 
480
+ #: includes/class-bwp-simple-gxs.php:544
481
+ msgid "item(s). Again , you can not go over 50,000."
482
+ msgstr ""
483
+
484
+ #: includes/class-bwp-simple-gxs.php:545
485
  msgid "Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead."
486
  msgstr "Masuk ruang penuh untuk direktori dimana anda meletak modul anda sendiri (contoh <code>/home/mysite/public_html/gxs-modules/</code>), anda juga boleh melebih-naik modul yang terbina dengan mendapat nama modul fail yang sama di dalam direktori. Penapis juga tersedia jika anda mahu menggunakan PHP."
487
 
488
+ #: includes/class-bwp-simple-gxs.php:546
489
  msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
490
  msgstr "Cache direktori harus boleh ditulis (i.e. CHMOD to 755 or 777)."
491
 
492
+ #: includes/class-bwp-simple-gxs.php:547
493
  msgid "item(s) in one SQL query. This helps you avoid running too heavy queries."
494
  msgstr "item-item di dalam satu maklumat SQL. Ini membantu anda untuk menghindar dari menggunakan maklumat terlalu banyak."
495
 
496
+ #: includes/class-bwp-simple-gxs.php:550
497
  msgid "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use."
498
  msgstr "jangkaan untuk menjadi URL tetap, contohnya <code>http://example.com/my-stylesheet.xsl</code>. Anda juga harus mempunyai gaya lembar untuk indeks pelan tapak yang mana boleh di akses melalui URL di atas, contohnya <code>my-stylesheet.xsl</code> dan <code>my-stylesheetindex.xsl</code>). Sila tinggalkan kosong sekiranya anda tidak berhasrat untuk menggunakannya."
499
 
500
+ #: includes/class-bwp-simple-gxs.php:557
501
+ #, php-format
502
+ msgid "<em><strong>Note:</strong> If you encounter white page problem, please refer to the <a target=\"_blank\" href=\"%s\">FAQ section</a> to know how to change this limit appropriately to make this plugin work. Also note that, for post-based sitemaps, this option will be overridden by the limit you set in the Sitemap Index Options below.</em>"
503
+ msgstr ""
504
+
505
+ #: includes/class-bwp-simple-gxs.php:659
506
+ #, fuzzy
507
+ msgid "What is a Google News Sitemap?"
508
+ msgstr "Apa itu Pelan tapak?"
509
+
510
+ #: includes/class-bwp-simple-gxs.php:660
511
+ msgid "Enable this module?"
512
+ msgstr ""
513
+
514
+ #: includes/class-bwp-simple-gxs.php:661
515
+ msgid "Enable Multi-category Mode?"
516
+ msgstr ""
517
+
518
+ #: includes/class-bwp-simple-gxs.php:662
519
+ msgid "Ping Search Engines when you publish a news article?"
520
+ msgstr ""
521
+
522
+ #: includes/class-bwp-simple-gxs.php:663
523
+ msgid "Use keywords in News Sitemap?"
524
+ msgstr ""
525
+
526
+ #: includes/class-bwp-simple-gxs.php:664
527
+ msgid "News Sitemap's language"
528
+ msgstr ""
529
+
530
+ #: includes/class-bwp-simple-gxs.php:665
531
+ msgid "News Categories"
532
+ msgstr ""
533
+
534
+ #: includes/class-bwp-simple-gxs.php:666
535
+ msgid "This module will"
536
+ msgstr ""
537
+
538
+ #: includes/class-bwp-simple-gxs.php:670
539
+ msgid "A Google News Sitemap is a file that allows you to control which content you submit to Google News. By creating and submitting a Google News Sitemap, you're able to help Google News discover and crawl your site's articles &mdash; <em>http://support.google.com/</em>"
540
+ msgstr ""
541
+
542
+ #: includes/class-bwp-simple-gxs.php:671
543
+ msgid "<em>Below you will be able to choose what categories to use (or not use) in the news sitemap. You can also assign genres to a specific category.</em>"
544
+ msgstr ""
545
+
546
+ #: includes/class-bwp-simple-gxs.php:674
547
+ msgid "below selected categories in the news sitemap."
548
+ msgstr ""
549
+
550
+ #: includes/class-bwp-simple-gxs.php:679
551
+ msgid "English"
552
+ msgstr ""
553
+
554
+ #: includes/class-bwp-simple-gxs.php:680
555
+ msgid "French"
556
+ msgstr ""
557
+
558
+ #: includes/class-bwp-simple-gxs.php:681
559
+ msgid "Spanish"
560
+ msgstr ""
561
+
562
+ #: includes/class-bwp-simple-gxs.php:682
563
+ msgid "German"
564
+ msgstr ""
565
+
566
+ #: includes/class-bwp-simple-gxs.php:683
567
+ msgid "Portuguese"
568
+ msgstr ""
569
+
570
+ #: includes/class-bwp-simple-gxs.php:684
571
+ msgid "Polish"
572
+ msgstr ""
573
+
574
+ #: includes/class-bwp-simple-gxs.php:685
575
+ msgid "Norwegian"
576
+ msgstr ""
577
+
578
+ #: includes/class-bwp-simple-gxs.php:686
579
+ msgid "Dutch"
580
+ msgstr ""
581
+
582
+ #: includes/class-bwp-simple-gxs.php:687
583
+ msgid "Italian"
584
+ msgstr ""
585
+
586
+ #: includes/class-bwp-simple-gxs.php:688
587
+ msgid "Vietnamese"
588
+ msgstr ""
589
+
590
+ #: includes/class-bwp-simple-gxs.php:689
591
+ msgid "Simplified Chinese"
592
+ msgstr ""
593
+
594
+ #: includes/class-bwp-simple-gxs.php:692
595
+ msgid "include"
596
+ msgstr ""
597
+
598
+ #: includes/class-bwp-simple-gxs.php:693
599
+ msgid "exclude"
600
+ msgstr ""
601
+
602
+ #: includes/class-bwp-simple-gxs.php:696
603
+ msgid "news categories"
604
+ msgstr ""
605
+
606
+ #: includes/class-bwp-simple-gxs.php:697
607
+ msgid "news tags"
608
+ msgstr ""
609
+
610
+ #: includes/class-bwp-simple-gxs.php:703
611
+ msgid "A new <code>post_google_news.xml</code> sitemap will be added to the main <code>sitemapindex.xml</code>."
612
+ msgstr ""
613
+
614
+ #: includes/class-bwp-simple-gxs.php:704
615
+ msgid "Keywords are derived from"
616
+ msgstr ""
617
 
618
+ #: includes/class-bwp-simple-gxs.php:705
619
+ msgid "This ping works separately from the sitemapindex ping, and only occurs when you publish an article in one of the news categories set below."
620
+ msgstr ""
621
+
622
+ #: includes/class-bwp-simple-gxs.php:706
623
+ msgid "This mode is meant for News Blogs that have posts assigned to more than one categories. It is an advanced feature and should only be enabled if you do have similar blogs."
624
+ msgstr ""
625
+
626
+ #: includes/class-bwp-simple-gxs.php:712
627
+ msgid ". Do <strong>NOT</strong> use news tags if your news sitemap contains a lot of posts as it can be very inefficient to do so. This will be improved in future versions."
628
+ msgstr ""
629
+
630
+ #: includes/class-bwp-simple-gxs.php:736
631
  #, php-format
632
  msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
633
  msgstr "<strong>%d</strong> pelan tapak yang di-cache-kan telah di buang!"
634
 
635
+ #: includes/class-bwp-simple-gxs.php:738
636
  msgid "Could not delete any cached sitemaps. Please manually check the cache directory."
637
  msgstr "Tidak boleh buang mana-mana pelan tapak yang telah di-cache-kan. Sila rujuk cache direktori secara manual."
638
 
639
+ #: includes/class-bwp-simple-gxs.php:787
640
+ msgid "All options have been saved."
641
+ msgstr ""
642
+
643
+ #: includes/class-bwp-simple-gxs.php:809
644
  msgid "Warning"
645
  msgstr "Amaran"
646
 
647
+ #: includes/class-bwp-simple-gxs.php:809
648
  msgid "Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix)."
649
  msgstr "Direktori cache tidak wujud atau tidak boleh dibaca. Sila rujuk direktori berkenaan kebenaran <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>disini</a> (Unix)."
650
 
651
+ #: includes/class-bwp-simple-gxs.php:820
652
+ msgid "Clear All Logs"
653
+ msgstr ""
654
+
655
+ #: includes/class-bwp-simple-gxs.php:874
656
  msgid "(Debug is on)"
657
  msgstr "(Debug dibuka)"
658
 
659
+ #: includes/class-bwp-simple-gxs.php:887
660
  msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
661
  msgstr "<strong>Google XML Pelan tapak BWP Ralat:</strong>"
662
 
663
+ #: includes/class-bwp-simple-gxs.php:887
664
  msgid "BWP Google XML Sitemaps Error"
665
  msgstr "Google XML Pelan tapak BWP Ralat"
666
 
667
+ #: includes/class-bwp-simple-gxs.php:910
668
  #, php-format
669
  msgid "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> first!"
670
  msgstr "Tiada disini...lagi! Cuba hantar <a href=\"%s\">indeks pelan tapak</a> anda dahulu!"
671
 
672
+ #: includes/class-bwp-simple-gxs.php:910
673
  msgid "No log yet!"
674
  msgstr "Tiada log lagi!"
675
 
676
+ #: includes/class-bwp-simple-gxs.php:921
 
 
 
 
 
677
  #, php-format
678
  msgid "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on <strong>%s</strong>."
679
  msgstr "<a href=\"%s\" target=\"_blank\">%s</a> telah berjaya dibina <strong>%s</strong>."
680
 
681
+ #: includes/class-bwp-simple-gxs.php:932
682
+ #: includes/class-bwp-simple-gxs.php:949
683
  msgid "M j, Y : H:i:s"
684
  msgstr "M j, Y : H:i:s"
685
 
686
+ #: includes/class-bwp-simple-gxs.php:1018
687
+ msgid "Category's name"
688
+ msgstr ""
689
+
690
+ #: includes/class-bwp-simple-gxs.php:1018
691
+ #, php-format
692
+ msgid "<span>Genres used for this category</span> (more info <a href=\"%s\" target=\"_blank\">here</a>)"
693
+ msgstr ""
694
+
695
+ #: includes/class-bwp-simple-gxs.php:1309
696
  #, php-format
697
  msgid "Requested module (<em>%s</em>) not found or not allowed."
698
  msgstr "Modul yang diminta (<em>%s</em>) tidak dijumpai atau tidak dibenarkan."
699
 
700
+ #: includes/class-bwp-simple-gxs.php:1368
701
+ #: includes/class-bwp-simple-gxs.php:1389
702
  #, php-format
703
  msgid "Loaded a custom sub-module file: <strong>%s</strong>."
704
  msgstr "Lain-lain fail sub-modul telah dibekalkan: <strong>%s</strong>."
705
 
706
+ #: includes/class-bwp-simple-gxs.php:1377
707
  #, php-format
708
  msgid "Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead."
709
  msgstr "Fail sub-module yang dikategorikan: <strong>%s</strong> tidak terdapat di dalam kedua-dua lalai dan lain-lain direktori modul. Plugin sekarang akan cuba untuk menggunakan sub-modul."
710
 
711
+ #: includes/class-bwp-simple-gxs.php:1397
712
  #, php-format
713
  msgid "Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead."
714
  msgstr "Fail sub-modul: <strong>%s</strong> tidak terdapat di dalam kedua-dua lalai dan juga lain-lain direktori modul. Plugin akan cuba menggunakan modul utama."
715
 
716
+ #: includes/class-bwp-simple-gxs.php:1411
717
  #, php-format
718
  msgid "Loaded a custom module file: <strong>%s</strong>."
719
  msgstr "Menggunakan lain-lain fail modul: <strong>%s</strong>."
720
 
721
+ #: includes/class-bwp-simple-gxs.php:1417
722
  #, php-format
723
  msgid "Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists."
724
  msgstr "Tidak boleh menggunakan fail modul: <strong>%s</strong> di kedua-dua lalai dan juga lain-lain direktori modul. Sila semak semula jika fail modul itu wujud."
725
 
726
+ #: includes/class-bwp-simple-gxs.php:1437
727
  #, php-format
728
  msgid "There is no class named <strong>%s</strong> in the module file <strong>%s</strong>."
729
  msgstr "Tiada kelas dinamakan <strong>%s</strong> di dalam fail modul <strong>%s</strong>."
730
 
731
+ #: includes/class-bwp-simple-gxs.php:1446
732
  #, php-format
733
  msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
734
  msgstr "Menggunakan lain-lain fail modul indeks pelan tapak: <strong>%s</strong>."
735
 
736
+ #: includes/class-bwp-simple-gxs.php:1469
737
  #, php-format
738
  msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
739
  msgstr "Berjaya menghasilkan <em>%s.xml</em> menggunakan modul <em>%s</em>."
740
 
741
+ #: includes/class-bwp-simple-gxs.php:1500
742
+ msgid "<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of the time PHP errors) is preventing BWP GXS from showing any sitemap contents. Try disabling <code>WP_DEBUG</code> or this plugin's debug mode, whichever is on. All unexpected outputs should be shown just above this message. If you don't see any, contact me and I might be able to help."
743
+ msgstr ""
744
+
745
+ #: includes/class-bwp-simple-gxs.php:1630
746
+ msgid "Unknown response code from search engines. Ping failed."
747
+ msgstr ""
748
+
749
+ #: includes/class-bwp-simple-gxs.php:1632
750
+ #, fuzzy, php-format
751
+ msgid "Pinged %s with %s successfully!"
752
  msgstr "Penghantaran berjaya %s !"
753
 
754
+ #: includes/class-bwp-simple-gxs.php:1637
755
+ #, php-format
756
+ msgid "Error %s from %s"
757
+ msgstr ""
758
+
759
+ #: includes/class-bwp-simple-gxs.php:1642
760
  #, php-format
761
  msgid "Ping limit for today to %s has been reached, sorry!"
762
  msgstr "Had menghantar untuk hari ini kepada %s telah dicapai, maaf!"
763
 
764
+ #: includes/class-bwp-simple-gxs.php:1670
765
+ #, fuzzy, php-format
766
+ msgid "<em>%s.xml</em> does not have any item. You can fix this easily by excluding any post types / terms you do not use in <em>Sitemap Generator</em> tab within your admin area. If you still see this error, consider checking the module that generates this sitemap (<em>%s.php</em>)."
767
  msgstr "<em>%s.xml</em> tiada apa-apa item. Plugin telah membuang permulaan 404 kepada enjian carian yang memintanya. Anda seharusnya meninjau modul yang menghasilkan pelan tapak itu (<em>%s.php</em>)."
768
 
769
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:80
770
  msgid "Plugin Configurations"
771
  msgstr "Tetapan Plugin"
772
 
773
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:398
774
  msgid "Save Changes"
775
  msgstr "Simpan Perubahan"
776
 
777
+ #~ msgid "log"
778
+ #~ msgstr "log"
779
+
780
+ #~ msgid "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
781
+ #~ msgstr "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">penting</a>"
782
+
783
+ #~ msgid "make your sitemaps ~ 70% smaller."
784
+ #~ msgstr "membuat pelan tapak anda 70% lebih kecil."
785
+
786
+ #~ msgid "static pages' sitemap."
787
+ #~ msgstr "pelan tapak muka statik."
788
+
789
+ #~ msgid "tag archives' sitemaps."
790
+ #~ msgstr "Lekat arkib pelan tapak."
791
+
792
+ #~ msgid "%s"
793
+ #~ msgstr "%s"
languages/bwp-simple-gxs-ro_RO.mo ADDED
Binary file
languages/bwp-simple-gxs-ro_RO.po ADDED
@@ -0,0 +1,793 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: BWP Google XML Sitemaps(Malay Translation)\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-03 20:10+0700\n"
6
+ "PO-Revision-Date: 2012-04-03 20:10+0700\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: <darkcry3r@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Language: Malay\n"
17
+ "X-Poedit-Country: MALAYSIA\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: includes/class-bwp-framework.php:177
21
+ #, php-format
22
+ msgid "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin."
23
+ msgstr "%s are nevoie de versiunea WordPress <strong>%s</strong>sau mai mare si PHP <strong>%s</strong> sau mai mare . Pluginul nu va functiona pana nu actualizati versiunile de software. Va rugam dezactivati pluginul."
24
+
25
+ #: includes/class-bwp-framework.php:188
26
+ msgid "Development Log"
27
+ msgstr ""
28
+
29
+ #: includes/class-bwp-framework.php:188
30
+ msgid "Frequently Asked Questions"
31
+ msgstr ""
32
+
33
+ #: includes/class-bwp-framework.php:188
34
+ msgid "FAQ"
35
+ msgstr ""
36
+
37
+ #: includes/class-bwp-framework.php:188
38
+ msgid "Got a problem? Send me a feedback!"
39
+ msgstr ""
40
+
41
+ #: includes/class-bwp-framework.php:188
42
+ msgid "Contact"
43
+ msgstr ""
44
+
45
+ #: includes/class-bwp-framework.php:195
46
+ #, fuzzy
47
+ msgid "You can buy me some special coffees if you appreciate my work, thank you!"
48
+ msgstr "Imi poti face cinste cu o cafea daca apreciezi munca mea, mersi!"
49
+
50
+ #: includes/class-bwp-framework.php:209
51
+ msgid "Donate to "
52
+ msgstr ""
53
+
54
+ #: includes/class-bwp-framework.php:211
55
+ msgid "One cup $5.00"
56
+ msgstr ""
57
+
58
+ #: includes/class-bwp-framework.php:212
59
+ msgid "Two cups $10.00"
60
+ msgstr ""
61
+
62
+ #: includes/class-bwp-framework.php:213
63
+ msgid "Five cups! $25.00"
64
+ msgstr ""
65
+
66
+ #: includes/class-bwp-framework.php:214
67
+ msgid "One LL-cup!!! $50.00"
68
+ msgstr ""
69
+
70
+ #: includes/class-bwp-framework.php:215
71
+ msgid "... or any amount!"
72
+ msgstr ""
73
+
74
+ #: includes/class-bwp-framework.php:230
75
+ msgid "Latest updates from BetterWP.net!"
76
+ msgstr ""
77
+
78
+ #: includes/class-bwp-framework.php:231
79
+ msgid "Follow me on Twitter!"
80
+ msgstr ""
81
+
82
+ #: includes/class-bwp-framework.php:240
83
+ #, php-format
84
+ msgid "You are using version %s!"
85
+ msgstr "Folositi versiunea %s!"
86
+
87
+ #: includes/class-bwp-framework.php:385
88
+ msgid "Settings"
89
+ msgstr "Setari"
90
+
91
+ #: includes/class-bwp-gxs-cache.php:34
92
+ #, php-format
93
+ msgid "Cache directory (\"%s\") does not exist or is not writable."
94
+ msgstr "Directorul de cache (\"%s\") nu exista sau nu este accesibil."
95
+
96
+ #: includes/class-bwp-gxs-cache.php:56
97
+ #, php-format
98
+ msgid "Cache file for module <em>%s</em> is not found and will be built right away."
99
+ msgstr "Fisierul de cache pentru modulul <em>%s</em> nu a fost gasit si va fi creat imediat."
100
+
101
+ #: includes/class-bwp-gxs-cache.php:108
102
+ #: includes/class-bwp-simple-gxs.php:1341
103
+ #, php-format
104
+ msgid "Successfully served a cached version of <em>%s.xml</em>."
105
+ msgstr "S-a servit cu succes o versiune din cache a <em>%s.xml</em>."
106
+
107
+ #: includes/class-bwp-simple-gxs.php:141
108
+ #: includes/class-bwp-simple-gxs.php:347
109
+ #: includes/class-bwp-simple-gxs.php:354
110
+ msgid "Sitemap Statistics"
111
+ msgstr "Statistici sitemap"
112
+
113
+ #: includes/class-bwp-simple-gxs.php:142
114
+ #: includes/class-bwp-simple-gxs.php:348
115
+ #: includes/class-bwp-simple-gxs.php:355
116
+ msgid "Sitemap Generator"
117
+ msgstr "Generator de sitemap"
118
+
119
+ #: includes/class-bwp-simple-gxs.php:143
120
+ #: includes/class-bwp-simple-gxs.php:349
121
+ #: includes/class-bwp-simple-gxs.php:356
122
+ #, fuzzy
123
+ msgid "News Sitemap"
124
+ msgstr "Ce sunt sitemap-urile?"
125
+
126
+ #: includes/class-bwp-simple-gxs.php:174
127
+ #, php-format
128
+ msgid "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
129
+ msgstr "Acest sitemap a fost generat in %s secunde (Memorie folosita: %s) - %s interogari - %s URL(-uri) listate"
130
+
131
+ #: includes/class-bwp-simple-gxs.php:347
132
+ #: includes/class-bwp-simple-gxs.php:354
133
+ msgid "BWP Google XML Sitemaps Statistics"
134
+ msgstr "Statistici BWP Google XML Sitemaps"
135
+
136
+ #: includes/class-bwp-simple-gxs.php:348
137
+ #: includes/class-bwp-simple-gxs.php:355
138
+ msgid "BWP Google XML Sitemaps Generator"
139
+ msgstr "Generator BWP Google XML Sitemaps "
140
+
141
+ #: includes/class-bwp-simple-gxs.php:349
142
+ #: includes/class-bwp-simple-gxs.php:356
143
+ #, fuzzy
144
+ msgid "BWP Google News XML Sitemap"
145
+ msgstr "BWP Google XML Sitemaps"
146
+
147
+ #: includes/class-bwp-simple-gxs.php:353
148
+ msgid "BWP Google XML Sitemaps"
149
+ msgstr "BWP Google XML Sitemaps"
150
+
151
+ #: includes/class-bwp-simple-gxs.php:368
152
+ msgid "You do not have sufficient permissions to access this page."
153
+ msgstr "Nu aveti permisiuni suficiente pentru a accesa aceasta pagina."
154
+
155
+ #: includes/class-bwp-simple-gxs.php:389
156
+ #: includes/class-bwp-simple-gxs.php:736
157
+ #: includes/class-bwp-simple-gxs.php:738
158
+ msgid "Notice"
159
+ msgstr "Notificare"
160
+
161
+ #: includes/class-bwp-simple-gxs.php:389
162
+ msgid "All logs have been cleared successfully!"
163
+ msgstr ""
164
+
165
+ #: includes/class-bwp-simple-gxs.php:396
166
+ msgid "What are Sitemaps?"
167
+ msgstr "Ce sunt sitemap-urile?"
168
+
169
+ #: includes/class-bwp-simple-gxs.php:397
170
+ msgid "Your sitemaps"
171
+ msgstr "Sitemap-urile tale"
172
+
173
+ #: includes/class-bwp-simple-gxs.php:398
174
+ msgid "Submit your sitemaps"
175
+ msgstr "Inscrie un sitemap"
176
+
177
+ #: includes/class-bwp-simple-gxs.php:399
178
+ msgid "Pinging search engines"
179
+ msgstr "Ping motoarelor de cautare"
180
+
181
+ #: includes/class-bwp-simple-gxs.php:400
182
+ msgid "Enable pinging functionality?"
183
+ msgstr "Activeaza functionalitate de ping"
184
+
185
+ #: includes/class-bwp-simple-gxs.php:401
186
+ msgid "Enable pinging individual SE"
187
+ msgstr "Activeaza pinging invididual al motoarelor de cautare"
188
+
189
+ #: includes/class-bwp-simple-gxs.php:402
190
+ msgid "Sitemap Generator's Log"
191
+ msgstr "Log-ul generatorului de sitemap"
192
+
193
+ #: includes/class-bwp-simple-gxs.php:403
194
+ msgid "Enable logging?"
195
+ msgstr "Permite logarea?"
196
+
197
+ #: includes/class-bwp-simple-gxs.php:404
198
+ msgid "Enable debugging?"
199
+ msgstr "Permite debugging?"
200
+
201
+ #: includes/class-bwp-simple-gxs.php:413
202
+ #, fuzzy
203
+ msgid "In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; <em>http://www.sitemaps.org/</em>"
204
+ msgstr "In forma sa simpla, un sitemap e un fisier XML care listeaza toate URL-urile unui site, impreuna cu meta data despre fiecare URL (cand a fost actualizat, cat de des, importanta sa) pentru ca motoarele de cautare sa indexeze mai bine site-ul - http://www.sitemaps.org/"
205
+
206
+ #: includes/class-bwp-simple-gxs.php:413
207
+ msgid "This plugin helps you generate both Sitemap Index files as well as normal Sitemap files. A Sitemap Index, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemap files inside it."
208
+ msgstr ""
209
+
210
+ #: includes/class-bwp-simple-gxs.php:414
211
+ msgid "<em>Basic information about all your sitemaps.</em>"
212
+ msgstr "<em>Informatii de baza despre sitemap-urile tale.</em>"
213
+
214
+ #: includes/class-bwp-simple-gxs.php:415
215
+ msgid "<em>More detailed information about how your sitemaps are generated including <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;\">success messages</span>.</em>"
216
+ msgstr "<em>MaMai multe detalii despre cum sitemap-urile sunt generate, incluzand <span style=\"color: #999999;\">notificari</span>, <span style=\"color: #FF0000;\">erori</span> si <span style=\"color: #009900;\">confirmari</span>.</em>"
217
+
218
+ #: includes/class-bwp-simple-gxs.php:416
219
+ #, fuzzy, php-format
220
+ msgid "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
221
+ msgstr "<em>Inscrie sitemapindex in motoarele de cautare mari precum <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> sau <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
222
+
223
+ #: includes/class-bwp-simple-gxs.php:417
224
+ msgid "<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>"
225
+ msgstr "<em>Acum, cand scrii ceva nou pe blog, poti <em>pingui</em> motoarele de cautare, spunandu-le ca blogul tau a fost actualizat. Ping-ul ar putea fi mai putin eficient decat crezi dar aceasta functionalitate ar trebui activata.</em>"
226
+
227
+ #: includes/class-bwp-simple-gxs.php:422
228
+ msgid "Selected SE below will be pinged when you publish new posts."
229
+ msgstr "Motoarele de cautare selectate vor fi ping-uite cand publicati posturi noi."
230
+
231
+ #: includes/class-bwp-simple-gxs.php:423
232
+ msgid "No additional load is needed so enabling this is recommended."
233
+ msgstr "Activarea acestei functii este recomandata."
234
+
235
+ #: includes/class-bwp-simple-gxs.php:424
236
+ msgid "Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules."
237
+ msgstr "Erori minore vor fi afisate. De asemenea, cand debugging-ul este activ sau cand nu este facut cache."
238
+
239
+ #: includes/class-bwp-simple-gxs.php:425
240
+ msgid "Google"
241
+ msgstr "Google"
242
+
243
+ #: includes/class-bwp-simple-gxs.php:426
244
+ msgid "Bing"
245
+ msgstr "Bing"
246
+
247
+ #: includes/class-bwp-simple-gxs.php:427
248
+ msgid "Ask.com"
249
+ msgstr "Ask.com"
250
+
251
+ #: includes/class-bwp-simple-gxs.php:430
252
+ #, php-format
253
+ msgid "After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href=\"%s\">How-to</a> if you are interested."
254
+ msgstr "Dupa ce activezi acest plugin, toate sitemap-urile vor fi disponibile imediat. Urmatorul pas este sa submiti sitemapindex in motoarele de cautare. Nu ai nevoie decat de <strong>sitemapindex</strong> motoarele de cautare vor recunoaste alte sitemap-uri incluse. Poti citi un mic <a href=\"%s\">ghid</a> daca te intereseaza."
255
+
256
+ #: includes/class-bwp-simple-gxs.php:458
257
+ msgid "Output no more than"
258
+ msgstr "Output pentru numai"
259
+
260
+ #: includes/class-bwp-simple-gxs.php:459
261
+ msgid "Default change frequency"
262
+ msgstr "Frecventa de schimbare prestabilit"
263
+
264
+ #: includes/class-bwp-simple-gxs.php:460
265
+ msgid "Default priority"
266
+ msgstr "Prioritate prestabilita"
267
+
268
+ #: includes/class-bwp-simple-gxs.php:461
269
+ msgid "Minimum priority"
270
+ msgstr "Prioritate minima"
271
+
272
+ #: includes/class-bwp-simple-gxs.php:462
273
+ msgid "Use GMT for Last Modified date?"
274
+ msgstr ""
275
+
276
+ #: includes/class-bwp-simple-gxs.php:463
277
+ msgid "Style your sitemaps with an XSLT stylesheet?"
278
+ msgstr "Foloseste un stylesheet XSLT pentru sitemap-urile tale"
279
+
280
+ #: includes/class-bwp-simple-gxs.php:464
281
+ msgid "Custom XSLT stylesheet URL"
282
+ msgstr "Stylesheet URL XSLT customizat"
283
+
284
+ #: includes/class-bwp-simple-gxs.php:465
285
+ msgid "Show build stats in sitemaps?"
286
+ msgstr "Arata statisticile de la generare in sitemap-uri?"
287
+
288
+ #: includes/class-bwp-simple-gxs.php:466
289
+ msgid "Enable credit?"
290
+ msgstr "Crediteaza?"
291
+
292
+ #: includes/class-bwp-simple-gxs.php:467
293
+ msgid "Enable Gzip?"
294
+ msgstr "Activeaza Gzip?"
295
+
296
+ #: includes/class-bwp-simple-gxs.php:468
297
+ msgid "Clean unexpected output before sitemap generation?"
298
+ msgstr ""
299
+
300
+ #: includes/class-bwp-simple-gxs.php:469
301
+ #, fuzzy
302
+ msgid "Sitemap Index Options"
303
+ msgstr "Generator de sitemap"
304
+
305
+ #: includes/class-bwp-simple-gxs.php:470
306
+ msgid "Automatically split post-based sitemaps into smaller sitemaps?"
307
+ msgstr ""
308
+
309
+ #: includes/class-bwp-simple-gxs.php:471
310
+ #, fuzzy
311
+ msgid "Add sitemapindex to individual blog's virtual robots.txt?"
312
+ msgstr "Adauga sitemapindex in WordPress's robots.txt?"
313
+
314
+ #: includes/class-bwp-simple-gxs.php:472
315
+ #, fuzzy
316
+ msgid "Add sitemapindex from all blogs within network to primary blog's virtual robots.txt?"
317
+ msgstr "Adauga sitemapindex in WordPress's robots.txt?"
318
+
319
+ #: includes/class-bwp-simple-gxs.php:473
320
+ msgid "In sitemapindex, include"
321
+ msgstr "In sitemapindex, include"
322
+
323
+ #: includes/class-bwp-simple-gxs.php:474
324
+ msgid "Exclude following post types:"
325
+ msgstr ""
326
+
327
+ #: includes/class-bwp-simple-gxs.php:475
328
+ msgid "Exclude following taxonomies:"
329
+ msgstr ""
330
+
331
+ #: includes/class-bwp-simple-gxs.php:476
332
+ msgid "Module Options"
333
+ msgstr "Optiunile modulului"
334
+
335
+ #: includes/class-bwp-simple-gxs.php:477
336
+ msgid "Alternate module directory"
337
+ msgstr "Alterneaza directorul modulului"
338
+
339
+ #: includes/class-bwp-simple-gxs.php:478
340
+ msgid "Get no more than"
341
+ msgstr "Ia numai"
342
+
343
+ #: includes/class-bwp-simple-gxs.php:479
344
+ msgid "Caching Options"
345
+ msgstr "Optiuni de cache"
346
+
347
+ #: includes/class-bwp-simple-gxs.php:480
348
+ msgid "Enable caching?"
349
+ msgstr "Activeaza cache?"
350
+
351
+ #: includes/class-bwp-simple-gxs.php:481
352
+ msgid "Enable auto cache re-generation?"
353
+ msgstr "Activeaza auto-regenerarea cache-ului?"
354
+
355
+ #: includes/class-bwp-simple-gxs.php:482
356
+ msgid "Cached sitemaps will last for"
357
+ msgstr "Sitemap-urile din cache sunt valabile pana"
358
+
359
+ #: includes/class-bwp-simple-gxs.php:483
360
+ msgid "Cached sitemaps are stored in (auto detected)"
361
+ msgstr "Sitemap-urile din cache sunt stocate in (auto detectare)"
362
+
363
+ #: includes/class-bwp-simple-gxs.php:487
364
+ msgid "<em>Cache your sitemaps for better performance.</em>"
365
+ msgstr "<em>Fa cache sitemap-ului pentru o mai buna performanta.</em>"
366
+
367
+ #: includes/class-bwp-simple-gxs.php:488
368
+ #, php-format
369
+ msgid "<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href=\"%s#using-modules\">here</a>.</em>"
370
+ msgstr "<em>Acest plugin foloseste module pentru a construi sitemap-ul deci este recomandat sa extinzi plugin folosind module si nu hooks. Unele setari de mai jos doar afecteaza modulele existente. Citeste mai mult despre module <a href=\"%s#using-modules\">aici</a>.</em>"
371
+
372
+ #: includes/class-bwp-simple-gxs.php:489
373
+ msgid "<em>Here you can change some settings that affect the default Sitemap Index file.</em>"
374
+ msgstr ""
375
+
376
+ #: includes/class-bwp-simple-gxs.php:503
377
+ #: includes/class-bwp-simple-gxs.php:509
378
+ msgid "second(s)"
379
+ msgstr "secunda(e)"
380
+
381
+ #: includes/class-bwp-simple-gxs.php:504
382
+ #: includes/class-bwp-simple-gxs.php:510
383
+ msgid "minute(s)"
384
+ msgstr "minut(e)"
385
+
386
+ #: includes/class-bwp-simple-gxs.php:505
387
+ #: includes/class-bwp-simple-gxs.php:511
388
+ msgid "hour(s)"
389
+ msgstr "ora(e)"
390
+
391
+ #: includes/class-bwp-simple-gxs.php:506
392
+ #: includes/class-bwp-simple-gxs.php:512
393
+ msgid "day(s)"
394
+ msgstr "zi(le)"
395
+
396
+ #: includes/class-bwp-simple-gxs.php:519
397
+ #: includes/class-bwp-simple-gxs.php:520
398
+ #: includes/class-bwp-simple-gxs.php:521
399
+ msgid "read more"
400
+ msgstr "citeste mai mult"
401
+
402
+ #: includes/class-bwp-simple-gxs.php:524
403
+ msgid "your sitemaps are generated and then cached to reduce unnecessary work."
404
+ msgstr "sitemap-urile tale sunt generate apoi puse in cache pentru a nu incarca serverul"
405
+
406
+ #: includes/class-bwp-simple-gxs.php:525
407
+ msgid "when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while."
408
+ msgstr "cand un sitemap din cache expira, pluginul il va genera din nou. Daca dezactivati functia, va trebui sa curatat cache-ul din cand in cand."
409
+
410
+ #: includes/class-bwp-simple-gxs.php:525
411
+ msgid "Flush the cache"
412
+ msgstr "Curata cacge"
413
+
414
+ #: includes/class-bwp-simple-gxs.php:526
415
+ msgid "tell you useful information such as build time, memory usage, SQL queries, etc."
416
+ msgstr "iti spune informatii utile, precum timpul in care a fost construit sitemap-ul, memoria folosita, interogari SQL, etc."
417
+
418
+ #: includes/class-bwp-simple-gxs.php:527
419
+ #, php-format
420
+ msgid "make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an error after enabling this, it's very likely that you have gzip active on your server already."
421
+ msgstr ""
422
+
423
+ #: includes/class-bwp-simple-gxs.php:528
424
+ msgid "only disable this when sitemaps appear in either blank page or plain text."
425
+ msgstr ""
426
+
427
+ #: includes/class-bwp-simple-gxs.php:529
428
+ #, php-format
429
+ msgid "If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex.xml</code> entries will be added to your primary blog's robots.txt, i.e. <code>%s</code>."
430
+ msgstr ""
431
+
432
+ #: includes/class-bwp-simple-gxs.php:530
433
+ msgid "taxonomy archives' sitemaps, including custom taxonomies."
434
+ msgstr "sitemap al taxonomiilor, inclusiv cele customizate"
435
+
436
+ #: includes/class-bwp-simple-gxs.php:532
437
+ msgid "date archives' sitemaps."
438
+ msgstr "sitemap pentru arhivele pe baza de data"
439
+
440
+ #: includes/class-bwp-simple-gxs.php:533
441
+ msgid "external pages' sitemap. This allows you to add links to pages that do not belong to WordPress to the sitemap."
442
+ msgstr ""
443
+
444
+ #: includes/class-bwp-simple-gxs.php:534
445
+ msgid "some copyrighted info is also added to your sitemaps. Thanks!"
446
+ msgstr "unele informatii de copyright sunt adaugate sitemap-ului. Mersi! "
447
+
448
+ #: includes/class-bwp-simple-gxs.php:535
449
+ #, fuzzy
450
+ msgid "This will load the default style sheet provided by this plugin. You can set a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook."
451
+ msgstr "Acesta va incarca stylesheet-ul prestabilit oferit de plugin. Poti seta un stylesheet customizat sau poti filtra <code>bwp_gxs_xslt</code>"
452
+
453
+ #: includes/class-bwp-simple-gxs.php:536
454
+ #, php-format
455
+ msgid "If you're on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more info."
456
+ msgstr "Daca folosesti o versiune Multi-site pe un subdomeniu, fiecare site va avea robots.txt al sau, iar site-urile din subdirectoare nu. Va rog cititi <a href=\"%s#toc-robots\" target=\"_blank\">documentatia</a> pentru mai multe informatii."
457
+
458
+ #: includes/class-bwp-simple-gxs.php:537
459
+ msgid "e.g. post1.xml, post2.xml, etc. And each sitemap will contain"
460
+ msgstr ""
461
+
462
+ #: includes/class-bwp-simple-gxs.php:538
463
+ msgid "If you disable this, make sure you also use <code>date_default_timezone_set</code> to correctly set up a timezone for your application."
464
+ msgstr ""
465
+
466
+ #: includes/class-bwp-simple-gxs.php:539
467
+ #, fuzzy
468
+ msgid "author archives' sitemap."
469
+ msgstr "sitemap pentru arhivele pe baza de data"
470
+
471
+ #: includes/class-bwp-simple-gxs.php:540
472
+ msgid "site's home URL sitemap. For a multi-site installation of WordPress, this sitemap will list all domains within your network, not just the main blog. This also supports WPMU Domain Mapping plugin."
473
+ msgstr ""
474
+
475
+ #: includes/class-bwp-simple-gxs.php:543
476
+ #, fuzzy
477
+ msgid "item(s) in one sitemap. You can not go over 50,000."
478
+ msgstr "itemi dintr-un sitemap. De fapt, 5000 ar fi ideal. Nu poti depasi 50,000 itemi."
479
+
480
+ #: includes/class-bwp-simple-gxs.php:544
481
+ msgid "item(s). Again , you can not go over 50,000."
482
+ msgstr ""
483
+
484
+ #: includes/class-bwp-simple-gxs.php:545
485
+ msgid "Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead."
486
+ msgstr "Introdu calea catre directoarele unde sunt modulele proprii (contoh <code>/home/mysite/public_html/gxs-modules/</code>); poti suprascrie modului preinstalat cu un modul avand acelasi nume. Un filtru este disponibil daca doresti sa folosesti PHP."
487
+
488
+ #: includes/class-bwp-simple-gxs.php:546
489
+ msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
490
+ msgstr "Directorul de cache trebuie sa fie \"writable\" (i.e. CHMOD to 755 or 777)."
491
+
492
+ #: includes/class-bwp-simple-gxs.php:547
493
+ msgid "item(s) in one SQL query. This helps you avoid running too heavy queries."
494
+ msgstr "itemi intr-o interogare SQL. Acest lucru te ajuta sa eviti incarcaturile mari."
495
+
496
+ #: includes/class-bwp-simple-gxs.php:550
497
+ msgid "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use."
498
+ msgstr "ar trebui sa fie un URL absolut, de ex. <code>http://example.com/my-stylesheet.xsl</code>. Trebuie sa ai un stylesheet pentru sitemapindex care poate fi accesat prin URL-ul de mai sus, de ex. <code>my-stylesheet.xsl</code> si <code>my-stylesheetindex.xsl</code>). Lasa spatiul gol daca nu folosesti."
499
+
500
+ #: includes/class-bwp-simple-gxs.php:557
501
+ #, php-format
502
+ msgid "<em><strong>Note:</strong> If you encounter white page problem, please refer to the <a target=\"_blank\" href=\"%s\">FAQ section</a> to know how to change this limit appropriately to make this plugin work. Also note that, for post-based sitemaps, this option will be overridden by the limit you set in the Sitemap Index Options below.</em>"
503
+ msgstr ""
504
+
505
+ #: includes/class-bwp-simple-gxs.php:659
506
+ #, fuzzy
507
+ msgid "What is a Google News Sitemap?"
508
+ msgstr "Ce sunt sitemap-urile?"
509
+
510
+ #: includes/class-bwp-simple-gxs.php:660
511
+ msgid "Enable this module?"
512
+ msgstr ""
513
+
514
+ #: includes/class-bwp-simple-gxs.php:661
515
+ msgid "Enable Multi-category Mode?"
516
+ msgstr ""
517
+
518
+ #: includes/class-bwp-simple-gxs.php:662
519
+ msgid "Ping Search Engines when you publish a news article?"
520
+ msgstr ""
521
+
522
+ #: includes/class-bwp-simple-gxs.php:663
523
+ msgid "Use keywords in News Sitemap?"
524
+ msgstr ""
525
+
526
+ #: includes/class-bwp-simple-gxs.php:664
527
+ msgid "News Sitemap's language"
528
+ msgstr ""
529
+
530
+ #: includes/class-bwp-simple-gxs.php:665
531
+ msgid "News Categories"
532
+ msgstr ""
533
+
534
+ #: includes/class-bwp-simple-gxs.php:666
535
+ msgid "This module will"
536
+ msgstr ""
537
+
538
+ #: includes/class-bwp-simple-gxs.php:670
539
+ msgid "A Google News Sitemap is a file that allows you to control which content you submit to Google News. By creating and submitting a Google News Sitemap, you're able to help Google News discover and crawl your site's articles &mdash; <em>http://support.google.com/</em>"
540
+ msgstr ""
541
+
542
+ #: includes/class-bwp-simple-gxs.php:671
543
+ msgid "<em>Below you will be able to choose what categories to use (or not use) in the news sitemap. You can also assign genres to a specific category.</em>"
544
+ msgstr ""
545
+
546
+ #: includes/class-bwp-simple-gxs.php:674
547
+ msgid "below selected categories in the news sitemap."
548
+ msgstr ""
549
+
550
+ #: includes/class-bwp-simple-gxs.php:679
551
+ msgid "English"
552
+ msgstr ""
553
+
554
+ #: includes/class-bwp-simple-gxs.php:680
555
+ msgid "French"
556
+ msgstr ""
557
+
558
+ #: includes/class-bwp-simple-gxs.php:681
559
+ msgid "Spanish"
560
+ msgstr ""
561
+
562
+ #: includes/class-bwp-simple-gxs.php:682
563
+ msgid "German"
564
+ msgstr ""
565
+
566
+ #: includes/class-bwp-simple-gxs.php:683
567
+ msgid "Portuguese"
568
+ msgstr ""
569
+
570
+ #: includes/class-bwp-simple-gxs.php:684
571
+ msgid "Polish"
572
+ msgstr ""
573
+
574
+ #: includes/class-bwp-simple-gxs.php:685
575
+ msgid "Norwegian"
576
+ msgstr ""
577
+
578
+ #: includes/class-bwp-simple-gxs.php:686
579
+ msgid "Dutch"
580
+ msgstr ""
581
+
582
+ #: includes/class-bwp-simple-gxs.php:687
583
+ msgid "Italian"
584
+ msgstr ""
585
+
586
+ #: includes/class-bwp-simple-gxs.php:688
587
+ msgid "Vietnamese"
588
+ msgstr ""
589
+
590
+ #: includes/class-bwp-simple-gxs.php:689
591
+ msgid "Simplified Chinese"
592
+ msgstr ""
593
+
594
+ #: includes/class-bwp-simple-gxs.php:692
595
+ msgid "include"
596
+ msgstr ""
597
+
598
+ #: includes/class-bwp-simple-gxs.php:693
599
+ msgid "exclude"
600
+ msgstr ""
601
+
602
+ #: includes/class-bwp-simple-gxs.php:696
603
+ msgid "news categories"
604
+ msgstr ""
605
+
606
+ #: includes/class-bwp-simple-gxs.php:697
607
+ msgid "news tags"
608
+ msgstr ""
609
+
610
+ #: includes/class-bwp-simple-gxs.php:703
611
+ msgid "A new <code>post_google_news.xml</code> sitemap will be added to the main <code>sitemapindex.xml</code>."
612
+ msgstr ""
613
+
614
+ #: includes/class-bwp-simple-gxs.php:704
615
+ msgid "Keywords are derived from"
616
+ msgstr ""
617
+
618
+ #: includes/class-bwp-simple-gxs.php:705
619
+ msgid "This ping works separately from the sitemapindex ping, and only occurs when you publish an article in one of the news categories set below."
620
+ msgstr ""
621
+
622
+ #: includes/class-bwp-simple-gxs.php:706
623
+ msgid "This mode is meant for News Blogs that have posts assigned to more than one categories. It is an advanced feature and should only be enabled if you do have similar blogs."
624
+ msgstr ""
625
+
626
+ #: includes/class-bwp-simple-gxs.php:712
627
+ msgid ". Do <strong>NOT</strong> use news tags if your news sitemap contains a lot of posts as it can be very inefficient to do so. This will be improved in future versions."
628
+ msgstr ""
629
+
630
+ #: includes/class-bwp-simple-gxs.php:736
631
+ #, php-format
632
+ msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
633
+ msgstr "<strong>%d</strong> sitemap-uri din cache au fost reinnoite astazi!"
634
+
635
+ #: includes/class-bwp-simple-gxs.php:738
636
+ msgid "Could not delete any cached sitemaps. Please manually check the cache directory."
637
+ msgstr "Nu s-au putut sterge sitemap-urile din cache. Va rugam verificati manual directorul de cache."
638
+
639
+ #: includes/class-bwp-simple-gxs.php:787
640
+ msgid "All options have been saved."
641
+ msgstr ""
642
+
643
+ #: includes/class-bwp-simple-gxs.php:809
644
+ msgid "Warning"
645
+ msgstr "Atentie"
646
+
647
+ #: includes/class-bwp-simple-gxs.php:809
648
+ msgid "Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix)."
649
+ msgstr "Directorul de cache nu exista sau nu este \"writable\". Va rugam citit despre permisiunile directoarelor <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>aici</a> (Unix)."
650
+
651
+ #: includes/class-bwp-simple-gxs.php:820
652
+ msgid "Clear All Logs"
653
+ msgstr ""
654
+
655
+ #: includes/class-bwp-simple-gxs.php:874
656
+ msgid "(Debug is on)"
657
+ msgstr "(Debug-ul este activat)"
658
+
659
+ #: includes/class-bwp-simple-gxs.php:887
660
+ msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
661
+ msgstr "<strong>Eroare Google XML Sitemaps Error:</strong>"
662
+
663
+ #: includes/class-bwp-simple-gxs.php:887
664
+ msgid "BWP Google XML Sitemaps Error"
665
+ msgstr "Eroare Google XML Sitemaps Error"
666
+
667
+ #: includes/class-bwp-simple-gxs.php:910
668
+ #, php-format
669
+ msgid "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> first!"
670
+ msgstr "Nimic aici... inca! Inscrie tu <a href=\"%s\">sitemap index</a> "
671
+
672
+ #: includes/class-bwp-simple-gxs.php:910
673
+ msgid "No log yet!"
674
+ msgstr "Nimic logat inca!"
675
+
676
+ #: includes/class-bwp-simple-gxs.php:921
677
+ #, php-format
678
+ msgid "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on <strong>%s</strong>."
679
+ msgstr "<a href=\"%s\" target=\"_blank\">%s</a> a fost creat cu succes pe <strong>%s</strong>."
680
+
681
+ #: includes/class-bwp-simple-gxs.php:932
682
+ #: includes/class-bwp-simple-gxs.php:949
683
+ msgid "M j, Y : H:i:s"
684
+ msgstr "M j, Y : H:i:s"
685
+
686
+ #: includes/class-bwp-simple-gxs.php:1018
687
+ msgid "Category's name"
688
+ msgstr ""
689
+
690
+ #: includes/class-bwp-simple-gxs.php:1018
691
+ #, php-format
692
+ msgid "<span>Genres used for this category</span> (more info <a href=\"%s\" target=\"_blank\">here</a>)"
693
+ msgstr ""
694
+
695
+ #: includes/class-bwp-simple-gxs.php:1309
696
+ #, php-format
697
+ msgid "Requested module (<em>%s</em>) not found or not allowed."
698
+ msgstr "Modulul cerut (<em>%s</em>) nu a fost gasit."
699
+
700
+ #: includes/class-bwp-simple-gxs.php:1368
701
+ #: includes/class-bwp-simple-gxs.php:1389
702
+ #, php-format
703
+ msgid "Loaded a custom sub-module file: <strong>%s</strong>."
704
+ msgstr "A fost incarcat un sub-modul customizat: <strong>%s</strong>."
705
+
706
+ #: includes/class-bwp-simple-gxs.php:1377
707
+ #, php-format
708
+ msgid "Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead."
709
+ msgstr "Sub-modului mapat: <strong>%s</strong> nu este disponibil in directorul prestabilit sau customizat. Plugin-ul va incerca sa incarce modulul cerut."
710
+
711
+ #: includes/class-bwp-simple-gxs.php:1397
712
+ #, php-format
713
+ msgid "Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead."
714
+ msgstr "Sub-modulul: <strong>%s</strong> nu este disponibil in directorul prestabilit sau customizat. Plugin-ul va incerca sa incarce modulul parinte"
715
+
716
+ #: includes/class-bwp-simple-gxs.php:1411
717
+ #, php-format
718
+ msgid "Loaded a custom module file: <strong>%s</strong>."
719
+ msgstr "A fost incarcat un modul customizat: <strong>%s</strong>."
720
+
721
+ #: includes/class-bwp-simple-gxs.php:1417
722
+ #, php-format
723
+ msgid "Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists."
724
+ msgstr "Nu a putut fi incarcat modulul: <strong>%s</strong> in directorul prestabilit sau customizat. Va rog verificati daca modulul exista."
725
+
726
+ #: includes/class-bwp-simple-gxs.php:1437
727
+ #, php-format
728
+ msgid "There is no class named <strong>%s</strong> in the module file <strong>%s</strong>."
729
+ msgstr "Nu exista o clasa denumita <strong>%s</strong> in modulul <strong>%s</strong>."
730
+
731
+ #: includes/class-bwp-simple-gxs.php:1446
732
+ #, php-format
733
+ msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
734
+ msgstr "A fost incarcat un sitemapindex customizat: <strong>%s</strong>."
735
+
736
+ #: includes/class-bwp-simple-gxs.php:1469
737
+ #, php-format
738
+ msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
739
+ msgstr "<em>%s.xml</em> a fost generat cu succes folosit modulul <em>%s</em>."
740
+
741
+ #: includes/class-bwp-simple-gxs.php:1500
742
+ msgid "<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of the time PHP errors) is preventing BWP GXS from showing any sitemap contents. Try disabling <code>WP_DEBUG</code> or this plugin's debug mode, whichever is on. All unexpected outputs should be shown just above this message. If you don't see any, contact me and I might be able to help."
743
+ msgstr ""
744
+
745
+ #: includes/class-bwp-simple-gxs.php:1630
746
+ msgid "Unknown response code from search engines. Ping failed."
747
+ msgstr ""
748
+
749
+ #: includes/class-bwp-simple-gxs.php:1632
750
+ #, fuzzy, php-format
751
+ msgid "Pinged %s with %s successfully!"
752
+ msgstr "S-a facut ping cu succes la %s !"
753
+
754
+ #: includes/class-bwp-simple-gxs.php:1637
755
+ #, php-format
756
+ msgid "Error %s from %s"
757
+ msgstr ""
758
+
759
+ #: includes/class-bwp-simple-gxs.php:1642
760
+ #, php-format
761
+ msgid "Ping limit for today to %s has been reached, sorry!"
762
+ msgstr "Limita de ping pentru azi la %s a fost atinsa!"
763
+
764
+ #: includes/class-bwp-simple-gxs.php:1670
765
+ #, fuzzy, php-format
766
+ msgid "<em>%s.xml</em> does not have any item. You can fix this easily by excluding any post types / terms you do not use in <em>Sitemap Generator</em> tab within your admin area. If you still see this error, consider checking the module that generates this sitemap (<em>%s.php</em>)."
767
+ msgstr "<em>%s.xml</em> este gol. Plugin-ul a afisat un header de 404 la motorul de cautare care l-a cerut. Ar trebui sa verifici modulul care genereaza sitemap-ul (<em>%s.php</em>)."
768
+
769
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:80
770
+ msgid "Plugin Configurations"
771
+ msgstr "Configurarea plugin-ului"
772
+
773
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:398
774
+ msgid "Save Changes"
775
+ msgstr "Salveaza schimbarile"
776
+
777
+ #~ msgid "log"
778
+ #~ msgstr "log"
779
+
780
+ #~ msgid "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
781
+ #~ msgstr "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
782
+
783
+ #~ msgid "make your sitemaps ~ 70% smaller."
784
+ #~ msgstr "face sitemap-urile cu 70% mai mici."
785
+
786
+ #~ msgid "static pages' sitemap."
787
+ #~ msgstr "sitemap pentru pagini statice"
788
+
789
+ #~ msgid "tag archives' sitemaps."
790
+ #~ msgstr "sitemap pentru tag-uri"
791
+
792
+ #~ msgid "%s"
793
+ #~ msgstr "%s"
languages/bwp-simple-gxs-zh_TW.mo ADDED
Binary file
languages/bwp-simple-gxs-zh_TW.po ADDED
@@ -0,0 +1,785 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: BWP Google XML Sitemaps(Malay Translation)\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-03 20:10+0700\n"
6
+ "PO-Revision-Date: 2012-04-03 20:10+0700\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: <darkcry3r@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: ./../\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Language: Malay\n"
17
+ "X-Poedit-Country: MALAYSIA\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: includes/class-bwp-framework.php:177
21
+ #, php-format
22
+ msgid "%s requires WordPress <strong>%s</strong> or higher and PHP <strong>%s</strong> or higher. The plugin will not function until you update your software. Please deactivate this plugin."
23
+ msgstr ""
24
+
25
+ #: includes/class-bwp-framework.php:188
26
+ msgid "Development Log"
27
+ msgstr "研發記錄"
28
+
29
+ #: includes/class-bwp-framework.php:188
30
+ msgid "Frequently Asked Questions"
31
+ msgstr "常見問題"
32
+
33
+ #: includes/class-bwp-framework.php:188
34
+ msgid "FAQ"
35
+ msgstr "問與答"
36
+
37
+ #: includes/class-bwp-framework.php:188
38
+ msgid "Got a problem? Send me a feedback!"
39
+ msgstr "有問題嗎?通知我吧!"
40
+
41
+ #: includes/class-bwp-framework.php:188
42
+ msgid "Contact"
43
+ msgstr "聯絡我"
44
+
45
+ #: includes/class-bwp-framework.php:195
46
+ msgid "You can buy me some special coffees if you appreciate my work, thank you!"
47
+ msgstr "如果你欣賞我的工作,請幫我買些咖啡吧!感謝你!"
48
+
49
+ #: includes/class-bwp-framework.php:209
50
+ msgid "Donate to "
51
+ msgstr "贊助"
52
+
53
+ #: includes/class-bwp-framework.php:211
54
+ msgid "One cup $5.00"
55
+ msgstr "一杯 $5.00"
56
+
57
+ #: includes/class-bwp-framework.php:212
58
+ msgid "Two cups $10.00"
59
+ msgstr "兩杯 $10.00"
60
+
61
+ #: includes/class-bwp-framework.php:213
62
+ msgid "Five cups! $25.00"
63
+ msgstr "五杯! $25.00"
64
+
65
+ #: includes/class-bwp-framework.php:214
66
+ msgid "One LL-cup!!! $50.00"
67
+ msgstr "特大杯的 $50.00"
68
+
69
+ #: includes/class-bwp-framework.php:215
70
+ msgid "... or any amount!"
71
+ msgstr "或者你開心的"
72
+
73
+ #: includes/class-bwp-framework.php:230
74
+ msgid "Latest updates from BetterWP.net!"
75
+ msgstr "BetterWP.net 的最新訊息"
76
+
77
+ #: includes/class-bwp-framework.php:231
78
+ msgid "Follow me on Twitter!"
79
+ msgstr "追隨我的 Twitter!"
80
+
81
+ #: includes/class-bwp-framework.php:240
82
+ #, php-format
83
+ msgid "You are using version %s!"
84
+ msgstr "你正在使用 %s 版本!"
85
+
86
+ #: includes/class-bwp-framework.php:385
87
+ msgid "Settings"
88
+ msgstr "設定"
89
+
90
+ #: includes/class-bwp-gxs-cache.php:34
91
+ #, php-format
92
+ msgid "Cache directory (\"%s\") does not exist or is not writable."
93
+ msgstr "快取資料夾 (\"%s\") 不存在或是不允許寫入"
94
+
95
+ #: includes/class-bwp-gxs-cache.php:56
96
+ #, php-format
97
+ msgid "Cache file for module <em>%s</em> is not found and will be built right away."
98
+ msgstr "沒有找到模組 <em>%s</em> 的快取檔案,系統將會建立一個。"
99
+
100
+ #: includes/class-bwp-gxs-cache.php:108
101
+ #: includes/class-bwp-simple-gxs.php:1341
102
+ #, php-format
103
+ msgid "Successfully served a cached version of <em>%s.xml</em>."
104
+ msgstr "成功的儲存 <em>%s.xml</em> 的快取檔案。"
105
+
106
+ #: includes/class-bwp-simple-gxs.php:141
107
+ #: includes/class-bwp-simple-gxs.php:347
108
+ #: includes/class-bwp-simple-gxs.php:354
109
+ msgid "Sitemap Statistics"
110
+ msgstr "Sitemap 統計"
111
+
112
+ #: includes/class-bwp-simple-gxs.php:142
113
+ #: includes/class-bwp-simple-gxs.php:348
114
+ #: includes/class-bwp-simple-gxs.php:355
115
+ msgid "Sitemap Generator"
116
+ msgstr "Sitemap 生成設定"
117
+
118
+ #: includes/class-bwp-simple-gxs.php:143
119
+ #: includes/class-bwp-simple-gxs.php:349
120
+ #: includes/class-bwp-simple-gxs.php:356
121
+ #, fuzzy
122
+ msgid "News Sitemap"
123
+ msgstr "什麼是 Sitemap?"
124
+
125
+ #: includes/class-bwp-simple-gxs.php:174
126
+ #, php-format
127
+ msgid "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
128
+ msgstr "This sitemap was originally generated in %s second(s) (Memory usage: %s) - %s queries - %s URL(s) listed"
129
+
130
+ #: includes/class-bwp-simple-gxs.php:347
131
+ #: includes/class-bwp-simple-gxs.php:354
132
+ msgid "BWP Google XML Sitemaps Statistics"
133
+ msgstr "BWP Google XML Sitemaps Statistics"
134
+
135
+ #: includes/class-bwp-simple-gxs.php:348
136
+ #: includes/class-bwp-simple-gxs.php:355
137
+ msgid "BWP Google XML Sitemaps Generator"
138
+ msgstr "BWP Google XML Sitemaps Generator"
139
+
140
+ #: includes/class-bwp-simple-gxs.php:349
141
+ #: includes/class-bwp-simple-gxs.php:356
142
+ #, fuzzy
143
+ msgid "BWP Google News XML Sitemap"
144
+ msgstr "BWP Google XML Sitemaps"
145
+
146
+ #: includes/class-bwp-simple-gxs.php:353
147
+ msgid "BWP Google XML Sitemaps"
148
+ msgstr "BWP Google XML Sitemaps"
149
+
150
+ #: includes/class-bwp-simple-gxs.php:368
151
+ msgid "You do not have sufficient permissions to access this page."
152
+ msgstr "你沒有足夠的權限來閱讀本頁面。"
153
+
154
+ #: includes/class-bwp-simple-gxs.php:389
155
+ #: includes/class-bwp-simple-gxs.php:736
156
+ #: includes/class-bwp-simple-gxs.php:738
157
+ msgid "Notice"
158
+ msgstr "注意"
159
+
160
+ #: includes/class-bwp-simple-gxs.php:389
161
+ msgid "All logs have been cleared successfully!"
162
+ msgstr "成功的清除所有的記錄!"
163
+
164
+ #: includes/class-bwp-simple-gxs.php:396
165
+ msgid "What are Sitemaps?"
166
+ msgstr "什麼是 Sitemap?"
167
+
168
+ #: includes/class-bwp-simple-gxs.php:397
169
+ msgid "Your sitemaps"
170
+ msgstr "你的 sitemap"
171
+
172
+ #: includes/class-bwp-simple-gxs.php:398
173
+ msgid "Submit your sitemaps"
174
+ msgstr "提交你的 sitemap"
175
+
176
+ #: includes/class-bwp-simple-gxs.php:399
177
+ msgid "Pinging search engines"
178
+ msgstr "主動告知搜尋引擎"
179
+
180
+ #: includes/class-bwp-simple-gxs.php:400
181
+ msgid "Enable pinging functionality?"
182
+ msgstr "啟用 ping 的功能"
183
+
184
+ #: includes/class-bwp-simple-gxs.php:401
185
+ msgid "Enable pinging individual SE"
186
+ msgstr "允許告知的 搜尋引擎"
187
+
188
+ #: includes/class-bwp-simple-gxs.php:402
189
+ msgid "Sitemap Generator's Log"
190
+ msgstr "Sitemap 生成的紀錄檔"
191
+
192
+ #: includes/class-bwp-simple-gxs.php:403
193
+ msgid "Enable logging?"
194
+ msgstr "啟用記錄"
195
+
196
+ #: includes/class-bwp-simple-gxs.php:404
197
+ msgid "Enable debugging?"
198
+ msgstr "啟用 偵錯模式"
199
+
200
+ #: includes/class-bwp-simple-gxs.php:413
201
+ msgid "In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site &mdash; <em>http://www.sitemaps.org/</em>"
202
+ msgstr "簡單的說, Sitemap 是一個 XML 檔案將網站的網址及與各網址相關的其他中繼資料 (上次更新日期、變更頻率,以及相對於網站中其他網址的重要性) 列在 XML 檔中,讓搜尋引擎能夠更有效地檢索該網站 &mdash; <em>http://www.sitemaps.org/</em>"
203
+
204
+ #: includes/class-bwp-simple-gxs.php:413
205
+ msgid "This plugin helps you generate both Sitemap Index files as well as normal Sitemap files. A Sitemap Index, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemap files inside it."
206
+ msgstr "本外掛協助你生成 sitemap 的索引檔與 sitemap 的內容. sitemap 索引檔, 就如同他的名稱,他也是一種 sitemap 檔案包含了很多 sitemap 檔案的資訊在其中。"
207
+
208
+ #: includes/class-bwp-simple-gxs.php:414
209
+ msgid "<em>Basic information about all your sitemaps.</em>"
210
+ msgstr "<em>關於你全部的 sitemap 的基本資訊</em>"
211
+
212
+ #: includes/class-bwp-simple-gxs.php:415
213
+ msgid "<em>More detailed information about how your sitemaps are generated including <span style=\"color: #999999;\">notices</span>, <span style=\"color: #FF0000;\">errors</span> and <span style=\"color: #009900;\">success messages</span>.</em>"
214
+ msgstr "<em>更多的關於你的 sitemap 生成的訊息:<span style=\"color: #999999;\">告知資訊</span>, <span style=\"color: #FF0000;\">錯誤訊息</span> 和 <span style=\"color: #009900;\">成功訊息</span>.</em>"
215
+
216
+ #: includes/class-bwp-simple-gxs.php:416
217
+ #, fuzzy, php-format
218
+ msgid "<em>Submit your sitemapindex to major search engines like <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Bing</a> or <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
219
+ msgstr "<em>提交你的 sitemap 索引檔給主要的搜尋引擎。例如: <a href=\"%s\" target=\"_blank\">Google</a>, <a href=\"%s\" target=\"_blank\">Yahoo</a>, <a href=\"%s\" target=\"_blank\">Bing</a> 或 <a href=\"%s\" target=\"_blank\">Ask</a>.</em>"
220
+
221
+ #: includes/class-bwp-simple-gxs.php:417
222
+ msgid "<em>Now when you post something new to your blog, you can <em>ping</em> those search engines to tell them your blog just got updated. Pinging could be less effective than you think it is but you should enable such feature anyway.</em>"
223
+ msgstr "<em>當你發表什麼東西到你的部落格之時, 你可以 <em>ping (主動告知)</em> 搜尋引擎你的部落格剛剛更新. 你可能認為 ping 是不太有效的,但你應該讓他這麼做.</em>"
224
+
225
+ #: includes/class-bwp-simple-gxs.php:422
226
+ msgid "Selected SE below will be pinged when you publish new posts."
227
+ msgstr "在下面選擇的 搜尋引擎 將會在你發表新文章之時主動告知"
228
+
229
+ #: includes/class-bwp-simple-gxs.php:423
230
+ msgid "No additional load is needed so enabling this is recommended."
231
+ msgstr "如果沒有額外的負載需求建議啟用。"
232
+
233
+ #: includes/class-bwp-simple-gxs.php:424
234
+ msgid "Minor errors will be printed on screen. Also, when debug is on, no caching is used, useful when you develop new modules."
235
+ msgstr "錯誤將顯示是在螢幕上. 當啟用偵錯模式,將不會使用快取系統,當你在寫新的 模組 時是很有用的。"
236
+
237
+ #: includes/class-bwp-simple-gxs.php:425
238
+ msgid "Google"
239
+ msgstr "Google"
240
+
241
+ #: includes/class-bwp-simple-gxs.php:426
242
+ msgid "Bing"
243
+ msgstr "Bing"
244
+
245
+ #: includes/class-bwp-simple-gxs.php:427
246
+ msgid "Ask.com"
247
+ msgstr "Ask.com"
248
+
249
+ #: includes/class-bwp-simple-gxs.php:430
250
+ #, php-format
251
+ msgid "After you activate this plugin, all sitemaps should be available right away. The next step is to submit the sitemapindex to major search engines. You only need the <strong>sitemapindex</strong> and nothing else, those search engines will automatically recognize other included sitemaps. You can read a small <a href=\"%s\">How-to</a> if you are interested."
252
+ msgstr "在你啟用本外掛之後, 所有的 sitemap索引 應該已經準備妥當. 下一步是向各大搜尋引擎提供你的 sitemap索引 . 你只需要提供 <strong>sitemapindex</strong> 就好, 搜尋引擎應該會自動抓取包含在內的 sitemap 檔案. 如果你感興趣的話,可以觀看 <a href=\"%s\">操作手冊</a> "
253
+
254
+ #: includes/class-bwp-simple-gxs.php:458
255
+ msgid "Output no more than"
256
+ msgstr "輸出不超過"
257
+
258
+ #: includes/class-bwp-simple-gxs.php:459
259
+ msgid "Default change frequency"
260
+ msgstr "預設變更的頻率"
261
+
262
+ #: includes/class-bwp-simple-gxs.php:460
263
+ msgid "Default priority"
264
+ msgstr "預設的優先順序"
265
+
266
+ #: includes/class-bwp-simple-gxs.php:461
267
+ msgid "Minimum priority"
268
+ msgstr "最小的優先順序"
269
+
270
+ #: includes/class-bwp-simple-gxs.php:462
271
+ msgid "Use GMT for Last Modified date?"
272
+ msgstr "在最後更新時間使用 GMT 時間"
273
+
274
+ #: includes/class-bwp-simple-gxs.php:463
275
+ msgid "Style your sitemaps with an XSLT stylesheet?"
276
+ msgstr "為你的 sitemap 加上 XSLT 樣式"
277
+
278
+ #: includes/class-bwp-simple-gxs.php:464
279
+ msgid "Custom XSLT stylesheet URL"
280
+ msgstr "自行設定 XSLT 樣式的網址"
281
+
282
+ #: includes/class-bwp-simple-gxs.php:465
283
+ msgid "Show build stats in sitemaps?"
284
+ msgstr "添加生成狀態在 sitemap 中"
285
+
286
+ #: includes/class-bwp-simple-gxs.php:466
287
+ msgid "Enable credit?"
288
+ msgstr "允許信任的?"
289
+
290
+ #: includes/class-bwp-simple-gxs.php:467
291
+ msgid "Enable Gzip?"
292
+ msgstr "啟用 GZIP"
293
+
294
+ #: includes/class-bwp-simple-gxs.php:468
295
+ msgid "Clean unexpected output before sitemap generation?"
296
+ msgstr "在產生 sitemap 之前清理非預期的輸出"
297
+
298
+ #: includes/class-bwp-simple-gxs.php:469
299
+ msgid "Sitemap Index Options"
300
+ msgstr "Sitemap 索引 設定"
301
+
302
+ #: includes/class-bwp-simple-gxs.php:470
303
+ msgid "Automatically split post-based sitemaps into smaller sitemaps?"
304
+ msgstr "自動分割以文章為基礎的 sitemap 成更小的 sitemap"
305
+
306
+ #: includes/class-bwp-simple-gxs.php:471
307
+ msgid "Add sitemapindex to individual blog's virtual robots.txt?"
308
+ msgstr "加入 sitemap 索引 資訊到虛擬的 robots.txt 中"
309
+
310
+ #: includes/class-bwp-simple-gxs.php:472
311
+ msgid "Add sitemapindex from all blogs within network to primary blog's virtual robots.txt?"
312
+ msgstr "加入所有部落格的 sitemap索引 到主網站的虛擬 robots.txt"
313
+
314
+ #: includes/class-bwp-simple-gxs.php:473
315
+ msgid "In sitemapindex, include"
316
+ msgstr "在 sitemap 索引中包含"
317
+
318
+ #: includes/class-bwp-simple-gxs.php:474
319
+ msgid "Exclude following post types:"
320
+ msgstr "排除下列的文章類型:"
321
+
322
+ #: includes/class-bwp-simple-gxs.php:475
323
+ msgid "Exclude following taxonomies:"
324
+ msgstr "排除下列的分類:"
325
+
326
+ #: includes/class-bwp-simple-gxs.php:476
327
+ msgid "Module Options"
328
+ msgstr "模組設定"
329
+
330
+ #: includes/class-bwp-simple-gxs.php:477
331
+ msgid "Alternate module directory"
332
+ msgstr "強化的模組目錄"
333
+
334
+ #: includes/class-bwp-simple-gxs.php:478
335
+ msgid "Get no more than"
336
+ msgstr "得到不超過"
337
+
338
+ #: includes/class-bwp-simple-gxs.php:479
339
+ msgid "Caching Options"
340
+ msgstr "快取設定"
341
+
342
+ #: includes/class-bwp-simple-gxs.php:480
343
+ msgid "Enable caching?"
344
+ msgstr "啟用快取"
345
+
346
+ #: includes/class-bwp-simple-gxs.php:481
347
+ msgid "Enable auto cache re-generation?"
348
+ msgstr "允許自動更新快取"
349
+
350
+ #: includes/class-bwp-simple-gxs.php:482
351
+ msgid "Cached sitemaps will last for"
352
+ msgstr "快取的有效期"
353
+
354
+ #: includes/class-bwp-simple-gxs.php:483
355
+ msgid "Cached sitemaps are stored in (auto detected)"
356
+ msgstr "快取檔案的所在地 (自動填寫)"
357
+
358
+ #: includes/class-bwp-simple-gxs.php:487
359
+ msgid "<em>Cache your sitemaps for better performance.</em>"
360
+ msgstr "<em>快取你的 sitemap 可有更好的性能</em>"
361
+
362
+ #: includes/class-bwp-simple-gxs.php:488
363
+ #, php-format
364
+ msgid "<em>This plugin uses modules to build sitemap data so it is recommended that you extend this plugin using modules rather than hooks. Some of the settings below only affect modules extending the base module class. Read more about using modules <a href=\"%s#using-modules\">here</a>.</em>"
365
+ msgstr "<em>本外掛使用模組的方式來生成 sitemap, 所以建議你在強化本外掛時使用 模組 而不是 hooks. 底下的設定只會影響到以基本模組擴展而來的模組。於 <a href=\"%s#using-modules\">這裡</a> 取得更多關於模組的資訊。</em>"
366
+
367
+ #: includes/class-bwp-simple-gxs.php:489
368
+ msgid "<em>Here you can change some settings that affect the default Sitemap Index file.</em>"
369
+ msgstr "<em>這裡你可以改變一些預設的 sitemap 索引 設定.</em>"
370
+
371
+ #: includes/class-bwp-simple-gxs.php:503
372
+ #: includes/class-bwp-simple-gxs.php:509
373
+ msgid "second(s)"
374
+ msgstr "秒"
375
+
376
+ #: includes/class-bwp-simple-gxs.php:504
377
+ #: includes/class-bwp-simple-gxs.php:510
378
+ msgid "minute(s)"
379
+ msgstr "分鐘"
380
+
381
+ #: includes/class-bwp-simple-gxs.php:505
382
+ #: includes/class-bwp-simple-gxs.php:511
383
+ msgid "hour(s)"
384
+ msgstr "小時"
385
+
386
+ #: includes/class-bwp-simple-gxs.php:506
387
+ #: includes/class-bwp-simple-gxs.php:512
388
+ msgid "day(s)"
389
+ msgstr "天"
390
+
391
+ #: includes/class-bwp-simple-gxs.php:519
392
+ #: includes/class-bwp-simple-gxs.php:520
393
+ #: includes/class-bwp-simple-gxs.php:521
394
+ msgid "read more"
395
+ msgstr "更多資訊"
396
+
397
+ #: includes/class-bwp-simple-gxs.php:524
398
+ msgid "your sitemaps are generated and then cached to reduce unnecessary work."
399
+ msgstr "將你生成的 sitemap 快取,以減少不必要的工作."
400
+
401
+ #: includes/class-bwp-simple-gxs.php:525
402
+ msgid "when a cached sitemap expires, this plugin will try to generate the cache again. If you disable this, remember to manually flush the cache once in a while."
403
+ msgstr "當 sitemap 的快取資料過期,系統將嘗試建立新的快取資料. 如果你不允許, 記得每隔一動時間清空你的快取檔案。"
404
+
405
+ #: includes/class-bwp-simple-gxs.php:525
406
+ msgid "Flush the cache"
407
+ msgstr "清空快取檔案"
408
+
409
+ #: includes/class-bwp-simple-gxs.php:526
410
+ msgid "tell you useful information such as build time, memory usage, SQL queries, etc."
411
+ msgstr "告訴你一些有用的資訊,如生成時間、記憶體使用量、 SQL 次數等"
412
+
413
+ #: includes/class-bwp-simple-gxs.php:527
414
+ #, fuzzy, php-format
415
+ msgid "make your sitemaps ~ 70% smaller. <strong>Important:</strong> If you see an error after enabling this, it's very likely that you have gzip active on your server already."
416
+ msgstr "使你的 sitrmap 縮小約 70%。<strong>重要:</strong> 如果有錯誤產生的話,很可能是因為你的伺服器上已經有設定 GZIP 了。"
417
+
418
+ #: includes/class-bwp-simple-gxs.php:528
419
+ msgid "only disable this when sitemaps appear in either blank page or plain text."
420
+ msgstr "只有在 sitemap 出現一片空白或純文字呈現的時候才要停用。"
421
+
422
+ #: includes/class-bwp-simple-gxs.php:529
423
+ #, php-format
424
+ msgid "If you have like 50 blogs, 50 <code>Sitemap: http://example.com/sitemapindex.xml</code> entries will be added to your primary blog's robots.txt, i.e. <code>%s</code>."
425
+ msgstr "如果你有 50個部落格, 50行 <code>Sitemap: http://example.com/sitemapindex.xml</code> 將會加入到你主站的 robots.txt 當中。<code>%s</code>"
426
+
427
+ #: includes/class-bwp-simple-gxs.php:530
428
+ msgid "taxonomy archives' sitemaps, including custom taxonomies."
429
+ msgstr "分類彙整的 sitemap,包含自行定義的。"
430
+
431
+ #: includes/class-bwp-simple-gxs.php:532
432
+ msgid "date archives' sitemaps."
433
+ msgstr "日期彙整的 sitemap"
434
+
435
+ #: includes/class-bwp-simple-gxs.php:533
436
+ msgid "external pages' sitemap. This allows you to add links to pages that do not belong to WordPress to the sitemap."
437
+ msgstr "外部頁面的 sitemap。使你可以添加一些不屬於 WordPress 生成的頁面。"
438
+
439
+ #: includes/class-bwp-simple-gxs.php:534
440
+ msgid "some copyrighted info is also added to your sitemaps. Thanks!"
441
+ msgstr "一些版權保護的訊息也會加入 sitemap 中。感謝!"
442
+
443
+ #: includes/class-bwp-simple-gxs.php:535
444
+ msgid "This will load the default style sheet provided by this plugin. You can set a custom style sheet below or filter the <code>bwp_gxs_xslt</code> hook."
445
+ msgstr "這會為你載入本外掛預設的樣式。你可以在下面設定你自己的樣式或使用過濾器 <code>bwp_gxs_xslt</code> 來更改。"
446
+
447
+ #: includes/class-bwp-simple-gxs.php:536
448
+ #, php-format
449
+ msgid "If you're on a Multi-site installation with Sub-domain enabled, each site will have its own robots.txt, sites in sub-directory will not. Please read the <a href=\"%s#toc-robots\" target=\"_blank\">documentation</a> for more info."
450
+ msgstr "如果你使用 多網站的WordPress, 在一個子域名中的每一個網站將有自己的 robots.txt,如果在子資料夾就不會。請參考 <a href=\"%s#toc-robots\" target=\"_blank\">說明文件</a> 以得到更多的訊息。"
451
+
452
+ #: includes/class-bwp-simple-gxs.php:537
453
+ msgid "e.g. post1.xml, post2.xml, etc. And each sitemap will contain"
454
+ msgstr "例如:post1.xml, post2.xml 等。而且每一個 sitemap 包含"
455
+
456
+ #: includes/class-bwp-simple-gxs.php:538
457
+ msgid "If you disable this, make sure you also use <code>date_default_timezone_set</code> to correctly set up a timezone for your application."
458
+ msgstr "如果你停用這選項,請確定你有使用 <code>date_default_timezone_set</code> 來正確的設定網站的時區。"
459
+
460
+ #: includes/class-bwp-simple-gxs.php:539
461
+ msgid "author archives' sitemap."
462
+ msgstr "作者彙整的 sitemap"
463
+
464
+ #: includes/class-bwp-simple-gxs.php:540
465
+ msgid "site's home URL sitemap. For a multi-site installation of WordPress, this sitemap will list all domains within your network, not just the main blog. This also supports WPMU Domain Mapping plugin."
466
+ msgstr "網站首頁的 sitemap。當使用 多網站的WordPress ,這個 sitemap 會列出所有網站的連結,不只有主要的網站。這也支援 WPMU 的網站映射功能。"
467
+
468
+ #: includes/class-bwp-simple-gxs.php:543
469
+ msgid "item(s) in one sitemap. You can not go over 50,000."
470
+ msgstr "項目在一個 sitemap 中。不能超過 50,000。"
471
+
472
+ #: includes/class-bwp-simple-gxs.php:544
473
+ msgid "item(s). Again , you can not go over 50,000."
474
+ msgstr "項目。再次重申,不可以超過 50,000"
475
+
476
+ #: includes/class-bwp-simple-gxs.php:545
477
+ msgid "Input a full path to the directory where you put your own modules (e.g. <code>/home/mysite/public_html/gxs-modules/</code>), you can also override a built-in module by having a module with the same filename in this directory. A filter is also available if you would like to use PHP instead."
478
+ msgstr "輸入你的模組所在的資料夾的絕對目錄 (例如 <code>/home/mysite/public_html/gxs-modules/</code>), 你可以藉由使用跟預設模組相同的名稱來改寫內建的模組內容. A filter is also available if you would like to use PHP instead."
479
+
480
+ #: includes/class-bwp-simple-gxs.php:546
481
+ msgid "The cache directory must be writable (i.e. CHMOD to 755 or 777)."
482
+ msgstr "快取檔案所在地需要可以寫入的 (例如 CHMOD 為 755 或 777)."
483
+
484
+ #: includes/class-bwp-simple-gxs.php:547
485
+ msgid "item(s) in one SQL query. This helps you avoid running too heavy queries."
486
+ msgstr "項目在一個 SQL 查詢中。 這可以避免過慢的查詢。"
487
+
488
+ #: includes/class-bwp-simple-gxs.php:550
489
+ msgid "expected to be an absolute URL, e.g. <code>http://example.com/my-stylesheet.xsl</code>. You must also have a style sheet for the sitemapindex that can be accessed through the above URL, e.g. <code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>). Please leave blank if you do not wish to use."
490
+ msgstr "預設為一個完整的網址,例如<code>http://example.com/my-stylesheet.xsl</code>。你還必須要有一個針對 sitemap索引 的樣式錶,例如<code>my-stylesheet.xsl</code> and <code>my-stylesheetindex.xsl</code>。如果你不需要使用請留空白。"
491
+
492
+ #: includes/class-bwp-simple-gxs.php:557
493
+ #, php-format
494
+ msgid "<em><strong>Note:</strong> If you encounter white page problem, please refer to the <a target=\"_blank\" href=\"%s\">FAQ section</a> to know how to change this limit appropriately to make this plugin work. Also note that, for post-based sitemaps, this option will be overridden by the limit you set in the Sitemap Index Options below.</em>"
495
+ msgstr "<em><strong>注意:</strong> 如果有空白頁面的問題,請參考 <a target=\"_blank\" href=\"%s\">常見問題</a> 以瞭解如何是當的修改限制讓外掛順利運作。也請注意,再以文章為基礎的 sitemap,這個設定值會被你在之後【Sitemap 索引 設定】中的設定複寫。</em>"
496
+
497
+ #: includes/class-bwp-simple-gxs.php:659
498
+ #, fuzzy
499
+ msgid "What is a Google News Sitemap?"
500
+ msgstr "什麼是 Sitemap?"
501
+
502
+ #: includes/class-bwp-simple-gxs.php:660
503
+ msgid "Enable this module?"
504
+ msgstr ""
505
+
506
+ #: includes/class-bwp-simple-gxs.php:661
507
+ msgid "Enable Multi-category Mode?"
508
+ msgstr ""
509
+
510
+ #: includes/class-bwp-simple-gxs.php:662
511
+ msgid "Ping Search Engines when you publish a news article?"
512
+ msgstr ""
513
+
514
+ #: includes/class-bwp-simple-gxs.php:663
515
+ msgid "Use keywords in News Sitemap?"
516
+ msgstr ""
517
+
518
+ #: includes/class-bwp-simple-gxs.php:664
519
+ msgid "News Sitemap's language"
520
+ msgstr ""
521
+
522
+ #: includes/class-bwp-simple-gxs.php:665
523
+ msgid "News Categories"
524
+ msgstr ""
525
+
526
+ #: includes/class-bwp-simple-gxs.php:666
527
+ msgid "This module will"
528
+ msgstr ""
529
+
530
+ #: includes/class-bwp-simple-gxs.php:670
531
+ msgid "A Google News Sitemap is a file that allows you to control which content you submit to Google News. By creating and submitting a Google News Sitemap, you're able to help Google News discover and crawl your site's articles &mdash; <em>http://support.google.com/</em>"
532
+ msgstr ""
533
+
534
+ #: includes/class-bwp-simple-gxs.php:671
535
+ msgid "<em>Below you will be able to choose what categories to use (or not use) in the news sitemap. You can also assign genres to a specific category.</em>"
536
+ msgstr ""
537
+
538
+ #: includes/class-bwp-simple-gxs.php:674
539
+ msgid "below selected categories in the news sitemap."
540
+ msgstr ""
541
+
542
+ #: includes/class-bwp-simple-gxs.php:679
543
+ msgid "English"
544
+ msgstr ""
545
+
546
+ #: includes/class-bwp-simple-gxs.php:680
547
+ msgid "French"
548
+ msgstr ""
549
+
550
+ #: includes/class-bwp-simple-gxs.php:681
551
+ msgid "Spanish"
552
+ msgstr ""
553
+
554
+ #: includes/class-bwp-simple-gxs.php:682
555
+ msgid "German"
556
+ msgstr ""
557
+
558
+ #: includes/class-bwp-simple-gxs.php:683
559
+ msgid "Portuguese"
560
+ msgstr ""
561
+
562
+ #: includes/class-bwp-simple-gxs.php:684
563
+ msgid "Polish"
564
+ msgstr ""
565
+
566
+ #: includes/class-bwp-simple-gxs.php:685
567
+ msgid "Norwegian"
568
+ msgstr ""
569
+
570
+ #: includes/class-bwp-simple-gxs.php:686
571
+ msgid "Dutch"
572
+ msgstr ""
573
+
574
+ #: includes/class-bwp-simple-gxs.php:687
575
+ msgid "Italian"
576
+ msgstr ""
577
+
578
+ #: includes/class-bwp-simple-gxs.php:688
579
+ msgid "Vietnamese"
580
+ msgstr ""
581
+
582
+ #: includes/class-bwp-simple-gxs.php:689
583
+ msgid "Simplified Chinese"
584
+ msgstr ""
585
+
586
+ #: includes/class-bwp-simple-gxs.php:692
587
+ msgid "include"
588
+ msgstr ""
589
+
590
+ #: includes/class-bwp-simple-gxs.php:693
591
+ msgid "exclude"
592
+ msgstr ""
593
+
594
+ #: includes/class-bwp-simple-gxs.php:696
595
+ msgid "news categories"
596
+ msgstr ""
597
+
598
+ #: includes/class-bwp-simple-gxs.php:697
599
+ msgid "news tags"
600
+ msgstr ""
601
+
602
+ #: includes/class-bwp-simple-gxs.php:703
603
+ msgid "A new <code>post_google_news.xml</code> sitemap will be added to the main <code>sitemapindex.xml</code>."
604
+ msgstr ""
605
+
606
+ #: includes/class-bwp-simple-gxs.php:704
607
+ msgid "Keywords are derived from"
608
+ msgstr ""
609
+
610
+ #: includes/class-bwp-simple-gxs.php:705
611
+ msgid "This ping works separately from the sitemapindex ping, and only occurs when you publish an article in one of the news categories set below."
612
+ msgstr ""
613
+
614
+ #: includes/class-bwp-simple-gxs.php:706
615
+ msgid "This mode is meant for News Blogs that have posts assigned to more than one categories. It is an advanced feature and should only be enabled if you do have similar blogs."
616
+ msgstr ""
617
+
618
+ #: includes/class-bwp-simple-gxs.php:712
619
+ msgid ". Do <strong>NOT</strong> use news tags if your news sitemap contains a lot of posts as it can be very inefficient to do so. This will be improved in future versions."
620
+ msgstr ""
621
+
622
+ #: includes/class-bwp-simple-gxs.php:736
623
+ #, php-format
624
+ msgid "<strong>%d</strong> cached sitemaps have been flushed successfully!"
625
+ msgstr "成功的更新 <strong>%d</strong> sitemap 的快取檔案"
626
+
627
+ #: includes/class-bwp-simple-gxs.php:738
628
+ msgid "Could not delete any cached sitemaps. Please manually check the cache directory."
629
+ msgstr ""
630
+
631
+ #: includes/class-bwp-simple-gxs.php:787
632
+ msgid "All options have been saved."
633
+ msgstr ""
634
+
635
+ #: includes/class-bwp-simple-gxs.php:809
636
+ msgid "Warning"
637
+ msgstr "警告"
638
+
639
+ #: includes/class-bwp-simple-gxs.php:809
640
+ msgid "Cache directory does not exist or is not writable. Please read more about directory permission <a href='http://www.zzee.com/solutions/unix-permissions.shtml'>here</a> (Unix)."
641
+ msgstr ""
642
+
643
+ #: includes/class-bwp-simple-gxs.php:820
644
+ msgid "Clear All Logs"
645
+ msgstr "清除所有記錄"
646
+
647
+ #: includes/class-bwp-simple-gxs.php:874
648
+ msgid "(Debug is on)"
649
+ msgstr "(啟用 偵錯模式)"
650
+
651
+ #: includes/class-bwp-simple-gxs.php:887
652
+ msgid "<strong>BWP Google XML Sitemaps Error:</strong> "
653
+ msgstr "<strong>BWP Google XML Sitemaps 錯誤訊息:</strong> "
654
+
655
+ #: includes/class-bwp-simple-gxs.php:887
656
+ msgid "BWP Google XML Sitemaps Error"
657
+ msgstr "BWP Google XML Sitemaps 錯誤訊息:"
658
+
659
+ #: includes/class-bwp-simple-gxs.php:910
660
+ #, php-format
661
+ msgid "Nothing here... yet! Try submitting your <a href=\"%s\">sitemapindex</a> first!"
662
+ msgstr "還沒有任何的東西! 請先嘗試連結 <a href=\"%s\">sitemapindex</a>!"
663
+
664
+ #: includes/class-bwp-simple-gxs.php:910
665
+ msgid "No log yet!"
666
+ msgstr "還沒有任何的記錄!"
667
+
668
+ #: includes/class-bwp-simple-gxs.php:921
669
+ #, php-format
670
+ msgid "<a href=\"%s\" target=\"_blank\">%s</a> has been successfully built on <strong>%s</strong>."
671
+ msgstr "<a href=\"%s\" target=\"_blank\">%s</a> 於 <strong>%s</strong> 成功的生成"
672
+
673
+ #: includes/class-bwp-simple-gxs.php:932
674
+ #: includes/class-bwp-simple-gxs.php:949
675
+ msgid "M j, Y : H:i:s"
676
+ msgstr "M j, Y : H:i:s"
677
+
678
+ #: includes/class-bwp-simple-gxs.php:1018
679
+ msgid "Category's name"
680
+ msgstr ""
681
+
682
+ #: includes/class-bwp-simple-gxs.php:1018
683
+ #, php-format
684
+ msgid "<span>Genres used for this category</span> (more info <a href=\"%s\" target=\"_blank\">here</a>)"
685
+ msgstr ""
686
+
687
+ #: includes/class-bwp-simple-gxs.php:1309
688
+ #, php-format
689
+ msgid "Requested module (<em>%s</em>) not found or not allowed."
690
+ msgstr "請求的模組 (<em>%s</em>) 不存在或是不允許使用。"
691
+
692
+ #: includes/class-bwp-simple-gxs.php:1368
693
+ #: includes/class-bwp-simple-gxs.php:1389
694
+ #, php-format
695
+ msgid "Loaded a custom sub-module file: <strong>%s</strong>."
696
+ msgstr ""
697
+
698
+ #: includes/class-bwp-simple-gxs.php:1377
699
+ #, php-format
700
+ msgid "Mapped sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the requested sub-module instead."
701
+ msgstr ""
702
+
703
+ #: includes/class-bwp-simple-gxs.php:1397
704
+ #, php-format
705
+ msgid "Sub-module file: <strong>%s</strong> is not available in both default and custom module directory. The plugin will now try loading the parent module instead."
706
+ msgstr "子模組 <strong>%s</strong> 檔案並不存在於預設或是自行定義的模組資料夾中。外掛將會嘗試以其父模組取代他的作用。"
707
+
708
+ #: includes/class-bwp-simple-gxs.php:1411
709
+ #, php-format
710
+ msgid "Loaded a custom module file: <strong>%s</strong>."
711
+ msgstr ""
712
+
713
+ #: includes/class-bwp-simple-gxs.php:1417
714
+ #, php-format
715
+ msgid "Could not load module file: <strong>%s</strong> in both default and custom module directory. Please recheck if that module file exists."
716
+ msgstr "無法載入模組檔案 <strong>%s</strong> 。請檢查模組檔案是否存在。"
717
+
718
+ #: includes/class-bwp-simple-gxs.php:1437
719
+ #, php-format
720
+ msgid "There is no class named <strong>%s</strong> in the module file <strong>%s</strong>."
721
+ msgstr ""
722
+
723
+ #: includes/class-bwp-simple-gxs.php:1446
724
+ #, php-format
725
+ msgid "Loaded a custom sitemapindex module file: <strong>%s</strong>."
726
+ msgstr ""
727
+
728
+ #: includes/class-bwp-simple-gxs.php:1469
729
+ #, php-format
730
+ msgid "Successfully generated <em>%s.xml</em> using module <em>%s</em>."
731
+ msgstr "成功的生成 <em>%s.xml</em> ,使用模組 <em>%s</em> "
732
+
733
+ #: includes/class-bwp-simple-gxs.php:1500
734
+ msgid "<strong>BWP Google XML Sitemap Message:</strong> Unexpected output (most of the time PHP errors) is preventing BWP GXS from showing any sitemap contents. Try disabling <code>WP_DEBUG</code> or this plugin's debug mode, whichever is on. All unexpected outputs should be shown just above this message. If you don't see any, contact me and I might be able to help."
735
+ msgstr ""
736
+
737
+ #: includes/class-bwp-simple-gxs.php:1630
738
+ msgid "Unknown response code from search engines. Ping failed."
739
+ msgstr ""
740
+
741
+ #: includes/class-bwp-simple-gxs.php:1632
742
+ #, fuzzy, php-format
743
+ msgid "Pinged %s with %s successfully!"
744
+ msgstr "成功的主動通知 %s。"
745
+
746
+ #: includes/class-bwp-simple-gxs.php:1637
747
+ #, php-format
748
+ msgid "Error %s from %s"
749
+ msgstr "錯誤 %s 來至於 %s"
750
+
751
+ #: includes/class-bwp-simple-gxs.php:1642
752
+ #, php-format
753
+ msgid "Ping limit for today to %s has been reached, sorry!"
754
+ msgstr "對不起!已超過本日的限額 %s。"
755
+
756
+ #: includes/class-bwp-simple-gxs.php:1670
757
+ #, fuzzy, php-format
758
+ msgid "<em>%s.xml</em> does not have any item. You can fix this easily by excluding any post types / terms you do not use in <em>Sitemap Generator</em> tab within your admin area. If you still see this error, consider checking the module that generates this sitemap (<em>%s.php</em>)."
759
+ msgstr "<em>%s.xml</em> 不包含任何的項目。本外掛將針對收尋引擎的請求送出 404 錯誤。你應該要檢查負責生成本 sitemap 的檔案(<em>%s.php</em>)。"
760
+
761
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:80
762
+ msgid "Plugin Configurations"
763
+ msgstr "外掛設定"
764
+
765
+ #: includes/bwp-option-page/includes/class-bwp-option-page.php:398
766
+ msgid "Save Changes"
767
+ msgstr "儲存變更"
768
+
769
+ #~ msgid "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">important</a>"
770
+ #~ msgstr "Yahoo &mdash; <a href=\"%s\" target=\"_blank\">資訊</a>"
771
+
772
+ #~ msgid "log"
773
+ #~ msgstr "log"
774
+
775
+ #~ msgid "make your sitemaps ~ 70% smaller."
776
+ #~ msgstr "make your sitemaps ~ 70% smaller."
777
+
778
+ #~ msgid "static pages' sitemap."
779
+ #~ msgstr "static pages' sitemap."
780
+
781
+ #~ msgid "tag archives' sitemaps."
782
+ #~ msgstr "tag archives' sitemaps."
783
+
784
+ #~ msgid "%s"
785
+ #~ msgstr "%s"
readme.txt CHANGED
@@ -1,257 +1,275 @@
1
- === Better WordPress Google XML Sitemaps (with sitemapindex and Multi-site support) ===
2
- Contributors: OddOneOut
3
- Donate link: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#contributions
4
- Tags: xml sitemaps, xml sitemap, google xml sitemaps, sitemapindex, sitemap, sitemaps, seo, bing, google, msn, ask, multi-site, multisite
5
- Requires at least: 3.0
6
- Tested up to: 3.3
7
- Stable tag: 1.1.6
8
-
9
- The first WordPress XML Sitemap plugin that comes with comprehensive support for Sitemapindex and Multi-site.
10
-
11
- == Description ==
12
-
13
- Welcome to the first WordPress sitemap plugin that has support for both sitemapindex and Multi-site websites! You will no longer have to worry about the 50,000 URL limit or the time it takes for a sitemap to be generated. This plugin is fast, consumes much fewer resources and can be extended via your very own modules (yes, no hooks needed!). Here's a [demo](http://betterwp.net/sitemapindex.xml) of the sitemapindex if you are interested.
14
-
15
- **New in 1.1.0!**
16
-
17
- * This plugin can now automatically split large post sitemaps into smaller ones. You can set a limit for each small sitemap. For example if you have 200K posts and would like to have 10K posts for each sitemap, BWP GXS will then split `post.xml` into 20 parts (i.e. from `post_part1.xml` to `post_part20.xml`). This helps you bypass the 50,000 URLs limit without having to build your custom modules, and also helps make your sitemaps smaller, lighter, and of course faster to generate. This plugin has been tested on sites that have nearly 200K posts and it took less than 1 second to generate the sitemapindex.
18
- * Added a new sitemap, called External Pages' sitemap, using which you can easily add links to pages that do not belong to WordPress to the Sitemap Index. Please refer to the [customization section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#external_sitemap) for more details.
19
- * Added options in the Generator to exclude certain post types, taxonomies without having to use filters.
20
- * Added new hooks to default post-based and taxonomy-based modules to allow easier SQL query customization (you don't have to develop custom modules anymore just to change minor things). Read [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#exclude_items) for more details.
21
-
22
- **Sitemapindex Support**
23
-
24
- What's so great about a sitemapindex you might say? Sitemapindex, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemaps files inside it. Sitemapindex, therefore, gives you many benefits, such as: possibility to bypass the 50,000 URL limit (you can have 10 custom sitemaps, each has 10000 URLs), or possibility to make the generation time much faster (because each sitemap is requested separately and is built by its own module), etc.
25
-
26
- **Multi-site Support**
27
-
28
- Each website within your network will have its own sitemapindex and sitemaps. For sub-domain installation, your sitemapindex will appear at `http://sub-domain.example.com/sitemapindex.xml`. For sub-folder installation, your sitemapindex will appear at `http://example.com/sub-folder/sitemapindex.xml`. And of course, there's always a sitemapindex for your main site, available at `http://example.com/sitemapindex.xml`. If you choose the sub-domain approach, each sub-domain can also have its own robots.txt.
29
-
30
- **Custom sitemaps using modules**
31
-
32
- The unrivaled flexibility this plugin offers is the ability to define your custom sitemaps using modules. Each module is a actually .php file that tell BWP Google XML Sitemap how to build a sitemap file. You can extend default modules or create completely new ones. This plugin also comes with a convenient base class for developing modules with easy to use and thoroughly documented API. Since modules can be defined by you, there's no limitation what a sitemap can have (for example you can bypass the 50,000 URL limit, as stated above). There's one limitation, though: your imagination ;) . Oh, did I mention that you can even use module to create another sitemapindex?
33
-
34
- **Detailed Log and Debugging mode**
35
-
36
- Developing modules needs debugging and this plugin makes that so easy for any developers. There are two kinds of logs: sitemap log and build log. Sitemap log tells you what sitemaps you have and when they were last requested/updated while build log tells you what's going on when a particular sitemap is built. The debug mode helps you trace errors in modules conveniently!
37
-
38
- **For a complete feature list, please visit this [plugin's official page](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/)**
39
-
40
- **Important Notes**
41
-
42
- If you have any problem using this plugin, refer to the [FAQ section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/faq/) for possible solutions, and workarounds.
43
-
44
- **Get in touch**
45
-
46
- * I'm available at [BetterWP.net](http://betterwp.net) and you can also follow me on [Twitter](http://twitter.com/0dd0ne0ut).
47
- * Check out [latest WordPress Tips and Ideas](http://feeds.feedburner.com/BetterWPnet) from BetterWP.net.
48
-
49
- **Languages**
50
-
51
- * English (default)
52
- * Malaysian (ms_MY) - Thanks to [d4rkcry3r](http://d4rkcry3r.com)!
53
-
54
- Please [help translate](http://betterwp.net/wordpress-tips/create-pot-file-using-poedit/) this plugin!
55
-
56
- == Installation ==
57
-
58
- 1. Upload the `bwp-google-xml-sitemaps` folder to the `/wp-content/plugins/` directory
59
- 2. Activate the plugin through the Plugins menu in WordPress. After activation, you should see a menu of this plugin on your left. If you can not locate it, click on Settings under the plugin's name.
60
- 3. Configure the plugin
61
- 4. Build your sitemap for the first time or just submit the sitemapindex to all major search engines.
62
- 5. Enjoy!
63
-
64
- [View instructions with images](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/installation/).
65
-
66
- == Frequently Asked Questions ==
67
-
68
- **Q1: I got white pages and/or 'Content Encoding Error' error?**
69
-
70
- 1. PHP error messages from other plugins or from this plugin itself can cause this issue, especially when you have `WP_DEBUG` set to true (try commenting out this line in your `wp-config.php` file: `define(WP_DEBUG, true);`). Refer to the second question to know how to trace the actual errors.
71
-
72
- 2. BWP GXS runs out of memory or reaches maximum execution time. This often happens when you try to build large sitemaps. I've tried to optimize this plugin a lot since the first version, but if you are using a lot of memory eating plugins on your website, it is very hard for BWP GXS to build huge sitemaps (containing thousands of items). Anyway, to resolve this issue, try decreasing the three limit options in the Generator tab: max number of items per sitemap (first option), max number of items per split sitemap (first option in Sitemap Index Options) and max items to get in one SQL query (second option in Module Options). You might try the following presets (in the same order as above):
73
- * 1000, 1000, 100 (for sites with low memory limit like 32MB)
74
- * 5000, 5000, 500 (for sites with lots of posts, tags, categories, etc.)
75
- * 5000, 5000, 2500 (if you have problem with max execution time)
76
-
77
- Also, you can try the tips mentioned in [this post of mine](http://betterwp.net/6-wordpress-memory-usage/).
78
-
79
- 3. A caching plugin is interfering. Tell that caching plugin to ignore `.xml` file. For example, if you use WP Super Cache, on the Advanced Tab, scroll to the 'Accepted Filenames & Rejected URIs' section, and then in the first textarea, type in `\.xml`. Now save the changes and flush the all caches. See if that works for you.
80
-
81
- **Q2: I've tried the tips mentioned in Question #1, but still got white pages / plain text sitemaps?**
82
-
83
- It's very likely that you're enabling this option: 'Clean unexpected output before sitemap generation', try disabling it and your sitemaps will show up as expected.
84
-
85
- **Q3: I got the error 'Content Encoding Error', what should I do?**
86
-
87
- If you are enabling this plugin's debug mode and/or WP_DEBUG, this error is very normal because the module you use might print errors on pages, thus corrupting your xml sitemaps. To view the actual errors without being greeted with the 'Content Encoding Error', please follow these steps:
88
-
89
- 1. Enable this plugin's debug mode if you haven't done so.
90
- 2. Open the file `class-bwp-simple-gxs.php` inside `bwp-google-xml-sitemaps/includes/` and look for this function: `output_sitemap()`.
91
- 3. Place an `exit;` right after the opening bracket, like so:
92
- <pre><code>
93
- function output_sitemap()
94
- {
95
- exit;
96
- </code></pre>
97
- 4. Refresh the sitemaps with problems.
98
- 5. Kindly report the errors you see by commenting or through the [contact form](http://betterwp.net/contact/). Thanks!
99
-
100
- Note that, however, some error messages will never show up. In such case, you might want to locate the `error_log` file within your WordPress installation's root directory and read its contents for the error messages.
101
-
102
- **Q4: I got an 'Error loading stylesheet' error, what should I do?**
103
-
104
- As of version 1.1.0 it is almost impossible for such error to show up, but if you set the site url and the home url differently (one with `www` and one isn't), you will see this error. Just choose to disable stylesheet in Generator tab or change your site / home URL settings.
105
-
106
- **Q5: I got a HTTP parse error when I submit sitemap to Google Webmaster Tools, what should I do?**
107
-
108
- Please first see the answer to the first question, if it didn't work, and you are using a cache plugin such as W3 Total Cache, it is possible that such plugin wrongly assigns HTTP status headers to my sitemaps.
109
-
110
- For example, in W3 Total Cache 0.9.2.2 or possibly older, go to **Performance -> Browser Cache**, and then go to '404 error exception list' in the 'General' option block, and find this line:
111
-
112
- <pre><code>sitemap(_index|[0-9]+)?\.xml(\.gz)?</code></pre>
113
-
114
- OR this line:
115
-
116
- <pre><code>sitemap\.xml(\.gz)?</code></pre>
117
-
118
- and change it to:
119
-
120
- <pre><code>(sitemapindex|[a-z0-9_-]+)\.xml</code></pre>
121
-
122
- Save the changes and then tell W3TC to auto-install the rewrite rules to your `.htaccess` file.
123
-
124
- BWP GXS's sitemaps will now have correct HTTP status headers.
125
-
126
- **Q6: When I visit `http://example.com/sitemapindex.xml` , WordPress returns a 404 page. What should I do?**
127
-
128
- This might be caused by unflushed rewrite rules, which should have been flushed when you activate this plugin. You can try flushing them manually by visiting Settings -> Permalinks and then clicking Save Changes.
129
-
130
- **Q7: When I visit any sitemap, a plain (no theme) 404 error page appears, what's the problem?**
131
-
132
- You are possibly using some caching plugins that redirect all non-existent pages to 404 error page. Sitemaps produced by this plugin are virtual sitemaps so they will all be redirected. Just open the .htaccess file and change the `sitemap\.xml` part to something like `[a-z0-9-_]+\.xml` and you're fine.
133
-
134
- **Q8: I choose not to display certain sitemaps but the sitemapindex still displays the them?**
135
-
136
- What you see is actually a cached version of the sitemapindex. You can wait for it to be refreshed automatically or simply choose to 'Flush the Cache'.
137
-
138
- **Q9: BWP GXS tells me that 'Requested module not found or not allowed', what should I do?**
139
-
140
- This depends on specific situations and your current settings. Basically this means that the module you're trying to access has not been registered with BWP GXS or that module has been disabled but the cached sitemapindex still displays it (which is related to the question above). For a list of default modules (or sitemaps), please read this section.
141
-
142
- **Q10: Is there anyway to rename sitemapindex.xml to sitemap.xml?**
143
-
144
- You don't have to. A visit to `http://example.com/sitemap.xml` will show you the same sitemapindex. This is done to make BWP GXS more compatible with blogs that have lots of real `robots.txt`. Please note that you must remove any real sitemap.xml file in your website's root for this feature to work.
145
-
146
- **Q11: The custom sitemapindex I create seems to be nested inside the default sitemapindex, is that a bug or something?**
147
-
148
- That's the default behaviour of this plugin and I plan to improve it in future versions. Don't worry, though, you might see a red X next to your sitemapindex's name in Google's Webmaster Tools but that's only because you haven't submitted your custom sitemapindex. If you submit it separately, the error will go away :).
149
-
150
- [Check plugin news and ask questions](http://betterwp.net/topic/google-xml-sitemaps/).
151
-
152
- == Screenshots ==
153
-
154
- 1. A sample Sitemap Index this plugin produces. Large post-based sitemap was split into two parts.
155
- 2. A Custom Post Type Sitemap
156
- 3. An External Pages' Sitemap
157
- 4. The Configuration Page
158
-
159
- == Changelog ==
160
-
161
- = 1.1.6 =
162
- * Temporary fix for 1.1.5's broken custom post type URL issue. Expect a 1.1.7 real soon.
163
-
164
- = 1.1.5 =
165
- * Added a new 'site.xml' sitemap that lists all blogs within your site / network.
166
- * Added a new 'author.xml' sitemap that lists all authors contributing to a blog.
167
- * BWP GXS should now show the correct mapped sitemap URLs in the Statistics tab if you use WPMU Domain Mapping plugin.
168
- * Fixed a bug that causes duplicate items to appear on sitemap parts, thanks to Aahan for reporting!
169
- * Fixed a bug that causes the `post` post type sitemaps to show up even when disabled.
170
-
171
- **Note that the site sitemap will be enabled, while the author sitemap will be disabled by default.**
172
-
173
- = 1.1.4 =
174
- * Changed some options' descriptions.
175
- * Fixed a possible incompatibility issue with FeedWordPress plugin and Suffusion theme.
176
- * Other minor bug fixes.
177
-
178
- = 1.1.3 =
179
- * Gzip is now off by default as it was causing issue on some hosts.
180
- * In previous versions, this plugin automatically cleaned unexpected outputs before sitemap generation so that sitemaps are generated properly. Such feature also causes issues on certain hosts. As of 1.1.3 this is an option in Generator tab, and it is enabled by default.
181
- * Fixed a possible bug in the taxonomy module that could cause a maximum execution time error. Thanks to David Killingsworth for reporting this bug!
182
- * Other minor bug fixes and improvements.
183
-
184
- = 1.1.2 =
185
- * Fixed a possible memory leak.
186
- * Clear PHP errors in a friendlier way.
187
- * Other minor bug fixes and improvements.
188
-
189
- = 1.1.1 =
190
- * Added an option for users to choose whether to use GMT for Last Modified time or not.
191
- * Improved the taxonomy module a bit.
192
- * Fixed a minor bug in the page module.
193
- * Fixed a bug that affects rewrite rules of custom post types and taxonomies in some cases. A big thanks to crowinck!
194
- * Other minor bug fixes and improvements.
195
-
196
- = 1.1.0 =
197
-
198
- **New Features:**
199
-
200
- * This plugin can now automatically split large post sitemaps into smaller ones. You can set a limit for each small sitemap. For example if you have 200K posts and would like to have 10K posts for each sitemap, BWP GXS will then split `post.xml` into 20 parts (i.e. from `post_part1.xml` to `post_part20.xml`). This helps you bypass the 50,000 URLs limit without having to build your custom modules, and also helps make your sitemaps smaller, lighter, and of course faster to generate. This plugin has been tested on sites that have nearly 200K posts and it took less than 1 second to generate the sitemapindex.
201
- * Added a new sitemap, called External Pages' sitemap, using which you can easily add links to pages that do not belong to WordPress to the Sitemap Index. Please refer to the [customization section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#external_sitemap) for more details.
202
- * Added options in the Generator to exclude certain post types, taxonomies without having to use filters.
203
- * Added new hooks to default post-based and taxonomy-based modules to allow easier SQL query customization (you don't have to develop custom modules anymore just to change minor things). Read [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#exclude_items) for more details.
204
-
205
- **Improvements:**
206
-
207
- * Major overhaul of all modules to make them faster, more efficient, more accurate, and of course, consume much less memory. This version should eliminate most white page problems happened in previous versions.
208
- * Improved compatibility with cache plugins.
209
- * Improved support for sites that uses `%category%` in permalink structure.
210
- * The plugin should now display style sheet correctly in tight situations.
211
- * Added a clear log button to clear redundant log (available to network admin only).
212
- * Added an option to include links to all sitemapindex.xml files in your network in the primary website's `robots.txt`.
213
- * Tag archive sitemap can now be disabled properly.
214
- * Fixed permalinks for people using index.php in permalink structure.
215
- * Other minor bug fixes and improvements.
216
-
217
- For a detailed description of each new feature, please refer to the [release announcement](http://betterwp.net/257-bwp-google-xml-sitemaps-1-1-0/).
218
-
219
- **Due to major changes in core it is suggested that you clear the logs using the new 'Clear All Logs' button and double-check the Generator's settings. Have fun and please [rate this plugin](http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/) 5 stars if you like it, thanks!**
220
-
221
- = 1.0.5 =
222
- * Unregistered modules (such as redundant modules from 1.0.3) will now have a 404 HTTP status to prevent search engines from requesting them again.
223
- * Time for each log will now make use of your current timezone setting in Settings -> General.
224
- * And other minor fixes.
225
-
226
- **Thanks everyone for using this plugin!**
227
-
228
- = 1.0.4 =
229
- * Hot fix for WordPress in other languages, such as French, Russian. Prior to this version this plugin tries to use posts' and taxonomies' labels to build sitemaps' URLs in plural forms (e.g. taxonomy_categories). Unfortunately this breaks sitemaps when labels contain UTF8 characters with marks (such as cat�gories). All sitemaps now have singular forms. Hope that we will have a better solution in the future.
230
-
231
- **This change will make all logs' contents change as well. To remove redundant logs, please deactivate this plugin and then reactivate it.**
232
-
233
- = 1.0.3 =
234
- * Fixed incorrect regex for rewrite rules.
235
- * Added a check to make sure all necessary rewrite rules are added. No need to manually flush rewrite rules anymore.
236
- * `bwp_gxs_add_rewrite_rules` action now becomes `bwp_gxs_rewrite_rules` filter (the hook used to add your own sitemaps).
237
-
238
- **For people using a cache plugin, please visit the [FAQ section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/faq/) for a possible compatibility fix.**
239
-
240
- = 1.0.2 =
241
- * Fixed a bug that could produce wrong or empty last modified dates in sitemapindex.
242
- * Corrected a typo in page.php module.
243
- * Added Malaysian translation, thanks to d4rkcry3r!
244
-
245
- = 1.0.1 =
246
- * Now you can browser to `http://example.com/sitemap.xml` to view your sitemapindex. You can submit it too if you want. **Important**: Make sure you don't have any real sitemap.xml file in your website's root. Also, you will have to flush all rewrite rules, by either deactivating and then reactivating this plugin, or simply go to [Permalink Settings](http://example.com/wp-admin/options-permalink.php) and click on Save Changes.
247
- * Build stats (build time, number of queries, memory usage) should be more accurate now.
248
- * Add a canonical redirection for sitemap URL to avoid problems with XSLT style sheet's absolute URL.
249
- * Fixed a minor error in the base module class.
250
-
251
- = 1.0.0 =
252
- * Initial Release.
253
-
254
- == Upgrade Notice ==
255
-
256
- = 1.0.0 =
257
- * Enjoy the plugin!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Better WordPress Google XML Sitemaps (with sitemapindex, multi-site and Google News sitemap support) ===
2
+ Contributors: OddOneOut
3
+ Donate link: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#contributions
4
+ Tags: xml sitemaps, xml sitemap, google xml sitemaps, sitemapindex, sitemap, sitemaps, sitemap.xml, seo, bing, google, msn, ask, google news, news sitemap, google news sitemap
5
+ Requires at least: 3.0
6
+ Tested up to: 3.9.1
7
+ Stable tag: 1.3.0
8
+ License: GPLv3 or later
9
+
10
+ The first WordPress XML Sitemap plugin that comes with comprehensive support for Sitemapindex, Multi-site and Google News sitemap.
11
+
12
+ == Description ==
13
+
14
+ With BWP GXS you will no longer have to worry about the 50,000 URL limit or the time it takes for a sitemap to be generated. This plugin is fast, consumes much less resource and can be extended via your very own modules (yes, no hooks needed!). Here's a [demo](http://betterwp.net/sitemapindex.xml) of the sitemapindex if you are interested.
15
+
16
+ **Google News Sitemap Support (since 1.2.0)**
17
+
18
+ Add a [Google News sitemap](https://support.google.com/news/publisher/answer/75717?hl=en&ref_topic=4359874) to your sitemapindex easily. News sitemap can be used to ping search engines individually if you want. And of course, whenever you publish a new post in a news category, all selected search engines will be pinged.
19
+
20
+ **Sitemapindex Support**
21
+
22
+ Sitemapindex, as its name suggests, is one kind of sitemaps that allows you to group multiple sitemaps files inside it. Sitemapindex, therefore, gives you many benefits, such as: possibility to bypass the 50,000 URL limit (you can have 10 custom sitemaps, each has 10000 URLs), or possibility to make the generation time much faster (because each sitemap is requested separately and is built by its own module), etc.
23
+
24
+ **Splitting post-based sitemaps (since 1.1.0)**
25
+
26
+ As of version 1.1.0, this plugin can automatically split large post sitemaps into smaller ones. You can set a limit for each small sitemap. For example if you have 200K posts and would like to have 10K posts for each sitemap, BWP GXS will then split `post.xml` into 20 parts (i.e. from `post_part1.xml` to `post_part20.xml`). This helps you bypass the 50,000 URLs limit without having to build your custom modules, and also helps make your sitemaps smaller, lighter, and of course faster to generate. This plugin has been tested on sites that have nearly 200K posts and it took less than 1 second to generate the sitemapindex.
27
+
28
+ **Multi-site Support**
29
+
30
+ Each website within your network will have its own sitemapindex and sitemaps. For sub-domain installation, your sitemapindex will appear at `http://sub-domain.example.com/sitemapindex.xml`. For sub-folder installation, your sitemapindex will appear at `http://example.com/sub-folder/sitemapindex.xml`. And of course, there's always a sitemapindex for your main site, available at `http://example.com/sitemapindex.xml`. If you choose the sub-domain approach, each sub-domain can also have its own robots.txt.
31
+
32
+ **Custom sitemaps using modules**
33
+
34
+ The unrivaled flexibility this plugin offers is the ability to define your custom sitemaps using modules. Each module is a actually .php file that tell BWP Google XML Sitemap how to build a sitemap file. You can extend default modules or create completely new ones. This plugin also comes with a convenient base class for developing modules with easy to use and thoroughly documented API. Since modules can be defined by you, there's no limitation what a sitemap can have (for example you can bypass the 50,000 URL limit, as stated above). There's one limitation, though: your imagination ;) . Oh, did I mention that you can even use module to create another sitemapindex?
35
+
36
+ **Detailed Sitemap Log and Debug**
37
+
38
+ Developing modules needs debugging and this plugin makes that so easy for any developers.
39
+
40
+ There are two kinds of logs: sitemap item log and sitemap generation log. Sitemap item log tells you what and when sitemaps are generated while sitemap generation log tells you how they are generated.
41
+
42
+ As of version 1.3.0 there are two debug modes, namely "Debug" and "Debug extra", read more [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#sitemap_log_debug) to know how to make the most out of them.
43
+
44
+ **For a complete feature list, please visit this [plugin's official page](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/)**
45
+
46
+ Please don't forget to rate this plugin [5 shining stars](http://wordpress.org/support/view/plugin-reviews/bwp-google-xml-sitemaps?filter=5) if you like it, thanks!
47
+
48
+ **Important Notes**
49
+
50
+ If you have any problem using this plugin, refer to the [FAQ section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/faq/) for possible solutions, and workarounds.
51
+
52
+ **Get in touch**
53
+
54
+ * Support is provided via [BetterWP.net Community](http://betterwp.net/community/).
55
+ * Follow and contribute to development via [Github](https://github.com/OddOneOut/Better-WordPress-Google-XML-Sitemaps).
56
+ * You can also follow me on [Twitter](http://twitter.com/0dd0ne0ut).
57
+ * Check out [latest WordPress Tips and Ideas](http://feeds.feedburner.com/BetterWPnet) from BetterWP.net.
58
+
59
+ **Languages**
60
+
61
+ * English (default)
62
+ * Malaysian (ms_MY) - Thanks to [d4rkcry3r](http://d4rkcry3r.com)!
63
+ * Traditional Chinese (zh_TW) - Thanks to Richer Yang!
64
+ * Romanian (ro_RO) - Thanks to Luke Tyler!
65
+ * Spanish (es_ES) - Thanks to Ruben Hernandez - http://usitility.es
66
+
67
+ Please [help translate](http://betterwp.net/wordpress-tips/create-pot-file-using-poedit/) this plugin!
68
+
69
+ == Installation ==
70
+
71
+ 1. Upload the `bwp-google-xml-sitemaps` folder to the `/wp-content/plugins/` directory
72
+ 2. Activate the plugin through the Plugins menu in WordPress. After activation, you should see a menu of this plugin on your left. If you can not locate it, click on Settings under the plugin's name.
73
+ 3. Configure the plugin
74
+ 4. Build your sitemap for the first time or just submit the sitemapindex to all major search engines.
75
+ 5. Enjoy!
76
+
77
+ [View instructions with images](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/installation/).
78
+
79
+ == Frequently Asked Questions ==
80
+
81
+ [Visit this link for the complete FAQ](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/faq/)
82
+
83
+ == Screenshots ==
84
+
85
+ 1. A sample Sitemap Index this plugin produces. Large post-based sitemaps are split into smaller parts.
86
+ 2. A custom post type sitemap
87
+ 3. An external pages sitemap
88
+
89
+ == Changelog ==
90
+
91
+ = 1.3.0 =
92
+ * **New features**
93
+ * Added a new setting to control which post types can be used to ping search engines
94
+ * Added a ping limit setting
95
+ * Added a "Save changes and Flush cache" button
96
+
97
+ * **Enhancements**
98
+ * Plugin's admin areas have been re-organized to be easier to use.
99
+ * Updated all sitemap modules with easier to use APIs.
100
+ * Last modified dates are now more properly handled.
101
+ * Error log has been refined to be more friendly and useful.
102
+ * Post types that do not have any post should not be listed in `sitemapindex.xml` by default.
103
+ * Posts that are password-protected should not be listed in sitemap files.
104
+ * Be more selective when pinging search engines, this is to avoid double pinging when using plugin like Snitch.
105
+ * Replaced the "Clean PHP errors" function with a "Debug extra" mode that can be used to easily debug "Content Encoding error" and similar errors, more info about "Debug extra" [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#sitemap_log_debug).
106
+ * When debug or debug extra is on, `no-cache` headers are sent to ensure a proper debugging environment.
107
+ * Caching is now disabled by default to avoid confusion when setting up the sitemapindex.
108
+ * Cache directory can now be edited via:
109
+ * Plugin's admin area: *BWP Sitemaps >> XML Sitemaps >> Caching*
110
+ * PHP Constant: e.g. `define('BWP_GXS_CACHE_DIR', 'path/to/cache/directory');`
111
+ * Filters: use `bwp_gxs_cache_dir`
112
+ * Added `bwp_gxs_excluded_posts` filter hook to let users exclude posts using an array of IDs instead of an SQL string. This is meant to replace `bwp_gxs_post_where` filter hook when using to exclude certain posts. More info [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#exclude_items).
113
+ * Added `bwp_gxs_excluded_terms` filter hook as a taxonomy-equivalent to `bwp_gxs_excluded_posts`, this works the same as (and deprecates) `bwp_gxs_term_exclude`.
114
+ * Added `bwp_gxs_sitemap_lastmod` filter hook to let users modify last modified dates of sitemaps inside a sitemapindex programmatically when needed.
115
+ * Ping settings can now be set per blog instead of site-wise.
116
+ * Added a Spanish translation - Thanks to Ruben!
117
+ * Added more News languages:
118
+ * Hebrew (he)
119
+ * Traditional Chinese (zh-tw)
120
+ * Arabic (ar)
121
+ * Hindi (hi)
122
+ * Japanese (ja)
123
+ * Other enhancements.
124
+
125
+ * **Bugfixes**:
126
+ * Fixed an issue that might cause an extraneous split part to appear.
127
+ * Fixed an issue that might cause "Invalid last modified date" error
128
+ * Fixed an issue that might cause the sitemapindex to use the regular XSLT stylesheet
129
+ * Sitemapindex should now respect excluded posts when splitting post-based sitemaps
130
+ * Other bugfixes.
131
+
132
+ **Important Update Note**:
133
+
134
+ * if you're using custom modules make sure that you re-read the [documentation](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#module_api) for updated info about the module API.
135
+ * When the sitemapindex is generated for the first time, you won't see any <em>Last modified date</em> for any child sitemaps because none of them have been generated yet. This is expected and adhered to the <a href="http://www.sitemaps.org/protocol.html#sitemapIndexTagDefinitions">official sitemap protocol</a>.
136
+
137
+ **Next major version (1.4.0) will have Image and Video sitemap support, so make sure you [stay alerted](http://feeds.feedburner.com/BetterWPnet)!**
138
+
139
+ = 1.2.3 =
140
+ * Temporary fix for unexpected character that appears on every page.
141
+
142
+ = 1.2.2 =
143
+
144
+ * Marked as WordPress 3.7 compatible.
145
+ * Added two new Google News Sitemap languages: Turkish (tr) and Russian (ru).
146
+ * Updated BWP Framework to fix a possible bug that caues BWP setting pages to go blank.
147
+ * Removed Ask.com's pinging service as it has been retired.
148
+ * **Good news**: ManageWP.com has become the official sponsor for BWP Google Xml Sitemaps - [Read more](http://betterwp.net/319-better-wordpress-plugins-updates-2013/).
149
+
150
+ = 1.2.1 =
151
+ As you might have guessed, this release focuses on improving the new Google News Sitemap Module which was introduced in 1.2.0. Below are some enhancements:
152
+
153
+ * Added new languages (Spanish, German, Polish, Portuguese, etc.).
154
+ * Added a new hook (`bwp_gxs_news_name`) that allows you to set a custom sitename without having to change the sitename setting inside WordPress.
155
+ * Added a new option that allows you to choose whether to use news categories or news tags as keywords (very experimental and can be inefficient if you have a lot of posts).
156
+ * WordPress's timezone settings are now properly respected.
157
+ * Genres tags are omitted entirely if no genres are set for a particular categories.
158
+ * A new Multi-category mode (disabled by default) has been added that offers the following features:
159
+ * If a post is in both an included and an excluded category, it's now excluded.
160
+ * If a post is in two or more categories, it can now have all genres that are assigned to those categories.
161
+ * If a post is in two or more categories, it can now have all categories as its keywords (only if you choose to use news categories as keywords of course)
162
+
163
+ Other functionality of BWP GXS remains the same, so test the News sitemap as much as you can and report any bug you may stumble upon. Enjoy :).
164
+
165
+ = 1.2.0 =
166
+ * Added a Google News sitemap module. Creating a news sitemap has never been so easy! More information can be found [here](http://betterwp.net/314-bwp-gxs-1-2-0-with-news-sitemap/).
167
+ * WPMU Domain Mapping is now supported better (robots.txt, site.xml, sitemap urls in Statistics tab).
168
+ * BWP GXS's menu can now be put under **Settings** using a simple filter.
169
+ * BWP GXS's admin style is now enqueued correctly so no more warning from WordPress.
170
+ * Added a Traditional Chinese and a Romanian transation, thanks to Richer Yang and Luke Tyler!
171
+ * All invalid URls, such as `#` and external or empty ones, are now removed from sitemaps.
172
+ * Removed Yahoo's pinging service.
173
+ * Fixed a bug that causes duplicate author entries to appear in author sitemap.
174
+ * Fixed a bug that causes a "class not found" error with paginated custom post type sitemap modules.
175
+ * Other fixes and improvements.
176
+
177
+ **Report bugs, request features here: http://betterwp.net/community/forum/2/bwp-google-xml-sitemaps/**
178
+
179
+ = 1.1.6 =
180
+ * Temporary fix for 1.1.5's broken custom post type URL issue.
181
+
182
+ = 1.1.5 =
183
+ * Added a new 'site.xml' sitemap that lists all blogs within your site / network.
184
+ * Added a new 'author.xml' sitemap that lists all authors contributing to a blog.
185
+ * BWP GXS should now show the correct mapped sitemap URLs in the Statistics tab if you use WPMU Domain Mapping plugin.
186
+ * Fixed a bug that causes duplicate items to appear on sitemap parts, thanks to Aahan for reporting!
187
+ * Fixed a bug that causes the `post` post type sitemaps to show up even when disabled.
188
+
189
+ **Note that the site sitemap will be enabled, while the author sitemap will be disabled by default.**
190
+
191
+ = 1.1.4 =
192
+ * Changed some options' descriptions.
193
+ * Fixed a possible incompatibility issue with FeedWordPress plugin and Suffusion theme.
194
+ * Other minor bug fixes.
195
+
196
+ = 1.1.3 =
197
+ * Gzip is now off by default as it was causing issue on some hosts.
198
+ * In previous versions, this plugin automatically cleaned unexpected outputs before sitemap generation so that sitemaps are generated properly. Such feature also causes issues on certain hosts. As of 1.1.3 this is an option in Generator tab, and it is enabled by default.
199
+ * Fixed a possible bug in the taxonomy module that could cause a maximum execution time error. Thanks to David Killingsworth for reporting this bug!
200
+ * Other minor bug fixes and improvements.
201
+
202
+ = 1.1.2 =
203
+ * Fixed a possible memory leak.
204
+ * Clear PHP errors in a friendlier way.
205
+ * Other minor bug fixes and improvements.
206
+
207
+ = 1.1.1 =
208
+ * Added an option for users to choose whether to use GMT for Last Modified time or not.
209
+ * Improved the taxonomy module a bit.
210
+ * Fixed a minor bug in the page module.
211
+ * Fixed a bug that affects rewrite rules of custom post types and taxonomies in some cases. A big thanks to crowinck!
212
+ * Other minor bug fixes and improvements.
213
+
214
+ = 1.1.0 =
215
+
216
+ **New Features:**
217
+
218
+ * This plugin can now automatically split large post sitemaps into smaller ones. You can set a limit for each small sitemap. For example if you have 200K posts and would like to have 10K posts for each sitemap, BWP GXS will then split `post.xml` into 20 parts (i.e. from `post_part1.xml` to `post_part20.xml`). This helps you bypass the 50,000 URLs limit without having to build your custom modules, and also helps make your sitemaps smaller, lighter, and of course faster to generate. This plugin has been tested on sites that have nearly 200K posts and it took less than 1 second to generate the sitemapindex.
219
+ * Added a new sitemap, called External Pages' sitemap, using which you can easily add links to pages that do not belong to WordPress to the Sitemap Index. Please refer to the [customization section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#external_sitemap) for more details.
220
+ * Added options in the Generator to exclude certain post types, taxonomies without having to use filters.
221
+ * Added new hooks to default post-based and taxonomy-based modules to allow easier SQL query customization (you don't have to develop custom modules anymore just to change minor things). Read [here](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#exclude_items) for more details.
222
+
223
+ **Improvements:**
224
+
225
+ * Major overhaul of all modules to make them faster, more efficient, more accurate, and of course, consume much less memory. This version should eliminate most white page problems happened in previous versions.
226
+ * Improved compatibility with cache plugins.
227
+ * Improved support for sites that uses `%category%` in permalink structure.
228
+ * The plugin should now display style sheet correctly in tight situations.
229
+ * Added a clear log button to clear redundant log (available to network admin only).
230
+ * Added an option to include links to all sitemapindex.xml files in your network in the primary website's `robots.txt`.
231
+ * Tag archive sitemap can now be disabled properly.
232
+ * Fixed permalinks for people using index.php in permalink structure.
233
+ * Other minor bug fixes and improvements.
234
+
235
+ For a detailed description of each new feature, please refer to the [release announcement](http://betterwp.net/257-bwp-google-xml-sitemaps-1-1-0/).
236
+
237
+ **Due to major changes in core it is suggested that you clear the logs using the new 'Clear All Logs' button and double-check the Generator's settings. Have fun and please [rate this plugin](http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/) 5 stars if you like it, thanks!**
238
+
239
+ = 1.0.5 =
240
+ * Unregistered modules (such as redundant modules from 1.0.3) will now have a 404 HTTP status to prevent search engines from requesting them again.
241
+ * Time for each log will now make use of your current timezone setting in Settings -> General.
242
+ * And other minor fixes.
243
+
244
+ **Thanks everyone for using this plugin!**
245
+
246
+ = 1.0.4 =
247
+ * Hot fix for WordPress in other languages, such as French, Russian. Prior to this version this plugin tries to use posts' and taxonomies' labels to build sitemaps' URLs in plural forms (e.g. taxonomy_categories). Unfortunately this breaks sitemaps when labels contain UTF8 characters with marks (such as cat�gories). All sitemaps now have singular forms. Hope that we will have a better solution in the future.
248
+
249
+ **This change will make all logs' contents change as well. To remove redundant logs, please deactivate this plugin and then reactivate it.**
250
+
251
+ = 1.0.3 =
252
+ * Fixed incorrect regex for rewrite rules.
253
+ * Added a check to make sure all necessary rewrite rules are added. No need to manually flush rewrite rules anymore.
254
+ * `bwp_gxs_add_rewrite_rules` action now becomes `bwp_gxs_rewrite_rules` filter (the hook used to add your own sitemaps).
255
+
256
+ **For people using a cache plugin, please visit the [FAQ section](http://betterwp.net/wordpress-plugins/google-xml-sitemaps/faq/) for a possible compatibility fix.**
257
+
258
+ = 1.0.2 =
259
+ * Fixed a bug that could produce wrong or empty last modified dates in sitemapindex.
260
+ * Corrected a typo in page.php module.
261
+ * Added Malaysian translation, thanks to d4rkcry3r!
262
+
263
+ = 1.0.1 =
264
+ * Now you can browser to `http://example.com/sitemap.xml` to view your sitemapindex. You can submit it too if you want. **Important**: Make sure you don't have any real sitemap.xml file in your website's root. Also, you will have to flush all rewrite rules, by either deactivating and then reactivating this plugin, or simply go to [Permalink Settings](http://example.com/wp-admin/options-permalink.php) and click on Save Changes.
265
+ * Build stats (build time, number of queries, memory usage) should be more accurate now.
266
+ * Add a canonical redirection for sitemap URL to avoid problems with XSLT style sheet's absolute URL.
267
+ * Fixed a minor error in the base module class.
268
+
269
+ = 1.0.0 =
270
+ * Initial Release.
271
+
272
+ == Upgrade Notice ==
273
+
274
+ = 1.0.0 =
275
+ * Enjoy the plugin!
screenshot-1.gif DELETED
Binary file
screenshot-1.png ADDED
Binary file
screenshot-2.gif DELETED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.gif DELETED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.gif DELETED
Binary file
xsl/bwp-sitemap.xsl CHANGED
@@ -1,99 +1,99 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
4
- <xsl:template match="/">
5
- <html xmlns="http://www.w3.org/1999/xhtml">
6
- <head>
7
- <title>XML Sitemap</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <style type="text/css">
10
- body {
11
- font-family: Verdana, Arial, Helvetica, sans-serif;
12
- font-size: 12px;
13
- }
14
-
15
- #header, #footer {
16
- background-color: #F0F7FC;
17
- border: 1px #50A6E0 solid;
18
- border-right: none; border-left: none;
19
- padding: 5px 10px;
20
- margin: 10px 0px;
21
- line-height: 1.7;
22
- }
23
-
24
- #header a, #footer a {
25
- color: #2266bb;
26
- }
27
-
28
- #footer {
29
- margin-top: 15px;
30
- }
31
-
32
- table {
33
- width: 100%;
34
- }
35
-
36
- th {
37
- text-align: left;
38
- border-bottom: 1px solid #aaaaaa;
39
- padding-bottom: 10px; padding-left: 5px;
40
- }
41
-
42
- tr.odd {
43
- background-color: #f7f7f7;
44
- }
45
-
46
- td {
47
- padding: 5px;
48
- margin: 0px;
49
- }
50
- </style>
51
- </head>
52
- <body>
53
- <h1>XML Sitemap</h1>
54
- <div id="header">
55
- <p>
56
- This sitemap was created using <a href="http://betterwp.net/wordpress-plugins/google-xml-sitemaps/" title="Better WordPress Google XML Sitemaps">Better WordPress Google XML Sitemaps</a>, a WordPress plugin that has support for sitemapindex and Multi-site blogs, you can also build custom sitemaps if you want.
57
- </p>
58
- </div>
59
- <div id="content">
60
- <table cellpadding="0" cellspacing="0">
61
- <tr>
62
- <th style="width: 60%;">Location</th>
63
- <th>Priority</th>
64
- <th>Change Frequency</th>
65
- <th>Last Modified (GMT)</th>
66
- </tr>
67
- <xsl:for-each select="sitemap:urlset/sitemap:url">
68
- <tr>
69
- <xsl:if test="position() mod 2 != 0">
70
- <xsl:attribute name="class">odd</xsl:attribute>
71
- </xsl:if>
72
- <td>
73
- <xsl:variable name="itemURL">
74
- <xsl:value-of select="sitemap:loc"/>
75
- </xsl:variable>
76
- <a href="{$itemURL}">
77
- <xsl:value-of select="sitemap:loc"/>
78
- </a>
79
- </td>
80
- <td>
81
- <xsl:value-of select="sitemap:priority"/>
82
- </td>
83
- <td>
84
- <xsl:value-of select="sitemap:changefreq"/>
85
- </td>
86
- <td>
87
- <xsl:value-of select="concat(substring(sitemap:lastmod, 0, 11),concat(' ', substring(sitemap:lastmod, 12, 5)))"/>
88
- </td>
89
- </tr>
90
- </xsl:for-each>
91
- </table>
92
- </div>
93
- <div id="footer">
94
- This plugin is (c) 2011 <a href="http://profiles.wordpress.org/users/OddOneOut/">Khang Minh</a> and is licensed under GPLv3.
95
- </div>
96
- </body>
97
- </html>
98
- </xsl:template>
99
- </xsl:stylesheet>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
4
+ <xsl:template match="/">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>XML Sitemap</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
+ <style type="text/css">
10
+ body {
11
+ font-family: Verdana, Arial, Helvetica, sans-serif;
12
+ font-size: 12px;
13
+ }
14
+
15
+ #header, #footer {
16
+ background-color: #F0F7FC;
17
+ border: 1px #50A6E0 solid;
18
+ border-right: none; border-left: none;
19
+ padding: 5px 10px;
20
+ margin: 10px 0px;
21
+ line-height: 1.7;
22
+ }
23
+
24
+ #header a, #footer a {
25
+ color: #2266bb;
26
+ }
27
+
28
+ #footer {
29
+ margin-top: 15px;
30
+ }
31
+
32
+ table {
33
+ width: 100%;
34
+ }
35
+
36
+ th {
37
+ text-align: left;
38
+ border-bottom: 1px solid #aaaaaa;
39
+ padding-bottom: 10px; padding-left: 5px;
40
+ }
41
+
42
+ tr.odd {
43
+ background-color: #f7f7f7;
44
+ }
45
+
46
+ td {
47
+ padding: 5px;
48
+ margin: 0px;
49
+ }
50
+ </style>
51
+ </head>
52
+ <body>
53
+ <h1>XML Sitemap</h1>
54
+ <div id="header">
55
+ <p>
56
+ This sitemap was created using <a href="http://betterwp.net/wordpress-plugins/google-xml-sitemaps/" title="Better WordPress Google XML Sitemaps">Better WordPress Google XML Sitemaps</a>, a WordPress plugin that has support for Sitemapindex, Google News sitemap, and Multi-site.
57
+ </p>
58
+ </div>
59
+ <div id="content">
60
+ <table cellpadding="0" cellspacing="0">
61
+ <tr>
62
+ <th style="width: 60%;">Location</th>
63
+ <th>Priority</th>
64
+ <th>Change Frequency</th>
65
+ <th>Last Modified</th>
66
+ </tr>
67
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
68
+ <tr>
69
+ <xsl:if test="position() mod 2 != 0">
70
+ <xsl:attribute name="class">odd</xsl:attribute>
71
+ </xsl:if>
72
+ <td>
73
+ <xsl:variable name="itemURL">
74
+ <xsl:value-of select="sitemap:loc"/>
75
+ </xsl:variable>
76
+ <a href="{$itemURL}">
77
+ <xsl:value-of select="sitemap:loc"/>
78
+ </a>
79
+ </td>
80
+ <td>
81
+ <xsl:value-of select="sitemap:priority"/>
82
+ </td>
83
+ <td>
84
+ <xsl:value-of select="sitemap:changefreq"/>
85
+ </td>
86
+ <td>
87
+ <xsl:value-of select="concat(substring(sitemap:lastmod, 0, 11),concat(' ', substring(sitemap:lastmod, 12, 5)))"/>
88
+ </td>
89
+ </tr>
90
+ </xsl:for-each>
91
+ </table>
92
+ </div>
93
+ <div id="footer">
94
+ This plugin is (c) 2014 <a href="http://profiles.wordpress.org/users/OddOneOut/">Khang Minh</a> and is licensed under GPLv3.
95
+ </div>
96
+ </body>
97
+ </html>
98
+ </xsl:template>
99
+ </xsl:stylesheet>
xsl/bwp-sitemapindex.xsl CHANGED
@@ -1,90 +1,90 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
4
- <xsl:template match="/">
5
- <html xmlns="http://www.w3.org/1999/xhtml">
6
- <head>
7
- <title>XML Sitemap Index</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <style type="text/css">
10
- body {
11
- font-family: Verdana, Arial, Helvetica, sans-serif;
12
- font-size: 12px;
13
- }
14
-
15
- #header, #footer {
16
- background-color: #F0F7FC;
17
- border: 1px #50A6E0 solid;
18
- border-right: none; border-left: none;
19
- padding: 5px 10px;
20
- margin: 10px 0px;
21
- line-height: 1.7;
22
- }
23
-
24
- #header a, #footer a {
25
- color: #2266bb;
26
- }
27
-
28
- #footer {
29
- margin-top: 15px;
30
- }
31
-
32
- table {
33
- width: 100%;
34
- }
35
-
36
- th {
37
- text-align: left;
38
- border-bottom: 1px solid #aaaaaa;
39
- padding-bottom: 10px; padding-left: 5px;
40
- }
41
-
42
- tr.odd {
43
- background-color: #f7f7f7;
44
- }
45
-
46
- td {
47
- padding: 5px;
48
- }
49
- </style>
50
- </head>
51
- <body>
52
- <h1>XML Sitemap Index</h1>
53
- <div id="header">
54
- <p>
55
- This sitemapindex was created using <a href="http://betterwp.net/wordpress-plugins/google-xml-sitemaps/" title="Better WordPress Google XML Sitemaps">Better WordPress Google XML Sitemaps</a>, a WordPress plugin that has support for sitemapindex and Multi-site blogs, you can also build custom sitemaps if you want.
56
- </p>
57
- </div>
58
- <div id="content">
59
- <table cellpadding="0" cellspacing="0">
60
- <tr>
61
- <th style="width: 70%;">Location</th>
62
- <th>Last Modified (GMT)</th>
63
- </tr>
64
- <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
65
- <tr>
66
- <xsl:if test="position() mod 2 != 0">
67
- <xsl:attribute name="class">odd</xsl:attribute>
68
- </xsl:if>
69
- <td>
70
- <xsl:variable name="itemURL">
71
- <xsl:value-of select="sitemap:loc"/>
72
- </xsl:variable>
73
- <a href="{$itemURL}">
74
- <xsl:value-of select="sitemap:loc"/>
75
- </a>
76
- </td>
77
- <td>
78
- <xsl:value-of select="concat(substring(sitemap:lastmod, 0, 11),concat(' ', substring(sitemap:lastmod, 12, 5)))"/>
79
- </td>
80
- </tr>
81
- </xsl:for-each>
82
- </table>
83
- </div>
84
- <div id="footer">
85
- This plugin is (c) 2011 <a href="http://profiles.wordpress.org/users/OddOneOut/">Khang Minh</a> and is licensed under GPLv3.
86
- </div>
87
- </body>
88
- </html>
89
- </xsl:template>
90
- </xsl:stylesheet>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
4
+ <xsl:template match="/">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>XML Sitemap Index</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
+ <style type="text/css">
10
+ body {
11
+ font-family: Verdana, Arial, Helvetica, sans-serif;
12
+ font-size: 12px;
13
+ }
14
+
15
+ #header, #footer {
16
+ background-color: #F0F7FC;
17
+ border: 1px #50A6E0 solid;
18
+ border-right: none; border-left: none;
19
+ padding: 5px 10px;
20
+ margin: 10px 0px;
21
+ line-height: 1.7;
22
+ }
23
+
24
+ #header a, #footer a {
25
+ color: #2266bb;
26
+ }
27
+
28
+ #footer {
29
+ margin-top: 15px;
30
+ }
31
+
32
+ table {
33
+ width: 100%;
34
+ }
35
+
36
+ th {
37
+ text-align: left;
38
+ border-bottom: 1px solid #aaaaaa;
39
+ padding-bottom: 10px; padding-left: 5px;
40
+ }
41
+
42
+ tr.odd {
43
+ background-color: #f7f7f7;
44
+ }
45
+
46
+ td {
47
+ padding: 5px;
48
+ }
49
+ </style>
50
+ </head>
51
+ <body>
52
+ <h1>XML Sitemap Index</h1>
53
+ <div id="header">
54
+ <p>
55
+ This sitemapindex was created using <a href="http://betterwp.net/wordpress-plugins/google-xml-sitemaps/" title="Better WordPress Google XML Sitemaps">Better WordPress Google XML Sitemaps</a>, a WordPress plugin that has support for Sitemapindex, Google News sitemap and Multi-site.
56
+ </p>
57
+ </div>
58
+ <div id="content">
59
+ <table cellpadding="0" cellspacing="0">
60
+ <tr>
61
+ <th style="width: 70%;">Location</th>
62
+ <th>Last Modified</th>
63
+ </tr>
64
+ <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
65
+ <tr>
66
+ <xsl:if test="position() mod 2 != 0">
67
+ <xsl:attribute name="class">odd</xsl:attribute>
68
+ </xsl:if>
69
+ <td>
70
+ <xsl:variable name="itemURL">
71
+ <xsl:value-of select="sitemap:loc"/>
72
+ </xsl:variable>
73
+ <a href="{$itemURL}">
74
+ <xsl:value-of select="sitemap:loc"/>
75
+ </a>
76
+ </td>
77
+ <td>
78
+ <xsl:value-of select="concat(substring(sitemap:lastmod, 0, 11),concat(' ', substring(sitemap:lastmod, 12, 5)))"/>
79
+ </td>
80
+ </tr>
81
+ </xsl:for-each>
82
+ </table>
83
+ </div>
84
+ <div id="footer">
85
+ This plugin is (c) 2014 <a href="http://profiles.wordpress.org/users/OddOneOut/">Khang Minh</a> and is licensed under GPLv3.
86
+ </div>
87
+ </body>
88
+ </html>
89
+ </xsl:template>
90
+ </xsl:stylesheet>