Platinum SEO Pack - Version 2.1.1

Version Description

  • 2020-05-22 - Platinum SEO Plugin becomes the first SEO plugin to integrate with the upcoming SiteMap functionality in WordPress Core. The Core siteMap is still in development and Platinum SEO has integrated with the currently available version of the Core Module. If you do like to generate a sitemap with Platinum SEO, do enable it and enable the Object Types for which you want to generate a sitemap in SiteMap settings in Platinum SEO.
Download this release

Release Info

Developer Rajesh Babu
Plugin Icon 128x128 Platinum SEO Pack
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

Changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  = 2.1.0 =
2
  * 2020-05-16 - Platinum SEO Plugin will now have its own SEO meta table _platinumseometa. All the SEO meta data used by the plugin will now be in this table. Importers for Yoast, Yoast Indexables and RankMath WordPress SEO Plugins have now been included to make it easy for users using those plugins to migrate to Platinum SEO WordPress Plugin.
3
 
1
+ = 2.1.1 =
2
+ * 2020-05-22 - Platinum SEO Plugin becomes the first SEO plugin to integrate with the upcoming SiteMap functionality in WordPress Core. The Core siteMap is still in development and Platinum SEO has integrated with the currently available version of the Core Module. If you do like to generate a sitemap with Platinum SEO, do enable it and enable the Object Types for which you want to generate a sitemap in SiteMap settings in Platinum SEO.
3
+
4
  = 2.1.0 =
5
  * 2020-05-16 - Platinum SEO Plugin will now have its own SEO meta table _platinumseometa. All the SEO meta data used by the plugin will now be in this table. Importers for Yoast, Yoast Indexables and RankMath WordPress SEO Plugins have now been included to make it easy for users using those plugins to migrate to Platinum SEO WordPress Plugin.
6
 
platinum-seo-pack.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Platinum SEO Pack
5
  Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
  Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
- Version: 2.1.0
8
  Author: Techblissonline.com (Rajesh)
9
  Author URI: https://techblissonline.com/
10
  Text Domain: platinum-seo-pack
@@ -61,7 +61,9 @@ include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_pre_settings.php' );
61
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_social_settings.php' );
62
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_tools_settings.php' );
63
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_redirect_404.php' );
 
64
  include_once( PSP_PLUGIN_HOME . PSPINC . '/importers/psp_import.php' );
 
65
 
66
  global $psp;
67
  $psp = PspMain::get_instance();
4
  Plugin Name: Platinum SEO Pack
5
  Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
  Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
+ Version: 2.1.1
8
  Author: Techblissonline.com (Rajesh)
9
  Author URI: https://techblissonline.com/
10
  Text Domain: platinum-seo-pack
61
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_social_settings.php' );
62
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_tools_settings.php' );
63
  include_once( PSP_PLUGIN_HOME . PSPINC . '/settings/psp_redirect_404.php' );
64
+ include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap_settings.php' );
65
  include_once( PSP_PLUGIN_HOME . PSPINC . '/importers/psp_import.php' );
66
+ include_once( PSP_PLUGIN_HOME . PSPINC . '/sitemap/psp_sitemap.php' );
67
 
68
  global $psp;
69
  $psp = PspMain::get_instance();
psp-include/settings/psp_settings.php CHANGED
@@ -21,6 +21,7 @@ class PspSettings {
21
  public $psp_redirect_instance;
22
  public $psp_social_instance;
23
  public $psp_import_instance;
 
24
 
25
  private $psp_helper;
26
  private $sitename;
@@ -35,6 +36,7 @@ class PspSettings {
35
  private $psp_social_settings_group = 'psp_social';
36
  private $psp_other_settings_group = 'psp_others';
37
  private $psp_breadcrumb_settings_group = 'psp_breadcrumb';
 
38
 
39
  protected $psp_plugin_options_key = 'platinum-seo-social-pack-by-techblissonline';
40
  private $psp_settings_tabs = array();
@@ -87,7 +89,9 @@ class PspSettings {
87
  $this->psp_redirect_instance = $psp_redirect_instance;
88
  $this->sitename = $psp_helper_instance->get_sitename();
89
 
90
- $this->psp_import_instance = PspImporter::get_instance();
 
 
91
 
92
  $psp_do_rewrite_rules = false;
93
 
@@ -154,6 +158,7 @@ class PspSettings {
154
  //$this->psp_settings_tabs[$this->psp_home_settings_group] = 'Home';
155
  $this->psp_settings_tabs[$this->psp_archives_settings_group] = 'Archives';
156
  $this->psp_settings_tabs[$this->psp_permalink_settings_group] = 'Permalinks';
 
157
  //if (!$psp_premium_status) $this->psp_settings_tabs[$this->psp_social_settings_group] = 'Social';
158
  $this->psp_settings_tabs[$this->psp_other_settings_group] = 'Others';
159
  $this->psp_settings_tabs[$this->psp_breadcrumb_settings_group] = 'Breadcrumbs';
@@ -267,6 +272,8 @@ class PspSettings {
267
  $this->register_posttype_settings($cust_post_type);
268
  }
269
 
 
 
270
  //if ($tab == $this->psp_archives_settings_group) {
271
  $this->register_archive_settings('date_archive');
272
  $this->register_archive_settings('author_archive');
@@ -2890,6 +2897,24 @@ class PspSettings {
2890
  }
2891
  $psp_seo_meta['schema_string'] = $json_schema_string;
2892
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2893
  //$psp_seo_meta = array_map( 'esc_attr', $psp_seo_meta );
2894
  $this->psp_taxonomy_meta_original = $psp_seo_meta;
2895
  $psp_social_meta = get_term_meta( $category_id, "psp_category_social_metas_$category_id");
@@ -3020,9 +3045,11 @@ class PspSettings {
3020
 
3021
  //update google sitemap generator
3022
  if (!empty($psp_category_seo_data['nositemap'])) {
 
3023
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, true );
3024
  $psp_exclude = true;
3025
  } else {
 
3026
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, false );
3027
  $psp_exclude = false;
3028
  }
@@ -3118,6 +3145,22 @@ class PspSettings {
3118
  $json_schema_string = 'Invalid JSON Schema';
3119
  }
3120
  $psp_seo_meta['schema_string'] = $json_schema_string;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3121
 
3122
  //$psp_seo_meta = array_map( 'esc_attr', $psp_seo_meta );
3123
  $this->psp_taxonomy_meta_original = $psp_seo_meta;
@@ -3248,9 +3291,11 @@ class PspSettings {
3248
  }
3249
  //update google sitemap generator
3250
  if (!empty($psp_taxonomy_seo_data['nositemap'])) {
 
3251
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, true );
3252
  $psp_exclude = true;
3253
  } else {
 
3254
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, false );
3255
  $psp_exclude = false;
3256
  }
@@ -3341,7 +3386,22 @@ class PspSettings {
3341
  $psp_settings_name = "psp_".$post->post_type."_settings";
3342
  $psp_p_settings = get_option($psp_settings_name);
3343
 
3344
- $psp_settings = get_option('psp_sitewide_settings');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3345
  $psp_posttype_metabox_advanced_hidden = isset($psp_settings['hide_metabox_advanced']) ? $psp_settings['hide_metabox_advanced'] : '';
3346
 
3347
  $psp_pre_settings = get_option('psp_pre_setting');
@@ -3475,7 +3535,7 @@ class PspSettings {
3475
  $psp_post_meta['noindex'] = isset($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) ? (!empty($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) : '') : esc_attr($psp_posttype_noindex);
3476
  $psp_post_meta['nofollow'] = isset($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) ? (!empty($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) : '') : esc_attr($psp_posttype_nofollow);
3477
 
3478
- $psp_post_meta['nositemap'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_nositemap'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_nositemap'][0]) : '';
3479
  $psp_post_meta['canonical_url'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_canonical_url'][0]) ? esc_url_raw($wp_post_meta_data_arr['_techblissonline_psp_canonical_url'][0]) : '';
3480
  //$psp_post_meta['schema_string'] = isset($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) : '';
3481
  //$psp_post_meta['schema_string'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) ? html_entity_decode(stripcslashes(esc_attr($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]))) : '';
@@ -4350,9 +4410,11 @@ class PspSettings {
4350
 
4351
  //update google sitemap generator
4352
  if (!empty($psp_post_seo_data['nositemap'])) {
 
4353
  $this->psp_update_gsg("sm_b_exclude", $post_id, true );
4354
  $psp_exclude = true;
4355
  } else {
 
4356
  $this->psp_update_gsg("sm_b_exclude", $post_id, false );
4357
  $psp_exclude = false;
4358
  }
@@ -4363,6 +4425,55 @@ class PspSettings {
4363
  do_action( 'techblissonline_psp_update_sitemap', $psp_id, $psp_exclude );
4364
  }
4365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4366
  //update GoogleSitemapGenerator
4367
  private function psp_update_gsg( $gsckey, $post_id, $exclude = false ) {
4368
  $className = 'GoogleSitemapGenerator';
@@ -4907,7 +5018,10 @@ class PspSettings {
4907
  }
4908
  if ($tab_key == $this->psp_permalink_settings_group) {
4909
  $psp_icon = '<span class="dashicons dashicons-admin-links"></span> ';
4910
- }
 
 
 
4911
  if ($tab_key == $this->psp_breadcrumb_settings_group) {
4912
  $psp_icon = '<span class="dashicons dashicons-networking"></span> ';
4913
  }
21
  public $psp_redirect_instance;
22
  public $psp_social_instance;
23
  public $psp_import_instance;
24
+ public $psp_sitemap_instance;
25
 
26
  private $psp_helper;
27
  private $sitename;
36
  private $psp_social_settings_group = 'psp_social';
37
  private $psp_other_settings_group = 'psp_others';
38
  private $psp_breadcrumb_settings_group = 'psp_breadcrumb';
39
+ private $psp_sm_settings_group = 'psp_sitemap';
40
 
41
  protected $psp_plugin_options_key = 'platinum-seo-social-pack-by-techblissonline';
42
  private $psp_settings_tabs = array();
89
  $this->psp_redirect_instance = $psp_redirect_instance;
90
  $this->sitename = $psp_helper_instance->get_sitename();
91
 
92
+ $this->psp_import_instance = PspImporter::get_instance();
93
+
94
+ $this->psp_sitemap_instance = PspSmSettings::get_instance();
95
 
96
  $psp_do_rewrite_rules = false;
97
 
158
  //$this->psp_settings_tabs[$this->psp_home_settings_group] = 'Home';
159
  $this->psp_settings_tabs[$this->psp_archives_settings_group] = 'Archives';
160
  $this->psp_settings_tabs[$this->psp_permalink_settings_group] = 'Permalinks';
161
+ $this->psp_settings_tabs[$this->psp_sm_settings_group] = 'Sitemap';
162
  //if (!$psp_premium_status) $this->psp_settings_tabs[$this->psp_social_settings_group] = 'Social';
163
  $this->psp_settings_tabs[$this->psp_other_settings_group] = 'Others';
164
  $this->psp_settings_tabs[$this->psp_breadcrumb_settings_group] = 'Breadcrumbs';
272
  $this->register_posttype_settings($cust_post_type);
273
  }
274
 
275
+ $this->psp_sitemap_instance->register_sm_settings();
276
+
277
  //if ($tab == $this->psp_archives_settings_group) {
278
  $this->register_archive_settings('date_archive');
279
  $this->register_archive_settings('author_archive');
2897
  }
2898
  $psp_seo_meta['schema_string'] = $json_schema_string;
2899
 
2900
+ $psp_sm_settings = get_option('psp_sitemap');
2901
+ $excluded_term_ids = array();
2902
+ $term_excluded_from_sitemap = '';
2903
+
2904
+ if( $psp_sm_settings['excluded_term_ids'] ) {
2905
+ $excluded_term_ids = explode(",", $psp_sm_settings['excluded_term_ids']);
2906
+ }
2907
+ if( !empty( $excluded_term_ids ) ) {
2908
+ $excluded_term_ids = array_map( 'intval', $excluded_term_ids );
2909
+
2910
+ if( in_array($category_id, $excluded_term_ids)) {
2911
+ $term_excluded_from_sitemap = 'on';
2912
+ }
2913
+
2914
+ }
2915
+ //$psp_seo_meta['nositemap'] = $term_excluded_from_sitemap;
2916
+ $psp_seo_meta['nositemap'] = !empty($psp_seo_meta['nositemap']) ? esc_attr($psp_seo_meta['nositemap']) : $term_excluded_from_sitemap;
2917
+
2918
  //$psp_seo_meta = array_map( 'esc_attr', $psp_seo_meta );
2919
  $this->psp_taxonomy_meta_original = $psp_seo_meta;
2920
  $psp_social_meta = get_term_meta( $category_id, "psp_category_social_metas_$category_id");
3045
 
3046
  //update google sitemap generator
3047
  if (!empty($psp_category_seo_data['nositemap'])) {
3048
+ $this->psp_update_wps("excluded_term_ids", $t_id, true );
3049
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, true );
3050
  $psp_exclude = true;
3051
  } else {
3052
+ $this->psp_update_wps("excluded_term_ids", $t_id, false );
3053
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, false );
3054
  $psp_exclude = false;
3055
  }
3145
  $json_schema_string = 'Invalid JSON Schema';
3146
  }
3147
  $psp_seo_meta['schema_string'] = $json_schema_string;
3148
+
3149
+ $psp_sm_settings = get_option('psp_sitemap');
3150
+ $excluded_term_ids = array();
3151
+ $term_excluded_from_sitemap = '';
3152
+
3153
+ if( $psp_sm_settings['excluded_term_ids'] ) {
3154
+ $excluded_term_ids = explode(",", $psp_sm_settings['excluded_term_ids']);
3155
+ }
3156
+ if( !empty( $excluded_term_ids ) ) {
3157
+ $excluded_term_ids = array_map( 'intval', $excluded_term_ids );
3158
+ if( in_array($t_id, $excluded_term_ids)) {
3159
+ $term_excluded_from_sitemap = 'on';
3160
+ }
3161
+ }
3162
+ //$psp_seo_meta['nositemap'] = $term_excluded_from_sitemap;
3163
+ $psp_seo_meta['nositemap'] = !empty($psp_seo_meta['nositemap']) ? esc_attr($psp_seo_meta['nositemap']) : $term_excluded_from_sitemap;
3164
 
3165
  //$psp_seo_meta = array_map( 'esc_attr', $psp_seo_meta );
3166
  $this->psp_taxonomy_meta_original = $psp_seo_meta;
3291
  }
3292
  //update google sitemap generator
3293
  if (!empty($psp_taxonomy_seo_data['nositemap'])) {
3294
+ $this->psp_update_wps("excluded_term_ids", $t_id, true );
3295
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, true );
3296
  $psp_exclude = true;
3297
  } else {
3298
+ $this->psp_update_wps("excluded_term_ids", $t_id, false );
3299
  $this->psp_update_gsg("sm_b_exclude_cats", $t_id, false );
3300
  $psp_exclude = false;
3301
  }
3386
  $psp_settings_name = "psp_".$post->post_type."_settings";
3387
  $psp_p_settings = get_option($psp_settings_name);
3388
 
3389
+ $psp_settings = get_option('psp_sitewide_settings');
3390
+
3391
+ $psp_sm_settings = get_option('psp_sitemap');
3392
+ $excluded_post_ids = array();
3393
+ $post_excluded_from_sitemap = '';
3394
+
3395
+ if( !empty( $psp_sm_settings['excluded_post_ids'] ) ) {
3396
+ $excluded_post_ids = explode(",", $psp_sm_settings['excluded_post_ids']);
3397
+ }
3398
+ if( !empty( $excluded_post_ids ) ) {
3399
+ $excluded_post_ids = array_map( 'intval', $excluded_post_ids );
3400
+ if( in_array($post->ID, $excluded_post_ids)) {
3401
+ $post_excluded_from_sitemap = 'on';
3402
+ }
3403
+ }
3404
+
3405
  $psp_posttype_metabox_advanced_hidden = isset($psp_settings['hide_metabox_advanced']) ? $psp_settings['hide_metabox_advanced'] : '';
3406
 
3407
  $psp_pre_settings = get_option('psp_pre_setting');
3535
  $psp_post_meta['noindex'] = isset($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) ? (!empty($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_noindex'][0]) : '') : esc_attr($psp_posttype_noindex);
3536
  $psp_post_meta['nofollow'] = isset($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) ? (!empty($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_nofollow'][0]) : '') : esc_attr($psp_posttype_nofollow);
3537
 
3538
+ $psp_post_meta['nositemap'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_nositemap'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_nositemap'][0]) : $post_excluded_from_sitemap;
3539
  $psp_post_meta['canonical_url'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_canonical_url'][0]) ? esc_url_raw($wp_post_meta_data_arr['_techblissonline_psp_canonical_url'][0]) : '';
3540
  //$psp_post_meta['schema_string'] = isset($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) : '';
3541
  //$psp_post_meta['schema_string'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]) ? html_entity_decode(stripcslashes(esc_attr($wp_post_meta_data_arr['_techblissonline_psp_schema_string'][0]))) : '';
4410
 
4411
  //update google sitemap generator
4412
  if (!empty($psp_post_seo_data['nositemap'])) {
4413
+ $this->psp_update_wps("excluded_post_ids", $post_id, true );
4414
  $this->psp_update_gsg("sm_b_exclude", $post_id, true );
4415
  $psp_exclude = true;
4416
  } else {
4417
+ $this->psp_update_wps("excluded_post_ids", $post_id, false );
4418
  $this->psp_update_gsg("sm_b_exclude", $post_id, false );
4419
  $psp_exclude = false;
4420
  }
4425
  do_action( 'techblissonline_psp_update_sitemap', $psp_id, $psp_exclude );
4426
  }
4427
 
4428
+ //update Platinum SEO Settings for wordPress sitemap
4429
+ private function psp_update_wps( $gsckey, $post_id, $exclude = false ) {
4430
+
4431
+ if (empty($post_id) || empty($gsckey) ) {
4432
+ return;
4433
+ }
4434
+
4435
+ $psp_sm_settings = get_option('psp_sitemap');
4436
+ //$this->psp_sitemap_settings = $psp_sm_settings;
4437
+
4438
+ $excluded_ids = array();
4439
+
4440
+ if( !empty( $psp_sm_settings[$gsckey] ) ) {
4441
+ error_log(print_r($psp_sm_settings[$gsckey], true));
4442
+ $excluded_ids = explode(",", $psp_sm_settings[$gsckey]);
4443
+ }
4444
+
4445
+ if( !empty( $excluded_ids ) ) {
4446
+ //$excluded_ids = array_map( 'intval', $excluded_ids );
4447
+ }
4448
+
4449
+ if($exclude) {
4450
+ if(empty($excluded_ids) || !in_array($post_id, $excluded_ids)) {
4451
+ //$excluded = array_push($excluded_ids, $post_id);
4452
+ $excluded_ids[] = $post_id;
4453
+ $psp_sm_settings[$gsckey] = implode(",", $excluded_ids);
4454
+ update_option("psp_sitemap", $psp_sm_settings);
4455
+ }
4456
+ } else {
4457
+
4458
+ if(!empty($excluded_ids) && in_array($post_id, $excluded_ids)) {
4459
+
4460
+
4461
+ if (($id = array_search($post_id, $excluded_ids)) !== false) {
4462
+ error_log(print_r($excluded_ids[$id], true));
4463
+ unset($excluded_ids[$id]);
4464
+ }
4465
+ if(!empty($excluded_ids)) {
4466
+ $psp_sm_settings[$gsckey] = implode(",", $excluded_ids);
4467
+ } else {
4468
+ //unset($psp_sm_settings[$gsckey]);
4469
+ $psp_sm_settings[$gsckey] = '';
4470
+ }
4471
+ update_option("psp_sitemap", $psp_sm_settings);
4472
+ }
4473
+ }
4474
+
4475
+ }
4476
+
4477
  //update GoogleSitemapGenerator
4478
  private function psp_update_gsg( $gsckey, $post_id, $exclude = false ) {
4479
  $className = 'GoogleSitemapGenerator';
5018
  }
5019
  if ($tab_key == $this->psp_permalink_settings_group) {
5020
  $psp_icon = '<span class="dashicons dashicons-admin-links"></span> ';
5021
+ }
5022
+ if ($tab_key == $this->psp_sm_settings_group) {
5023
+ $psp_icon = '<span class="dashicons dashicons-admin-site-alt3"></span> ';
5024
+ }
5025
  if ($tab_key == $this->psp_breadcrumb_settings_group) {
5026
  $psp_icon = '<span class="dashicons dashicons-networking"></span> ';
5027
  }
psp-include/sitemap/inc/class-core-sitemaps-index.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Index class.
4
+ *
5
+ * Generates the sitemap index.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Class Core_Sitemaps_Index.
14
+ * Builds the sitemap index page that lists the links to all of the sitemaps.
15
+ *
16
+ * @since 5.5.0
17
+ */
18
+ class Core_Sitemaps_Index {
19
+
20
+ /**
21
+ * The main registry of supported sitemaps.
22
+ *
23
+ * @since 5.5.0
24
+ * @var Core_Sitemaps_Registry
25
+ */
26
+ protected $registry;
27
+
28
+ /**
29
+ * Core_Sitemaps_Index constructor.
30
+ *
31
+ * @since 5.5.0
32
+ *
33
+ * @param Core_Sitemaps_Registry $registry Sitemap provider registry.
34
+ */
35
+ public function __construct( $registry ) {
36
+ $this->registry = $registry;
37
+ }
38
+
39
+ /**
40
+ * Gets a sitemap list for the index.
41
+ *
42
+ * @since 5.5.0
43
+ *
44
+ * @return array List of all sitemaps.
45
+ */
46
+ public function get_sitemap_list() {
47
+ $sitemaps = array();
48
+
49
+ $providers = $this->registry->get_sitemaps();
50
+ /* @var Core_Sitemaps_Provider $provider */
51
+ foreach ( $providers as $provider ) {
52
+ // Using array_push is more efficient than array_merge in a loop.
53
+ $sitemap = $provider->get_sitemap_entries();
54
+ //array_push( $sitemaps, ...$provider->get_sitemap_entries() );
55
+ if($sitemap) array_push( $sitemaps, ...$sitemap );
56
+ }
57
+
58
+ return $sitemaps;
59
+ }
60
+
61
+ /**
62
+ * Builds the URL for the sitemap index.
63
+ *
64
+ * @since 5.5.0
65
+ *
66
+ * @return string the sitemap index url.
67
+ */
68
+ public function get_index_url() {
69
+ /* @var WP_Rewrite $wp_rewrite */
70
+ global $wp_rewrite;
71
+
72
+ $url = home_url( '/wp-sitemap.xml' );
73
+ //$url = home_url( '/sitemap.xml' );
74
+
75
+ if ( ! $wp_rewrite->using_permalinks() ) {
76
+ $url = add_query_arg( 'sitemap', 'index', home_url( '/' ) );
77
+ }
78
+
79
+ return $url;
80
+ }
81
+ }
psp-include/sitemap/inc/class-core-sitemaps-provider.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Provider class
4
+ *
5
+ * This class is a base class for other sitemap providers to extend and contains shared functionality.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Class Core_Sitemaps_Provider.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ abstract class Core_Sitemaps_Provider {
18
+
19
+ /**
20
+ * Provider name.
21
+ *
22
+ * This will also be used as the public-facing name in URLs.
23
+ *
24
+ * @since 5.5.0
25
+ *
26
+ * @var string
27
+ */
28
+ protected $name = '';
29
+
30
+ /**
31
+ * Object type name (e.g. 'post', 'term', 'user').
32
+ *
33
+ * @since 5.5.0
34
+ *
35
+ * @var string
36
+ */
37
+ protected $object_type = '';
38
+
39
+ /**
40
+ * Object subtype name.
41
+ *
42
+ * For example, this should be a post type name for object type 'post' or
43
+ * a taxonomy name for object type 'term').
44
+ *
45
+ * @since 5.5.0
46
+ *
47
+ * @var string
48
+ */
49
+ protected $object_subtype = '';
50
+
51
+ /**
52
+ * Gets a URL list for a sitemap.
53
+ *
54
+ * @since 5.5.0
55
+ *
56
+ * @param int $page_num Page of results.
57
+ * @param string $object_subtype Optional. Object subtype name. Default empty.
58
+ * @return array List of URLs for a sitemap.
59
+ */
60
+ abstract public function get_url_list( $page_num, $object_subtype = '' );
61
+
62
+ /**
63
+ * Returns the name of the object type or object subtype being queried.
64
+ *
65
+ * @since 5.5.0
66
+ *
67
+ * @return string Object subtype if set, otherwise object type.
68
+ */
69
+ public function get_queried_type() {
70
+ if ( empty( $this->object_subtype ) ) {
71
+ return $this->object_type;
72
+ }
73
+
74
+ return $this->object_subtype;
75
+ }
76
+
77
+ /**
78
+ * Gets the max number of pages available for the object type.
79
+ *
80
+ * @since 5.5.0
81
+ *
82
+ * @param string $object_subtype Optional. Object subtype. Default empty.
83
+ * @return int Total number of pages.
84
+ */
85
+ abstract public function max_num_pages( $object_subtype = '' );
86
+
87
+ /**
88
+ * Sets the object subtype.
89
+ *
90
+ * @since 5.5.0
91
+ *
92
+ * @param string $object_subtype The name of the object subtype.
93
+ * @return bool Returns true on success.
94
+ */
95
+ public function set_object_subtype( $object_subtype ) {
96
+ $this->object_subtype = $object_subtype;
97
+
98
+ return true;
99
+ }
100
+
101
+ /**
102
+ * Gets data about each sitemap type.
103
+ *
104
+ * @since 5.5.0
105
+ *
106
+ * @return array List of sitemap types including object subtype name and number of pages.
107
+ */
108
+ public function get_sitemap_type_data() {
109
+ $sitemap_data = array();
110
+
111
+ $object_subtypes = $this->get_object_subtypes();
112
+
113
+ foreach ( $object_subtypes as $object_subtype_name => $data ) {
114
+ $sitemap_data[] = array(
115
+ 'name' => $object_subtype_name,
116
+ 'pages' => $this->max_num_pages( $object_subtype_name ),
117
+ );
118
+ }
119
+
120
+ return $sitemap_data;
121
+ }
122
+
123
+ /**
124
+ * Lists sitemap pages exposed by this provider.
125
+ *
126
+ * The returned data is used to populate the sitemap entries of the index.
127
+ *
128
+ * @since 5.5.0
129
+ *
130
+ * @return array List of sitemaps.
131
+ */
132
+ public function get_sitemap_entries() {
133
+ $sitemaps = array();
134
+
135
+ $sitemap_types = $this->get_sitemap_type_data();
136
+
137
+ foreach ( $sitemap_types as $type ) {
138
+ for ( $page = 1; $page <= $type['pages']; $page ++ ) {
139
+ $loc = $this->get_sitemap_url( $type['name'], $page );
140
+ $sitemaps[] = array(
141
+ 'loc' => $loc,
142
+ );
143
+ }
144
+ }
145
+
146
+ return $sitemaps;
147
+ }
148
+
149
+ /**
150
+ * Gets the URL of a sitemap entry.
151
+ *
152
+ * @since 5.5.0
153
+ *
154
+ * @param string $name The name of the sitemap.
155
+ * @param int $page The page of the sitemap.
156
+ * @return string The composed URL for a sitemap entry.
157
+ */
158
+ public function get_sitemap_url( $name, $page ) {
159
+ /* @var WP_Rewrite $wp_rewrite */
160
+ global $wp_rewrite;
161
+
162
+ if ( ! $wp_rewrite->using_permalinks() ) {
163
+ return add_query_arg(
164
+ // Accounts for cases where name is not included, ex: sitemaps-users-1.xml.
165
+ array_filter(
166
+ array(
167
+ 'sitemap' => $this->name,
168
+ 'sitemap-sub-type' => $name,
169
+ 'paged' => $page,
170
+ )
171
+ ),
172
+ home_url( '/' )
173
+ );
174
+ }
175
+
176
+ $basename = sprintf(
177
+ '/wp-sitemap-%1$s.xml',
178
+ implode(
179
+ '-',
180
+ // Accounts for cases where name is not included, ex: sitemaps-users-1.xml.
181
+ array_filter(
182
+ array(
183
+ $this->name,
184
+ $name,
185
+ (string) $page,
186
+ )
187
+ )
188
+ )
189
+ );
190
+
191
+ return home_url( $basename );
192
+ }
193
+
194
+ /**
195
+ * Returns the list of supported object sub-types exposed by the provider.
196
+ *
197
+ * @since 5.5.0
198
+ *
199
+ * @return array List of object subtypes objects keyed by their name.
200
+ */
201
+ public function get_object_subtypes() {
202
+ if ( ! empty( $this->object_subtype ) ) {
203
+ return array(
204
+ $this->object_subtype => (object) array( 'name' => $this->object_subtype ),
205
+ );
206
+ }
207
+
208
+ /**
209
+ * To prevent complexity in code calling this function, such as `get_sitemap_type_data()`
210
+ * in this class, a non-empty array is returned, so that sitemaps for providers without
211
+ * object subtypes are still registered correctly.
212
+ *
213
+ * @link https://github.com/GoogleChromeLabs/wp-sitemaps/pull/72#discussion_r347496750
214
+ */
215
+ return array(
216
+ '' => (object) array( 'name' => '' ),
217
+ );
218
+ }
219
+ }
psp-include/sitemap/inc/class-core-sitemaps-registry.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Registry class
4
+ *
5
+ * Handles registering sitemaps.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Class Core_Sitemaps_Registry.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Registry {
18
+ /**
19
+ * Registered sitemaps.
20
+ *
21
+ * @since 5.5.0
22
+ *
23
+ * @var array Array of registered sitemaps.
24
+ */
25
+ private $sitemaps = array();
26
+
27
+ /**
28
+ * Adds a sitemap with route to the registry.
29
+ *
30
+ * @since 5.5.0
31
+ *
32
+ * @param string $name Name of the sitemap.
33
+ * @param Core_Sitemaps_Provider $provider Instance of a Core_Sitemaps_Provider.
34
+ * @return bool True if the sitemap was added, false if it is already registered.
35
+ */
36
+ public function add_sitemap( $name, $provider ) {
37
+ if ( isset( $this->sitemaps[ $name ] ) ) {
38
+ return false;
39
+ }
40
+
41
+ if ( ! $provider instanceof Core_Sitemaps_Provider ) {
42
+ return false;
43
+ }
44
+
45
+ $this->sitemaps[ $name ] = $provider;
46
+
47
+ return true;
48
+ }
49
+
50
+ /**
51
+ * Returns a single registered sitemaps provider.
52
+ *
53
+ * @since 5.5.0
54
+ *
55
+ * @param string $name Sitemap provider name.
56
+ * @return Core_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise.
57
+ */
58
+ public function get_sitemap( $name ) {
59
+ if ( ! isset( $this->sitemaps[ $name ] ) ) {
60
+ return null;
61
+ }
62
+
63
+ return $this->sitemaps[ $name ];
64
+ }
65
+
66
+ /**
67
+ * Lists all registered sitemaps.
68
+ *
69
+ * @since 5.5.0
70
+ *
71
+ * @return array List of sitemaps.
72
+ */
73
+ public function get_sitemaps() {
74
+ $total_sitemaps = count( $this->sitemaps );
75
+
76
+ if ( $total_sitemaps > CORE_SITEMAPS_MAX_SITEMAPS ) {
77
+ return array_slice( $this->sitemaps, 0, CORE_SITEMAPS_MAX_SITEMAPS, true );
78
+ }
79
+
80
+ return $this->sitemaps;
81
+ }
82
+ }
psp-include/sitemap/inc/class-core-sitemaps-renderer.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Renderer class
4
+ *
5
+ * Responsible for rendering Sitemaps data to XML in accordance with sitemap protocol.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Class Core_Sitemaps_Renderer
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Renderer {
18
+ /**
19
+ * XSL stylesheet for styling a sitemap for web browsers.
20
+ *
21
+ * @since 5.5.0
22
+ *
23
+ * @var string
24
+ */
25
+ protected $stylesheet = '';
26
+
27
+ /**
28
+ * XSL stylesheet for styling a sitemap for web browsers.
29
+ *
30
+ * @since 5.5.0
31
+ *
32
+ * @var string
33
+ */
34
+ protected $stylesheet_index = '';
35
+
36
+ /**
37
+ * Core_Sitemaps_Renderer constructor.
38
+ *
39
+ * @since 5.5.0
40
+ */
41
+ public function __construct() {
42
+ $stylesheet_url = $this->get_sitemap_stylesheet_url();
43
+ if ( $stylesheet_url ) {
44
+ $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_url ) . '" ?>';
45
+ }
46
+ $stylesheet_index_url = $this->get_sitemap_index_stylesheet_url();
47
+ if ( $stylesheet_index_url ) {
48
+ $this->stylesheet_index = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_index_url ) . '" ?>';
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Gets the URL for the sitemap stylesheet.
54
+ *
55
+ * @since 5.5.0
56
+ *
57
+ * @return string the sitemap stylesheet url.
58
+ */
59
+ public function get_sitemap_stylesheet_url() {
60
+ /* @var WP_Rewrite $wp_rewrite */
61
+ global $wp_rewrite;
62
+
63
+ $sitemap_url = home_url( '/wp-sitemap.xsl' );
64
+
65
+ if ( ! $wp_rewrite->using_permalinks() ) {
66
+ $sitemap_url = add_query_arg( 'sitemap-stylesheet', 'sitemap', home_url( '/' ) );
67
+ }
68
+
69
+ /**
70
+ * Filters the URL for the sitemap stylesheet.
71
+ *
72
+ * If a falsy value is returned, no stylesheet will be used and
73
+ * the "raw" XML of the sitemap will be displayed.
74
+ *
75
+ * @since 5.5.0
76
+ *
77
+ * @param string $sitemap_url Full URL for the sitemaps xsl file.
78
+ */
79
+ return apply_filters( 'core_sitemaps_stylesheet_url', $sitemap_url );
80
+ }
81
+
82
+ /**
83
+ * Gets the URL for the sitemap index stylesheet.
84
+ *
85
+ * @since 5.5.0
86
+ *
87
+ * @return string the sitemap index stylesheet url.
88
+ */
89
+ public function get_sitemap_index_stylesheet_url() {
90
+ /* @var WP_Rewrite $wp_rewrite */
91
+ global $wp_rewrite;
92
+
93
+ $sitemap_url = home_url( '/wp-sitemap-index.xsl' );
94
+
95
+ if ( ! $wp_rewrite->using_permalinks() ) {
96
+ $sitemap_url = add_query_arg( 'sitemap-stylesheet', 'index', home_url( '/' ) );
97
+ }
98
+
99
+ /**
100
+ * Filters the URL for the sitemap index stylesheet.
101
+ *
102
+ * If a falsy value is returned, no stylesheet will be used and
103
+ * the "raw" XML of the sitemap index will be displayed.
104
+ *
105
+ * @since 5.5.0
106
+ *
107
+ * @param string $sitemap_url Full URL for the sitemaps index xsl file.
108
+ */
109
+ return apply_filters( 'core_sitemaps_stylesheet_index_url', $sitemap_url );
110
+ }
111
+
112
+ /**
113
+ * Renders a sitemap index.
114
+ *
115
+ * @since 5.5.0
116
+ *
117
+ * @param array $sitemaps List of sitemap entries.
118
+ */
119
+ public function render_index( $sitemaps ) {
120
+ header( 'Content-type: application/xml; charset=UTF-8' );
121
+
122
+ $this->check_for_simple_xml_availability();
123
+
124
+ $index_xml = $this->get_sitemap_index_xml( $sitemaps );
125
+
126
+ if ( ! empty( $index_xml ) ) {
127
+ // All output is escaped within get_sitemap_index_xml().
128
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
129
+ echo $index_xml;
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Gets XML for a sitemap index.
135
+ *
136
+ * @since 5.5.0
137
+ *
138
+ * @param array $sitemaps List of sitemap entries.
139
+ * @return string|false A well-formed XML string for a sitemap index. False on error.
140
+ */
141
+ public function get_sitemap_index_xml( $sitemaps ) {
142
+ $sitemap_index = new SimpleXMLElement(
143
+ sprintf(
144
+ '%1$s%2$s%3$s',
145
+ '<?xml version="1.0" encoding="UTF-8" ?>',
146
+ $this->stylesheet_index,
147
+ '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
148
+ )
149
+ );
150
+
151
+ foreach ( $sitemaps as $entry ) {
152
+ $sitemap = $sitemap_index->addChild( 'sitemap' );
153
+ $sitemap->addChild( 'loc', esc_url( $entry['loc'] ) );
154
+ }
155
+
156
+ return $sitemap_index->asXML();
157
+ }
158
+
159
+ /**
160
+ * Renders a sitemap.
161
+ *
162
+ * @since 5.5.0
163
+ *
164
+ * @param array $url_list A list of URLs for a sitemap.
165
+ */
166
+ public function render_sitemap( $url_list, $object_subtype ) {
167
+ header( 'Content-type: application/xml; charset=UTF-8' );
168
+
169
+ $this->check_for_simple_xml_availability();
170
+
171
+ $sitemap_xml = apply_filters( "core_sitemaps_get_sitemap_xml", $url_list, $object_subtype );
172
+
173
+ if ( empty( $sitemap_xml ) ) {
174
+
175
+ $sitemap_xml = $this->get_sitemap_xml( $url_list );
176
+
177
+ }
178
+
179
+ if ( ! empty( $sitemap_xml ) ) {
180
+ // All output is escaped within get_sitemap_xml().
181
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
182
+ $dom = new DOMDocument;
183
+ $dom->preserveWhiteSpace = false;
184
+ $dom->formatOutput = true;
185
+ $dom->loadXML($sitemap_xml);
186
+ echo $dom->saveXML();
187
+ //echo $sitemap_xml;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Gets XML for a sitemap.
193
+ *
194
+ * @since 5.5.0
195
+ *
196
+ * @param array $url_list A list of URLs for a sitemap.
197
+ * @return string|false A well-formed XML string for a sitemap index. False on error.
198
+ */
199
+ public function get_sitemap_xml( $url_list ) {
200
+ $urlset = new SimpleXMLElement(
201
+ sprintf(
202
+ '%1$s%2$s%3$s',
203
+ '<?xml version="1.0" encoding="UTF-8" ?>',
204
+ $this->stylesheet,
205
+ //'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
206
+ '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
207
+ )
208
+ );
209
+
210
+ foreach ( $url_list as $url_item ) {
211
+ $url = $urlset->addChild( 'url' );
212
+
213
+ // Add each attribute as a child node to the URL entry.
214
+ foreach ( $url_item as $attr => $value ) {
215
+ if ( 'url' === $attr ) {
216
+ $url->addChild( $attr, esc_url( $value ) );
217
+ } else if ('image' === $attr) {
218
+ //$image = $url->addChild('image:image');
219
+ //$image = $url->addChild('image:image', null, 'http://www.google.com/schemas/sitemap-image/1.1');
220
+ foreach ($value as $imageattr) {
221
+ $image = $url->addChild('image:image', null, 'http://www.google.com/schemas/sitemap-image/1.1');
222
+ if(array_key_exists("loc", $imageattr)) $image->addChild('image:loc',esc_url( $imageattr['loc'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
223
+ if(array_key_exists("title", $imageattr)) $image->addChild('image:title',esc_attr( $imageattr['title'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
224
+ if(array_key_exists("caption", $imageattr)) $image->addChild('image:caption',esc_attr( $imageattr['caption'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
225
+ }
226
+ } else {
227
+ $url->addChild( $attr, esc_attr( $value ) );
228
+ }
229
+ }
230
+ }
231
+
232
+ return $urlset->asXML();
233
+ }
234
+
235
+ /**
236
+ * Checks for the availability of the SimpleXML extension and errors if missing.
237
+ *
238
+ * @since 5.5.0
239
+ */
240
+ private function check_for_simple_xml_availability() {
241
+ if ( ! class_exists( 'SimpleXMLElement' ) ) {
242
+ add_filter(
243
+ 'wp_die_handler',
244
+ static function () {
245
+ return '_xml_wp_die_handler';
246
+ }
247
+ );
248
+
249
+ wp_die(
250
+ sprintf(
251
+ /* translators: %s: SimpleXML */
252
+ __( 'Could not generate XML sitemap due to missing %s extension', 'core-sitemaps' ),
253
+ 'SimpleXML'
254
+ ),
255
+ __( 'WordPress &rsaquo; Error', 'core-sitemaps' ),
256
+ array(
257
+ 'response' => 501, // "Not implemented".
258
+ )
259
+ );
260
+ }
261
+ }
262
+ }
psp-include/sitemap/inc/class-core-sitemaps-stylesheet.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Stylesheet class
4
+ *
5
+ * This class provides the XSL stylesheets to style all sitemaps.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Stylesheet provider class.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Stylesheet {
18
+ /**
19
+ * Renders the xsl stylesheet depending on whether its the sitemap index or not.
20
+ *
21
+ * @param string $type Stylesheet type. Either 'sitemap' or 'index'.
22
+ */
23
+ public function render_stylesheet( $type ) {
24
+ header( 'Content-type: application/xml; charset=UTF-8' );
25
+
26
+ if ( 'sitemap' === $type ) {
27
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.
28
+ echo $this->get_sitemap_stylesheet();
29
+ }
30
+
31
+ if ( 'index' === $type ) {
32
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.
33
+ echo $this->get_sitemap_index_stylesheet();
34
+ }
35
+
36
+ exit;
37
+ }
38
+
39
+ /**
40
+ * Returns the escaped xsl for all sitemaps, except index.
41
+ *
42
+ * @since 5.5.0
43
+ */
44
+ public function get_sitemap_stylesheet() {
45
+ $css = $this->get_stylesheet_css();
46
+ $title = esc_html__( 'XML Sitemap', 'core-sitemaps' );
47
+ $description = sprintf(
48
+ /* translators: %s: URL to sitemaps documentation. */
49
+ __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="%s">sitemaps.org</a>.', 'core-sitemaps' ),
50
+ __( 'https://www.sitemaps.org/', 'core-sitemaps' )
51
+ );
52
+ $text = sprintf(
53
+ /* translators: %s: number of URLs. */
54
+ __( 'Number of URLs in this XML Sitemap: %s.', 'core-sitemaps' ),
55
+ '<xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>'
56
+ );
57
+
58
+ $url = esc_html__( 'URL', 'core-sitemaps' );
59
+
60
+ $xsl_content = <<<XSL
61
+ <?xml version="1.0" encoding="UTF-8"?>
62
+ <xsl:stylesheet version="2.0"
63
+ xmlns:html="http://www.w3.org/TR/REC-html40"
64
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
65
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
66
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
67
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
68
+ <xsl:template match="/">
69
+ <html xmlns="http://www.w3.org/1999/xhtml">
70
+ <head>
71
+ <title>$title</title>
72
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
73
+ <style type="text/css">
74
+ $css
75
+ </style>
76
+ </head>
77
+ <body>
78
+ <div id="sitemap__header">
79
+ <h1>$title</h1>
80
+ <p>$description</p>
81
+ </div>
82
+ <div id="sitemap__content">
83
+ <p class="text">$text</p>
84
+ <table id="sitemap__table">
85
+ <thead>
86
+ <tr>
87
+ <th>$url</th>
88
+ </tr>
89
+ </thead>
90
+ <tbody>
91
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
92
+ <tr>
93
+ <td>
94
+ <xsl:variable name="itemURL">
95
+ <xsl:value-of select="sitemap:loc"/>
96
+ </xsl:variable>
97
+ <a href="{\$itemURL}">
98
+ <xsl:value-of select="sitemap:loc"/>
99
+ </a>
100
+ </td>
101
+ </tr>
102
+ </xsl:for-each>
103
+ </tbody>
104
+ </table>
105
+
106
+ </div>
107
+ </body>
108
+ </html>
109
+ </xsl:template>
110
+ </xsl:stylesheet>\n
111
+ XSL;
112
+
113
+ /**
114
+ * Filters the content of the sitemap stylesheet.
115
+ *
116
+ * @since 5.5.0
117
+ *
118
+ * @param string $xsl Full content for the xml stylesheet.
119
+ */
120
+ return apply_filters( 'core_sitemaps_stylesheet_content', $xsl_content );
121
+ }
122
+
123
+ /**
124
+ * Returns the escaped xsl for the index sitemaps.
125
+ *
126
+ * @since 5.5.0
127
+ */
128
+ public function get_sitemap_index_stylesheet() {
129
+ $css = $this->get_stylesheet_css();
130
+ $title = esc_html__( 'XML Sitemap', 'core-sitemaps' );
131
+ $description = sprintf(
132
+ /* translators: %s: URL to sitemaps documentation. */
133
+ __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="%s">sitemaps.org</a>.', 'core-sitemaps' ),
134
+ __( 'https://www.sitemaps.org/', 'core-sitemaps' )
135
+ );
136
+ $text = sprintf(
137
+ /* translators: %s: number of URLs. */
138
+ __( 'This XML Sitemap contains %s URLs.', 'core-sitemaps' ),
139
+ '<xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/>'
140
+ );
141
+
142
+ $url = esc_html__( 'URL', 'core-sitemaps' );
143
+
144
+ $xsl_content = <<<XSL
145
+ <?xml version="1.0" encoding="UTF-8"?>
146
+ <xsl:stylesheet version="2.0"
147
+ xmlns:html="http://www.w3.org/TR/REC-html40"
148
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
149
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
150
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
151
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
152
+ <xsl:template match="/">
153
+ <html xmlns="http://www.w3.org/1999/xhtml">
154
+ <head>
155
+ <title>$title</title>
156
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
157
+ <style type="text/css">
158
+ $css
159
+ </style>
160
+ </head>
161
+ <body>
162
+ <div id="sitemap__header">
163
+ <h1>$title</h1>
164
+ <p>$description</p>
165
+ </div>
166
+ <div id="sitemap__content">
167
+ <p class="text">$text</p>
168
+ <table id="sitemap__table">
169
+ <thead>
170
+ <tr>
171
+ <th>$url</th>
172
+ </tr>
173
+ </thead>
174
+ <tbody>
175
+ <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
176
+ <tr>
177
+ <td>
178
+ <xsl:variable name="itemURL">
179
+ <xsl:value-of select="sitemap:loc"/>
180
+ </xsl:variable>
181
+ <a href="{\$itemURL}">
182
+ <xsl:value-of select="sitemap:loc"/>
183
+ </a>
184
+ </td>
185
+ </tr>
186
+ </xsl:for-each>
187
+ </tbody>
188
+ </table>
189
+
190
+ </div>
191
+ </body>
192
+ </html>
193
+ </xsl:template>
194
+ </xsl:stylesheet>\n
195
+ XSL;
196
+
197
+ /**
198
+ * Filters the content of the sitemap index stylesheet.
199
+ *
200
+ * @since 5.5.0
201
+ *
202
+ * @param string $xsl Full content for the xml stylesheet.
203
+ */
204
+ return apply_filters( 'core_sitemaps_index_stylesheet_content', $xsl_content );
205
+ }
206
+
207
+ /**
208
+ * Gets the CSS to be included in sitemap XSL stylesheets.
209
+ *
210
+ * @since 5.5.0
211
+ *
212
+ * @return string The CSS.
213
+ */
214
+ public function get_stylesheet_css() {
215
+ $css = '
216
+ body {
217
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
218
+ color: #444;
219
+ }
220
+
221
+ #sitemap__table {
222
+ border: solid 1px #ccc;
223
+ border-collapse: collapse;
224
+ }
225
+
226
+ #sitemap__table tr th {
227
+ text-align: left;
228
+ }
229
+
230
+ #sitemap__table tr td,
231
+ #sitemap__table tr th {
232
+ padding: 10px;
233
+ }
234
+
235
+ #sitemap__table tr:nth-child(odd) td {
236
+ background-color: #eee;
237
+ }
238
+
239
+ a:hover {
240
+ text-decoration: none;
241
+ }';
242
+
243
+ /**
244
+ * Filters the css only for the sitemap stylesheet.
245
+ *
246
+ * @since 5.5.0
247
+ *
248
+ * @param string $css CSS to be applied to default xsl file.
249
+ */
250
+ return apply_filters( 'core_sitemaps_stylesheet_css', $css );
251
+ }
252
+ }
psp-include/sitemap/inc/class-core-sitemaps.php ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps class
4
+ *
5
+ * This is the main class integrating all other classes.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Class Core_Sitemaps.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps {
18
+ /**
19
+ * The main index of supported sitemaps.
20
+ *
21
+ * @since 5.5.0
22
+ *
23
+ * @var Core_Sitemaps_Index
24
+ */
25
+ public $index;
26
+
27
+ /**
28
+ * The main registry of supported sitemaps.
29
+ *
30
+ * @since 5.5.0
31
+ *
32
+ * @var Core_Sitemaps_Registry
33
+ */
34
+ public $registry;
35
+
36
+ /**
37
+ * An instance of the renderer class.
38
+ *
39
+ * @since 5.5.0
40
+ *
41
+ * @var Core_Sitemaps_Renderer
42
+ */
43
+ public $renderer;
44
+
45
+ /**
46
+ * Core_Sitemaps constructor.
47
+ *
48
+ * @since 5.5.0
49
+ */
50
+ public function __construct() {
51
+ $this->registry = new Core_Sitemaps_Registry();
52
+ $this->renderer = new Core_Sitemaps_Renderer();
53
+ $this->index = new Core_Sitemaps_Index( $this->registry );
54
+ }
55
+
56
+ /**
57
+ * Initiates all sitemap functionality.
58
+ *
59
+ * @since 5.5.0
60
+ */
61
+ public function init() {
62
+ // These will all fire on the init hook.
63
+ $this->register_sitemaps();
64
+
65
+ // Add additional action callbacks.
66
+ add_action( 'core_sitemaps_init', array( $this, 'register_rewrites' ) );
67
+ add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
68
+ add_action( 'wp_loaded', array( $this, 'maybe_flush_rewrites' ) );
69
+ add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
70
+ add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
71
+ add_filter( 'redirect_canonical', array( $this, 'redirect_canonical' ) );
72
+ }
73
+
74
+ /**
75
+ * Registers and sets up the functionality for all supported sitemaps.
76
+ *
77
+ * @since 5.5.0
78
+ */
79
+ public function register_sitemaps() {
80
+ /**
81
+ * Filters the list of registered sitemap providers.
82
+ *
83
+ * @since 5.5.0
84
+ *
85
+ * @param array $providers Array of Core_Sitemap_Provider objects keyed by their name.
86
+ */
87
+ $providers = apply_filters(
88
+ 'core_sitemaps_register_providers',
89
+ array(
90
+ 'posts' => new Core_Sitemaps_Posts(),
91
+ 'taxonomies' => new Core_Sitemaps_Taxonomies(),
92
+ 'users' => new Core_Sitemaps_Users(),
93
+ )
94
+ );
95
+
96
+ // Register each supported provider.
97
+ /* @var Core_Sitemaps_Provider $provider */
98
+ foreach ( $providers as $name => $provider ) {
99
+ $this->registry->add_sitemap( $name, $provider );
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Registers sitemap rewrite tags and routing rules.
105
+ *
106
+ * @since 5.5.0
107
+ */
108
+ public function register_rewrites() {
109
+ // Add rewrite tags.
110
+ add_rewrite_tag( '%sitemap%', '([^?]+)' );
111
+ add_rewrite_tag( '%sitemap-sub-type%', '([^?]+)' );
112
+
113
+ // Register index route.
114
+ add_rewrite_rule( '^wp-sitemap\.xml$', 'index.php?sitemap=index', 'top' );
115
+
116
+ // Register rewrites for the XSL stylesheet.
117
+ add_rewrite_tag( '%sitemap-stylesheet%', '([^?]+)' );
118
+ add_rewrite_rule( '^wp-sitemap\.xsl$', 'index.php?sitemap-stylesheet=sitemap', 'top' );
119
+ add_rewrite_rule( '^wp-sitemap-index\.xsl$', 'index.php?sitemap-stylesheet=index', 'top' );
120
+
121
+ // Register routes for providers.
122
+ add_rewrite_rule(
123
+ '^wp-sitemap-([a-z]+?)-([a-z\d_-]+?)-(\d+?)\.xml$',
124
+ 'index.php?sitemap=$matches[1]&sitemap-sub-type=$matches[2]&paged=$matches[3]',
125
+ 'top'
126
+ );
127
+ add_rewrite_rule(
128
+ '^wp-sitemap-([a-z]+?)-(\d+?)\.xml$',
129
+ 'index.php?sitemap=$matches[1]&paged=$matches[2]',
130
+ 'top'
131
+ );
132
+ }
133
+
134
+ /**
135
+ * Un-registers sitemap rewrite tags and routing rules.
136
+ *
137
+ * @since 5.5.0
138
+ */
139
+ public function unregister_rewrites() {
140
+ /* @var WP_Rewrite $wp_rewrite */
141
+ global $wp_rewrite;
142
+
143
+ // Unregister index route.
144
+ unset( $wp_rewrite->extra_rules_top['^wp-sitemap\.xml$'] );
145
+
146
+ // Unregister rewrites for the XSL stylesheet.
147
+ unset( $wp_rewrite->extra_rules_top['^wp-sitemap\.xsl$'] );
148
+ unset( $wp_rewrite->extra_rules_top['^wp-sitemap-index\.xsl$'] );
149
+
150
+ // Unregister routes for providers.
151
+ unset( $wp_rewrite->extra_rules_top['^wp-sitemap-([a-z]+?)-([a-z\d-]+?)-(\d+?)\.xml$'] );
152
+ unset( $wp_rewrite->extra_rules_top['^wp-sitemap-([a-z]+?)-(\d+?)\.xml$'] );
153
+ }
154
+
155
+ /**
156
+ * Flushes rewrite rules if developers updated them.
157
+ *
158
+ * @since 5.5.0
159
+ */
160
+ public function maybe_flush_rewrites() {
161
+ if ( update_option( 'core_sitemaps_rewrite_version', CORE_SITEMAPS_REWRITE_VERSION ) ) {
162
+ flush_rewrite_rules( false );
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Renders sitemap templates based on rewrite rules.
168
+ *
169
+ * @since 5.5.0
170
+ */
171
+ public function render_sitemaps() {
172
+ global $wp_query;
173
+
174
+ $sitemap = sanitize_text_field( get_query_var( 'sitemap' ) );
175
+ $object_subtype = sanitize_text_field( get_query_var( 'sitemap-sub-type' ) );
176
+ $stylesheet_type = sanitize_text_field( get_query_var( 'sitemap-stylesheet' ) );
177
+ $paged = absint( get_query_var( 'paged' ) );
178
+
179
+ // Bail early if this isn't a sitemap or stylesheet route.
180
+ if ( ! ( $sitemap || $stylesheet_type ) ) {
181
+ return;
182
+ }
183
+
184
+ // Render stylesheet if this is stylesheet route.
185
+ if ( $stylesheet_type ) {
186
+ $stylesheet = new Core_Sitemaps_Stylesheet();
187
+
188
+ $stylesheet->render_stylesheet( $stylesheet_type );
189
+ exit;
190
+ }
191
+
192
+ // Render the index.
193
+ if ( 'index' === $sitemap ) {
194
+ $sitemap_list = $this->index->get_sitemap_list();
195
+
196
+ $this->renderer->render_index( $sitemap_list );
197
+ exit;
198
+ }
199
+
200
+ $provider = $this->registry->get_sitemap( $sitemap );
201
+
202
+ if ( ! $provider ) {
203
+ return;
204
+ }
205
+
206
+ if ( empty( $paged ) ) {
207
+ $paged = 1;
208
+ }
209
+
210
+ $object_subtypes = $provider->get_object_subtypes();
211
+
212
+ // Only set the current object sub-type if it's supported.
213
+ if ( isset( $object_subtypes[ $object_subtype ] ) ) {
214
+ $provider->set_object_subtype( $object_subtype );
215
+ }
216
+
217
+ $url_list = $provider->get_url_list( $paged, $object_subtype );
218
+
219
+ // Force a 404 and bail early if no URLs are present.
220
+ if ( empty( $url_list ) ) {
221
+ $wp_query->set_404();
222
+ return;
223
+ }
224
+
225
+ $this->renderer->render_sitemap( $url_list, $object_subtype );
226
+ exit;
227
+ }
228
+
229
+ /**
230
+ * Redirects a URL to the wp-sitemap.xml
231
+ *
232
+ * @since 5.5.0
233
+ *
234
+ * @param bool $bypass Pass-through of the pre_handle_404 filter value.
235
+ * @param WP_Query $query The WP_Query object.
236
+ *
237
+ * @return bool bypass value.
238
+ */
239
+ public function redirect_sitemapxml( $bypass, $query ) {
240
+ // If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts.
241
+ if ( $bypass ) {
242
+ return $bypass;
243
+ }
244
+
245
+ // 'pagename' is for most permalink types, name is for when the %postname% is used as a top-level field.
246
+ if ( 'sitemap-xml' === $query->get( 'pagename' ) ||
247
+ 'sitemap-xml' === $query->get( 'name' ) ) {
248
+ wp_safe_redirect( $this->index->get_index_url() );
249
+ exit();
250
+ }
251
+
252
+ return $bypass;
253
+ }
254
+
255
+ /**
256
+ * Adds the sitemap index to robots.txt.
257
+ *
258
+ * @since 5.5.0
259
+ *
260
+ * @param string $output robots.txt output.
261
+ * @param bool $public Whether the site is public or not.
262
+ * @return string robots.txt output.
263
+ */
264
+ public function add_robots( $output, $public ) {
265
+ if ( $public ) {
266
+ $output .= "\nSitemap: " . esc_url( $this->index->get_index_url() ) . "\n";
267
+ }
268
+
269
+ return $output;
270
+ }
271
+
272
+ /**
273
+ * Prevent trailing slashes.
274
+ *
275
+ * @since 5.5.0
276
+ *
277
+ * @param string $redirect The redirect URL currently determined.
278
+ * @return bool|string $redirect
279
+ */
280
+ public function redirect_canonical( $redirect ) {
281
+ if ( get_query_var( 'sitemap' ) || get_query_var( 'sitemap-stylesheet' ) ) {
282
+ return false;
283
+ }
284
+
285
+ return $redirect;
286
+ }
287
+ }
psp-include/sitemap/inc/functions.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Public functions
4
+ *
5
+ * This file contains a variety of public functions developers can use to interact with
6
+ * the XML Sitemaps API.
7
+ *
8
+ * @package WordPress
9
+ * @subpackage Sitemaps
10
+ * @since 5.5.0
11
+ */
12
+
13
+ /**
14
+ * Retrieves the current Sitemaps server instance.
15
+ *
16
+ * @since 5.5.0
17
+ *
18
+ * @return Core_Sitemaps|null Core_Sitemaps instance, or null of sitemaps are disabled.
19
+ */
20
+ function core_sitemaps_get_server() {
21
+ /**
22
+ * Global Core Sitemaps instance.
23
+ *
24
+ * @since 5.5.0
25
+ *
26
+ * @var Core_Sitemaps $core_sitemaps
27
+ */
28
+ global $core_sitemaps;
29
+
30
+ $is_enabled = (bool) get_option( 'blog_public' );
31
+
32
+ /**
33
+ * Filters whether XML Sitemaps are enabled or not.
34
+ *
35
+ * @since 5.5.0
36
+ *
37
+ * @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults to true for public sites.
38
+ */
39
+ $is_enabled = (bool) apply_filters( 'core_sitemaps_is_enabled', $is_enabled );
40
+
41
+ if ( ! $is_enabled ) {
42
+ return null;
43
+ }
44
+
45
+ // If there isn't a global instance, set and bootstrap the sitemaps system.
46
+ if ( empty( $core_sitemaps ) ) {
47
+ $core_sitemaps = new Core_Sitemaps();
48
+ $core_sitemaps->init();
49
+
50
+ /**
51
+ * Fires when initializing the Core_Sitemaps object.
52
+ *
53
+ * Additional sitemaps should be registered on this hook.
54
+ *
55
+ * @since 5.5.0
56
+ *
57
+ * @param core_sitemaps $core_sitemaps Server object.
58
+ */
59
+ do_action( 'core_sitemaps_init', $core_sitemaps );
60
+ }
61
+
62
+ return $core_sitemaps;
63
+ }
64
+
65
+ /**
66
+ * Gets a list of sitemap providers.
67
+ *
68
+ * @since 5.5.0
69
+ *
70
+ * @return array $sitemaps A list of registered sitemap providers.
71
+ */
72
+ function core_sitemaps_get_sitemaps() {
73
+ $core_sitemaps = core_sitemaps_get_server();
74
+
75
+ if ( ! $core_sitemaps ) {
76
+ return array();
77
+ }
78
+
79
+ return $core_sitemaps->registry->get_sitemaps();
80
+ }
81
+
82
+ /**
83
+ * Registers a new sitemap provider.
84
+ *
85
+ * @since 5.5.0
86
+ *
87
+ * @param string $name Unique name for the sitemap provider.
88
+ * @param Core_Sitemaps_Provider $provider The `Core_Sitemaps_Provider` instance implementing the sitemap.
89
+ * @return bool Returns true if the sitemap was added. False on failure.
90
+ */
91
+ function core_sitemaps_register_sitemap( $name, $provider ) {
92
+ $core_sitemaps = core_sitemaps_get_server();
93
+
94
+ if ( ! $core_sitemaps ) {
95
+ return false;
96
+ }
97
+
98
+ return $core_sitemaps->registry->add_sitemap( $name, $provider );
99
+ }
100
+
101
+ /**
102
+ * Gets the maximum number of URLs for a sitemap.
103
+ *
104
+ * @since 5.5.0
105
+ *
106
+ * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
107
+ * @return int The maximum number of URLs.
108
+ */
109
+ function core_sitemaps_get_max_urls( $object_type ) {
110
+ /**
111
+ * Filters the maximum number of URLs displayed on a sitemap.
112
+ *
113
+ * @since 5.5.0
114
+ *
115
+ * @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
116
+ * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
117
+ */
118
+ return apply_filters( 'core_sitemaps_max_urls', CORE_SITEMAPS_MAX_URLS, $object_type );
119
+ }
psp-include/sitemap/inc/providers/class-core-sitemaps-posts.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Posts class
4
+ *
5
+ * Builds the sitemaps for the 'post' object type.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Posts XML sitemap provider.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Posts extends Core_Sitemaps_Provider {
18
+ /**
19
+ * Core_Sitemaps_Posts constructor.
20
+ *
21
+ * @since 5.5.0
22
+ */
23
+ public function __construct() {
24
+ $this->name = 'posts';
25
+ $this->object_type = 'post';
26
+ }
27
+
28
+ /**
29
+ * Returns the public post types, which excludes nav_items and similar types.
30
+ * Attachments are also excluded. This includes custom post types with public = true.
31
+ *
32
+ * @since 5.5.0
33
+ *
34
+ * @return array Map of registered post type objects keyed by their name.
35
+ */
36
+ public function get_object_subtypes() {
37
+ $post_types = get_post_types( array( 'public' => true ), 'objects' );
38
+ unset( $post_types['attachment'] );
39
+
40
+ /**
41
+ * Filters the list of post object sub types available within the sitemap.
42
+ *
43
+ * @since 5.5.0
44
+ *
45
+ * @param array $post_types Map of registered post type objects keyed by their name.
46
+ */
47
+ return apply_filters( 'core_sitemaps_post_types', $post_types );
48
+ }
49
+
50
+ /**
51
+ * Gets a URL list for a post type sitemap.
52
+ *
53
+ * @since 5.5.0
54
+ *
55
+ * @param int $page_num Page of results.
56
+ * @param string $post_type Optional. Post type name. Default empty.
57
+ * @return array List of URLs for a sitemap.
58
+ */
59
+ public function get_url_list( $page_num, $post_type = '' ) {
60
+ if ( ! $post_type ) {
61
+ $post_type = $this->get_queried_type();
62
+ }
63
+
64
+ // Return an empty array if the type is not supported.
65
+ $supported_types = $this->get_object_subtypes();
66
+
67
+ if ( ! isset( $supported_types[ $post_type ] ) ) {
68
+ return array();
69
+ }
70
+
71
+ $query = new WP_Query(
72
+ array(
73
+ 'fields' => 'ids',
74
+ 'orderby' => 'ID',
75
+ 'order' => 'ASC',
76
+ 'post_type' => $post_type,
77
+ 'posts_per_page' => core_sitemaps_get_max_urls( $this->object_type ),
78
+ 'post_status' => array( 'publish' ),
79
+ 'paged' => $page_num,
80
+ 'no_found_rows' => true,
81
+ 'update_post_term_cache' => false,
82
+ 'update_post_meta_cache' => false,
83
+ )
84
+ );
85
+
86
+ /**
87
+ * Returns an array of posts.
88
+ *
89
+ * @var array<int, \WP_Post> $posts
90
+ */
91
+ $posts = $query->get_posts();
92
+
93
+ $posts = apply_filters( 'core_sitemaps_posts_list', $posts, $post_type, $page_num );
94
+
95
+ $url_list = array();
96
+
97
+ $post_sitemap_attributes = array();
98
+
99
+ /*
100
+ * Add a URL for the homepage in the pages sitemap.
101
+ * Shows only on the first page if the reading settings are set to display latest posts.
102
+ */
103
+ if ( 'page' === $post_type && 1 === $page_num && 'posts' === get_option( 'show_on_front' ) ) {
104
+ // Extract the data needed for home URL to add to the array.
105
+ $url_list[] = array(
106
+ 'loc' => home_url(),
107
+ );
108
+ }
109
+
110
+ foreach ( $posts as $post ) {
111
+ $post_sitemap_attributes = array( 'loc' => get_permalink( $post )) ;
112
+ $url_list[] = apply_filters( 'core_sitemaps_post_attributes', $post_sitemap_attributes, $post );
113
+ /***
114
+ $url_list[] = array(
115
+ 'loc' => get_permalink( $post ),
116
+ );
117
+ ***/
118
+ }
119
+
120
+ /**
121
+ * Filters the list of URLs for a sitemap before rendering.
122
+ *
123
+ * @since 5.5.0
124
+ *
125
+ * @param array $url_list List of URLs for a sitemap.
126
+ * @param string $post_type Name of the post_type.
127
+ * @param int $page_num Page number of the results.
128
+ */
129
+ return apply_filters( 'core_sitemaps_posts_url_list', $url_list, $post_type, $page_num );
130
+ }
131
+
132
+ /**
133
+ * Gets the max number of pages available for the object type.
134
+ *
135
+ * @since 5.5.0
136
+ *
137
+ * @param string $post_type Optional. Post type name. Default empty.
138
+ * @return int Total number of pages.
139
+ */
140
+ public function max_num_pages( $post_type = '' ) {
141
+ if ( empty( $post_type ) ) {
142
+ $post_type = $this->get_queried_type();
143
+ }
144
+
145
+ $query = new WP_Query(
146
+ array(
147
+ 'fields' => 'ids',
148
+ 'orderby' => 'ID',
149
+ 'order' => 'ASC',
150
+ 'post_type' => $post_type,
151
+ 'posts_per_page' => core_sitemaps_get_max_urls( $this->object_type ),
152
+ 'paged' => 1,
153
+ 'update_post_term_cache' => false,
154
+ 'update_post_meta_cache' => false,
155
+ )
156
+ );
157
+
158
+ return isset( $query->max_num_pages ) ? $query->max_num_pages : 1;
159
+ }
160
+ }
psp-include/sitemap/inc/providers/class-core-sitemaps-taxonomies.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Taxonomies class
4
+ *
5
+ * Builds the sitemaps for the 'taxonomy' object type.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Taxonomies XML sitemap provider.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Taxonomies extends Core_Sitemaps_Provider {
18
+ /**
19
+ * Core_Sitemaps_Taxonomies constructor.
20
+ *
21
+ * @since 5.5.0
22
+ */
23
+ public function __construct() {
24
+ $this->name = 'taxonomies';
25
+ $this->object_type = 'term';
26
+ }
27
+
28
+ /**
29
+ * Returns all public, registered taxonomies.
30
+ *
31
+ * @since 5.5.0
32
+ *
33
+ * @return array Map of registered taxonomy objects keyed by their name.
34
+ */
35
+ public function get_object_subtypes() {
36
+ $taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );
37
+
38
+ /**
39
+ * Filter the list of taxonomy object subtypes available within the sitemap.
40
+ *
41
+ * @since 5.5.0
42
+ *
43
+ * @param array $taxonomies Map of registered taxonomy objects keyed by their name.
44
+ */
45
+ return apply_filters( 'core_sitemaps_taxonomies', $taxonomies );
46
+ }
47
+
48
+ /**
49
+ * Gets a URL list for a taxonomy sitemap.
50
+ *
51
+ * @since 5.5.0
52
+ *
53
+ * @param int $page_num Page of results.
54
+ * @param string $taxonomy Optional. Taxonomy name. Default empty.
55
+ * @return array List of URLs for a sitemap.
56
+ */
57
+ public function get_url_list( $page_num, $taxonomy = '' ) {
58
+ // Find the query_var for subtype.
59
+ if ( ! $taxonomy ) {
60
+ $taxonomy = $this->get_queried_type();
61
+ }
62
+
63
+ // Bail early if we don't have a taxonomy.
64
+ if ( empty( $taxonomy ) ) {
65
+ return array();
66
+ }
67
+
68
+ $supported_types = $this->get_object_subtypes();
69
+
70
+ // Bail early if the queried taxonomy is not a supported type.
71
+ if ( ! isset( $supported_types[ $taxonomy ] ) ) {
72
+ return array();
73
+ }
74
+
75
+ $url_list = array();
76
+
77
+ // Offset by how many terms should be included in previous pages.
78
+ $offset = ( $page_num - 1 ) * core_sitemaps_get_max_urls( $this->object_type );
79
+
80
+ $args = array(
81
+ 'fields' => 'ids',
82
+ 'taxonomy' => $taxonomy,
83
+ 'orderby' => 'term_order',
84
+ 'number' => core_sitemaps_get_max_urls( $this->object_type ),
85
+ 'offset' => $offset,
86
+ 'hide_empty' => true,
87
+
88
+ /*
89
+ * Limits aren't included in queries when hierarchical is set to true (by default).
90
+ *
91
+ * @link: https://github.com/WordPress/WordPress/blob/5.3/wp-includes/class-wp-term-query.php#L558-L567
92
+ */
93
+ 'hierarchical' => false,
94
+ 'update_term_meta_cache' => false,
95
+ );
96
+
97
+ $taxonomy_terms = new WP_Term_Query( $args );
98
+
99
+ $taxonomy_terms = apply_filters( 'core_sitemaps_terms_list', $taxonomy_terms, $taxonomy, $page_num );
100
+
101
+ if ( ! empty( $taxonomy_terms->terms ) ) {
102
+ foreach ( $taxonomy_terms->terms as $term ) {
103
+
104
+ $term_sitemap_attributes = array( 'loc' => get_term_link( $term )) ;
105
+ $url_list[] = apply_filters( 'core_sitemaps_term_attributes', $term_sitemap_attributes, $term );
106
+ /**
107
+ $url_list[] = array(
108
+ 'loc' => get_term_link( $term ),
109
+ );
110
+ **/
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Filters the list of URLs for a sitemap before rendering.
116
+ *
117
+ * @since 5.5.0
118
+ *
119
+ * @param array $url_list List of URLs for a sitemap.
120
+ * @param string $taxonomy Taxonomy name.
121
+ * @param int $page_num Page of results.
122
+ */
123
+ return apply_filters( 'core_sitemaps_taxonomies_url_list', $url_list, $taxonomy, $page_num );
124
+ }
125
+
126
+ /**
127
+ * Gets the max number of pages available for the object type.
128
+ *
129
+ * @since 5.5.0
130
+ *
131
+ * @param string $taxonomy Taxonomy name.
132
+ * @return int Total number of pages.
133
+ */
134
+ public function max_num_pages( $taxonomy = '' ) {
135
+ if ( empty( $taxonomy ) ) {
136
+ $taxonomy = $this->get_queried_type();
137
+ }
138
+
139
+ $term_count = wp_count_terms( $taxonomy, array( 'hide_empty' => true ) );
140
+
141
+ return (int) ceil( $term_count / core_sitemaps_get_max_urls( $this->object_type ) );
142
+ }
143
+ }
psp-include/sitemap/inc/providers/class-core-sitemaps-users.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemaps: Core_Sitemaps_Users class
4
+ *
5
+ * Builds the sitemaps for the 'user' object type.
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Sitemaps
9
+ * @since 5.5.0
10
+ */
11
+
12
+ /**
13
+ * Users XML sitemap provider.
14
+ *
15
+ * @since 5.5.0
16
+ */
17
+ class Core_Sitemaps_Users extends Core_Sitemaps_Provider {
18
+ /**
19
+ * Core_Sitemaps_Users constructor.
20
+ *
21
+ * @since 5.5.0
22
+ */
23
+ public function __construct() {
24
+ $this->name = 'users';
25
+ $this->object_type = 'user';
26
+ }
27
+
28
+ /**
29
+ * Gets a URL list for a user sitemap.
30
+ *
31
+ * @since 5.5.0
32
+ *
33
+ * @param int $page_num Page of results.
34
+ * @param string $object_subtype Optional. Not applicable for Users but
35
+ * required for compatibility with the parent
36
+ * provider class. Default empty.
37
+ * @return array List of URLs for a sitemap.
38
+ */
39
+ public function get_url_list( $page_num, $object_subtype = '' ) {
40
+ $query = $this->get_public_post_authors_query( $page_num );
41
+ $users = $query->get_results();
42
+ $url_list = array();
43
+
44
+ foreach ( $users as $user ) {
45
+ $url_list[] = array(
46
+ 'loc' => get_author_posts_url( $user->ID ),
47
+ );
48
+ }
49
+
50
+ /**
51
+ * Filters the list of URLs for a sitemap before rendering.
52
+ *
53
+ * @since 5.5.0
54
+ *
55
+ * @param array $url_list List of URLs for a sitemap.
56
+ * @param int $page_num Page of results.
57
+ */
58
+ return apply_filters( 'core_sitemaps_users_url_list', $url_list, $page_num );
59
+ }
60
+
61
+ /**
62
+ * Gets the max number of pages available for the object type.
63
+ *
64
+ * @since 5.5.0
65
+ *
66
+ * @see Core_Sitemaps_Provider::max_num_pages
67
+ *
68
+ * @param string $object_subtype Optional. Not applicable for Users but
69
+ * required for compatibility with the parent
70
+ * provider class. Default empty.
71
+ * @return int Total page count.
72
+ */
73
+ public function max_num_pages( $object_subtype = '' ) {
74
+ $query = $this->get_public_post_authors_query();
75
+
76
+ $total_users = $query->get_total();
77
+
78
+ return (int) ceil( $total_users / core_sitemaps_get_max_urls( $this->object_type ) );
79
+ }
80
+
81
+ /**
82
+ * Returns a query for authors with public posts.
83
+ *
84
+ * Implementation must support `$query->max_num_pages`.
85
+ *
86
+ * @since 5.5.0
87
+ *
88
+ * @param integer $page_num Optional. Default is 1. Page of query results to return.
89
+ * @return WP_User_Query
90
+ */
91
+ public function get_public_post_authors_query( $page_num = 1 ) {
92
+ $public_post_types = get_post_types(
93
+ array(
94
+ 'public' => true,
95
+ )
96
+ );
97
+
98
+ // We're not supporting sitemaps for author pages for attachments.
99
+ unset( $public_post_types['attachment'] );
100
+
101
+ $query = new WP_User_Query(
102
+ array(
103
+ 'has_published_posts' => array_keys( $public_post_types ),
104
+ 'number' => core_sitemaps_get_max_urls( $this->object_type ),
105
+ 'paged' => absint( $page_num ),
106
+ )
107
+ );
108
+
109
+ return $query;
110
+ }
111
+ }
psp-include/sitemap/psp_sitemap.php ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Techblissonline Platinum SEO and Social Pack
5
+ Description: SiteMap Management class
6
+ Text Domain: platinum-seo-pack
7
+ Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
8
+ Author: Rajesh - Techblissonline
9
+ Author URI: https://techblissonline.com/
10
+ */
11
+
12
+ class PspSitemap {
13
+
14
+ private static $obj_handle = null;
15
+ private $psp_helper;
16
+ private $psp_sitemap_settings;
17
+ private $psp_excluded_post_ids = array();
18
+ private $psp_excluded_term_ids = array();
19
+ private $stylesheet;
20
+
21
+ public static function get_instance() {
22
+
23
+ if ( null == self::$obj_handle ) {
24
+ self::$obj_handle = new self;
25
+ }
26
+
27
+ return self::$obj_handle;
28
+
29
+ } // end get_instance;
30
+
31
+ function __construct() {
32
+
33
+ $psp_helper_instance = PspHelper::get_instance();
34
+ $this->psp_helper = $psp_helper_instance;
35
+
36
+ // Limit the number of URLs included in a sitemap.
37
+ if ( ! defined( 'CORE_SITEMAPS_MAX_SITEMAPS' ) ) {
38
+ define( 'CORE_SITEMAPS_MAX_SITEMAPS', 50000 );
39
+ }
40
+
41
+ // Limit the number of URLs included in a sitemap.
42
+ if ( ! defined( 'CORE_SITEMAPS_REWRITE_VERSION' ) ) {
43
+ define( 'CORE_SITEMAPS_REWRITE_VERSION', '2020-04-29' );
44
+ }
45
+
46
+ // Limit the number of URLs included in a sitemap.
47
+ if ( ! defined( 'CORE_SITEMAPS_MAX_URLS' ) ) {
48
+ define( 'CORE_SITEMAPS_MAX_URLS', 2000 );
49
+ }
50
+
51
+ $psp_sm_settings = get_option('psp_sitemap');
52
+ $this->psp_sitemap_settings = $psp_sm_settings;
53
+
54
+ $psp_core_sitemaps_enabled = isset($psp_sm_settings['enable']) ? $psp_sm_settings['enable'] : '';
55
+
56
+ require_once __DIR__ . '/inc/class-core-sitemaps.php';
57
+ require_once __DIR__ . '/inc/class-core-sitemaps-provider.php';
58
+ require_once __DIR__ . '/inc/class-core-sitemaps-index.php';
59
+ require_once __DIR__ . '/inc/class-core-sitemaps-registry.php';
60
+ require_once __DIR__ . '/inc/class-core-sitemaps-renderer.php';
61
+ require_once __DIR__ . '/inc/class-core-sitemaps-stylesheet.php';
62
+ require_once __DIR__ . '/inc/providers/class-core-sitemaps-posts.php';
63
+ require_once __DIR__ . '/inc/providers/class-core-sitemaps-taxonomies.php';
64
+ require_once __DIR__ . '/inc/providers/class-core-sitemaps-users.php';
65
+ require_once __DIR__ . '/inc/functions.php';
66
+
67
+ if (!$psp_core_sitemaps_enabled) return;
68
+
69
+
70
+ add_filter('core_sitemaps_stylesheet_index_url', array($this, 'psp_get_sitemaps_stylesheet_index_url'), 10, 1);
71
+ add_filter('core_sitemaps_stylesheet_url', array($this, 'psp_get_sitemaps_stylesheet_url'), 10, 1);
72
+
73
+
74
+ $excluded_post_ids = array();
75
+ $excluded_term_ids = array();
76
+
77
+ $psp_excluded_post_ids = isset($psp_sm_settings['excluded_post_ids']) ? $psp_sm_settings['excluded_post_ids'] : '';
78
+ $excluded_post_ids = explode(",", $psp_excluded_post_ids);
79
+ if( !empty( $excluded_post_ids ) ) $excluded_post_ids = array_map( 'absint', $excluded_post_ids );
80
+ $this->psp_excluded_post_ids = $excluded_post_ids;
81
+
82
+ $excluded_term_ids = isset($psp_sm_settings['excluded_term_ids']) ? $psp_sm_settings['excluded_term_ids'] : '';
83
+ $excluded_term_ids = explode(",", $excluded_term_ids);
84
+ if( !empty( $excluded_term_ids ) ) $excluded_term_ids = array_map( 'absint', $excluded_term_ids );
85
+ $this->psp_excluded_term_ids = $excluded_term_ids;
86
+
87
+ //psp sitemap disabled
88
+ //add_filter( 'pre_handle_404', array( $this, 'psp_redirect_sitemapxml' ), 9, 2 );
89
+ add_filter( 'core_sitemaps_register_providers', array( $this, 'psp_sitemap_providers' ), 10, 1 );
90
+ add_filter( 'core_sitemaps_max_urls', array( $this, 'psp_sitemap_max_urls' ), 10, 2 );
91
+
92
+ add_filter('core_sitemaps_is_enabled', array($this, 'psp_enable_core_sitemaps'), 10, 1);
93
+ add_filter('core_sitemaps_taxonomies', array($this, 'psp_taxonomies_for_sitemap'), 10, 1);
94
+ add_filter('core_sitemaps_post_types', array($this, 'psp_post_types_for_sitemap'), 10, 1);
95
+
96
+ add_filter('core_sitemaps_posts_list', array($this, 'psp_posts_for_sitemap'), 10, 3);
97
+ add_filter('core_sitemaps_terms_list', array($this, 'psp_terms_for_sitemap'), 10, 3);
98
+
99
+ add_filter('core_sitemaps_post_attributes', array($this, 'psp_post_attr_for_sitemap'), 10, 2);
100
+
101
+ add_filter('core_sitemaps_term_attributes', array($this, 'psp_term_attr_for_sitemap'), 10, 2);
102
+
103
+ add_filter('core_sitemaps_get_sitemap_xml', array($this, 'psp_get_sitemap_xml'), 10, 2);
104
+
105
+ // Boot the sitemaps system.
106
+ add_action( 'init', 'core_sitemaps_get_server' );
107
+
108
+ }
109
+
110
+ public function psp_enable_core_sitemaps($enabled) {
111
+
112
+ $psp_sm_settings = $this->psp_sitemap_settings;
113
+ $psp_core_sitemaps_enabled = isset($psp_sm_settings['enable']) ? $psp_sm_settings['enable'] : '';
114
+
115
+ if ( $psp_core_sitemaps_enabled ) {
116
+ return 'enabled';
117
+ } else {
118
+ return false;
119
+ }
120
+
121
+ }
122
+
123
+ public function psp_sitemap_providers($providers) {
124
+
125
+ $psp_sm_settings = $this->psp_sitemap_settings;
126
+ $psp_author_sitemaps_enabled = isset($psp_sm_settings['enable_authors']) ? $psp_sm_settings['enable_authors'] : '';
127
+
128
+ if ( $psp_author_sitemaps_enabled ) {
129
+ return $providers;
130
+ } else {
131
+ return array(
132
+ 'posts' => new Core_Sitemaps_Posts(),
133
+ 'taxonomies' => new Core_Sitemaps_Taxonomies(),
134
+ );
135
+ }
136
+
137
+ }
138
+
139
+ public function psp_sitemap_max_urls($core_sitemap_max_urls, $object_type) {
140
+
141
+ $psp_sm_settings = $this->psp_sitemap_settings;
142
+ $psp_sitemaps_max_urls = isset($psp_sm_settings['max_urls']) ? $psp_sm_settings['max_urls'] : '';
143
+
144
+ if ( $psp_sitemaps_max_urls ) {
145
+ return (int) $psp_sitemaps_max_urls;
146
+ } else {
147
+ return (int) $core_sitemap_max_urls;
148
+ }
149
+
150
+ }
151
+
152
+ public function psp_taxonomies_for_sitemap($taxonomies) {
153
+
154
+ $psp_sm_settings = $this->psp_sitemap_settings;
155
+ $psp_taxonomies_for_sm = isset($psp_sm_settings['taxonomies_list']) ? $psp_sm_settings['taxonomies_list'] : '';
156
+
157
+ $psp_taxonomies = array();
158
+
159
+ if (!empty( $psp_taxonomies_for_sm )) {
160
+
161
+ foreach($taxonomies as $key => $val) {
162
+ if (in_array($key, $psp_taxonomies_for_sm)) {
163
+ $psp_taxonomies[$key] = $val;
164
+ }
165
+ }
166
+
167
+ return $psp_taxonomies;
168
+ }
169
+
170
+ return $psp_taxonomies;
171
+
172
+ }
173
+
174
+ public function psp_post_types_for_sitemap($post_types) {
175
+
176
+ $psp_sm_settings = $this->psp_sitemap_settings;
177
+ $psp_post_types_for_sm = isset($psp_sm_settings['posttypes_list']) ? $psp_sm_settings['posttypes_list'] : '';
178
+
179
+ $psp_post_types = array();
180
+
181
+ if (!empty( $psp_post_types_for_sm )) {
182
+ foreach($post_types as $key => $val) {
183
+ if (in_array($key, $psp_post_types_for_sm)) {
184
+ $psp_post_types[$key] = $val;
185
+ }
186
+ }
187
+ return $psp_post_types;
188
+ }
189
+
190
+ return $post_types;
191
+
192
+ }
193
+
194
+ public function psp_posts_for_sitemap($posts, $post_type, $page_num) {
195
+
196
+ $psp_posts = array();
197
+
198
+ $psp_excluded_post_ids = $this->psp_excluded_post_ids;
199
+
200
+ if ($psp_excluded_post_ids) {
201
+
202
+ foreach ( $posts as $post ) {
203
+ if ( !in_array($post, $psp_excluded_post_ids) ) {
204
+ $psp_posts[] = $post;
205
+ }
206
+ }
207
+
208
+ return $psp_posts;
209
+
210
+ }
211
+
212
+ return $posts;
213
+
214
+ }
215
+
216
+ public function psp_terms_for_sitemap($terms, $taxonomy, $page_num) {
217
+
218
+ $psp_terms = array();
219
+
220
+ $psp_excluded_term_ids = $this->psp_excluded_term_ids;
221
+
222
+ if ($psp_excluded_term_ids) {
223
+
224
+ foreach ( $terms->terms as $term ) {
225
+ if ( !in_array($term, $psp_excluded_term_ids) ) {
226
+ $psp_terms[] = $term;
227
+ }
228
+ }
229
+ $terms->terms = $psp_terms;
230
+ return $terms;
231
+
232
+ }
233
+
234
+ return $terms;
235
+
236
+ }
237
+
238
+ public function psp_post_attr_for_sitemap($post_sm_attributes = array(), $post) {
239
+
240
+ $psp_sm_settings = $this->psp_sitemap_settings;
241
+
242
+ $psp_lastmod_sitemaps_enabled = isset($psp_sm_settings['include_lastmod']) ? $psp_sm_settings['include_lastmod'] : '';
243
+
244
+ if ($psp_lastmod_sitemaps_enabled) {
245
+ $post_sm_attributes['lastmod'] = $this->psp_get_last_modified_time( $post )->format('Y-m-d\TH:i:sP');
246
+ }
247
+
248
+ $psp_image_sitemaps_enabled = isset($psp_sm_settings['include_images']) ? $psp_sm_settings['include_images'] : '';
249
+
250
+ if ($psp_image_sitemaps_enabled) {
251
+ $images = $this->psp_get_images( $post );
252
+
253
+ if ($images) {
254
+
255
+ $post_sm_attributes["image"] = $images;
256
+
257
+ }
258
+ }
259
+ return $post_sm_attributes;
260
+
261
+ }
262
+
263
+ public function psp_term_attr_for_sitemap($term_sm_attributes = array(), $term) {
264
+
265
+ //$post_sm_attributes['lastmod'] = $this->psp_get_last_modified_time( $post )->format('Y-m-d h:m:s');
266
+
267
+ return $term_sm_attributes;
268
+
269
+
270
+ }
271
+
272
+ public function psp_get_last_modified_time( $post ) {
273
+ //get the local time of the current post in seconds
274
+ $postTime = get_post_time( 'U', true, $post );
275
+
276
+ //get the time when the post was last modified
277
+ $postModifiedTime = get_post_modified_time( 'U', true, $post );
278
+
279
+ if ($postModifiedTime >= $postTime + 86400) {
280
+ return get_post_datetime( $post, 'modified', 'gmt' );
281
+ } else {
282
+ return get_post_datetime( $post, 'date', 'gmt' );
283
+ }
284
+ }
285
+
286
+ public function psp_get_images( $post ) {
287
+ //get the local time of the current post in seconds
288
+ /***
289
+ $attachments = get_posts( array(
290
+ 'post_type' => 'attachment',
291
+ 'posts_per_page' => -1,
292
+ 'post_parent' => $post,
293
+ ) );
294
+ ***/
295
+ //get images
296
+ $attachments = get_children(array('post_parent' => $post,
297
+ 'post_status' => 'inherit',
298
+ 'post_type' => 'attachment',
299
+ 'post_mime_type' => 'image',
300
+ 'order' => 'ASC',
301
+ 'orderby' => 'menu_order ID'));
302
+
303
+
304
+ $psp_images = array();
305
+ if ( $attachments ) {
306
+
307
+ foreach($attachments as $att_id => $attachment) {
308
+ $full_img_url = "";
309
+ $imagedet = array();
310
+ $full_img_url = wp_get_attachment_url($attachment->ID);
311
+ $full_image_title = get_the_title($attachment->ID);
312
+ $full_image_caption = wp_get_attachment_caption($attachment->ID);
313
+ if ($full_img_url) {
314
+ $imagedet['loc'] = $full_img_url;
315
+ }
316
+ if ($full_image_title) {
317
+ $imagedet['title'] = $full_image_title;
318
+ }
319
+ if ($full_image_caption) {
320
+ $imagedet['caption'] = $full_image_caption;
321
+ }
322
+ $psp_images[] = $imagedet;
323
+ }
324
+
325
+ }
326
+
327
+ return $psp_images;
328
+
329
+ }
330
+
331
+ public function psp_get_sitemaps_stylesheet_url( $sitemap_url = '' ) {
332
+ //error_log (plugins_url( '/sitemap.xsl', __FILE__ ));
333
+ //return $sitemaps_stylesheet_url;
334
+ $psp_stylesheet_url = plugins_url( '/sitemap.xsl', __FILE__ );
335
+
336
+ if($psp_stylesheet_url) {
337
+ //$this->stylesheet = $psp_stylesheet_url;
338
+ return plugins_url( '/sitemap.xsl', __FILE__ );
339
+ } else {
340
+ return $sitemaps_stylesheet_url;
341
+ }
342
+
343
+ }
344
+
345
+ public function psp_get_sitemaps_stylesheet_index_url( $sitemaps_stylesheet_url = '' ) {
346
+ //error_log (plugins_url( '/sitemap-index.xsl', __FILE__ ));
347
+ //return $sitemaps_stylesheet_url;
348
+ $psp_stylesheet_url = plugins_url( '/sitemap-index.xsl', __FILE__ );
349
+ if($psp_stylesheet_url) {
350
+ return plugins_url( '/sitemap-index.xsl', __FILE__ );
351
+ } else {
352
+ return $sitemaps_stylesheet_url;
353
+ }
354
+
355
+ }
356
+
357
+ /**
358
+ * Gets XML for a sitemap.
359
+ *
360
+ * @since 5.5.0
361
+ *
362
+ * @param array $url_list A list of URLs for a sitemap.
363
+ * @return string|false A well-formed XML string for a sitemap index. False on error.
364
+ */
365
+ public function psp_get_sitemap_xml( $url_list, $object_subtype ) {
366
+
367
+ $psp_sm_settings = $this->psp_sitemap_settings;
368
+
369
+ $psp_lastmod_sitemaps_enabled = isset($psp_sm_settings['include_lastmod']) ? $psp_sm_settings['include_lastmod'] : '';
370
+
371
+ $psp_image_sitemaps_enabled = isset($psp_sm_settings['include_images']) ? $psp_sm_settings['include_images'] : '';
372
+
373
+ if ($object_subtype === 'post') {
374
+
375
+ $psp_stylesheet_url = plugins_url( '/sitemap.xsl', __FILE__ );
376
+ $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $psp_stylesheet_url ) . '" ?>';
377
+
378
+ if ($psp_lastmod_sitemaps_enabled) {
379
+
380
+ $psp_stylesheet_url = plugins_url( '/sitemap-post.xsl', __FILE__ );
381
+ $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $psp_stylesheet_url ) . '" ?>';
382
+ }
383
+
384
+ if ($psp_image_sitemaps_enabled) {
385
+
386
+ $psp_stylesheet_url = plugins_url( '/sitemap-image.xsl', __FILE__ );
387
+ $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $psp_stylesheet_url ) . '" ?>';
388
+
389
+ }
390
+ } else {
391
+ $psp_stylesheet_url = plugins_url( '/sitemap.xsl', __FILE__ );
392
+ $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $psp_stylesheet_url ) . '" ?>';
393
+ }
394
+ $urlset = new SimpleXMLElement(
395
+ sprintf(
396
+ '%1$s%2$s%3$s',
397
+ '<?xml version="1.0" encoding="UTF-8" ?>',
398
+ $this->stylesheet,
399
+ '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
400
+ )
401
+ );
402
+
403
+ foreach ( $url_list as $url_item ) {
404
+ $url = $urlset->addChild( 'url' );
405
+
406
+ // Add each attribute as a child node to the URL entry.
407
+ foreach ( $url_item as $attr => $value ) {
408
+ if ( 'url' === $attr ) {
409
+
410
+ $url->addChild( $attr, esc_url( $value ) );
411
+
412
+ } else if ('image' === $attr) {
413
+
414
+ foreach ($value as $imageattr) {
415
+ $image = $url->addChild('image:image', null, 'http://www.google.com/schemas/sitemap-image/1.1');
416
+ if(array_key_exists("loc", $imageattr)) $image->addChild('image:loc',esc_url( $imageattr['loc'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
417
+ if(array_key_exists("title", $imageattr)) $image->addChild('image:title',esc_attr( $imageattr['title'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
418
+ if(array_key_exists("caption", $imageattr)) $image->addChild('image:caption',esc_attr( $imageattr['caption'] ), 'http://www.google.com/schemas/sitemap-image/1.1');
419
+ }
420
+
421
+ } else {
422
+
423
+ $url->addChild( $attr, esc_attr( $value ) );
424
+ }
425
+ }
426
+ }
427
+
428
+ return $urlset->asXML();
429
+ }
430
+
431
+ }
psp-include/sitemap/psp_sitemap_settings.php ADDED
@@ -0,0 +1,453 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Techblissonline Platinum SEO and Social Pack
5
+ Description: in content Links Management class
6
+ Text Domain: platinum-seo-pack
7
+ Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
8
+ Author: Rajesh - Techblissonline
9
+ Author URI: https://techblissonline.com/
10
+ */
11
+
12
+ class PspSmSettings extends PspSettings {
13
+
14
+ private static $obj_handle = null;
15
+
16
+ // this is the URL our updater / license checker pings.
17
+ private static $PSPP_SITE_URL = 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/';
18
+
19
+ // Product Name
20
+ private static $PSPP_ITEM_NAME = 'techblissonline_platinum_seo_premium';
21
+
22
+ // the name of the settings page for the links management settings to be displayed
23
+ private static $PSPP_LINKS_PAGE = 'pspp-links';
24
+
25
+ private $psp_helper;
26
+ private $psp_settings_instance;
27
+ private $sitename;
28
+ private $sitedescription;
29
+
30
+ private $plugin_settings_tabs = array();
31
+
32
+ private $psp_sm_settings_group = 'psp_sitemap';
33
+
34
+ protected $psp_plugin_options_key = 'psp-sm-by-techblissonline';
35
+ //private $psp_plugin_lic_key = 'psp-pre-by-techblissonline';
36
+ private $psp_settings_tabs = array();
37
+
38
+ private $psp_sm_settings = array();
39
+ private $psp_settings = array();
40
+
41
+ public static function get_instance() {
42
+
43
+ if ( null == self::$obj_handle ) {
44
+ self::$obj_handle = new self;
45
+ }
46
+
47
+ return self::$obj_handle;
48
+
49
+ } // end get_instance;
50
+
51
+ function __construct() {
52
+
53
+ $psp_helper_instance = PspHelper::get_instance();
54
+ $this->psp_helper = $psp_helper_instance;
55
+
56
+
57
+ $this->sitename = $psp_helper_instance->get_sitename();
58
+
59
+ if (get_option("psp_tools_plugin_url")) {
60
+ self::$PSPP_SITE_URL = get_option("psp_tools_plugin_url");
61
+ }
62
+
63
+ $this->psp_settings_tabs[$this->psp_sm_settings_group] = 'SiteMap Settings';
64
+ //$this->psp_settings = get_option("psp_sitewide_settings");
65
+
66
+ //add_action( 'admin_init', array( &$this, 'psp_sm_settings_init' ) );
67
+ //add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
68
+
69
+ }
70
+
71
+ function psp_sm_settings_init() {
72
+
73
+ wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
74
+
75
+ $this->register_sm_settings();
76
+
77
+ }
78
+
79
+ /*
80
+ * Registers the Home SEO settings and appends the
81
+ * key to the plugin settings tabs array.
82
+ */
83
+ protected function register_sm_settings() {
84
+ $this->psp_settings_tabs[$this->psp_sm_settings_group] = 'SiteMap Settings';
85
+ $psp_sm_settings_name = "psp_sitemap";
86
+
87
+ $psp_sm_settings = get_option($psp_sm_settings_name);
88
+ if (!empty($psp_sm_settings)) $this->psp_sm_settings = $psp_sm_settings;
89
+
90
+ //wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ) );
91
+ //register
92
+ register_setting( $this->psp_sm_settings_group, $psp_sm_settings_name, array( &$this, 'psp_sanitize_sm_settings' ) );
93
+ //add Section
94
+ add_settings_section( 'psp_sitemap_section', esc_html__('SiteMap Settings', 'platinum-seo-pack' ), array( &$this, 'section_sm_desc' ), $this->psp_sm_settings_group );
95
+
96
+ //add fields
97
+
98
+ //Enable siteMap
99
+ $sitemap_field = array (
100
+ 'label_for' => 'psp_'.$psp_sm_settings_name.'_enable',
101
+ 'option_name' => $psp_sm_settings_name.'[enable]',
102
+ 'option_value' => isset($psp_sm_settings['enable']) ? $psp_sm_settings['enable'] : '',
103
+ 'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
104
+ 'option_description' => esc_html__( 'This should always remain checked if you want to create sitemaps using Platinum SEO', 'platinum-seo-pack' ),
105
+ );
106
+
107
+ $sitemap_field_id = 'psp_'.$psp_sm_settings_name.'_enable';
108
+ $sitemap_field_title = esc_html__( 'Use Platinum SEO SiteMaps: ', 'platinum-seo-pack' );
109
+
110
+ add_settings_field( $sitemap_field_id, $sitemap_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_field );
111
+
112
+ //SiteMaps for Taxonomies
113
+ $psp_taxonomies = array();
114
+
115
+ $builtin_taxonomies = array("category", "post_tag");
116
+ $custom_taxonomies = $this->custom_taxonomies;
117
+ $psp_all_taxonomies = array_merge((array)$builtin_taxonomies, (array)$custom_taxonomies);
118
+ $psp_taxonomies = array_combine($psp_all_taxonomies, $psp_all_taxonomies);
119
+
120
+ $psp_taxonomies_list_field = array (
121
+ 'label_for' => 'psp_taxonomies_list',
122
+ 'option_name' => $psp_sm_settings_name.'[taxonomies_list][]',
123
+ 'option_value' => isset($psp_sm_settings['taxonomies_list']) ? $psp_sm_settings['taxonomies_list'] : '',
124
+ 'checkboxitems' => $psp_taxonomies,
125
+ 'option_description' => esc_html__( 'Select the list of Taxonomies for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
126
+ );
127
+
128
+ $psp_sitemap_taxonomies_field_id = 'psp_taxonomies_list';
129
+ $psp_sitemap_taxonomies_field_title = esc_html__('Taxonomies: ', 'platinum-seo-pack');
130
+
131
+ add_settings_field( $psp_sitemap_taxonomies_field_id, $psp_sitemap_taxonomies_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_taxonomies_list_field);
132
+
133
+ //SiteMaps for Post Types
134
+ $psp_post_rypes = array();
135
+
136
+ $builtin_post_types = array("post", "page");
137
+ $custom_post_types = $this->custom_post_types;
138
+ $psp_all_posttypes = array_merge((array)$builtin_post_types, (array)$custom_post_types);
139
+ $psp_post_rypes = array_combine($psp_all_posttypes, $psp_all_posttypes);
140
+
141
+ $psp_posttypes_list_field = array (
142
+ 'label_for' => 'psp_posttypes_list',
143
+ 'option_name' => $psp_sm_settings_name.'[posttypes_list][]',
144
+ 'option_value' => isset($psp_sm_settings['posttypes_list']) ? $psp_sm_settings['posttypes_list'] : '',
145
+ 'checkboxitems' => $psp_post_rypes,
146
+ 'option_description' => esc_html__( 'Select the list of Post Types for which SiteMaps have to be generated.', 'platinum-seo-pack' ),
147
+ );
148
+
149
+ $psp_sitemap_posttypes_field_id = 'psp_posttypes_list';
150
+ $psp_sitemap_posttypes_field_title = esc_html__('Post Types: ', 'platinum-seo-pack');
151
+
152
+ add_settings_field( $psp_sitemap_posttypes_field_id, $psp_sitemap_posttypes_field_title, array( &$this, 'psp_add_multiple_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_posttypes_list_field);
153
+
154
+ //include last modified time in Post type SiteMaps
155
+ $sitemap_lastmod_field = array (
156
+ 'label_for' => 'psp_'.$psp_sm_settings_name.'_include_lastmod',
157
+ 'option_name' => $psp_sm_settings_name.'[include_lastmod]',
158
+ 'option_value' => isset($psp_sm_settings['include_lastmod']) ? $psp_sm_settings['include_lastmod'] : '',
159
+ 'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
160
+ 'option_description' => esc_html__( 'This should always remain checked if you want to include Last Modified DateTime in Post type sitemaps created using Platinum SEO', 'platinum-seo-pack' ),
161
+ );
162
+
163
+ $sitemap_lastmod_field_id = 'psp_'.$psp_sm_settings_name.'_include_lastmod';
164
+ $sitemap_lastmod_field_title = esc_html__( 'Include Last Modified DateTime: ', 'platinum-seo-pack' );
165
+
166
+ add_settings_field( $sitemap_lastmod_field_id, $sitemap_lastmod_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_lastmod_field );
167
+
168
+ //include images in Post type SiteMaps
169
+ $sitemap_image_field = array (
170
+ 'label_for' => 'psp_'.$psp_sm_settings_name.'_include_images',
171
+ 'option_name' => $psp_sm_settings_name.'[include_images]',
172
+ 'option_value' => isset($psp_sm_settings['include_images']) ? $psp_sm_settings['include_images'] : '',
173
+ 'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
174
+ 'option_description' => esc_html__( 'This should always remain checked if you want to include images in Post type sitemaps created using Platinum SEO', 'platinum-seo-pack' ),
175
+ );
176
+
177
+ $sitemap_image_field_id = 'psp_'.$psp_sm_settings_name.'_include_images';
178
+ $sitemap_image_field_title = esc_html__( 'Include Images: ', 'platinum-seo-pack' );
179
+
180
+ add_settings_field( $sitemap_image_field_id, $sitemap_image_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_image_field );
181
+
182
+ //Enable siteMap for Authors
183
+ $sitemap_author_field = array (
184
+ 'label_for' => 'psp_'.$psp_sm_settings_name.'_enable_authors',
185
+ 'option_name' => $psp_sm_settings_name.'[enable_authors]',
186
+ 'option_value' => isset($psp_sm_settings['enable_authors']) ? $psp_sm_settings['enable_authors'] : '',
187
+ 'checkbox_label' => esc_html__( 'Enable ', 'platinum-seo-pack' ),
188
+ 'option_description' => esc_html__( 'This should be checked only if you want to create sitemaps for Author Archives', 'platinum-seo-pack' ),
189
+ );
190
+
191
+ $sitemap_author_field_id = 'psp_'.$psp_sm_settings_name.'_enable_authors';
192
+ $sitemap_author_field_title = esc_html__( 'Platinum SEO SiteMap for Authors: ', 'platinum-seo-pack' );
193
+
194
+ add_settings_field( $sitemap_author_field_id, $sitemap_author_field_title, array( &$this, 'psp_add_field_checkbox' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $sitemap_author_field );
195
+
196
+ //Number of URLs per sitemap
197
+ $psp_url_limit_field = array (
198
+ 'label_for' => 'psp_url_limit',
199
+ 'option_name' => $psp_sm_settings_name.'[max_urls]',
200
+ 'option_value' => isset($psp_sm_settings['max_urls']) ? $psp_sm_settings['max_urls'] : 2000,
201
+ 'option_label' => esc_html__( 'URLs per SiteMap', 'platinum-seo-pack' ),
202
+ 'option_description' => esc_html__( 'Set the max number of URLs for a sitemap.(Highly Recommended)', 'platinum-seo-pack' ),
203
+ );
204
+
205
+ $psp_url_limit_field_id = 'psp_url_limit';
206
+ $psp_url_limit_field_title = esc_html__('Limit number of URLs to: ', 'platinum-seo-pack');
207
+
208
+ add_settings_field( $psp_url_limit_field_id, $psp_url_limit_field_title, array( &$this, 'psp_add_field_text_number' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_url_limit_field);
209
+
210
+ //Excluded Post IDs
211
+ $psp_sm_posts_field_title = esc_html__( 'Excluded Posts: ', 'platinum-seo-pack' );
212
+
213
+ $psp_sm_posts_field = array (
214
+ 'label_for' => 'psp_sm_posts_id',
215
+ 'option_name' => $psp_sm_settings_name.'[excluded_post_ids]',
216
+ 'option_value' => isset($psp_sm_settings['excluded_post_ids']) ? esc_attr($psp_sm_settings['excluded_post_ids']) : '',
217
+ 'option_description' => esc_html__( 'Enter a comma separated list of Post IDs to be excluded from SiteMap. This can be automatically updated via Platinum SEO Meta Box for individual Posts or Pages', 'platinum-seo-pack' ),
218
+ );
219
+ add_settings_field( 'psp_sm_posts_id', $psp_sm_posts_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_sm_posts_field);
220
+
221
+
222
+ //Excluded Term IDs
223
+ $psp_sm_terms_field_title = esc_html__( 'Excluded Terms (Category IDs/Term IDs): ', 'platinum-seo-pack' );
224
+
225
+ $psp_sm_terms_field = array (
226
+ 'label_for' => 'psp_sm_terms_ids',
227
+ 'option_name' => $psp_sm_settings_name.'[excluded_term_ids]',
228
+ 'option_value' => isset($psp_sm_settings['excluded_term_ids']) ? esc_attr($psp_sm_settings['excluded_term_ids']) : '',
229
+ 'option_description' => esc_html__( 'Enter a comma separated list of Term IDs to be excluded from SiteMap. This can be automatically updated via Platinum SEO Meta Box for individual Category or Taxonomy Terms', 'platinum-seo-pack' ),
230
+ );
231
+ add_settings_field( 'psp_sm_terms_ids', $psp_sm_terms_field_title, array( &$this, 'psp_add_field_text' ), $this->psp_sm_settings_group, 'psp_sitemap_section', $psp_sm_terms_field);
232
+
233
+ }
234
+
235
+ function section_sm_desc() {echo ''; }
236
+ //function section_bl_mgmt_desc() {echo ''; }
237
+
238
+ function psp_sanitize_sm_settings( $settings ) {
239
+
240
+ if ( isset( $settings['enable'] ) ) {
241
+ $settings['enable'] = !is_null(filter_var($settings['enable'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable'] : '';
242
+ }
243
+
244
+ //global $wp_rewrite;
245
+ $core_sitemaps = new Core_Sitemaps();
246
+
247
+ if( isset( $settings['enable']) && $settings['enable'] ) {
248
+ $core_sitemaps->register_rewrites();
249
+ //$wp_rewrite -> flush_rules();
250
+ flush_rewrite_rules( false );
251
+ } else {
252
+ $core_sitemaps->unregister_rewrites();
253
+ //$wp_rewrite -> flush_rules();
254
+ flush_rewrite_rules( false );
255
+ }
256
+
257
+ if ( isset( $settings['include_images'] ) ) {
258
+ $settings['include_images'] = !is_null(filter_var($settings['include_images'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['include_images'] : '';
259
+
260
+ }
261
+
262
+ if ( isset( $settings['include_lastmod'] ) ) {
263
+ $settings['include_lastmod'] = !is_null(filter_var($settings['include_lastmod'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['include_lastmod'] : '';
264
+
265
+ }
266
+
267
+ if ( isset( $settings['enable_authors'] ) ) {
268
+ $settings['enable_authors'] = !is_null(filter_var($settings['enable_authors'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['enable_authors'] : '';
269
+ }
270
+
271
+ if ( isset( $settings['max_urls'] ) ) {
272
+ $settings['max_urls'] = sanitize_text_field( $settings['max_urls'] );
273
+ if (!filter_var($settings['max_urls'], FILTER_VALIDATE_INT) ) {
274
+ $settings['max_urls'] = 2000;
275
+ }
276
+ }
277
+
278
+ if ( isset( $settings['taxonomies_list'] ) ) {
279
+
280
+ $settings['taxonomies_list'] = array_map( 'sanitize_text_field', $settings['taxonomies_list'] );
281
+
282
+ $builtin_tax = array("category", "post_tag");
283
+ $custom_tax = array();
284
+ $psp_all_tax = array();
285
+ $custom_tax = $this->custom_taxonomies;
286
+ $psp_all_tax = array_merge((array)$builtin_tax, (array)$custom_tax);
287
+
288
+ if(!empty($settings['taxonomies_list'])) {
289
+ if (count($settings['taxonomies_list']) != count(array_intersect($settings['taxonomies_list'], $psp_all_tax))) {
290
+ $$settings['taxonomies_list'] = array();
291
+ }
292
+ }
293
+
294
+ }
295
+
296
+ if ( isset( $settings['posttypes_list'] ) ) {
297
+
298
+ $settings['posttypes_list'] = array_map( 'sanitize_text_field', $settings['posttypes_list'] );
299
+
300
+ $builtin_post_types = array("post", "page");
301
+ $custom_post_types = array();
302
+ $psp_all_post_types = array();
303
+ $custom_post_types = $this->custom_post_types;
304
+
305
+ $psp_all_post_types = array_merge((array)$builtin_post_types, (array)$custom_post_types);
306
+
307
+ if(!empty($settings['posttypes_list'])) {
308
+ if (count($settings['posttypes_list']) != count(array_intersect($settings['posttypes_list'], $psp_all_post_types))) {
309
+ $$settings['posttypes_list'] = array();
310
+ }
311
+ }
312
+
313
+ }
314
+
315
+ //if( !empty( $settings['excluded_term_ids'] ) ) $settings['excluded_term_ids'] = sanitize_text_field( $settings['excluded_term_ids'] );
316
+ $excluded_term_ids = explode(",", $settings['excluded_term_ids']);
317
+ if( !empty( $excluded_term_ids ) ) $excluded_term_ids = array_map( 'absint', $excluded_term_ids );
318
+ if( !empty( $settings['excluded_term_ids'] ) ) $settings['excluded_term_ids'] = implode(",", $excluded_term_ids);
319
+
320
+ //if( !empty( $settings['excluded_post_ids'] ) ) $settings['excluded_post_ids'] = sanitize_text_field( $settings['excluded_post_ids'] );
321
+ $excluded_post_ids = explode(",", $settings['excluded_post_ids']);
322
+ if( !empty( $excluded_post_ids ) ) $excluded_post_ids = array_map( 'absint', $excluded_post_ids );
323
+ if( !empty( $settings['excluded_post_ids'] ) ) $settings['excluded_post_ids'] = implode(",", $excluded_post_ids);
324
+
325
+ return $settings;
326
+ }
327
+
328
+ function psp_add_field_text_dd(array $args) {
329
+
330
+ $option_name = isset($args['option_name']) ? $args['option_name'] : '';
331
+ $id = isset($args['label_for']) ? $args['label_for'] : '';
332
+ $option_value = isset($args['option_value']) ? $args['option_value'] : '';
333
+ $option_description = isset($args['option_description']) ? esc_html( $args['option_description'] ) : '';
334
+ $option_button = isset($args['button']) ? esc_attr($args['button']) : '';
335
+ $desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
336
+
337
+ echo "<input style='width:10%;' type='number' min='0' maxlength='2' name='".esc_attr($option_name)."' id='".esc_attr($id)."' value='".esc_url($option_value)."'><br/><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
338
+ }
339
+
340
+ /*
341
+ * Callback for adding a checkbox.
342
+ */
343
+ function psp_add_field_checkbox(array $args) {
344
+
345
+ $option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
346
+ $id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
347
+ $option_value = isset($args['option_value']) ? esc_attr( $args['option_value'] ) : '';
348
+ //$option_value = esc_attr( $args['option_value'] );
349
+ $checkbox_label = isset($args['checkbox_label']) ? esc_html($args['checkbox_label']) : '';
350
+ $option_description = isset($args['option_description']) ? esc_html($args['option_description']) : '';
351
+ $checked = '';
352
+ $desc_allowed_html = array('br' => array(), 'code' => array(), 'strong' => array(), 'em' => array(), 'i' => array(), 'bold' => array(), 'a' => array('href' => array(), 'target' => array()));
353
+ if($option_value) { $checked = ' checked="checked" '; }
354
+ echo "<input ".esc_attr($checked)." id='".esc_attr($id)."' name='".esc_attr($option_name)."' type='checkbox' data-toggle='toggle'/><span>&nbsp;</span><span for='".esc_attr($id)."'>".wp_kses(html_entity_decode($checkbox_label), $desc_allowed_html)."</span><br /><p class='description'>".wp_kses(html_entity_decode($option_description), $desc_allowed_html)."</p>";
355
+
356
+ }
357
+
358
+ /*
359
+ * Callback for adding multiple checkboxes.
360
+ */
361
+ function psp_add_multiple_checkbox(array $args) {
362
+
363
+ $option_name = isset($args['option_name']) ? esc_attr($args['option_name']) : '';
364
+ $id = isset($args['label_for']) ? esc_attr($args['label_for']) : '';
365
+ $option_array_value = isset($args['option_value']) ? (array) $args['option_value'] : array();
366
+ $option_array_value = array_map( 'esc_attr', $option_array_value );
367
+ $checkboxitems = isset($args['checkboxitems']) ? $args['checkboxitems'] : array();//array
368
+ $option_description = isset($args['option_description']) ? esc_attr( $args['option_description'] ) : '';
369
+
370
+ $counter = 1;
371
+
372
+ //echo "<div id='$id' class='psp-separator'>";
373
+ echo "<div id='$id'>";
374
+
375
+ foreach ( $checkboxitems as $checkboxitemkey => $checkboxitemvalue ) {
376
+
377
+ $checkbox_id = esc_attr($id."-cbx-item-".$counter);
378
+ $checked = in_array($checkboxitemkey, $option_array_value) ? 'checked="checked"' : '';
379
+ //echo "<input id='$checkbox_id' $checked type='checkbox' name='$option_name' value='$checkboxitem' /><label class='psp-radio-separator' for='$radio_id'>$checkboxitemvalue</label>";
380
+ echo "<input ".$checked." id='$checkbox_id' name='$option_name' value='".esc_attr($checkboxitemkey)."' type='checkbox' data-toggle='toggle' /><span>&nbsp;</span><span for='$id'>".esc_attr($checkboxitemvalue)."</span><br />";
381
+
382
+ $counter = $counter + 1;
383
+
384
+ }
385
+
386
+ echo "</div><br /><p class='description'>".esc_html($option_description)."</p>";
387
+
388
+ }
389
+
390
+ /*
391
+ * renders Plugin settings page, checks
392
+ * for the active tab and replaces key with the related
393
+ * settings key. Uses the plugin_options_tabs method
394
+ * to render the tabs.
395
+ */
396
+ function psp_sm_options_page() {
397
+ $tab = isset( $_GET['pspstab'] ) ? Sanitize_key($_GET['pspstab']) : $this->psp_sm_settings_group;
398
+
399
+ $psp_pre_settings = get_option('psp_pre_setting');
400
+ $psp_premium_valid = isset($psp_pre_settings['psp_premium_license_key_status']) ? $psp_pre_settings['psp_premium_license_key_status'] : '';
401
+ //$psp_premium_status = isset($psp_pre_settings['psp_premium_license_key_status']) ? $psp_pre_settings['psp_premium_license_key_status'] : '';
402
+
403
+ if ($tab == $this->psp_sm_settings_group) {
404
+ $psp_button = "submitsmsettings";
405
+ $psp_nonce_field = "psp-sm-settings";
406
+ }
407
+ ?>
408
+ <div class="wrap">
409
+ <h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Pack -
410
+ SiteMaps', 'platinum-seo-pack') ?></h1>
411
+ <p style="color: red"><?php esc_html_e('You need to click the "Save Settings" button to save the changes you made to each individual tab before moving on to the next tab.', 'platinum-seo-pack') ?></p>
412
+ <?php $this->psp_sm_options_tabs(); ?>
413
+ <?php if (($tab == $this->psp_sm_settings_group) ) { ?>
414
+ <form name="platinum-seo-form" method="post" action="options.php">
415
+ <?php wp_nonce_field( $psp_nonce_field ); ?>
416
+ <?php settings_fields( $tab ); ?>
417
+ <?php settings_errors(); ?>
418
+ <?php do_settings_sections( $tab ); ?>
419
+ <?php submit_button('Save Settings', 'primary', $psp_button); ?>
420
+ </form>
421
+ <?php } else { include_once( 'psp_premiumad_metabox_renderer.php' ); } ?>
422
+ <div class="sidebar-cta">
423
+ <h2>
424
+ <a class="bookmarkme" href="<?php echo 'https://techblissonline.com/tools/'; ?>" target="_blank"><img src="<?php echo esc_url(PSP_PLUGIN_URL).'images/techblissonline-logo.png'; ?>" class="img-responsive" alt="Techblissonline Platinum SEO Wordpress Tools"/></a>
425
+ </h2>
426
+ <div class="container bg-info" id="tools" style="width:100%">
427
+ <div class="row"><div class="h3 col-sm-12"><a class="btn-primary col-sm-12" href="https://techblissonline.com/tools/platinum-seo-wordpress-premium/" target="_blank">Platinum SEO Premium for wordpress</a></div><div class="h3 col-sm-12"><a class="btn-success col-sm-12" href="https://techblissonline.com/tools/" target="_blank">Techblissonline Platinum SEO Audit and Analysis Tools</a></div></div>
428
+ </div>
429
+ <a href="https://techblissonline.com/tools/" target="_blank">Be our Patreon and enjoy these premium Wordpress SEO tools for just $9</a>
430
+ <div class="container" style="width:100%"><a href="https://techblissonline.com/tools/" target="_blank"><span class="col-sm-10 dashicons dashicons-thumbs-up dashicons-psp"></span></a></div>
431
+ </div>
432
+ </div>
433
+ <?php
434
+ }
435
+
436
+ /*
437
+ * Renders our tabs in the plugin options page,
438
+ * walks through the object's tabs array and prints
439
+ * them one by one. Provides the heading for the
440
+ * psp_options_page method.
441
+ */
442
+ function psp_sm_options_tabs() {
443
+ $current_tab = isset( $_GET['pspstab'] ) ? Sanitize_key($_GET['pspstab']) : $this->psp_sm_settings_group;
444
+ wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
445
+ //screen_icon();
446
+ echo '<h2 class="nav-tab-wrapper">';
447
+ foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
448
+ $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
449
+ echo '<a class="nav-tab ' . esc_attr($active) . '" href="?page=' . esc_attr($this->psp_plugin_options_key) . '&pspstab=' . esc_attr($tab_key) . '">' . esc_attr($tab_caption) . '</a>';
450
+ }
451
+ echo '</h2>';
452
+ }
453
+ }
psp-include/sitemap/sitemap-image.xsl ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <xsl:stylesheet version="2.0"
2
+ xmlns:html="http://www.w3.org/TR/REC-html40"
3
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
+ <xsl:template match="/">
8
+ <html xmlns="http://www.w3.org/1999/xhtml">
9
+ <head>
10
+ <title>XML Sitemap</title>
11
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
+ <style type="text/css">
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
16
+ color: #444;
17
+ }
18
+
19
+ #intro {
20
+ background-color:#CFEBF7;
21
+ border:1px #2580B2 solid;
22
+ padding:5px 13px 5px 13px;
23
+ margin:10px;
24
+ }
25
+
26
+ #intro p {
27
+ line-height: 16.8667px;
28
+ }
29
+ #intro strong {
30
+ font-weight:normal;
31
+ }
32
+
33
+ #sitemap__table {
34
+ border: solid 1px #ccc;
35
+ border-collapse: collapse;
36
+ }
37
+
38
+ #sitemap__table tr th {
39
+ text-align: left;
40
+ }
41
+
42
+ #sitemap__table tr td,
43
+ #sitemap__table tr th {
44
+ padding: 10px;
45
+ }
46
+
47
+ #sitemap__table tr:nth-child(odd) td {
48
+ background-color: #eee;
49
+ }
50
+
51
+ a:hover {
52
+ text-decoration: none;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div id="intro">
58
+ <p>
59
+ This is a XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
60
+ It was generated using the <a rel="external nofollow" href="https://wordpress.org/plugins/platinum-seo-pack/">WordPress</a> SiteMap and the <strong>Platinum SEO Plugin</strong> by <a rel="external nofollow" href="https://techblissonline.com/" title="Platinum SEO Plugin for WordPress">Techblissonline.com</a>.<br />
61
+ You can find more information about XML sitemaps on <a rel="external nofollow" href="http://sitemaps.org">sitemaps.org</a> and Google's <a rel="external nofollow" href="http://code.google.com/p/sitemap-generators/wiki/SitemapGenerators">list of sitemap programs</a>.
62
+ </p>
63
+ </div>
64
+ <div id="sitemap__header">
65
+ <h1>XML Sitemap</h1>
66
+ <p>This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="https://www.sitemaps.org/">sitemaps.org</a>.</p>
67
+ </div>
68
+ <div id="sitemap__content">
69
+ <p class="text">Number of URLs in this XML Sitemap: <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>.</p>
70
+ <table id="sitemap__table">
71
+ <thead>
72
+ <tr>
73
+ <th>URL</th>
74
+ <th>Last modified (GMT)</th>
75
+ </tr>
76
+ </thead>
77
+ <tbody>
78
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
79
+ <tr>
80
+ <td>
81
+ <xsl:variable name="itemURL">
82
+ <xsl:value-of select="sitemap:loc"/>
83
+ </xsl:variable>
84
+ <a href="{$itemURL}">
85
+ <xsl:value-of select="sitemap:loc"/>
86
+ </a>
87
+ </td>
88
+ <td>
89
+ <xsl:value-of select="concat(substring(sitemap:lastmod,0,10),concat(' ', substring(sitemap:lastmod,12,8)))"/>
90
+ </td>
91
+ <xsl:for-each select="image:image">
92
+ <tr>
93
+ <td>
94
+ <xsl:variable name="imageURL">
95
+ <xsl:value-of select="image:loc"/>
96
+ </xsl:variable>
97
+ <a href="{$imageURL}">
98
+ <xsl:value-of select="image:loc"/>
99
+ </a>
100
+ </td>
101
+ </tr>
102
+ </xsl:for-each>
103
+ </tr>
104
+ </xsl:for-each>
105
+ </tbody>
106
+ </table>
107
+
108
+ </div>
109
+ </body>
110
+ </html>
111
+ </xsl:template>
112
+ </xsl:stylesheet>
psp-include/sitemap/sitemap-index.xsl ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <xsl:stylesheet version="2.0"
2
+ xmlns:html="http://www.w3.org/TR/REC-html40"
3
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
+ <xsl:template match="/">
8
+ <html xmlns="http://www.w3.org/1999/xhtml">
9
+ <head>
10
+ <title>XML Sitemap</title>
11
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
+ <style type="text/css">
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
16
+ color: #444;
17
+ }
18
+
19
+ #intro {
20
+ background-color:#CFEBF7;
21
+ border:1px #2580B2 solid;
22
+ padding:5px 13px 5px 13px;
23
+ margin:10px;
24
+ }
25
+
26
+ #intro p {
27
+ line-height: 16.8667px;
28
+ }
29
+ #intro strong {
30
+ font-weight:normal;
31
+ }
32
+
33
+ #sitemap__table {
34
+ border: solid 1px #ccc;
35
+ border-collapse: collapse;
36
+ }
37
+
38
+ #sitemap__table tr th {
39
+ text-align: left;
40
+ }
41
+
42
+ #sitemap__table tr td,
43
+ #sitemap__table tr th {
44
+ padding: 10px;
45
+ }
46
+
47
+ #sitemap__table tr:nth-child(odd) td {
48
+ background-color: #eee;
49
+ }
50
+
51
+ a:hover {
52
+ text-decoration: none;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div id="intro">
58
+ <p>
59
+ This is a XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
60
+ It was generated using the <a rel="external nofollow" href="https://wordpress.org/plugins/platinum-seo-pack/">WordPress</a> SiteMap and the <strong>Platinum SEO Plugin</strong> by <a rel="external nofollow" href="https://techblissonline.com/" title="Platinum SEO Plugin for WordPress">Techblissonline.com</a>.<br />
61
+ You can find more information about XML sitemaps on <a rel="external nofollow" href="http://sitemaps.org">sitemaps.org</a> and Google's <a rel="external nofollow" href="http://code.google.com/p/sitemap-generators/wiki/SitemapGenerators">list of sitemap programs</a>.
62
+ </p>
63
+ </div>
64
+ <div id="sitemap__header">
65
+ <h1>XML Sitemap</h1>
66
+ <p>This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="https://www.sitemaps.org/">sitemaps.org</a>.</p>
67
+ </div>
68
+ <div id="sitemap__content">
69
+ <p class="text">This XML Sitemap contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> URLs.</p>
70
+ <table id="sitemap__table">
71
+ <thead>
72
+ <tr>
73
+ <th>URL</th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
78
+ <tr>
79
+ <td>
80
+ <xsl:variable name="itemURL">
81
+ <xsl:value-of select="sitemap:loc"/>
82
+ </xsl:variable>
83
+ <a href="{$itemURL}">
84
+ <xsl:value-of select="sitemap:loc"/>
85
+ </a>
86
+ </td>
87
+ </tr>
88
+ </xsl:for-each>
89
+ </tbody>
90
+ </table>
91
+
92
+ </div>
93
+ </body>
94
+ </html>
95
+ </xsl:template>
96
+ </xsl:stylesheet>
psp-include/sitemap/sitemap-post.xsl ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <xsl:stylesheet version="2.0"
2
+ xmlns:html="http://www.w3.org/TR/REC-html40"
3
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
+ <xsl:template match="/">
8
+ <html xmlns="http://www.w3.org/1999/xhtml">
9
+ <head>
10
+ <title>XML Sitemap</title>
11
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
+ <style type="text/css">
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
16
+ color: #444;
17
+ }
18
+
19
+ #intro {
20
+ background-color:#CFEBF7;
21
+ border:1px #2580B2 solid;
22
+ padding:5px 13px 5px 13px;
23
+ margin:10px;
24
+ }
25
+
26
+ #intro p {
27
+ line-height: 16.8667px;
28
+ }
29
+ #intro strong {
30
+ font-weight:normal;
31
+ }
32
+
33
+ #sitemap__table {
34
+ border: solid 1px #ccc;
35
+ border-collapse: collapse;
36
+ }
37
+
38
+ #sitemap__table tr th {
39
+ text-align: left;
40
+ }
41
+
42
+ #sitemap__table tr td,
43
+ #sitemap__table tr th {
44
+ padding: 10px;
45
+ }
46
+
47
+ #sitemap__table tr:nth-child(odd) td {
48
+ background-color: #eee;
49
+ }
50
+
51
+ a:hover {
52
+ text-decoration: none;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div id="intro">
58
+ <p>
59
+ This is a XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
60
+ It was generated using the <a rel="external nofollow" href="https://wordpress.org/plugins/platinum-seo-pack/">WordPress</a> SiteMap and the <strong>Platinum SEO Plugin</strong> by <a rel="external nofollow" href="https://techblissonline.com/" title="Platinum SEO Plugin for WordPress">Techblissonline.com</a>.<br />
61
+ You can find more information about XML sitemaps on <a rel="external nofollow" href="http://sitemaps.org">sitemaps.org</a> and Google's <a rel="external nofollow" href="http://code.google.com/p/sitemap-generators/wiki/SitemapGenerators">list of sitemap programs</a>.
62
+ </p>
63
+ </div>
64
+ <div id="sitemap__header">
65
+ <h1>XML Sitemap</h1>
66
+ <p>This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="https://www.sitemaps.org/">sitemaps.org</a>.</p>
67
+ </div>
68
+ <div id="sitemap__content">
69
+ <p class="text">Number of URLs in this XML Sitemap: <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>.</p>
70
+ <table id="sitemap__table">
71
+ <thead>
72
+ <tr>
73
+ <th>URL</th>
74
+ <th>Last modified (GMT)</th>
75
+ </tr>
76
+ </thead>
77
+ <tbody>
78
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
79
+ <tr>
80
+ <td>
81
+ <xsl:variable name="itemURL">
82
+ <xsl:value-of select="sitemap:loc"/>
83
+ </xsl:variable>
84
+ <a href="{$itemURL}">
85
+ <xsl:value-of select="sitemap:loc"/>
86
+ </a>
87
+ </td>
88
+ <td>
89
+ <xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12, 8)))"/>
90
+ </td>
91
+ </tr>
92
+ </xsl:for-each>
93
+ </tbody>
94
+ </table>
95
+
96
+ </div>
97
+ </body>
98
+ </html>
99
+ </xsl:template>
100
+ </xsl:stylesheet>
psp-include/sitemap/sitemap.xsl ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <xsl:stylesheet version="2.0"
2
+ xmlns:html="http://www.w3.org/TR/REC-html40"
3
+ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
4
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
+ <xsl:template match="/">
8
+ <html xmlns="http://www.w3.org/1999/xhtml">
9
+ <head>
10
+ <title>XML Sitemap</title>
11
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
+ <style type="text/css">
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
16
+ color: #444;
17
+ }
18
+
19
+ #intro {
20
+ background-color:#CFEBF7;
21
+ border:1px #2580B2 solid;
22
+ padding:5px 13px 5px 13px;
23
+ margin:10px;
24
+ }
25
+
26
+ #intro p {
27
+ line-height: 16.8667px;
28
+ }
29
+ #intro strong {
30
+ font-weight:normal;
31
+ }
32
+
33
+ #sitemap__table {
34
+ border: solid 1px #ccc;
35
+ border-collapse: collapse;
36
+ }
37
+
38
+ #sitemap__table tr th {
39
+ text-align: left;
40
+ }
41
+
42
+ #sitemap__table tr td,
43
+ #sitemap__table tr th {
44
+ padding: 10px;
45
+ }
46
+
47
+ #sitemap__table tr:nth-child(odd) td {
48
+ background-color: #eee;
49
+ }
50
+
51
+ a:hover {
52
+ text-decoration: none;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div id="intro">
58
+ <p>
59
+ This is a XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
60
+ It was generated using the <a rel="external nofollow" href="https://wordpress.org/plugins/platinum-seo-pack/">WordPress</a> SiteMap and the <strong>Platinum SEO Plugin</strong> by <a rel="external nofollow" href="https://techblissonline.com/" title="Platinum SEO Plugin for WordPress">Techblissonline.com</a>.<br />
61
+ You can find more information about XML sitemaps on <a rel="external nofollow" href="http://sitemaps.org">sitemaps.org</a> and Google's <a rel="external nofollow" href="http://code.google.com/p/sitemap-generators/wiki/SitemapGenerators">list of sitemap programs</a>.
62
+ </p>
63
+ </div>
64
+ <div id="sitemap__header">
65
+ <h1>XML Sitemap</h1>
66
+ <p>This XML Sitemap is generated by WordPress to make your content more visible for search engines. Learn more about XML sitemaps on <a href="https://www.sitemaps.org/">sitemaps.org</a>.</p>
67
+ </div>
68
+ <div id="sitemap__content">
69
+ <p class="text">Number of URLs in this XML Sitemap: <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>.</p>
70
+ <table id="sitemap__table">
71
+ <thead>
72
+ <tr>
73
+ <th>URL</th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
78
+ <tr>
79
+ <td>
80
+ <xsl:variable name="itemURL">
81
+ <xsl:value-of select="sitemap:loc"/>
82
+ </xsl:variable>
83
+ <a href="{$itemURL}">
84
+ <xsl:value-of select="sitemap:loc"/>
85
+ </a>
86
+ </td>
87
+ </tr>
88
+ </xsl:for-each>
89
+ </tbody>
90
+ </table>
91
+
92
+ </div>
93
+ </body>
94
+ </html>
95
+ </xsl:template>
96
+ </xsl:stylesheet>
psp-include/utilities/psp_helper.php CHANGED
@@ -19,7 +19,7 @@ class PspHelper {
19
  * as description. Touch only if you know what you're doing
20
  */
21
  private $min_description_length = 1;
22
- private $version = "2.1.0";
23
 
24
  public $sitename = "";
25
  public $sitedescription = "";
19
  * as description. Touch only if you know what you're doing
20
  */
21
  private $min_description_length = 1;
22
+ private $version = "2.1.1";
23
 
24
  public $sitename = "";
25
  public $sitedescription = "";
psp_main.php CHANGED
@@ -14,6 +14,7 @@ class PspMain {
14
  protected $psp_seo_meta_string = "";
15
 
16
  protected $psp_redirect_instance;
 
17
 
18
  public $psp_breadcrumb_settings = array();
19
  public $psp_ga_settings = array();
@@ -34,6 +35,8 @@ class PspMain {
34
 
35
  $psp_tools_instance = PspToolSettings::get_instance();
36
  $this->psp_redirect_instance = PspRedirections::get_instance();
 
 
37
 
38
 
39
  //get value for rss feeds indexing
@@ -256,24 +259,24 @@ class PspMain {
256
  $user_id = get_current_user_id();
257
  // Add the meta so that the notice is permanently dismissed.
258
  delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
259
- update_user_meta( $user_id, 'psp_ignore_notice', "v_210" );
260
  };
261
  };
262
  }
263
 
264
  public function platinum_seo_admin_notice__success() {
265
  $user_id = get_current_user_id();
266
- if ( "v_210" === trim(get_user_meta( $user_id, 'psp_ignore_notice', true ) )) return;
267
  global $pagenow;
268
  $psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
269
  if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
270
  ?>
271
  <div class="notice notice-success is-dismissible">
272
- <strong><p><?php echo esc_html__( 'Thank you for using Platinum SEO Plugin! See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank"> '.esc_html__( ' Version 2.1.0 and V2.0.9!', 'platinum-seo-pack' ).'</a>'.'<a href="'. esc_url( add_query_arg( [
273
  'psp_ignore_notice' => '1',
274
  'action' => 'psp_delete_adminnotice',
275
  'nonce' => wp_create_nonce('psp_delete_adminnotice'),
276
- ] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'; ?><br><?php echo esc_html__( "We are moving to a separate table. If you are an existing Platinum SEO Plugin User, import your existing Platinum SEO Data into the new table choosing Platinum SEO in the", "platinum-seo-pack" ).'<a href="'. get_admin_url(get_current_blog_id()).'admin.php?page=importer"> '.esc_html__( " Importer!", "platinum-seo-pack" ).'</a>' ?></p></strong>
277
  </div>
278
  <?php
279
  }
14
  protected $psp_seo_meta_string = "";
15
 
16
  protected $psp_redirect_instance;
17
+ protected $psp_sitemap_instance;
18
 
19
  public $psp_breadcrumb_settings = array();
20
  public $psp_ga_settings = array();
35
 
36
  $psp_tools_instance = PspToolSettings::get_instance();
37
  $this->psp_redirect_instance = PspRedirections::get_instance();
38
+
39
+ $this->psp_sitemap_instance = PspSitemap::get_instance();
40
 
41
 
42
  //get value for rss feeds indexing
259
  $user_id = get_current_user_id();
260
  // Add the meta so that the notice is permanently dismissed.
261
  delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
262
+ update_user_meta( $user_id, 'psp_ignore_notice', "v_211" );
263
  };
264
  };
265
  }
266
 
267
  public function platinum_seo_admin_notice__success() {
268
  $user_id = get_current_user_id();
269
+ if ( "v_211" === trim(get_user_meta( $user_id, 'psp_ignore_notice', true ) )) return;
270
  global $pagenow;
271
  $psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
272
  if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
273
  ?>
274
  <div class="notice notice-success is-dismissible">
275
+ <strong><p><?php echo esc_html__( 'Platinum SEO Plugin has now integrated WordPress SiteMap! ', 'platinum-seo-pack' ). esc_html__( 'See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank"> '.esc_html__( ' Version ', 'platinum-seo-pack' ).'2.1.1 and V2.1.0!</a>'.'<a href="'. esc_url( add_query_arg( [
276
  'psp_ignore_notice' => '1',
277
  'action' => 'psp_delete_adminnotice',
278
  'nonce' => wp_create_nonce('psp_delete_adminnotice'),
279
+ ] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'; ?><br><?php echo esc_html__( "We are moving to a separate table. If you are an existing Platinum SEO Plugin User, import your existing Platinum SEO Data into the new table choosing Platinum SEO in the", "platinum-seo-pack" ).'<a href="'. get_admin_url(get_current_blog_id()).'admin.php?page=importer"> '.esc_html__( " Importer!", "platinum-seo-pack" ).'</a>'.esc_html__( ' If you like this plugin ', 'platinum-seo-pack' ).'<a href="https://wordpress.org/support/plugin/platinum-seo-pack/reviews/" target="_blank"> '.esc_html__( " give us a rating!", "platinum-seo-pack" ).'</a>'; ?></p></strong>
280
  </div>
281
  <?php
282
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: seo, wordpress seo, plugin, google seo, platinum seo, schema, schema marku
6
  Requires at least: 4.0
7
  Tested up to: 5.4.1
8
  Requires PHP: 5.6
9
- Stable tag: 2.1.0
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -44,7 +44,8 @@ Some features:
44
  19) WordPress 307 Redirect Plugin using HTTP 307 Status Code
45
  20) WordPress 303 Redirect Plugin using HTTP 303 Status Code
46
  21) Add index, noindex, follow or nofollow, noodp, noydir, noarchive, nosnippet meta tags to any post/page.
47
- 22) Plenty of other features.
 
48
 
49
  == Installation ==
50
 
@@ -68,6 +69,9 @@ Please read these **[FAQs](https://techblissonline.com/platinum-seo-pack-faq/)**
68
  4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
69
 
70
  == Changelog ==
 
 
 
71
  = 2.1.0 =
72
  * 2020-05-16 - Platinum SEO Plugin will now have its own SEO meta table _platinumseometa. All the SEO meta data used by the plugin will now be in this table. Importers for Yoast, Yoast Indexables and RankMath WordPress SEO Plugins have now been included to make it easy for users using those plugins to migrate to Platinum SEO WordPress Plugin.
73
 
6
  Requires at least: 4.0
7
  Tested up to: 5.4.1
8
  Requires PHP: 5.6
9
+ Stable tag: 2.1.1
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
44
  19) WordPress 307 Redirect Plugin using HTTP 307 Status Code
45
  20) WordPress 303 Redirect Plugin using HTTP 303 Status Code
46
  21) Add index, noindex, follow or nofollow, noodp, noydir, noarchive, nosnippet meta tags to any post/page.
47
+ 22) Integration with wordPress Core SiteMap.
48
+ 23) Plenty of other features.
49
 
50
  == Installation ==
51
 
69
  4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
70
 
71
  == Changelog ==
72
+ = 2.1.1 =
73
+ * 2020-05-22 - Platinum SEO Plugin becomes the first SEO plugin to integrate with the upcoming SiteMap functionality in WordPress Core. The Core siteMap is still in development and Platinum SEO has integrated with the currently available version of the Core Module. If you do like to generate a sitemap with Platinum SEO, do enable it and enable the Object Types for which you want to generate a sitemap in SiteMap settings in Platinum SEO.
74
+
75
  = 2.1.0 =
76
  * 2020-05-16 - Platinum SEO Plugin will now have its own SEO meta table _platinumseometa. All the SEO meta data used by the plugin will now be in this table. Importers for Yoast, Yoast Indexables and RankMath WordPress SEO Plugins have now been included to make it easy for users using those plugins to migrate to Platinum SEO WordPress Plugin.
77