The SEO Framework - Version 4.2.3

Version Description

This minor update addresses a regression where the singular-archive canonical URLs always pointed to the first page.

Download this release

Release Info

Developer Cybr
Plugin Icon 128x128 The SEO Framework
Version 4.2.3
Comparing to
See all releases

Code changes from version 4.2.2 to 4.2.3

Files changed (102) hide show
  1. autodescription.php +3 -3
  2. bootstrap/activation.php +1 -1
  3. bootstrap/deactivation.php +1 -1
  4. bootstrap/define.php +1 -1
  5. bootstrap/load.php +18 -3
  6. bootstrap/upgrade.php +1 -1
  7. inc/classes/admin-init.class.php +24 -38
  8. inc/classes/admin-pages.class.php +2 -2
  9. inc/classes/bridges/ajax.class.php +1 -1
  10. inc/classes/bridges/feed.class.php +1 -1
  11. inc/classes/bridges/listedit.class.php +39 -31
  12. inc/classes/bridges/listtable.class.php +1 -1
  13. inc/classes/bridges/ping.class.php +1 -1
  14. inc/classes/bridges/plugintable.class.php +1 -1
  15. inc/classes/bridges/postsettings.class.php +1 -1
  16. inc/classes/bridges/scripts.class.php +1 -1
  17. inc/classes/bridges/seobar.class.php +1 -1
  18. inc/classes/bridges/seosettings.class.php +1 -1
  19. inc/classes/bridges/sitemap.class.php +1 -1
  20. inc/classes/bridges/termsettings.class.php +1 -1
  21. inc/classes/bridges/usersettings.class.php +1 -1
  22. inc/classes/builders/coresitemaps/main.class.php +1 -1
  23. inc/classes/builders/coresitemaps/posts.class.php +1 -1
  24. inc/classes/builders/coresitemaps/taxonomies.class.php +1 -1
  25. inc/classes/builders/images.class.php +1 -1
  26. inc/classes/builders/robots/args.class.php +1 -1
  27. inc/classes/builders/robots/factory.class.php +1 -1
  28. inc/classes/builders/robots/main.class.php +5 -3
  29. inc/classes/builders/robots/query.class.php +1 -1
  30. inc/classes/builders/scripts.class.php +2 -2
  31. inc/classes/builders/seobar/main.class.php +1 -1
  32. inc/classes/builders/seobar/page.class.php +14 -14
  33. inc/classes/builders/seobar/term.class.php +12 -12
  34. inc/classes/builders/sitemap.class.php +1 -1
  35. inc/classes/builders/sitemap/base.class.php +3 -3
  36. inc/classes/builders/sitemap/main.class.php +7 -7
  37. inc/classes/cache.class.php +29 -39
  38. inc/classes/core.class.php +1 -1
  39. inc/classes/detect.class.php +5 -5
  40. inc/classes/generate-description.class.php +1 -2
  41. inc/classes/generate-image.class.php +1 -1
  42. inc/classes/generate-ldjson.class.php +2 -2
  43. inc/classes/generate-title.class.php +1 -1
  44. inc/classes/generate-url.class.php +111 -120
  45. inc/classes/generate.class.php +4 -5
  46. inc/classes/init.class.php +1 -1
  47. inc/classes/internal/debug.class.php +4 -36
  48. inc/classes/internal/deprecated.class.php +1 -1
  49. inc/classes/internal/silencer.class.php +1 -1
  50. inc/classes/interpreters/form.class.php +1 -1
  51. inc/classes/interpreters/html.class.php +1 -1
  52. inc/classes/interpreters/markdown.class.php +1 -1
  53. inc/classes/interpreters/seobar.class.php +1 -1
  54. inc/classes/interpreters/settings-input.class.php +1 -1
  55. inc/classes/load.class.php +2 -2
  56. inc/classes/post-data.class.php +1 -1
  57. inc/classes/query.class.php +1 -1
  58. inc/classes/render.class.php +1 -7
  59. inc/classes/sanitize.class.php +21 -3
  60. inc/classes/site-options.class.php +1 -1
  61. inc/classes/term-data.class.php +1 -1
  62. inc/classes/user-data.class.php +1 -1
  63. inc/functions/api.php +17 -57
  64. inc/functions/deprecated.php +1 -1
  65. inc/functions/upgrade-suggestion.php +1 -1
  66. inc/views/debug/output.php +3 -3
  67. inc/views/edit/seo-settings-singular.php +16 -16
  68. inc/views/edit/seo-settings-tt.php +15 -15
  69. inc/views/edit/wrap-content.php +3 -3
  70. inc/views/edit/wrap-nav.php +1 -1
  71. inc/views/profile/author.php +9 -9
  72. inc/views/settings/metaboxes/general.php +1 -1
  73. inc/views/settings/metaboxes/homepage.php +9 -9
  74. inc/views/settings/metaboxes/post-type-archive.php +12 -12
  75. inc/views/settings/metaboxes/schema.php +7 -7
  76. inc/views/settings/metaboxes/sitemaps.php +5 -5
  77. inc/views/settings/metaboxes/social.php +9 -9
  78. inc/views/settings/metaboxes/title.php +6 -3
  79. inc/views/settings/wrap-content.php +3 -3
  80. inc/views/settings/wrap-nav.php +1 -1
  81. inc/views/settings/wrap.php +2 -2
  82. inc/views/sitemap/xsl-stylesheet.php +1 -1
  83. inc/views/sitemap/xsl/table.php +5 -5
  84. inc/views/sitemap/xsl/title.php +1 -1
  85. lib/js/ays.js +1 -1
  86. lib/js/c.js +1 -1
  87. lib/js/description.js +1 -1
  88. lib/js/gbc.js +1 -1
  89. lib/js/le.js +6 -2
  90. lib/js/le.min.js +1 -1
  91. lib/js/media.js +1 -1
  92. lib/js/post.js +1 -1
  93. lib/js/pt-gb.js +1 -1
  94. lib/js/pt.js +1 -1
  95. lib/js/settings.js +1 -1
  96. lib/js/social.js +1 -1
  97. lib/js/tabs.js +1 -1
  98. lib/js/term.js +1 -1
  99. lib/js/title.js +1 -1
  100. lib/js/tsf.js +1 -1
  101. lib/js/tt.js +1 -1
  102. readme.txt +8 -4
autodescription.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: The SEO Framework
4
  * Plugin URI: https://theseoframework.com/
5
  * Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for your WordPress website.
6
- * Version: 4.2.2
7
  * Author: The SEO Framework Team
8
  * Author URI: https://theseoframework.com/
9
  * License: GPLv3
@@ -19,7 +19,7 @@ defined( 'ABSPATH' ) or die;
19
 
20
  /**
21
  * The SEO Framework plugin
22
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
23
  *
24
  * This program is free software: you can redistribute it and/or modify
25
  * it under the terms of the GNU General Public License version 3 as published
@@ -41,7 +41,7 @@ defined( 'ABSPATH' ) or die;
41
  *
42
  * @since 2.3.5
43
  */
44
- define( 'THE_SEO_FRAMEWORK_VERSION', '4.2.2' );
45
 
46
  /**
47
  * The plugin Database version.
3
  * Plugin Name: The SEO Framework
4
  * Plugin URI: https://theseoframework.com/
5
  * Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for your WordPress website.
6
+ * Version: 4.2.3
7
  * Author: The SEO Framework Team
8
  * Author URI: https://theseoframework.com/
9
  * License: GPLv3
19
 
20
  /**
21
  * The SEO Framework plugin
22
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
23
  *
24
  * This program is free software: you can redistribute it and/or modify
25
  * it under the terms of the GNU General Public License version 3 as published
41
  *
42
  * @since 2.3.5
43
  */
44
+ define( 'THE_SEO_FRAMEWORK_VERSION', '4.2.3' );
45
 
46
  /**
47
  * The plugin Database version.
bootstrap/activation.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework\Bootstrap;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
bootstrap/deactivation.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework\Bootstrap;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
bootstrap/define.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
bootstrap/load.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
@@ -67,9 +67,10 @@ function _init_tsf() {
67
  return $tsf;
68
 
69
  /**
70
- * @package The_SEO_Framework
 
71
  */
72
- if ( _can_load() ) {
73
  if ( \is_admin() ) {
74
  //! TODO: admin-only loader?
75
  $tsf = new Load();
@@ -186,3 +187,17 @@ function _do_plugin_activation() {
186
  function _do_plugin_deactivation() {
187
  require THE_SEO_FRAMEWORK_BOOTSTRAP_PATH . 'deactivation.php';
188
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
67
  return $tsf;
68
 
69
  /**
70
+ * @since 2.3.7
71
+ * @param bool $load
72
  */
73
+ if ( \apply_filters( 'the_seo_framework_load', true ) ) {
74
  if ( \is_admin() ) {
75
  //! TODO: admin-only loader?
76
  $tsf = new Load();
187
  function _do_plugin_deactivation() {
188
  require THE_SEO_FRAMEWORK_BOOTSTRAP_PATH . 'deactivation.php';
189
  }
190
+
191
+ /**
192
+ * Adds and returns-to the memoized bootstrap timer.
193
+ *
194
+ * @since 4.0.0
195
+ * @access private
196
+ *
197
+ * @param int $add The time to add.
198
+ * @return int The accumulated time, roughly.
199
+ */
200
+ function _bootstrap_timer( $add = 0 ) {
201
+ static $time = 0;
202
+ return $time += $add;
203
+ }
bootstrap/upgrade.php CHANGED
@@ -492,7 +492,7 @@ function _prepare_upgrade_suggestion( $previous_version, $current_version ) { //
492
  if ( ! $previous_version ) return;
493
 
494
  // Can this even run twice? Let's play it safe to prevent crashes.
495
- if ( \The_SEO_Framework\_has_run( __METHOD__ ) ) return;
496
 
497
  require THE_SEO_FRAMEWORK_DIR_PATH_FUNCT . 'upgrade-suggestion.php';
498
  }
492
  if ( ! $previous_version ) return;
493
 
494
  // Can this even run twice? Let's play it safe to prevent crashes.
495
+ if ( \The_SEO_Framework\has_run( __METHOD__ ) ) return;
496
 
497
  require THE_SEO_FRAMEWORK_DIR_PATH_FUNCT . 'upgrade-suggestion.php';
498
  }
inc/classes/admin-init.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -147,7 +147,7 @@ class Admin_Init extends Init {
147
  */
148
  public function init_admin_scripts() {
149
 
150
- if ( _has_run( __METHOD__ ) ) return;
151
 
152
  Bridges\Scripts::_init();
153
  }
@@ -397,45 +397,31 @@ class Admin_Init extends Init {
397
  \wp_safe_redirect( $target, 302 );
398
 
399
  // White screen of death for non-debugging users. Let's make it friendlier.
400
- if ( $headers_sent )
401
  $this->handle_admin_redirect_error( $target );
402
 
403
- exit;
404
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
- /**
407
- * Provides an accessible error for when redirecting fails.
408
- *
409
- * @since 2.9.2
410
- * @see https://developer.wordpress.org/reference/functions/wp_redirect/
411
- *
412
- * @param string $target The redirect target location. Should be escaped.
413
- * @return void
414
- */
415
- protected function handle_admin_redirect_error( $target = '' ) {
416
-
417
- if ( ! $target ) return;
418
-
419
- $headers_list = headers_list();
420
- $location = sprintf( 'Location: %s', \wp_sanitize_redirect( $target ) );
421
-
422
- // Test if WordPress's redirect header is sent. Bail if true.
423
- if ( \in_array( $location, $headers_list, true ) )
424
- return;
425
-
426
- // phpcs:disable, WordPress.Security.EscapeOutput -- convert_markdown escapes. Added esc_url() for sanity.
427
- printf( '<p><strong>%s</strong></p>',
428
- $this->convert_markdown(
429
- sprintf(
430
- /* translators: %s = Redirect URL markdown */
431
- \esc_html__( 'There has been an error redirecting. Refresh the page or follow [this link](%s).', 'autodescription' ),
432
- \esc_url( $target )
433
- ),
434
- [ 'a' ],
435
- [ 'a_internal' => true ]
436
- )
437
- );
438
- // phpcs:enable, WordPress.Security.EscapeOutput
439
  }
440
 
441
  /**
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
147
  */
148
  public function init_admin_scripts() {
149
 
150
+ if ( has_run( __METHOD__ ) ) return;
151
 
152
  Bridges\Scripts::_init();
153
  }
397
  \wp_safe_redirect( $target, 302 );
398
 
399
  // White screen of death for non-debugging users. Let's make it friendlier.
400
+ if ( $headers_sent && $target ) {
401
  $this->handle_admin_redirect_error( $target );
402
 
403
+ $headers_list = headers_list();
404
+ $location = sprintf( 'Location: %s', \wp_sanitize_redirect( $target ) );
405
+
406
+ // Test if WordPress's redirect header is sent. Bail if true.
407
+ if ( \in_array( $location, $headers_list, true ) ) exit;
408
+
409
+ // phpcs:disable, WordPress.Security.EscapeOutput -- convert_markdown escapes. Added esc_url() for sanity.
410
+ printf(
411
+ '<p><strong>%s</strong></p>',
412
+ $this->convert_markdown(
413
+ sprintf(
414
+ /* translators: %s = Redirect URL markdown */
415
+ \esc_html__( 'There has been an error redirecting. Refresh the page or follow [this link](%s).', 'autodescription' ),
416
+ \esc_url( $target )
417
+ ),
418
+ [ 'a' ],
419
+ [ 'a_internal' => true ]
420
+ )
421
+ );
422
+ }
423
 
424
+ exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  }
426
 
427
  /**
inc/classes/admin-pages.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -50,7 +50,7 @@ class Admin_Pages extends Generate_Ldjson {
50
  */
51
  public function add_menu_link() {
52
 
53
- if ( _has_run( __METHOD__ ) ) return;
54
 
55
  $menu = [
56
  'page_title' => \esc_html__( 'SEO Settings', 'autodescription' ),
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
50
  */
51
  public function add_menu_link() {
52
 
53
+ if ( has_run( __METHOD__ ) ) return;
54
 
55
  $menu = [
56
  'page_title' => \esc_html__( 'SEO Settings', 'autodescription' ),
inc/classes/bridges/ajax.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/feed.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2020 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2020 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/listedit.class.php CHANGED
@@ -10,7 +10,7 @@ use \The_SEO_Framework\Interpreters\HTML;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -165,10 +165,10 @@ final class ListEdit extends ListTable {
165
 
166
  $tsf = \tsf();
167
 
168
- $query = [ 'id' => $post_id ];
169
 
170
  $r_defaults = $tsf->generate_robots_meta(
171
- $query,
172
  [ 'noindex', 'nofollow', 'noarchive' ],
173
  \The_SEO_Framework\ROBOTS_IGNORE_SETTINGS
174
  );
@@ -185,6 +185,8 @@ final class ListEdit extends ListTable {
185
  ],
186
  'canonical' => [
187
  'value' => $meta['_genesis_canonical_uri'],
 
 
188
  ],
189
  'noindex' => [
190
  'value' => $meta['_genesis_noindex'],
@@ -212,16 +214,18 @@ final class ListEdit extends ListTable {
212
  *
213
  * @since 4.0.5
214
  * @since 4.1.0 Now has `doctitle` and `description` indexes in its first parameter.
215
- * @param array $data The current data : {
 
216
  * string Index => @param array : {
217
- * @param mixed $value The current value.
218
- * @param bool $isSelect Optional. Whether the field is a select field.
219
- * @param string $default Optional. Only works when $isSelect is true. The default value to be set in select index 0.
 
220
  * }
221
  * }
222
- * @param array $query The query data. Contains 'id' or 'taxonomy'.
223
  */
224
- $data = \apply_filters_ref_array( 'the_seo_framework_list_table_data', [ $data, $query ] );
225
 
226
  printf(
227
  // '<span class=hidden id=%s data-le="%s"></span>',
@@ -231,12 +235,12 @@ final class ListEdit extends ListTable {
231
  HTML::make_data_attributes( [ 'le' => $data ] )
232
  );
233
 
234
- if ( $tsf->is_static_frontpage( $query['id'] ) ) {
235
  // When the homepage title is set, we can safely get the custom field.
236
  $_has_home_title = (bool) $tsf->escape_title( $tsf->get_option( 'homepage_title' ) );
237
  $default_title = $_has_home_title
238
- ? $tsf->get_custom_field_title( $query )
239
- : $tsf->get_filtered_raw_generated_title( $query );
240
  $addition = $tsf->get_home_title_additions();
241
  $seplocation = $tsf->get_home_title_seplocation();
242
  $is_title_ref_locked = $_has_home_title;
@@ -244,26 +248,26 @@ final class ListEdit extends ListTable {
244
  // When the homepage description is set, we can safely get the custom field.
245
  $_has_home_desc = (bool) $tsf->escape_title( $tsf->get_option( 'homepage_description' ) );
246
  $default_description = $_has_home_desc
247
- ? $tsf->get_description_from_custom_field( $query )
248
- : $tsf->get_generated_description( $query );
249
  $is_desc_ref_locked = $_has_home_desc;
250
  } else {
251
- $default_title = $tsf->get_filtered_raw_generated_title( $query );
252
  $addition = $tsf->get_blogname();
253
  $seplocation = $tsf->get_title_seplocation();
254
  $is_title_ref_locked = false;
255
 
256
- $default_description = $tsf->get_generated_description( $query );
257
  $is_desc_ref_locked = false;
258
  }
259
 
260
  $post_data = [
261
- 'isFront' => $tsf->is_static_frontpage( $query['id'] ),
262
  ];
263
  $title_data = [
264
  'refTitleLocked' => $is_title_ref_locked,
265
  'defaultTitle' => $tsf->s_title( $default_title ),
266
- 'addAdditions' => $tsf->use_title_branding( $query ),
267
  'additionValue' => $tsf->s_title( $addition ),
268
  'additionPlacement' => 'left' === $seplocation ? 'before' : 'after',
269
  ];
@@ -321,13 +325,13 @@ final class ListEdit extends ListTable {
321
 
322
  $tsf = \tsf();
323
 
324
- $query = [
325
  'id' => $term_id,
326
  'taxonomy' => $this->taxonomy,
327
  ];
328
 
329
  $r_defaults = $tsf->generate_robots_meta(
330
- $query,
331
  [ 'noindex', 'nofollow', 'noarchive' ],
332
  \The_SEO_Framework\ROBOTS_IGNORE_SETTINGS
333
  );
@@ -344,6 +348,8 @@ final class ListEdit extends ListTable {
344
  ],
345
  'canonical' => [
346
  'value' => $meta['canonical'],
 
 
347
  ],
348
  'noindex' => [
349
  'value' => $meta['noindex'],
@@ -371,16 +377,18 @@ final class ListEdit extends ListTable {
371
  *
372
  * @since 4.0.5
373
  * @since 4.1.0 Now has `doctitle` and `description` indexes in its first parameter.
374
- * @param array $data The current data : {
 
375
  * string Index => @param array : {
376
- * @param mixed $value The current value.
377
- * @param bool $isSelect Optional. Whether the field is a select field.
378
- * @param string $default Optional. Only works when $isSelect is true. The default value to be set in select index 0.
 
379
  * }
380
  * }
381
- * @param array $query The query data. Contains 'id' and 'taxonomy'.
382
  */
383
- $data = \apply_filters_ref_array( 'the_seo_framework_list_table_data', [ $data, $query ] );
384
 
385
  $container = '';
386
 
@@ -391,25 +399,25 @@ final class ListEdit extends ListTable {
391
  HTML::make_data_attributes( [ 'le' => $data ] )
392
  );
393
 
394
- $term_prefix = $tsf->use_generated_archive_prefix( \get_term( $query['id'], $query['taxonomy'] ) )
395
  ? sprintf(
396
  /* translators: %s: Taxonomy singular name. */
397
  \_x( '%s:', 'taxonomy term archive title prefix', 'default' ),
398
- $tsf->get_tax_type_label( $query['taxonomy'] )
399
  )
400
  : '';
401
 
402
  $title_data = [
403
  'refTitleLocked' => false,
404
- 'defaultTitle' => $tsf->s_title( $tsf->get_filtered_raw_generated_title( $query ) ),
405
- 'addAdditions' => $tsf->use_title_branding( $query ),
406
  'additionValue' => $tsf->s_title( $tsf->get_blogname() ),
407
  'additionPlacement' => 'left' === $tsf->get_title_seplocation() ? 'before' : 'after',
408
  'termPrefix' => $term_prefix,
409
  ];
410
  $desc_data = [
411
  'refDescriptionLocked' => false,
412
- 'defaultDescription' => $tsf->get_generated_description( $query ),
413
  ];
414
 
415
  $container .= sprintf(
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
165
 
166
  $tsf = \tsf();
167
 
168
+ $_generator_args = [ 'id' => $post_id ];
169
 
170
  $r_defaults = $tsf->generate_robots_meta(
171
+ $_generator_args,
172
  [ 'noindex', 'nofollow', 'noarchive' ],
173
  \The_SEO_Framework\ROBOTS_IGNORE_SETTINGS
174
  );
185
  ],
186
  'canonical' => [
187
  'value' => $meta['_genesis_canonical_uri'],
188
+ // TODO figure out how to make it work seamlessly with noindex.
189
+ // 'placeholder' => $tsf->get_canonical_url( $_generator_args + [ 'get_custom_field' => false ] ),
190
  ],
191
  'noindex' => [
192
  'value' => $meta['_genesis_noindex'],
214
  *
215
  * @since 4.0.5
216
  * @since 4.1.0 Now has `doctitle` and `description` indexes in its first parameter.
217
+ * @since 4.2.3 Now supports the `placeholder` index for $data.
218
+ * @param array $data The current data : {
219
  * string Index => @param array : {
220
+ * @param mixed $value The current value.
221
+ * @param bool $isSelect Optional. Whether the field is a select field.
222
+ * @param string $default Optional. Only works when $isSelect is true. The default value to be set in select index 0.
223
+ * @param string $placeholder Optional. Only works when $isSelect is false. Sets a placeholder for the input field.
224
  * }
225
  * }
226
+ * @param array $_generator_args The query data. Contains 'id' or 'taxonomy'.
227
  */
228
+ $data = \apply_filters_ref_array( 'the_seo_framework_list_table_data', [ $data, $_generator_args ] );
229
 
230
  printf(
231
  // '<span class=hidden id=%s data-le="%s"></span>',
235
  HTML::make_data_attributes( [ 'le' => $data ] )
236
  );
237
 
238
+ if ( $tsf->is_static_frontpage( $_generator_args['id'] ) ) {
239
  // When the homepage title is set, we can safely get the custom field.
240
  $_has_home_title = (bool) $tsf->escape_title( $tsf->get_option( 'homepage_title' ) );
241
  $default_title = $_has_home_title
242
+ ? $tsf->get_custom_field_title( $_generator_args )
243
+ : $tsf->get_filtered_raw_generated_title( $_generator_args );
244
  $addition = $tsf->get_home_title_additions();
245
  $seplocation = $tsf->get_home_title_seplocation();
246
  $is_title_ref_locked = $_has_home_title;
248
  // When the homepage description is set, we can safely get the custom field.
249
  $_has_home_desc = (bool) $tsf->escape_title( $tsf->get_option( 'homepage_description' ) );
250
  $default_description = $_has_home_desc
251
+ ? $tsf->get_description_from_custom_field( $_generator_args )
252
+ : $tsf->get_generated_description( $_generator_args );
253
  $is_desc_ref_locked = $_has_home_desc;
254
  } else {
255
+ $default_title = $tsf->get_filtered_raw_generated_title( $_generator_args );
256
  $addition = $tsf->get_blogname();
257
  $seplocation = $tsf->get_title_seplocation();
258
  $is_title_ref_locked = false;
259
 
260
+ $default_description = $tsf->get_generated_description( $_generator_args );
261
  $is_desc_ref_locked = false;
262
  }
263
 
264
  $post_data = [
265
+ 'isFront' => $tsf->is_static_frontpage( $_generator_args['id'] ),
266
  ];
267
  $title_data = [
268
  'refTitleLocked' => $is_title_ref_locked,
269
  'defaultTitle' => $tsf->s_title( $default_title ),
270
+ 'addAdditions' => $tsf->use_title_branding( $_generator_args ),
271
  'additionValue' => $tsf->s_title( $addition ),
272
  'additionPlacement' => 'left' === $seplocation ? 'before' : 'after',
273
  ];
325
 
326
  $tsf = \tsf();
327
 
328
+ $_generator_args = [
329
  'id' => $term_id,
330
  'taxonomy' => $this->taxonomy,
331
  ];
332
 
333
  $r_defaults = $tsf->generate_robots_meta(
334
+ $_generator_args,
335
  [ 'noindex', 'nofollow', 'noarchive' ],
336
  \The_SEO_Framework\ROBOTS_IGNORE_SETTINGS
337
  );
348
  ],
349
  'canonical' => [
350
  'value' => $meta['canonical'],
351
+ // TODO figure out how to make it work seamlessly with noindex.
352
+ // 'placeholder' => $tsf->get_canonical_url( $_generator_args + [ 'get_custom_field' => false ] ),
353
  ],
354
  'noindex' => [
355
  'value' => $meta['noindex'],
377
  *
378
  * @since 4.0.5
379
  * @since 4.1.0 Now has `doctitle` and `description` indexes in its first parameter.
380
+ * @since 4.2.3 Now supports the `placeholder` index for $data.
381
+ * @param array $data The current data : {
382
  * string Index => @param array : {
383
+ * @param mixed $value The current value.
384
+ * @param bool $isSelect Optional. Whether the field is a select field.
385
+ * @param string $default Optional. Only works when $isSelect is true. The default value to be set in select index 0.
386
+ * @param string $placeholder Optional. Only works when $isSelect is false. Sets a placeholder for the input field.
387
  * }
388
  * }
389
+ * @param array $_generator_args The query data. Contains 'id' and 'taxonomy'.
390
  */
391
+ $data = \apply_filters_ref_array( 'the_seo_framework_list_table_data', [ $data, $_generator_args ] );
392
 
393
  $container = '';
394
 
399
  HTML::make_data_attributes( [ 'le' => $data ] )
400
  );
401
 
402
+ $term_prefix = $tsf->use_generated_archive_prefix( \get_term( $_generator_args['id'], $_generator_args['taxonomy'] ) )
403
  ? sprintf(
404
  /* translators: %s: Taxonomy singular name. */
405
  \_x( '%s:', 'taxonomy term archive title prefix', 'default' ),
406
+ $tsf->get_tax_type_label( $_generator_args['taxonomy'] )
407
  )
408
  : '';
409
 
410
  $title_data = [
411
  'refTitleLocked' => false,
412
+ 'defaultTitle' => $tsf->s_title( $tsf->get_filtered_raw_generated_title( $_generator_args ) ),
413
+ 'addAdditions' => $tsf->use_title_branding( $_generator_args ),
414
  'additionValue' => $tsf->s_title( $tsf->get_blogname() ),
415
  'additionPlacement' => 'left' === $tsf->get_title_seplocation() ? 'before' : 'after',
416
  'termPrefix' => $term_prefix,
417
  ];
418
  $desc_data = [
419
  'refDescriptionLocked' => false,
420
+ 'defaultDescription' => $tsf->get_generated_description( $_generator_args ),
421
  ];
422
 
423
  $container .= sprintf(
inc/classes/bridges/listtable.class.php CHANGED
@@ -7,7 +7,7 @@ namespace The_SEO_Framework\Bridges;
7
 
8
  /**
9
  * The SEO Framework plugin
10
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
7
 
8
  /**
9
  * The SEO Framework plugin
10
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/ping.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/plugintable.class.php CHANGED
@@ -7,7 +7,7 @@ namespace The_SEO_Framework\Bridges;
7
 
8
  /**
9
  * The SEO Framework plugin
10
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
7
 
8
  /**
9
  * The SEO Framework plugin
10
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/postsettings.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/scripts.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/seobar.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/seosettings.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/sitemap.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/termsettings.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/bridges/usersettings.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Bridges;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/coresitemaps/main.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\CoreSitemaps;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2020 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2020 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/coresitemaps/posts.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\CoreSitemaps;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2020 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2020 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/coresitemaps/taxonomies.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\CoreSitemaps;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2020 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2020 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/images.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/robots/args.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Robots;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/robots/factory.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Robots;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/robots/main.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Robots;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -128,7 +128,9 @@ final class Main {
128
  // Remit FETCH_OBJ_R opcode calls every time we'd otherwise use $this->options hereinafter.
129
  $options = $this->options;
130
 
131
- $options & \The_SEO_Framework\ROBOTS_ASSERT
 
 
132
  and $this->reset_assertions();
133
 
134
  $factory = $this->get_factory();
@@ -150,7 +152,7 @@ final class Main {
150
 
151
  $results[ $g ] = $r;
152
 
153
- $options & \The_SEO_Framework\ROBOTS_ASSERT
154
  and $this->store_assertion( $g, $generator->key(), $r );
155
  // We could send anything, really. But this is the only method that loops and yields at the same time.
156
  } while ( $start !== $generator->send( true ) );
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
128
  // Remit FETCH_OBJ_R opcode calls every time we'd otherwise use $this->options hereinafter.
129
  $options = $this->options;
130
 
131
+ $assert = $options & \The_SEO_Framework\ROBOTS_ASSERT;
132
+
133
+ $assert
134
  and $this->reset_assertions();
135
 
136
  $factory = $this->get_factory();
152
 
153
  $results[ $g ] = $r;
154
 
155
+ $assert
156
  and $this->store_assertion( $g, $generator->key(), $r );
157
  // We could send anything, really. But this is the only method that loops and yields at the same time.
158
  } while ( $start !== $generator->send( true ) );
inc/classes/builders/robots/query.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Robots;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/scripts.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -191,7 +191,7 @@ final class Scripts {
191
  */
192
  public static function footer_enqueue() {
193
 
194
- if ( \The_SEO_Framework\_has_run( __METHOD__ ) ) return;
195
 
196
  \add_action( 'admin_footer', [ static::class, 'enqueue' ], 998 ); // Magic number: 1 before output_templates.
197
  }
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
191
  */
192
  public static function footer_enqueue() {
193
 
194
+ if ( \The_SEO_Framework\has_run( __METHOD__ ) ) return;
195
 
196
  \add_action( 'admin_footer', [ static::class, 'enqueue' ], 998 ); // Magic number: 1 before output_templates.
197
  }
inc/classes/builders/seobar/main.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\SEOBar;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/seobar/page.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\SEOBar;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -200,11 +200,11 @@ final class Page extends Main {
200
  ]
201
  );
202
 
203
- $title_args = [ 'id' => static::$query['id'] ];
204
 
205
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
206
  // This way, we can implement real-time live-edit AJAX SEO bar items...
207
- $title_part = static::$tsf->get_filtered_raw_custom_field_title( $title_args );
208
 
209
  if ( \strlen( $title_part ) ) {
210
  $item = $cache['defaults']['custom'];
@@ -234,7 +234,7 @@ final class Page extends Main {
234
  $item['assess']['base'] = \__( "It's built using the site title.", 'autodescription' );
235
  }
236
 
237
- $title_part = static::$tsf->get_filtered_raw_generated_title( $title_args );
238
  }
239
 
240
  if ( ! $title_part ) {
@@ -256,16 +256,16 @@ final class Page extends Main {
256
  $title = $title_part;
257
 
258
  // Don't use cache, as this can be filtered.
259
- if ( static::$tsf->use_title_protection( $title_args ) ) {
260
  $_title_before = $title;
261
- static::$tsf->merge_title_protection( $title, $title_args );
262
  if ( $title !== $_title_before )
263
  $item['assess']['protected'] = $cache['assess']['protected'];
264
  }
265
 
266
- if ( static::$tsf->use_title_branding( $title_args ) ) {
267
  $_title_before = $title;
268
- static::$tsf->merge_title_branding( $title, $title_args );
269
 
270
  // Absence assertion is done after this.
271
  if ( $title === $_title_before ) {
@@ -418,11 +418,11 @@ final class Page extends Main {
418
  ]
419
  );
420
 
421
- $desc_args = [ 'id' => static::$query['id'] ];
422
 
423
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
424
  // This way, we can implement real-time live-edit AJAX SEO bar items...
425
- $desc = static::$tsf->get_description_from_custom_field( $desc_args, false );
426
 
427
  if ( \strlen( $desc ) ) {
428
  $item = $cache['defaults']['custom'];
@@ -444,7 +444,7 @@ final class Page extends Main {
444
  // Further assessments must be made later. Halt assertion here to prevent confusion.
445
  return $item;
446
  }
447
- } elseif ( ! static::$tsf->is_auto_description_enabled( $desc_args ) ) {
448
  $item = $cache['defaults']['emptynoauto'];
449
 
450
  // No description is found. There's no need to continue parsing.
@@ -452,7 +452,7 @@ final class Page extends Main {
452
  } else {
453
  $item = $cache['defaults']['generated'];
454
 
455
- $desc = static::$tsf->get_generated_description( $desc_args, false );
456
 
457
  if ( ! \strlen( $desc ) ) {
458
  $item['reason'] = $cache['reason']['empty'];
@@ -674,12 +674,12 @@ final class Page extends Main {
674
  }
675
 
676
  if ( $this->query_cache['meta']['_genesis_canonical_uri'] ) {
677
- $permalink = static::$tsf->create_canonical_url( [
678
  'id' => static::$query['id'],
679
  'get_custom_field' => false,
680
  ] );
681
  // We create it because filters may apply.
682
- $canonical = static::$tsf->create_canonical_url( [
683
  'id' => static::$query['id'],
684
  'get_custom_field' => true,
685
  ] );
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
200
  ]
201
  );
202
 
203
+ $_generator_args = [ 'id' => static::$query['id'] ];
204
 
205
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
206
  // This way, we can implement real-time live-edit AJAX SEO bar items...
207
+ $title_part = static::$tsf->get_filtered_raw_custom_field_title( $_generator_args );
208
 
209
  if ( \strlen( $title_part ) ) {
210
  $item = $cache['defaults']['custom'];
234
  $item['assess']['base'] = \__( "It's built using the site title.", 'autodescription' );
235
  }
236
 
237
+ $title_part = static::$tsf->get_filtered_raw_generated_title( $_generator_args );
238
  }
239
 
240
  if ( ! $title_part ) {
256
  $title = $title_part;
257
 
258
  // Don't use cache, as this can be filtered.
259
+ if ( static::$tsf->use_title_protection( $_generator_args ) ) {
260
  $_title_before = $title;
261
+ static::$tsf->merge_title_protection( $title, $_generator_args );
262
  if ( $title !== $_title_before )
263
  $item['assess']['protected'] = $cache['assess']['protected'];
264
  }
265
 
266
+ if ( static::$tsf->use_title_branding( $_generator_args ) ) {
267
  $_title_before = $title;
268
+ static::$tsf->merge_title_branding( $title, $_generator_args );
269
 
270
  // Absence assertion is done after this.
271
  if ( $title === $_title_before ) {
418
  ]
419
  );
420
 
421
+ $_generator_args = [ 'id' => static::$query['id'] ];
422
 
423
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
424
  // This way, we can implement real-time live-edit AJAX SEO bar items...
425
+ $desc = static::$tsf->get_description_from_custom_field( $_generator_args, false );
426
 
427
  if ( \strlen( $desc ) ) {
428
  $item = $cache['defaults']['custom'];
444
  // Further assessments must be made later. Halt assertion here to prevent confusion.
445
  return $item;
446
  }
447
+ } elseif ( ! static::$tsf->is_auto_description_enabled( $_generator_args ) ) {
448
  $item = $cache['defaults']['emptynoauto'];
449
 
450
  // No description is found. There's no need to continue parsing.
452
  } else {
453
  $item = $cache['defaults']['generated'];
454
 
455
+ $desc = static::$tsf->get_generated_description( $_generator_args, false );
456
 
457
  if ( ! \strlen( $desc ) ) {
458
  $item['reason'] = $cache['reason']['empty'];
674
  }
675
 
676
  if ( $this->query_cache['meta']['_genesis_canonical_uri'] ) {
677
+ $permalink = static::$tsf->get_canonical_url( [
678
  'id' => static::$query['id'],
679
  'get_custom_field' => false,
680
  ] );
681
  // We create it because filters may apply.
682
+ $canonical = static::$tsf->get_canonical_url( [
683
  'id' => static::$query['id'],
684
  'get_custom_field' => true,
685
  ] );
inc/classes/builders/seobar/term.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\SEOBar;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -212,14 +212,14 @@ final class Term extends Main {
212
  ]
213
  );
214
 
215
- $title_args = [
216
  'id' => static::$query['id'],
217
  'taxonomy' => static::$query['taxonomy'],
218
  ];
219
 
220
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
221
  // This way, we can implement real-time live-edit AJAX SEO bar items...
222
- $title_part = static::$tsf->get_filtered_raw_custom_field_title( $title_args );
223
 
224
  if ( \strlen( $title_part ) ) {
225
  $item = $cache['defaults']['custom'];
@@ -239,7 +239,7 @@ final class Term extends Main {
239
  $item['assess']['prefixed'] = $cache['assess']['prefixed'];
240
  }
241
 
242
- $title_part = static::$tsf->get_filtered_raw_generated_title( $title_args );
243
  }
244
 
245
  if ( ! $title_part ) {
@@ -260,9 +260,9 @@ final class Term extends Main {
260
 
261
  $title = $title_part;
262
 
263
- if ( static::$tsf->use_title_branding( $title_args ) ) {
264
  $_title_before = $title;
265
- static::$tsf->merge_title_branding( $title, $title_args );
266
 
267
  // Absence assertion is done after this.
268
  if ( $title === $_title_before ) {
@@ -405,14 +405,14 @@ final class Term extends Main {
405
  ]
406
  );
407
 
408
- $desc_args = [
409
  'id' => static::$query['id'],
410
  'taxonomy' => static::$query['taxonomy'],
411
  ];
412
 
413
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
414
  // This way, we can implement real-time live-edit AJAX SEO bar items...
415
- $desc = static::$tsf->get_description_from_custom_field( $desc_args, false );
416
 
417
  if ( \strlen( $desc ) ) {
418
  $item = $cache['defaults']['custom'];
@@ -425,7 +425,7 @@ final class Term extends Main {
425
  // Further assessments must be made later. Halt assertion here to prevent confusion.
426
  return $item;
427
  }
428
- } elseif ( ! static::$tsf->is_auto_description_enabled( $desc_args ) ) {
429
  $item = $cache['defaults']['emptynoauto'];
430
 
431
  // No description is found. There's no need to continue parsing.
@@ -433,7 +433,7 @@ final class Term extends Main {
433
  } else {
434
  $item = $cache['defaults']['generated'];
435
 
436
- $desc = static::$tsf->get_generated_description( $desc_args, false );
437
 
438
  if ( ! \strlen( $desc ) ) {
439
  $item['status'] = \The_SEO_Framework\Interpreters\SEOBar::STATE_UNDEFINED;
@@ -632,13 +632,13 @@ final class Term extends Main {
632
  }
633
 
634
  if ( $this->query_cache['meta']['canonical'] ) {
635
- $permalink = static::$tsf->create_canonical_url( [
636
  'id' => static::$query['id'],
637
  'taxonomy' => static::$query['taxonomy'],
638
  'get_custom_field' => false,
639
  ] );
640
  // We create it because filters may apply.
641
- $canonical = static::$tsf->create_canonical_url( [
642
  'id' => static::$query['id'],
643
  'taxonomy' => static::$query['taxonomy'],
644
  'get_custom_field' => true,
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
212
  ]
213
  );
214
 
215
+ $_generator_args = [
216
  'id' => static::$query['id'],
217
  'taxonomy' => static::$query['taxonomy'],
218
  ];
219
 
220
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
221
  // This way, we can implement real-time live-edit AJAX SEO bar items...
222
+ $title_part = static::$tsf->get_filtered_raw_custom_field_title( $_generator_args );
223
 
224
  if ( \strlen( $title_part ) ) {
225
  $item = $cache['defaults']['custom'];
239
  $item['assess']['prefixed'] = $cache['assess']['prefixed'];
240
  }
241
 
242
+ $title_part = static::$tsf->get_filtered_raw_generated_title( $_generator_args );
243
  }
244
 
245
  if ( ! $title_part ) {
260
 
261
  $title = $title_part;
262
 
263
+ if ( static::$tsf->use_title_branding( $_generator_args ) ) {
264
  $_title_before = $title;
265
+ static::$tsf->merge_title_branding( $title, $_generator_args );
266
 
267
  // Absence assertion is done after this.
268
  if ( $title === $_title_before ) {
405
  ]
406
  );
407
 
408
+ $_generator_args = [
409
  'id' => static::$query['id'],
410
  'taxonomy' => static::$query['taxonomy'],
411
  ];
412
 
413
  // TODO instead of getting values from the options API, why don't we store the parameters and allow them to be modified?
414
  // This way, we can implement real-time live-edit AJAX SEO bar items...
415
+ $desc = static::$tsf->get_description_from_custom_field( $_generator_args, false );
416
 
417
  if ( \strlen( $desc ) ) {
418
  $item = $cache['defaults']['custom'];
425
  // Further assessments must be made later. Halt assertion here to prevent confusion.
426
  return $item;
427
  }
428
+ } elseif ( ! static::$tsf->is_auto_description_enabled( $_generator_args ) ) {
429
  $item = $cache['defaults']['emptynoauto'];
430
 
431
  // No description is found. There's no need to continue parsing.
433
  } else {
434
  $item = $cache['defaults']['generated'];
435
 
436
+ $desc = static::$tsf->get_generated_description( $_generator_args, false );
437
 
438
  if ( ! \strlen( $desc ) ) {
439
  $item['status'] = \The_SEO_Framework\Interpreters\SEOBar::STATE_UNDEFINED;
632
  }
633
 
634
  if ( $this->query_cache['meta']['canonical'] ) {
635
+ $permalink = static::$tsf->get_canonical_url( [
636
  'id' => static::$query['id'],
637
  'taxonomy' => static::$query['taxonomy'],
638
  'get_custom_field' => false,
639
  ] );
640
  // We create it because filters may apply.
641
+ $canonical = static::$tsf->get_canonical_url( [
642
  'id' => static::$query['id'],
643
  'taxonomy' => static::$query['taxonomy'],
644
  'get_custom_field' => true,
inc/classes/builders/sitemap.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/builders/sitemap/base.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Sitemap;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -475,12 +475,12 @@ class Base extends Main {
475
  protected function generate_url_item_values( $post_ids, $args, &$count = 0 ) {
476
 
477
  foreach ( $post_ids as $post_id ) {
478
- // Setup post cache, which is also used in is_post_included_in_sitemap() and create_canonical_url().
479
  $post = \get_post( $post_id );
480
 
481
  if ( $this->is_post_included_in_sitemap( $post_id ) ) {
482
  $_values = [
483
- 'loc' => static::$tsf->create_canonical_url( [ 'id' => $post_id ] ),
484
  ];
485
 
486
  if ( $args['show_modified'] )
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
475
  protected function generate_url_item_values( $post_ids, $args, &$count = 0 ) {
476
 
477
  foreach ( $post_ids as $post_id ) {
478
+ // Setup post cache, which is also used in is_post_included_in_sitemap() and get_canonical_url().
479
  $post = \get_post( $post_id );
480
 
481
  if ( $this->is_post_included_in_sitemap( $post_id ) ) {
482
  $_values = [
483
+ 'loc' => static::$tsf->get_canonical_url( [ 'id' => $post_id ] ),
484
  ];
485
 
486
  if ( $args['show_modified'] )
inc/classes/builders/sitemap/main.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Builders\Sitemap;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -179,18 +179,18 @@ abstract class Main {
179
  $included = ! isset( $excluded[ $post_id ] );
180
 
181
  while ( $included ) :
182
- $_args = [ 'id' => $post_id ];
183
 
184
  // ROBOTS_IGNORE_PROTECTION as we don't need to test 'private' ('post_status'=>'publish'), nor 'password' ('has_password'=>false)
185
  $included = 'noindex'
186
  !== (
187
- static::$tsf->generate_robots_meta( $_args, [ 'noindex' ], \The_SEO_Framework\ROBOTS_IGNORE_PROTECTION )['noindex']
188
  ?? false // We cast type false for Zend tests strict type before identical-string-comparing.
189
  );
190
 
191
  if ( ! $included ) break;
192
 
193
- $included = ! static::$tsf->get_redirect_url( $_args );
194
  break;
195
  endwhile;
196
 
@@ -231,7 +231,7 @@ abstract class Main {
231
  // Yes, 90% of this code code isn't DRY. However, terms !== posts. terms == posts, though :).
232
  // Really: <https://core.trac.wordpress.org/ticket/50568>
233
  while ( $included ) :
234
- $_args = [
235
  'id' => $term_id,
236
  'taxonomy' => $taxonomy,
237
  ];
@@ -239,13 +239,13 @@ abstract class Main {
239
  // ROBOTS_IGNORE_PROTECTION is not tested for terms. However, we may use that later.
240
  $included = 'noindex'
241
  !== (
242
- static::$tsf->generate_robots_meta( $_args, [ 'noindex' ], \The_SEO_Framework\ROBOTS_IGNORE_PROTECTION )['noindex']
243
  ?? false // We cast type false for Zend tests strict type before identical-string-comparing.
244
  );
245
 
246
  if ( ! $included ) break;
247
 
248
- $included = ! static::$tsf->get_redirect_url( $_args );
249
  break;
250
  endwhile;
251
 
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
179
  $included = ! isset( $excluded[ $post_id ] );
180
 
181
  while ( $included ) :
182
+ $_generator_args = [ 'id' => $post_id ];
183
 
184
  // ROBOTS_IGNORE_PROTECTION as we don't need to test 'private' ('post_status'=>'publish'), nor 'password' ('has_password'=>false)
185
  $included = 'noindex'
186
  !== (
187
+ static::$tsf->generate_robots_meta( $_generator_args, [ 'noindex' ], \The_SEO_Framework\ROBOTS_IGNORE_PROTECTION )['noindex']
188
  ?? false // We cast type false for Zend tests strict type before identical-string-comparing.
189
  );
190
 
191
  if ( ! $included ) break;
192
 
193
+ $included = ! static::$tsf->get_redirect_url( $_generator_args );
194
  break;
195
  endwhile;
196
 
231
  // Yes, 90% of this code code isn't DRY. However, terms !== posts. terms == posts, though :).
232
  // Really: <https://core.trac.wordpress.org/ticket/50568>
233
  while ( $included ) :
234
+ $_generator_args = [
235
  'id' => $term_id,
236
  'taxonomy' => $taxonomy,
237
  ];
239
  // ROBOTS_IGNORE_PROTECTION is not tested for terms. However, we may use that later.
240
  $included = 'noindex'
241
  !== (
242
+ static::$tsf->generate_robots_meta( $_generator_args, [ 'noindex' ], \The_SEO_Framework\ROBOTS_IGNORE_PROTECTION )['noindex']
243
  ?? false // We cast type false for Zend tests strict type before identical-string-comparing.
244
  );
245
 
246
  if ( ! $included ) break;
247
 
248
+ $included = ! static::$tsf->get_redirect_url( $_generator_args );
249
  break;
250
  endwhile;
251
 
inc/classes/cache.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -64,7 +64,7 @@ class Cache extends Site_Options {
64
  */
65
  public function init_post_cache_actions() {
66
 
67
- if ( _has_run( __METHOD__ ) ) return;
68
 
69
  // Can-be cron actions.
70
  \add_action( 'publish_post', [ $this, 'delete_post_cache' ] );
@@ -171,7 +171,32 @@ class Cache extends Site_Options {
171
  */
172
  public function delete_cache( $type, $id = 0, $args = [] ) {
173
 
174
- $this->parse_delete_cache_keys( $type, $id, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
  $success = false;
177
 
@@ -201,41 +226,6 @@ class Cache extends Site_Options {
201
  return $success;
202
  }
203
 
204
- /**
205
- * Parses input keys for method delete_cache.
206
- *
207
- * @since 2.8.0
208
- *
209
- * @param string $type The cache type. Passed by reference.
210
- * @param int $id The post, page or TT ID. Defaults to $this->get_the_real_ID(). Passed by reference.
211
- * @param array $args Additional arguments. They can overwrite $type and $id. Passed by reference.
212
- */
213
- protected function parse_delete_cache_keys( &$type, &$id, &$args ) {
214
-
215
- // Don't use cache on fetching ID.
216
- $id = $id ?: $this->get_the_real_ID( false );
217
-
218
- $defaults = [
219
- 'type' => $type,
220
- 'id' => $id,
221
- 'term' => '',
222
- ];
223
-
224
- /**
225
- * @since 2.8.0
226
- * @NOTE Careful: Altering this might infinitely loop method delete_cache() if not done strictly.
227
- * Don't blindly overwrite 'type'.
228
- * @param array $args All caching arguments
229
- * @param string $type The cache type.
230
- * @param int $id The post or term ID.
231
- */
232
- $args = (array) \apply_filters( 'the_seo_framework_delete_cache_args', $args, $type, $id );
233
- $args = \wp_parse_args( $args, $defaults );
234
-
235
- $type = $args['type'];
236
- $id = $args['id'];
237
- }
238
-
239
  /**
240
  * Set the value of the transient.
241
  *
@@ -405,7 +395,7 @@ class Cache extends Site_Options {
405
  */
406
  public function delete_sitemap_transient() {
407
 
408
- if ( _has_run( __METHOD__ ) ) return false;
409
 
410
  $transient = $this->get_sitemap_transient_name();
411
  $transient and \delete_transient( $transient );
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
64
  */
65
  public function init_post_cache_actions() {
66
 
67
+ if ( has_run( __METHOD__ ) ) return;
68
 
69
  // Can-be cron actions.
70
  \add_action( 'publish_post', [ $this, 'delete_post_cache' ] );
171
  */
172
  public function delete_cache( $type, $id = 0, $args = [] ) {
173
 
174
+ $args = array_merge(
175
+ [
176
+ 'type' => $type,
177
+ // Don't use cache when fetching ID.
178
+ 'id' => $id ?: $this->get_the_real_ID( false ),
179
+ 'term' => '',
180
+ ],
181
+ /**
182
+ * @since 2.8.0
183
+ * @NOTE Careful: Altering this might infinitely loop method delete_cache() if not done strictly.
184
+ * Don't blindly overwrite index key 'type'.
185
+ * @param array $args All caching arguments, with indexes 'type', 'id', and 'term'.
186
+ * @param string $type The cache type.
187
+ * @param int $id The post or term ID.
188
+ */
189
+ (array) \apply_filters_ref_array(
190
+ 'the_seo_framework_delete_cache_args',
191
+ [
192
+ $args,
193
+ $type,
194
+ $id,
195
+ ]
196
+ )
197
+ );
198
+ $type = $args['type'];
199
+ $id = $args['id'];
200
 
201
  $success = false;
202
 
226
  return $success;
227
  }
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Set the value of the transient.
231
  *
395
  */
396
  public function delete_sitemap_transient() {
397
 
398
+ if ( has_run( __METHOD__ ) ) return false;
399
 
400
  $transient = $this->get_sitemap_transient_name();
401
  $transient and \delete_transient( $transient );
inc/classes/core.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/detect.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -306,7 +306,7 @@ class Detect extends Render {
306
  }
307
  }
308
 
309
- return memo( (bool) ( $detected ?? false ) );
310
  }
311
 
312
  /**
@@ -355,7 +355,7 @@ class Detect extends Render {
355
  }
356
  }
357
 
358
- return memo( (bool) ( $detected ?? false ) );
359
  }
360
 
361
  /**
@@ -402,7 +402,7 @@ class Detect extends Render {
402
  }
403
  }
404
 
405
- return memo( (bool) ( $detected ?? false ) );
406
  }
407
 
408
  /**
@@ -466,7 +466,7 @@ class Detect extends Render {
466
  }
467
  }
468
 
469
- return memo( (bool) ( $detected ?? false ) );
470
  }
471
 
472
  /**
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
306
  }
307
  }
308
 
309
+ return memo( $detected ?? false );
310
  }
311
 
312
  /**
355
  }
356
  }
357
 
358
+ return memo( $detected ?? false );
359
  }
360
 
361
  /**
402
  }
403
  }
404
 
405
+ return memo( $detected ?? false );
406
  }
407
 
408
  /**
466
  }
467
  }
468
 
469
+ return memo( $detected ?? false );
470
  }
471
 
472
  /**
inc/classes/generate-description.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -667,7 +667,6 @@ class Generate_Description extends Generate {
667
  * @since 3.1.0
668
  * @since 4.0.0 Now processes HTML tags via s_excerpt_raw() for the author descriptions.
669
  * @since 4.2.0 Now uses post type archive descriptions to prefill meta descriptions.
670
- * @TODO fixme: why don't we parse filters? -> What did I mean when I wrote this?
671
  *
672
  * @param null|\WP_Term|\WP_Post_Type $object The term or post type object.
673
  * @return string
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
667
  * @since 3.1.0
668
  * @since 4.0.0 Now processes HTML tags via s_excerpt_raw() for the author descriptions.
669
  * @since 4.2.0 Now uses post type archive descriptions to prefill meta descriptions.
 
670
  *
671
  * @param null|\WP_Term|\WP_Post_Type $object The term or post type object.
672
  * @return string
inc/classes/generate-image.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/generate-ldjson.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -784,7 +784,7 @@ class Generate_Ldjson extends Generate_Image {
784
  break;
785
 
786
  case 'create':
787
- $url = $this->create_canonical_url( $args );
788
  break;
789
 
790
  default:
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
784
  break;
785
 
786
  case 'create':
787
+ $url = $this->get_canonical_url( $args );
788
  break;
789
 
790
  default:
inc/classes/generate-title.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/generate-url.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -100,7 +100,7 @@ class Generate_Url extends Generate_Title {
100
  */
101
  public function get_current_permalink() {
102
  return memo() ?? memo(
103
- $this->create_canonical_url( [
104
  'id' => $this->get_the_real_ID(),
105
  'taxonomy' => $this->get_current_taxonomy(),
106
  ] )
@@ -117,7 +117,7 @@ class Generate_Url extends Generate_Title {
117
  */
118
  public function get_homepage_permalink() {
119
  return memo() ?? memo(
120
- $this->create_canonical_url( [ 'id' => $this->get_the_front_page_ID() ] )
121
  );
122
  }
123
 
@@ -128,6 +128,8 @@ class Generate_Url extends Generate_Title {
128
  * @since 3.0.0
129
  * @since 4.0.0 Now preemptively fixes the generation arguments, for easier implementation.
130
  * @since 4.2.0 Now supports the `$args['pta']` index.
 
 
131
  * @uses $this->get_canonical_url()
132
  *
133
  * @param array $args The canonical URL arguments : {
@@ -139,14 +141,6 @@ class Generate_Url extends Generate_Title {
139
  * @return string The canonical URL, if any.
140
  */
141
  public function create_canonical_url( $args = [] ) {
142
-
143
- $args += [
144
- 'id' => 0,
145
- 'taxonomy' => '',
146
- 'pta' => '',
147
- 'get_custom_field' => false,
148
- ];
149
-
150
  return $this->get_canonical_url( $args );
151
  }
152
 
@@ -156,32 +150,42 @@ class Generate_Url extends Generate_Title {
156
  *
157
  * @since 3.0.0
158
  * @since 4.2.0 Now supports the `$args['pta']` index.
159
- * @see $this->create_canonical_url()
160
  *
161
- * @param array|null $args Private variable! Use `$this->create_canonical_url()` instead.
 
 
 
 
 
162
  * @return string The canonical URL, if any.
163
  */
164
  public function get_canonical_url( $args = null ) {
165
 
166
  if ( $args ) {
167
- // See and use `$this->create_canonical_url()` instead.
168
- $canonical_url = $this->build_canonical_url( $args );
169
- $query = false;
 
 
 
 
 
 
 
 
 
170
  } else {
171
- $canonical_url = $this->generate_canonical_url();
172
- $query = true;
173
  }
174
 
175
- if ( ! $canonical_url )
176
  return '';
177
 
178
- if ( ! $query && $args['id'] === $this->get_the_real_ID() )
179
- $canonical_url = $this->remove_pagination_from_url( $canonical_url );
180
 
181
- if ( $this->matches_this_domain( $canonical_url ) )
182
- $canonical_url = $this->set_preferred_url_scheme( $canonical_url );
183
-
184
- return $this->clean_canonical_url( $canonical_url );
185
  }
186
 
187
  /**
@@ -191,9 +195,9 @@ class Generate_Url extends Generate_Title {
191
  * @since 3.2.2 Now tests for the homepage as page prior getting custom field data.
192
  * @since 4.0.0 Can now fetch custom canonical URL for terms.
193
  * @since 4.2.0 Now supports the `$args['pta']` index.
194
- * @see $this->create_canonical_url()
195
  *
196
- * @param array $args Required. Use $this->create_canonical_url().
197
  * @return string The canonical URL.
198
  */
199
  protected function build_canonical_url( $args ) {
@@ -321,10 +325,10 @@ class Generate_Url extends Generate_Title {
321
  if ( $this->has_page_on_front() ) {
322
  if ( $this->is_static_frontpage( $query_id ) ) {
323
  // Yes, use the pagination base for the homepage-as-page!
324
- $url = $this->add_url_pagination( $url, $this->page(), true );
325
  }
326
  } elseif ( (int) \get_option( 'page_for_posts' ) === $query_id ) {
327
- $url = $this->add_url_pagination( $url, $this->paged(), true );
328
  }
329
 
330
  return $this->slash_root_url( $url );
@@ -364,36 +368,33 @@ class Generate_Url extends Generate_Title {
364
  * @since 4.0.5 Now passes the `$id` to `is_singular_archive()`
365
  * @since 4.2.0 1. Added memoization.
366
  * 2. When the $id isn't set, the URL won't get tested for pagination issues.
 
367
  *
368
- * @param int|null $id The page ID. Leave null to autodetermine.
369
  * @return string The custom canonical URL, if any.
370
  */
371
- public function get_singular_canonical_url( $id = null ) {
372
 
373
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
374
- if ( null !== $memo = umemo( __METHOD__, null, $id ) ) return $memo;
375
 
376
  $url = \wp_get_canonical_url(
377
- $id ?? $this->get_the_real_ID()
378
  ) ?: '';
379
 
380
  if ( ! $url ) return '';
381
 
382
- if ( null !== $id ) {
383
- $_page = \get_query_var( 'page', 1 ) ?: 1;
384
-
385
- if ( $_page > 1 && $_page !== $this->page() ) {
386
- /** @link https://core.trac.wordpress.org/ticket/37505 */
387
- $url = $this->remove_pagination_from_url( $url, $_page, false );
388
- }
389
 
390
- if ( $this->is_singular_archive( $id ) ) {
391
- // Singular archives, like blog pages and shop pages, use the pagination base with paged.
392
- $url = $this->add_url_pagination( $url, $this->paged(), true );
393
- }
394
- }
395
 
396
- return umemo( __METHOD__, $url, $id );
397
  }
398
 
399
  /**
@@ -446,12 +447,8 @@ class Generate_Url extends Generate_Title {
446
  if ( \is_wp_error( $url ) )
447
  return umemo( __METHOD__, '', $term_id, $taxonomy );
448
 
449
- if ( null === $term_id ) {
450
- $paged = $this->paged();
451
-
452
- if ( $paged > 1 )
453
- $url = $this->add_url_pagination( $url, $paged, true );
454
- }
455
 
456
  return umemo( __METHOD__, $url, $term_id, $taxonomy );
457
  }
@@ -466,24 +463,18 @@ class Generate_Url extends Generate_Title {
466
  * 2. Removed argument type deprecation doing it wrong warning.
467
  *
468
  * @param null|string $post_type The post type archive's post type.
469
- * Leave null to use query, and allow pagination.
470
  * @return string The post type archive canonical URL, if any.
471
  */
472
  public function get_post_type_archive_canonical_url( $post_type = null ) {
473
 
474
- if ( ! $post_type ) {
475
- $post_type = $this->get_current_post_type();
476
- $is_query = true;
477
- } else {
478
- $is_query = false;
479
- }
480
 
481
- $url = \get_post_type_archive_link( $post_type ) ?: '';
482
-
483
- if ( $is_query && $url )
484
- $url = $this->add_url_pagination( $url, $this->paged(), true );
485
 
486
- return $url;
 
 
487
  }
488
 
489
  /**
@@ -504,7 +495,7 @@ class Generate_Url extends Generate_Title {
504
  if ( ! $url ) return '';
505
 
506
  return null === $id
507
- ? $this->add_url_pagination( $url, $this->paged(), true )
508
  : $url;
509
  }
510
 
@@ -539,12 +530,12 @@ class Generate_Url extends Generate_Title {
539
  case 'day':
540
  $_day = \get_query_var( 'day' );
541
  $_paginate = $_paginate && $_day == $day; // phpcs:ignore, WordPress.PHP.StrictComparisons.LooseComparison
542
- // No break. Get month too.
543
 
544
  case 'month':
545
  $_month = \get_query_var( 'monthnum' );
546
  $_paginate = $_paginate && $_month == $month; // phpcs:ignore, WordPress.PHP.StrictComparisons.LooseComparison
547
- // No break. Get year too.
548
 
549
  case 'year':
550
  $_year = \get_query_var( 'year' );
@@ -554,7 +545,7 @@ class Generate_Url extends Generate_Title {
554
 
555
  if ( $_paginate ) {
556
  // Adds pagination if input matches query.
557
- $link = $this->add_url_pagination( $link, $this->paged(), true );
558
  }
559
 
560
  return $link;
@@ -569,27 +560,19 @@ class Generate_Url extends Generate_Title {
569
  * 2. The search term is now matched with the input query if not set,
570
  * instead of it being empty.
571
  *
572
- * @param string $query The search query. Mustn't be escaped.
573
- * When left empty, the current query will be used.
574
  * @return string The search link.
575
  */
576
- public function get_search_canonical_url( $query = null ) {
577
 
578
- $_paginate = false;
579
-
580
- if ( ! isset( $query ) ) {
581
- $query = \get_search_query( false );
582
- $_paginate = true;
583
- }
584
 
585
- $link = \get_search_link( $query );
586
-
587
- if ( $_paginate ) {
588
- // Adds pagination if input query isn't null.
589
- $link = $this->add_url_pagination( $link, $this->paged(), true );
590
- }
591
 
592
- return $link;
 
 
593
  }
594
 
595
  /**
@@ -607,13 +590,11 @@ class Generate_Url extends Generate_Title {
607
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
608
  if ( null !== $memo = memo() ) return $memo;
609
 
610
- switch ( $this->get_option( 'canonical_scheme' ) ) :
611
- case 'https':
612
- $scheme = 'https';
613
- break;
614
 
 
 
615
  case 'http':
616
- $scheme = 'http';
617
  break;
618
 
619
  default:
@@ -706,11 +687,7 @@ class Generate_Url extends Generate_Title {
706
  /**
707
  * Adds pagination to input URL.
708
  *
709
- * @since 3.0.0
710
- * @since 3.2.4 1. Now considers query arguments when using pretty permalinks.
711
- * 2. The second and third parameters are now optional.
712
- * @since 4.2.0 Now properly adds pagination to search links.
713
- * @TODO call this add_pagination_to_url()? Or call remove_pagination_from_url() remove_url_pagination()?
714
  *
715
  * @param string $url The fully qualified URL.
716
  * @param int $page The page number. Should be bigger than 1 to paginate.
@@ -720,7 +697,7 @@ class Generate_Url extends Generate_Title {
720
  * False on singular post types.
721
  * @return string The fully qualified URL with pagination.
722
  */
723
- public function add_url_pagination( $url, $page = null, $use_base = null ) {
724
 
725
  $page = $page ?? max( $this->paged(), $this->page() );
726
 
@@ -759,6 +736,27 @@ class Generate_Url extends Generate_Title {
759
  return $url;
760
  }
761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  /**
763
  * Removes pagination from input URL.
764
  * The URL must match this query if no second parameter is provided.
@@ -784,11 +782,9 @@ class Generate_Url extends Generate_Title {
784
 
785
  if ( $this->pretty_permalinks ) {
786
 
787
- $_page = $page ?? max( $this->paged(), $this->page() );
788
-
789
- if ( $_page > 1 ) {
790
- $_url = $url;
791
 
 
792
  $_use_base = $use_base ?? (
793
  $this->is_real_front_page() || $this->is_archive() || $this->is_singular_archive() || $this->is_search()
794
  );
@@ -796,30 +792,26 @@ class Generate_Url extends Generate_Title {
796
  $user_slash = ( $GLOBALS['wp_rewrite']->use_trailing_slashes ? '/' : '' );
797
 
798
  if ( $_use_base ) {
799
- $find = "/{$GLOBALS['wp_rewrite']->pagination_base}/{$_page}{$user_slash}";
800
  } else {
801
- $find = "/{$_page}{$user_slash}";
802
  }
803
 
804
- $_query = parse_url( $_url, PHP_URL_QUERY );
805
  // Remove queries, add them back later.
806
  if ( $_query )
807
- $_url = $this->s_url( $_url );
808
 
809
- $pos = strrpos( $_url, $find );
810
  // Defensive programming, only remove if $find matches the stack length, without query arguments.
811
- $continue = $pos && $pos + \strlen( $find ) === \strlen( $_url );
812
-
813
- if ( $continue ) {
814
- $_url = substr( $_url, 0, $pos );
815
- $_url = \user_trailingslashit( $_url );
816
 
817
  // Add back the query.
818
  if ( $_query )
819
- $_url = $this->append_url_query( $_url, $_query );
820
  }
821
-
822
- $url = $_url;
823
  }
824
  } else {
825
  $url = \remove_query_arg( [ 'page', 'paged', 'cpage' ], $url );
@@ -841,11 +833,10 @@ class Generate_Url extends Generate_Title {
841
  * @return \WP_Term The primary term.
842
  */
843
  public function _adjust_post_link_category( $term, $terms = null, $post = null ) {
844
-
845
- if ( null === $post )
846
- $post = \get_post( $this->get_the_real_ID() );
847
-
848
- return $this->get_primary_term( $post->ID, $term->taxonomy ) ?: $term;
849
  }
850
 
851
  /**
@@ -998,11 +989,11 @@ class Generate_Url extends Generate_Title {
998
 
999
  // If this page is not the last, create a next-URL.
1000
  if ( $page + 1 <= $_numpages )
1001
- $next = $this->add_url_pagination( $canonical_url, $page + 1 );
1002
 
1003
  // If this page is not the first, create a prev-URL.
1004
  if ( $page > 1 )
1005
- $prev = $this->add_url_pagination( $canonical_url, $page - 1 );
1006
 
1007
  end:;
1008
 
@@ -1066,7 +1057,7 @@ class Generate_Url extends Generate_Title {
1066
  * Always adds http prefix, not https.
1067
  *
1068
  * NOTE: Expects the URL to have either a scheme, or a relative scheme set.
1069
- * Domain-relative URLs aren't parsed correctly.
1070
  * '/path/to/folder/` will become `http:///path/to/folder/`
1071
  *
1072
  * @since 2.6.5
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
100
  */
101
  public function get_current_permalink() {
102
  return memo() ?? memo(
103
+ $this->get_canonical_url( [
104
  'id' => $this->get_the_real_ID(),
105
  'taxonomy' => $this->get_current_taxonomy(),
106
  ] )
117
  */
118
  public function get_homepage_permalink() {
119
  return memo() ?? memo(
120
+ $this->get_canonical_url( [ 'id' => $this->get_the_front_page_ID() ] )
121
  );
122
  }
123
 
128
  * @since 3.0.0
129
  * @since 4.0.0 Now preemptively fixes the generation arguments, for easier implementation.
130
  * @since 4.2.0 Now supports the `$args['pta']` index.
131
+ * @since 4.2.3 Marked for deprecation.
132
+ * @todo deprecate me.
133
  * @uses $this->get_canonical_url()
134
  *
135
  * @param array $args The canonical URL arguments : {
141
  * @return string The canonical URL, if any.
142
  */
143
  public function create_canonical_url( $args = [] ) {
 
 
 
 
 
 
 
 
144
  return $this->get_canonical_url( $args );
145
  }
146
 
150
  *
151
  * @since 3.0.0
152
  * @since 4.2.0 Now supports the `$args['pta']` index.
153
+ * @since 4.2.3 Now accepts arguments publicly.
154
  *
155
+ * @param array|null $args The canonical URL arguments, leave null to autodetermine query : {
156
+ * int $id The Post, Page or Term ID to generate the URL for.
157
+ * string $taxonomy The taxonomy.
158
+ * string $pta The pta.
159
+ * bool $get_custom_field Whether to get custom canonical URLs from user settings.
160
+ * }
161
  * @return string The canonical URL, if any.
162
  */
163
  public function get_canonical_url( $args = null ) {
164
 
165
  if ( $args ) {
166
+ $args += [
167
+ 'id' => 0,
168
+ 'taxonomy' => '',
169
+ 'pta' => '',
170
+ 'get_custom_field' => false,
171
+ ];
172
+
173
+ // See and use `$this->get_canonical_url()` instead.
174
+ $url = $this->build_canonical_url( $args );
175
+
176
+ if ( $args['id'] === $this->get_the_real_ID() )
177
+ $url = $this->remove_pagination_from_url( $url );
178
  } else {
179
+ $url = $this->generate_canonical_url();
 
180
  }
181
 
182
+ if ( ! $url )
183
  return '';
184
 
185
+ if ( $this->matches_this_domain( $url ) )
186
+ $url = $this->set_preferred_url_scheme( $url );
187
 
188
+ return $this->clean_canonical_url( $url );
 
 
 
189
  }
190
 
191
  /**
195
  * @since 3.2.2 Now tests for the homepage as page prior getting custom field data.
196
  * @since 4.0.0 Can now fetch custom canonical URL for terms.
197
  * @since 4.2.0 Now supports the `$args['pta']` index.
198
+ * @see $this->get_canonical_url()
199
  *
200
+ * @param array $args Required. Use $this->get_canonical_url().
201
  * @return string The canonical URL.
202
  */
203
  protected function build_canonical_url( $args ) {
325
  if ( $this->has_page_on_front() ) {
326
  if ( $this->is_static_frontpage( $query_id ) ) {
327
  // Yes, use the pagination base for the homepage-as-page!
328
+ $url = $this->add_pagination_to_url( $url, $this->page(), true );
329
  }
330
  } elseif ( (int) \get_option( 'page_for_posts' ) === $query_id ) {
331
+ $url = $this->add_pagination_to_url( $url, $this->paged(), true );
332
  }
333
 
334
  return $this->slash_root_url( $url );
368
  * @since 4.0.5 Now passes the `$id` to `is_singular_archive()`
369
  * @since 4.2.0 1. Added memoization.
370
  * 2. When the $id isn't set, the URL won't get tested for pagination issues.
371
+ * @since 4.2.3 Rectified pagination removal issue. No longer adds pagination when $post_id is null.
372
  *
373
+ * @param int|null $post_id The page ID. Leave null to autodetermine.
374
  * @return string The custom canonical URL, if any.
375
  */
376
+ public function get_singular_canonical_url( $post_id = null ) {
377
 
378
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
379
+ if ( null !== $memo = umemo( __METHOD__, null, $post_id ) ) return $memo;
380
 
381
  $url = \wp_get_canonical_url(
382
+ $post_id ?? $this->get_the_real_ID()
383
  ) ?: '';
384
 
385
  if ( ! $url ) return '';
386
 
387
+ $_page = \get_query_var( 'page', 1 ) ?: 1;
388
+ // Remove undesired/fake pagination. See: <https://core.trac.wordpress.org/ticket/37505>
389
+ if ( $_page > 1 && $_page !== $this->page() )
390
+ $url = $this->remove_pagination_from_url( $url, $_page, false );
 
 
 
391
 
392
+ // Singular archives, like blog pages and shop pages, use the pagination base with 'paged'.
393
+ // wp_get_canonical_url() only tests 'page'. Fix that:
394
+ if ( null === $post_id && $this->is_singular_archive() )
395
+ $url = $this->add_pagination_to_url( $url, $this->paged(), true );
 
396
 
397
+ return umemo( __METHOD__, $url, $post_id );
398
  }
399
 
400
  /**
447
  if ( \is_wp_error( $url ) )
448
  return umemo( __METHOD__, '', $term_id, $taxonomy );
449
 
450
+ if ( null === $term_id )
451
+ $url = $this->add_pagination_to_url( $url, $this->paged(), true );
 
 
 
 
452
 
453
  return umemo( __METHOD__, $url, $term_id, $taxonomy );
454
  }
463
  * 2. Removed argument type deprecation doing it wrong warning.
464
  *
465
  * @param null|string $post_type The post type archive's post type.
466
+ * Leave null to autodetermine query and allow pagination.
467
  * @return string The post type archive canonical URL, if any.
468
  */
469
  public function get_post_type_archive_canonical_url( $post_type = null ) {
470
 
471
+ $url = \get_post_type_archive_link( $post_type ?? $this->get_current_post_type() );
 
 
 
 
 
472
 
473
+ if ( ! $url ) return '';
 
 
 
474
 
475
+ return null === $post_type
476
+ ? $this->add_pagination_to_url( $url, $this->paged(), true )
477
+ : $url;
478
  }
479
 
480
  /**
495
  if ( ! $url ) return '';
496
 
497
  return null === $id
498
+ ? $this->add_pagination_to_url( $url, $this->paged(), true )
499
  : $url;
500
  }
501
 
530
  case 'day':
531
  $_day = \get_query_var( 'day' );
532
  $_paginate = $_paginate && $_day == $day; // phpcs:ignore, WordPress.PHP.StrictComparisons.LooseComparison
533
+ // No break. Test month too.
534
 
535
  case 'month':
536
  $_month = \get_query_var( 'monthnum' );
537
  $_paginate = $_paginate && $_month == $month; // phpcs:ignore, WordPress.PHP.StrictComparisons.LooseComparison
538
+ // No break. Test year too.
539
 
540
  case 'year':
541
  $_year = \get_query_var( 'year' );
545
 
546
  if ( $_paginate ) {
547
  // Adds pagination if input matches query.
548
+ $link = $this->add_pagination_to_url( $link, $this->paged(), true );
549
  }
550
 
551
  return $link;
560
  * 2. The search term is now matched with the input query if not set,
561
  * instead of it being empty.
562
  *
563
+ * @param string $search_query The search query. Mustn't be escaped.
564
+ * When left empty, the current query will be used.
565
  * @return string The search link.
566
  */
567
+ public function get_search_canonical_url( $search_query = null ) {
568
 
569
+ $url = \get_search_link( $search_query ?? \get_search_query( false ) );
 
 
 
 
 
570
 
571
+ if ( ! $url ) return '';
 
 
 
 
 
572
 
573
+ return null === $search_query
574
+ ? $this->add_pagination_to_url( $url, $this->paged(), true )
575
+ : $url;
576
  }
577
 
578
  /**
590
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
591
  if ( null !== $memo = memo() ) return $memo;
592
 
593
+ $scheme = $this->get_option( 'canonical_scheme' );
 
 
 
594
 
595
+ switch ( $scheme ) :
596
+ case 'https':
597
  case 'http':
 
598
  break;
599
 
600
  default:
687
  /**
688
  * Adds pagination to input URL.
689
  *
690
+ * @since 4.2.3
 
 
 
 
691
  *
692
  * @param string $url The fully qualified URL.
693
  * @param int $page The page number. Should be bigger than 1 to paginate.
697
  * False on singular post types.
698
  * @return string The fully qualified URL with pagination.
699
  */
700
+ public function add_pagination_to_url( $url, $page = null, $use_base = null ) {
701
 
702
  $page = $page ?? max( $this->paged(), $this->page() );
703
 
736
  return $url;
737
  }
738
 
739
+ /**
740
+ * Adds pagination to input URL.
741
+ *
742
+ * @since 3.0.0
743
+ * @since 3.2.4 1. Now considers query arguments when using pretty permalinks.
744
+ * 2. The second and third parameters are now optional.
745
+ * @since 4.2.0 Now properly adds pagination to search links.
746
+ * @todo deprecate
747
+ *
748
+ * @param string $url The fully qualified URL.
749
+ * @param int $page The page number. Should be bigger than 1 to paginate.
750
+ * @param bool $use_base Whether to use pagination base.
751
+ * If null, it will autodetermine.
752
+ * Should be true on archives and the homepage (blog and static!).
753
+ * False on singular post types.
754
+ * @return string The fully qualified URL with pagination.
755
+ */
756
+ public function add_url_pagination( $url, $page = null, $use_base = null ) {
757
+ return $this->add_pagination_to_url( $url, $page, $use_base );
758
+ }
759
+
760
  /**
761
  * Removes pagination from input URL.
762
  * The URL must match this query if no second parameter is provided.
782
 
783
  if ( $this->pretty_permalinks ) {
784
 
785
+ $page = $page ?? max( $this->paged(), $this->page() );
 
 
 
786
 
787
+ if ( $page > 1 ) {
788
  $_use_base = $use_base ?? (
789
  $this->is_real_front_page() || $this->is_archive() || $this->is_singular_archive() || $this->is_search()
790
  );
792
  $user_slash = ( $GLOBALS['wp_rewrite']->use_trailing_slashes ? '/' : '' );
793
 
794
  if ( $_use_base ) {
795
+ $find = "/{$GLOBALS['wp_rewrite']->pagination_base}/{$page}{$user_slash}";
796
  } else {
797
+ $find = "/{$page}{$user_slash}";
798
  }
799
 
800
+ $_query = parse_url( $url, PHP_URL_QUERY );
801
  // Remove queries, add them back later.
802
  if ( $_query )
803
+ $url = $this->s_url( $url );
804
 
805
+ $pos = strrpos( $url, $find );
806
  // Defensive programming, only remove if $find matches the stack length, without query arguments.
807
+ if ( $pos && $pos + \strlen( $find ) === \strlen( $url ) ) {
808
+ $url = substr( $url, 0, $pos );
809
+ $url = \user_trailingslashit( $url );
 
 
810
 
811
  // Add back the query.
812
  if ( $_query )
813
+ $url = $this->append_url_query( $url, $_query );
814
  }
 
 
815
  }
816
  } else {
817
  $url = \remove_query_arg( [ 'page', 'paged', 'cpage' ], $url );
833
  * @return \WP_Term The primary term.
834
  */
835
  public function _adjust_post_link_category( $term, $terms = null, $post = null ) {
836
+ return $this->get_primary_term(
837
+ ( $post ?? \get_post( $this->get_the_real_ID() ) )->ID,
838
+ $term->taxonomy
839
+ ) ?: $term;
 
840
  }
841
 
842
  /**
989
 
990
  // If this page is not the last, create a next-URL.
991
  if ( $page + 1 <= $_numpages )
992
+ $next = $this->add_pagination_to_url( $canonical_url, $page + 1 );
993
 
994
  // If this page is not the first, create a prev-URL.
995
  if ( $page > 1 )
996
+ $prev = $this->add_pagination_to_url( $canonical_url, $page - 1 );
997
 
998
  end:;
999
 
1057
  * Always adds http prefix, not https.
1058
  *
1059
  * NOTE: Expects the URL to have either a scheme, or a relative scheme set.
1060
+ * Domain-relative URLs will not be parsed correctly.
1061
  * '/path/to/folder/` will become `http:///path/to/folder/`
1062
  *
1063
  * @since 2.6.5
inc/classes/generate.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -44,6 +44,7 @@ class Generate extends User_Data {
44
  * 2. Removed isset() check -- we now expect incomplete $args, always.
45
  * 3. Improved performance by 60% switching from array_merge to array_union.
46
  * @internal
 
47
  *
48
  * @param array|int|null $args The arguments, passed by reference.
49
  */
@@ -376,10 +377,8 @@ class Generate extends User_Data {
376
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
377
  if ( null !== $memo = memo() ) return $memo;
378
 
379
- $id = $this->get_the_real_ID();
380
-
381
- $post = \get_post( $id );
382
- $post_modified_gmt = $post->post_modified_gmt;
383
 
384
  return memo(
385
  '0000-00-00 00:00:00' === $post_modified_gmt
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
44
  * 2. Removed isset() check -- we now expect incomplete $args, always.
45
  * 3. Improved performance by 60% switching from array_merge to array_union.
46
  * @internal
47
+ * @todo Remove support for non-array input. Integers' been silently deprecated since 2018. Announce deprecation first?
48
  *
49
  * @param array|int|null $args The arguments, passed by reference.
50
  */
377
  // phpcs:ignore, WordPress.CodeAnalysis.AssignmentInCondition -- I know.
378
  if ( null !== $memo = memo() ) return $memo;
379
 
380
+ $id = $this->get_the_real_ID();
381
+ $post_modified_gmt = \get_post( $id )->post_modified_gmt;
 
 
382
 
383
  return memo(
384
  '0000-00-00 00:00:00' === $post_modified_gmt
inc/classes/init.class.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/internal/debug.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Internal;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -375,38 +375,6 @@ final class Debug {
375
  \tsf()->get_view( 'debug/output' );
376
  }
377
 
378
- /**
379
- * Wrap debug key in a colored span.
380
- *
381
- * @since 2.3.9
382
- * @since 3.1.0 1. Removed second parameter.
383
- * 2. Now is protected.
384
- *
385
- * @param string $key The debug key.
386
- * @return string
387
- */
388
- protected function debug_key_wrapper( $key ) {
389
- return '<font color="chucknorris">' . \esc_html( $key ) . '</font>';
390
- }
391
-
392
- /**
393
- * Wrap debug value in a colored span.
394
- *
395
- * @since 2.3.9
396
- * @since 3.1.0 1. Removed second parameter.
397
- * 2. Now is protected.
398
- *
399
- * @param string $value The debug value.
400
- * @return string
401
- */
402
- protected function debug_value_wrapper( $value ) {
403
-
404
- if ( ! is_scalar( $value ) )
405
- return '<em>Debug message: not scalar</em>';
406
-
407
- return '<span class="wp-ui-notification">' . \esc_html( trim( $value ) ) . '</span>';
408
- }
409
-
410
  /**
411
  * Outputs the debug header.
412
  *
@@ -445,17 +413,17 @@ final class Debug {
445
  $tsf->html_output();
446
  $output = ob_get_clean();
447
 
448
- $timer = '<div style="display:inline-block;width:100%;padding:20px;border-bottom:1px solid #ccc;">Generated in: ' . number_format( microtime( true ) - $t, 5 ) . ' seconds</div>';
449
 
450
  $title = \is_admin() ? 'Expected SEO Output' : 'Determined SEO Output';
451
- $title = '<div style="display:inline-block;width:100%;padding:20px;margin:0 auto;border-bottom:1px solid #ccc;"><h2 style="color:#ddd;font-size:22px;padding:0;margin:0">' . $title . '</h2></div>';
452
 
453
  // Escape it, replace EOL with breaks, and style everything between quotes (which are ending with space).
454
  $output = str_replace( PHP_EOL, '<br>' . PHP_EOL, \esc_html( str_replace( str_repeat( ' ', 4 ), str_repeat( '&nbsp;', 4 ), $output ) ) );
455
  $output = preg_replace( '/(&quot;.*?&quot;)(\s|&nbps;)/', '<font color="arnoldschwarzenegger">$1</font> ', $output );
456
 
457
  $output = '<div style="display:inline-block;width:100%;padding:20px;font-family:Consolas,Monaco,monospace;font-size:14px;">' . $output . '</div>';
458
- $output = '<div style="display:block;width:100%;background:#23282D;color:#ddd;border-bottom:1px solid #ccc">' . $title . $timer . $output . '</div>';
459
 
460
  return $output;
461
  }
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
375
  \tsf()->get_view( 'debug/output' );
376
  }
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  /**
379
  * Outputs the debug header.
380
  *
413
  $tsf->html_output();
414
  $output = ob_get_clean();
415
 
416
+ $timer = '<div style="font-family:unset;display:inline-block;width:100%;padding:20px;border-bottom:1px solid #ccc;">Generated in: ' . number_format( microtime( true ) - $t, 5 ) . ' seconds</div>';
417
 
418
  $title = \is_admin() ? 'Expected SEO Output' : 'Determined SEO Output';
419
+ $title = '<div style="display:inline-block;width:100%;padding:20px;margin:0 auto;border-bottom:1px solid #ccc;"><h2 style="font-family:unset;color:#ddd;font-size:22px;padding:0;margin:0">' . $title . '</h2></div>';
420
 
421
  // Escape it, replace EOL with breaks, and style everything between quotes (which are ending with space).
422
  $output = str_replace( PHP_EOL, '<br>' . PHP_EOL, \esc_html( str_replace( str_repeat( ' ', 4 ), str_repeat( '&nbsp;', 4 ), $output ) ) );
423
  $output = preg_replace( '/(&quot;.*?&quot;)(\s|&nbps;)/', '<font color="arnoldschwarzenegger">$1</font> ', $output );
424
 
425
  $output = '<div style="display:inline-block;width:100%;padding:20px;font-family:Consolas,Monaco,monospace;font-size:14px;">' . $output . '</div>';
426
+ $output = '<div style="font-family:unset;display:block;width:100%;background:#23282D;color:#ddd;border-bottom:1px solid #ccc">' . $title . $timer . $output . '</div>';
427
 
428
  return $output;
429
  }
inc/classes/internal/deprecated.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Internal;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/internal/silencer.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Internal;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/interpreters/form.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Interpreters;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/interpreters/html.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Interpreters;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/interpreters/markdown.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Interpreters;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/interpreters/seobar.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Interpreters;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/interpreters/settings-input.class.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Interpreters;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2021 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/load.class.php CHANGED
@@ -11,7 +11,7 @@ namespace The_SEO_Framework;
11
 
12
  /**
13
  * The SEO Framework plugin
14
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
15
  *
16
  * This program is free software: you can redistribute it and/or modify
17
  * it under the terms of the GNU General Public License version 3 as published
@@ -84,7 +84,7 @@ final class Load extends Cache {
84
  */
85
  public function __construct() {
86
 
87
- if ( _has_run( __METHOD__ ) ) {
88
  // Don't construct twice, warn developer.
89
  $this->_doing_it_wrong( __METHOD__, 'Do not instance this class. Use function <code>tsf()</code> instead.', '3.1.0' );
90
  return null;
11
 
12
  /**
13
  * The SEO Framework plugin
14
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
15
  *
16
  * This program is free software: you can redistribute it and/or modify
17
  * it under the terms of the GNU General Public License version 3 as published
84
  */
85
  public function __construct() {
86
 
87
+ if ( has_run( __METHOD__ ) ) {
88
  // Don't construct twice, warn developer.
89
  $this->_doing_it_wrong( __METHOD__, 'Do not instance this class. Use function <code>tsf()</code> instead.', '3.1.0' );
90
  return null;
inc/classes/post-data.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/query.class.php CHANGED
@@ -9,7 +9,7 @@ namespace The_SEO_Framework;
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/render.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -952,7 +952,6 @@ class Render extends Admin_Init {
952
  * @return string The LD+json Schema.org scripts.
953
  */
954
  public function ld_json() {
955
-
956
  /**
957
  * @since 2.6.0
958
  * @param string $json The JSON output. Must be escaped.
@@ -977,7 +976,6 @@ class Render extends Admin_Init {
977
  * @return string The Google Site Verification code meta tag.
978
  */
979
  public function google_site_output() {
980
-
981
  /**
982
  * @since 2.6.0
983
  * @param string $code The Google verification code.
@@ -1005,7 +1003,6 @@ class Render extends Admin_Init {
1005
  * @return string The Bing Site Verification Code meta tag.
1006
  */
1007
  public function bing_site_output() {
1008
-
1009
  /**
1010
  * @since 2.6.0
1011
  * @param string $code The Bing verification code.
@@ -1033,7 +1030,6 @@ class Render extends Admin_Init {
1033
  * @return string The Yandex Site Verification code meta tag.
1034
  */
1035
  public function yandex_site_output() {
1036
-
1037
  /**
1038
  * @since 2.6.0
1039
  * @param string $code The Yandex verification code.
@@ -1061,7 +1057,6 @@ class Render extends Admin_Init {
1061
  * @return string The Baidu Site Verification code meta tag.
1062
  */
1063
  public function baidu_site_output() {
1064
-
1065
  /**
1066
  * @since 4.0.5
1067
  * @param string $code The Baidu verification code.
@@ -1089,7 +1084,6 @@ class Render extends Admin_Init {
1089
  * @return string The Pinterest Site Verification code meta tag.
1090
  */
1091
  public function pint_site_output() {
1092
-
1093
  /**
1094
  * @since 2.6.0
1095
  * @param string $code The Pinterest verification code.
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
952
  * @return string The LD+json Schema.org scripts.
953
  */
954
  public function ld_json() {
 
955
  /**
956
  * @since 2.6.0
957
  * @param string $json The JSON output. Must be escaped.
976
  * @return string The Google Site Verification code meta tag.
977
  */
978
  public function google_site_output() {
 
979
  /**
980
  * @since 2.6.0
981
  * @param string $code The Google verification code.
1003
  * @return string The Bing Site Verification Code meta tag.
1004
  */
1005
  public function bing_site_output() {
 
1006
  /**
1007
  * @since 2.6.0
1008
  * @param string $code The Bing verification code.
1030
  * @return string The Yandex Site Verification code meta tag.
1031
  */
1032
  public function yandex_site_output() {
 
1033
  /**
1034
  * @since 2.6.0
1035
  * @param string $code The Yandex verification code.
1057
  * @return string The Baidu Site Verification code meta tag.
1058
  */
1059
  public function baidu_site_output() {
 
1060
  /**
1061
  * @since 4.0.5
1062
  * @param string $code The Baidu verification code.
1084
  * @return string The Pinterest Site Verification code meta tag.
1085
  */
1086
  public function pint_site_output() {
 
1087
  /**
1088
  * @since 2.6.0
1089
  * @param string $code The Pinterest verification code.
inc/classes/sanitize.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
@@ -176,7 +176,7 @@ class Sanitize extends Admin_Pages {
176
  */
177
  public function init_sanitizer_filters() {
178
 
179
- if ( _has_run( __METHOD__ ) ) return;
180
 
181
  $this->add_option_filter(
182
  's_title_separator',
@@ -1418,7 +1418,6 @@ class Sanitize extends Admin_Pages {
1418
  * of entities in HTML input value attributes.
1419
  *
1420
  * @since 4.0.0
1421
- * TODO a better name would've been "esc_attr_revert_amp"...?
1422
  *
1423
  * @param string $new_value String with possibly ampersands.
1424
  * @return string
@@ -2133,4 +2132,23 @@ class Sanitize extends Admin_Pages {
2133
 
2134
  return \strlen( $var = trim( $value ) );
2135
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2136
  }
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
176
  */
177
  public function init_sanitizer_filters() {
178
 
179
+ if ( has_run( __METHOD__ ) ) return;
180
 
181
  $this->add_option_filter(
182
  's_title_separator',
1418
  * of entities in HTML input value attributes.
1419
  *
1420
  * @since 4.0.0
 
1421
  *
1422
  * @param string $new_value String with possibly ampersands.
1423
  * @return string
2132
 
2133
  return \strlen( $var = trim( $value ) );
2134
  }
2135
+
2136
+ /**
2137
+ * Sets string value if current variable has no content. Returns boolean value if it has any length.
2138
+ *
2139
+ * Can be used to loop via or statements -- here, $title will be set to 'two' if $usertitle is empty:
2140
+ * e.g. strlen_or_set( $title, trim( $usertitle ) ) || strlen_or_set( $title, 'two' );
2141
+ *
2142
+ * @since 4.2.3
2143
+ * @ignore unused. untested. Creates super-smelly code, but fixes bugs revolving around input '0' or ' '.
2144
+ * We'd prefer a native PHP "string has length" comparison operator.
2145
+ * I don't believe any language has this. Then again, many languages don't see '0' as false.
2146
+ *
2147
+ * @param variable $var The variable to set. Passed by reference.
2148
+ * @param string $value The value to set if $var has no string length.
2149
+ * @return bool True if content has any length.
2150
+ */
2151
+ protected function strlen_or_set( &$var, $value ) {
2152
+ return (bool) ( \strlen( $var ) ?: \strlen( $var = $value ) );
2153
+ }
2154
  }
inc/classes/site-options.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/term-data.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/classes/user-data.class.php CHANGED
@@ -10,7 +10,7 @@ namespace The_SEO_Framework;
10
 
11
  /**
12
  * The SEO Framework plugin
13
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
10
 
11
  /**
12
  * The SEO Framework plugin
13
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
14
  *
15
  * This program is free software: you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License version 3 as published
inc/functions/api.php CHANGED
@@ -9,7 +9,7 @@ namespace {
9
 
10
  /**
11
  * The SEO Framework plugin
12
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
@@ -34,6 +34,7 @@ namespace {
34
  *
35
  * @since 4.2.0
36
  * @see `the_seo_framework()` alias.
 
37
  *
38
  * @return null|object The plugin class object.
39
  */
@@ -50,6 +51,7 @@ namespace {
50
  *
51
  * @since 2.2.5
52
  * @see `tsf()` alias.
 
53
  *
54
  * @return null|object The plugin class object.
55
  */
@@ -62,6 +64,7 @@ namespace {
62
  *
63
  * @since 3.1.0
64
  * @since 3.1.2 Now casts to string.
 
65
  *
66
  * @return string The database version. '0' if version isn't found.
67
  */
@@ -75,6 +78,7 @@ namespace {
75
  * @since 2.7.0
76
  * @since 2.8.0 Added `did_action()` check.
77
  * @since 4.2.0 Removed memoization.
 
78
  *
79
  * @return string|bool The SEO Framework class name. False if The SEO Framework isn't loaded (yet).
80
  */
@@ -89,67 +93,19 @@ namespace {
89
  }
90
 
91
  namespace The_SEO_Framework {
92
- /**
93
- * Determines whether this plugin should load.
94
- * Memoizes the return value.
95
- *
96
- * @since 2.8.0
97
- * @access private
98
- * @action plugins_loaded
99
- *
100
- * @return bool Whether to allow loading of plugin.
101
- */
102
- function _can_load() {
103
- static $load = null;
104
- /**
105
- * @since 2.3.7
106
- * @param bool $load
107
- */
108
- return $load = $load ?? (bool) \apply_filters( 'the_seo_framework_load', true );
109
- }
110
-
111
- /**
112
- * Requires trait files, only once per request.
113
- *
114
- * @since 3.1.0
115
- * @uses THE_SEO_FRAMEWORK_DIR_PATH_TRAIT
116
- * @access private
117
- *
118
- * @param string $file Where the trait is for. Must be lowercase.
119
- * @return bool True if loaded, false otherwise.
120
- */
121
- function _load_trait( $file ) {
122
- static $loaded = [];
123
- return $loaded[ $file ] = $loaded[ $file ]
124
- ?? (bool) require THE_SEO_FRAMEWORK_DIR_PATH_TRAIT . str_replace( '/', DIRECTORY_SEPARATOR, $file ) . '.trait.php';
125
- }
126
-
127
  /**
128
  * Determines if the method or function has already run.
129
  *
130
- * @since 3.1.0
131
- * @access private
 
132
  *
133
  * @param string $caller The method or function that calls this.
134
  * @return bool True if already called, false otherwise.
135
  */
136
- function _has_run( $caller ) {
137
- static $runners = [];
138
- return $runners[ $caller ] ?? ! ( $runners[ $caller ] = true );
139
- }
140
-
141
- /**
142
- * Adds and returns-to the memoized bootstrap timer.
143
- *
144
- * @since 4.0.0
145
- * @access private
146
- *
147
- * @param int $add The time to add.
148
- * @return int The accumulated time, roughly.
149
- */
150
- function _bootstrap_timer( $add = 0 ) {
151
- static $time = 0;
152
- return $time += $add;
153
  }
154
 
155
  /**
@@ -194,6 +150,7 @@ namespace The_SEO_Framework {
194
  * @since 4.2.0
195
  * @see umemo() -- sacrifices cleanliness for performance.
196
  * @see fmemo() -- sacrifices everything for readability.
 
197
  *
198
  * @param mixed $value_to_set The value to set.
199
  * @param mixed ...$args Extra arguments, that are used to differentiaty callbacks.
@@ -238,7 +195,7 @@ namespace The_SEO_Framework {
238
  * return $arg * 2;
239
  * }
240
  * function my_function( $arg ) {
241
- * return umemo( 'something', null, $arg );
242
  * ?? umemo( __METHOD__, expensive_call( $arg ), $arg );
243
  * }
244
  * my_function( 1 ); // prints "expensive 1!", returns 2.
@@ -249,8 +206,10 @@ namespace The_SEO_Framework {
249
  * @since 4.2.0
250
  * @see memo() -- sacrifices performance for cleanliness.
251
  * @see fmemo() -- sacrifices everything for readability.
 
252
  *
253
  * @param string $key The key you want to use to memoize. It's best to use the method name.
 
254
  * @param mixed $value_to_set The value to set.
255
  * @param mixed ...$args Extra arguments, that are used to differentiate callbacks.
256
  * Arguments may not contain \Closure()s.
@@ -300,6 +259,7 @@ namespace The_SEO_Framework {
300
  * @see memo() -- sacrifices performance for cleanliness.
301
  * @see umemo() -- sacrifices cleanliness for performance.
302
  * @ignore We couldn't find a use for this... yet. Probably once we support only PHP7.4+
 
303
  *
304
  * @param \Closure $fn The Closure or function to memoize.
305
  * @return mixed : {
@@ -312,7 +272,7 @@ namespace The_SEO_Framework {
312
 
313
  static $memo = [];
314
 
315
- // phpcs:ignore, WordPress.PHP.DiscouragedPHPFunctions -- This is ever unserialized.
316
  $hash = serialize(
317
  [
318
  'file' => '',
9
 
10
  /**
11
  * The SEO Framework plugin
12
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
13
  *
14
  * This program is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License version 3 as published
34
  *
35
  * @since 4.2.0
36
  * @see `the_seo_framework()` alias.
37
+ * @api
38
  *
39
  * @return null|object The plugin class object.
40
  */
51
  *
52
  * @since 2.2.5
53
  * @see `tsf()` alias.
54
+ * @api
55
  *
56
  * @return null|object The plugin class object.
57
  */
64
  *
65
  * @since 3.1.0
66
  * @since 3.1.2 Now casts to string.
67
+ * @api
68
  *
69
  * @return string The database version. '0' if version isn't found.
70
  */
78
  * @since 2.7.0
79
  * @since 2.8.0 Added `did_action()` check.
80
  * @since 4.2.0 Removed memoization.
81
+ * @api
82
  *
83
  * @return string|bool The SEO Framework class name. False if The SEO Framework isn't loaded (yet).
84
  */
93
  }
94
 
95
  namespace The_SEO_Framework {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * Determines if the method or function has already run.
98
  *
99
+ * @since 4.2.3
100
+ * @api
101
+ * @todo make $caller optional and use debug_backtrace()?
102
  *
103
  * @param string $caller The method or function that calls this.
104
  * @return bool True if already called, false otherwise.
105
  */
106
+ function has_run( $caller ) {
107
+ static $ran = [];
108
+ return $ran[ $caller ] ?? ! ( $ran[ $caller ] = true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
  /**
150
  * @since 4.2.0
151
  * @see umemo() -- sacrifices cleanliness for performance.
152
  * @see fmemo() -- sacrifices everything for readability.
153
+ * @api
154
  *
155
  * @param mixed $value_to_set The value to set.
156
  * @param mixed ...$args Extra arguments, that are used to differentiaty callbacks.
195
  * return $arg * 2;
196
  * }
197
  * function my_function( $arg ) {
198
+ * return umemo( __METHOD__, null, $arg );
199
  * ?? umemo( __METHOD__, expensive_call( $arg ), $arg );
200
  * }
201
  * my_function( 1 ); // prints "expensive 1!", returns 2.
206
  * @since 4.2.0
207
  * @see memo() -- sacrifices performance for cleanliness.
208
  * @see fmemo() -- sacrifices everything for readability.
209
+ * @api
210
  *
211
  * @param string $key The key you want to use to memoize. It's best to use the method name.
212
+ * You can share a unique key between various functions.
213
  * @param mixed $value_to_set The value to set.
214
  * @param mixed ...$args Extra arguments, that are used to differentiate callbacks.
215
  * Arguments may not contain \Closure()s.
259
  * @see memo() -- sacrifices performance for cleanliness.
260
  * @see umemo() -- sacrifices cleanliness for performance.
261
  * @ignore We couldn't find a use for this... yet. Probably once we support only PHP7.4+
262
+ * @api
263
  *
264
  * @param \Closure $fn The Closure or function to memoize.
265
  * @return mixed : {
272
 
273
  static $memo = [];
274
 
275
+ // phpcs:ignore, WordPress.PHP.DiscouragedPHPFunctions -- This is never unserialized.
276
  $hash = serialize(
277
  [
278
  'file' => '',
inc/functions/deprecated.php CHANGED
@@ -6,7 +6,7 @@
6
 
7
  /**
8
  * The SEO Framework plugin
9
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
10
  *
11
  * This program is free software: you can redistribute it and/or modify
12
  * it under the terms of the GNU General Public License version 3 as published
6
 
7
  /**
8
  * The SEO Framework plugin
9
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
10
  *
11
  * This program is free software: you can redistribute it and/or modify
12
  * it under the terms of the GNU General Public License version 3 as published
inc/functions/upgrade-suggestion.php CHANGED
@@ -8,7 +8,7 @@ namespace The_SEO_Framework\Suggestion;
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
inc/views/debug/output.php CHANGED
@@ -34,8 +34,8 @@ if ( is_admin() ) {
34
  ? 'direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 200px );min-height:700px;padding:0;margin:20px 180px 40px 20px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18pxfont-feature-settings:normal;font-variant:normal'
35
  : 'direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 200px );min-height:700px;padding:0;margin:20px 20px 40px 180px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18pxfont-feature-settings:normal;font-variant:normal';
36
  ?>
37
- <div style="<?php echo $bstyle; // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
38
- <h3 style="font-size:14px;padding:0 12px;margin:0;line-height:39px;border-bottom:2px solid #aaa;position:absolute;z-index:9002;width:100%;right:0;left:0;top:0;background:#fff;border-radius:3px 3px 0 0;height:39px;">
39
  SEO Debug Information
40
  <?php
41
  if ( $this->is_post_edit() || $this->is_term_edit() ) :
@@ -60,7 +60,7 @@ if ( is_admin() ) {
60
  ?>
61
  <style type="text/css">.wp-ui-notification{color:#fff;background-color:#d54e21}.code.highlight{font-family:Consolas,Monaco,monospace;font-size:14px;}.theseoframework-debug h3{font-size:18px;margin:18px 0}</style>
62
  <div class="theseoframework-debug" style="direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 80px );min-height:700px;padding:0;margin:40px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18px;font-feature-settings:normal;font-variant:normal">
63
- <h3 style="font-size:14px;padding:0 12px;margin:0;line-height:39px;border-bottom:2px solid #aaa;position:absolute;z-index:9002;width:100%;right:0;left:0;top:0;background:#fff;border-radius:3px 3px 0 0;height:39px">
64
  SEO Debug Information
65
  <?php
66
  echo ' :: ';
34
  ? 'direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 200px );min-height:700px;padding:0;margin:20px 180px 40px 20px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18pxfont-feature-settings:normal;font-variant:normal'
35
  : 'direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 200px );min-height:700px;padding:0;margin:20px 20px 40px 180px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18pxfont-feature-settings:normal;font-variant:normal';
36
  ?>
37
+ <div style="<?= $bstyle // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
38
+ <h3 style="font-family:unset;font-size:14px;padding:0 12px;margin:0;line-height:39px;border-bottom:2px solid #aaa;position:absolute;z-index:9002;width:100%;right:0;left:0;top:0;background:#fff;border-radius:3px 3px 0 0;height:39px;">
39
  SEO Debug Information
40
  <?php
41
  if ( $this->is_post_edit() || $this->is_term_edit() ) :
60
  ?>
61
  <style type="text/css">.wp-ui-notification{color:#fff;background-color:#d54e21}.code.highlight{font-family:Consolas,Monaco,monospace;font-size:14px;}.theseoframework-debug h3{font-size:18px;margin:18px 0}</style>
62
  <div class="theseoframework-debug" style="direction:ltr;color:#444;font-family:Georgio,sans-serif;font-size:14px;clear:both;float:left;position:relative;width:calc( 100% - 80px );min-height:700px;padding:0;margin:40px;overflow:hidden;border:1px solid #ccc;border-radius:3px;line-height:18px;font-feature-settings:normal;font-variant:normal">
63
+ <h3 style="font-family:unset;font-size:14px;padding:0 12px;margin:0;line-height:39px;border-bottom:2px solid #aaa;position:absolute;z-index:9002;width:100%;right:0;left:0;top:0;background:#fff;border-radius:3px 3px 0 0;height:39px">
64
  SEO Debug Information
65
  <?php
66
  echo ' :: ';
inc/views/edit/seo-settings-singular.php CHANGED
@@ -134,7 +134,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
134
  </div>
135
  <div class="tsf-flex-setting-input tsf-flex">
136
  <div class=tsf-title-wrap>
137
- <input class="large-text" type="text" name="autodescription[_genesis_title]" id="autodescription_title" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_genesis_title' ) ); ?>" autocomplete=off />
138
  <?php
139
  $this->output_js_title_elements(); // legacy
140
  $this->output_js_title_data(
@@ -203,7 +203,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
203
  </div>
204
  </div>
205
  <div class="tsf-flex-setting-input tsf-flex">
206
- <textarea class="large-text" name="autodescription[_genesis_description]" id="autodescription_description" rows="4" cols="4" autocomplete=off><?php echo $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_genesis_description' ) ); ?></textarea>
207
  <?php
208
  $this->output_js_description_elements(); // legacy
209
  $this->output_js_description_data(
@@ -224,7 +224,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
224
 
225
  case 'inpost_visibility_tab':
226
  $canonical = $this->get_post_meta_item( '_genesis_canonical_uri' );
227
- $canonical_placeholder = $this->create_canonical_url( $_generator_args );
228
 
229
  // Get robots defaults.
230
  $r_defaults = $this->generate_robots_meta(
@@ -277,7 +277,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
277
  </div>
278
  </div>
279
  <div class="tsf-flex-setting-input tsf-flex">
280
- <input class="large-text" type="url" name="autodescription[_genesis_canonical_uri]" id="autodescription_canonical" placeholder="<?php echo esc_url( $canonical_placeholder ); ?>" value="<?php echo esc_url( $this->get_post_meta_item( '_genesis_canonical_uri' ) ); ?>" autocomplete=off />
281
  </div>
282
  </div>
283
 
@@ -316,8 +316,8 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
316
  <div class="tsf-flex-setting tsf-flex">
317
  <div class="tsf-flex-setting-label tsf-flex">
318
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
319
- <label for="<?php echo esc_attr( $_s['id'] ); ?>" class="tsf-flex-setting-label-item tsf-flex">
320
- <div><strong><?php echo esc_html( $_s['label'] ); ?></strong></div>
321
  </label>
322
  </div>
323
  </div>
@@ -408,7 +408,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
408
  </div>
409
  </div>
410
  <div class="tsf-flex-setting-input tsf-flex">
411
- <input class="large-text" type="url" name="autodescription[redirect]" id="autodescription_redirect" value="<?php echo esc_url( $this->get_post_meta_item( 'redirect' ) ); ?>" autocomplete=off />
412
  </div>
413
  </div>
414
  <?php
@@ -474,7 +474,7 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
474
  );
475
 
476
  ?>
477
- <div class="tsf-flex-setting tsf-flex" <?php echo $show_og ? '' : 'style=display:none'; ?>>
478
  <div class="tsf-flex-setting-label tsf-flex">
479
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
480
  <label for="autodescription_og_title" class="tsf-flex-setting-label-item tsf-flex">
@@ -488,12 +488,12 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
488
  </div>
489
  <div class="tsf-flex-setting-input tsf-flex">
490
  <div id="tsf-og-title-wrap">
491
- <input class="large-text" type="text" name="autodescription[_open_graph_title]" id="autodescription_og_title" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_open_graph_title' ) ); ?>" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=ogTitle />
492
  </div>
493
  </div>
494
  </div>
495
 
496
- <div class="tsf-flex-setting tsf-flex" <?php echo $show_og ? '' : 'style=display:none'; ?>>
497
  <div class="tsf-flex-setting-label tsf-flex">
498
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
499
  <label for="autodescription_og_description" class="tsf-flex-setting-label-item tsf-flex">
@@ -506,11 +506,11 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
506
  </div>
507
  </div>
508
  <div class="tsf-flex-setting-input tsf-flex">
509
- <textarea class="large-text" name="autodescription[_open_graph_description]" id="autodescription_og_description" rows="3" cols="4" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=ogDesc><?php echo $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_open_graph_description' ) ); ?></textarea>
510
  </div>
511
  </div>
512
 
513
- <div class="tsf-flex-setting tsf-flex" <?php echo $show_tw ? '' : 'style=display:none'; ?>>
514
  <div class="tsf-flex-setting-label tsf-flex">
515
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
516
  <label for="autodescription_twitter_title" class="tsf-flex-setting-label-item tsf-flex">
@@ -524,12 +524,12 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
524
  </div>
525
  <div class="tsf-flex-setting-input tsf-flex">
526
  <div id="tsf-twitter-title-wrap">
527
- <input class="large-text" type="text" name="autodescription[_twitter_title]" id="autodescription_twitter_title" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_twitter_title' ) ); ?>" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=twTitle />
528
  </div>
529
  </div>
530
  </div>
531
 
532
- <div class="tsf-flex-setting tsf-flex" <?php echo $show_tw ? '' : 'style=display:none'; ?>>
533
  <div class="tsf-flex-setting-label tsf-flex">
534
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
535
  <label for="autodescription_twitter_description" class="tsf-flex-setting-label-item tsf-flex">
@@ -576,8 +576,8 @@ switch ( $this->get_view_instance( 'inpost', $instance ) ) :
576
  </div>
577
  </div>
578
  <div class="tsf-flex-setting-input tsf-flex">
579
- <input class="large-text" type="url" name="autodescription[_social_image_url]" id="autodescription_socialimage-url" placeholder="<?php echo esc_url( $image_placeholder ); ?>" value="<?php echo esc_url( $this->get_post_meta_item( '_social_image_url' ) ); ?>" autocomplete=off />
580
- <input type="hidden" name="autodescription[_social_image_id]" id="autodescription_socialimage-id" value="<?php echo absint( $this->get_post_meta_item( '_social_image_id' ) ); ?>" disabled class="tsf-enable-media-if-js" />
581
  <div class="hide-if-no-tsf-js tsf-social-image-buttons">
582
  <?php
583
  // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped. (phpcs is broken here?)
134
  </div>
135
  <div class="tsf-flex-setting-input tsf-flex">
136
  <div class=tsf-title-wrap>
137
+ <input class="large-text" type="text" name="autodescription[_genesis_title]" id="autodescription_title" value="<?= $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_genesis_title' ) ) ?>" autocomplete=off />
138
  <?php
139
  $this->output_js_title_elements(); // legacy
140
  $this->output_js_title_data(
203
  </div>
204
  </div>
205
  <div class="tsf-flex-setting-input tsf-flex">
206
+ <textarea class="large-text" name="autodescription[_genesis_description]" id="autodescription_description" rows="4" cols="4" autocomplete=off><?= $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_genesis_description' ) ) ?></textarea>
207
  <?php
208
  $this->output_js_description_elements(); // legacy
209
  $this->output_js_description_data(
224
 
225
  case 'inpost_visibility_tab':
226
  $canonical = $this->get_post_meta_item( '_genesis_canonical_uri' );
227
+ $canonical_placeholder = $this->get_canonical_url( $_generator_args );
228
 
229
  // Get robots defaults.
230
  $r_defaults = $this->generate_robots_meta(
277
  </div>
278
  </div>
279
  <div class="tsf-flex-setting-input tsf-flex">
280
+ <input class="large-text" type="url" name="autodescription[_genesis_canonical_uri]" id="autodescription_canonical" placeholder="<?= esc_url( $canonical_placeholder ) ?>" value="<?= esc_url( $this->get_post_meta_item( '_genesis_canonical_uri' ) ) ?>" autocomplete=off />
281
  </div>
282
  </div>
283
 
316
  <div class="tsf-flex-setting tsf-flex">
317
  <div class="tsf-flex-setting-label tsf-flex">
318
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
319
+ <label for="<?= esc_attr( $_s['id'] ) ?>" class="tsf-flex-setting-label-item tsf-flex">
320
+ <div><strong><?= esc_html( $_s['label'] ) ?></strong></div>
321
  </label>
322
  </div>
323
  </div>
408
  </div>
409
  </div>
410
  <div class="tsf-flex-setting-input tsf-flex">
411
+ <input class="large-text" type="url" name="autodescription[redirect]" id="autodescription_redirect" value="<?= esc_url( $this->get_post_meta_item( 'redirect' ) ) ?>" autocomplete=off />
412
  </div>
413
  </div>
414
  <?php
474
  );
475
 
476
  ?>
477
+ <div class="tsf-flex-setting tsf-flex" <?= $show_og ? '' : 'style=display:none' ?>>
478
  <div class="tsf-flex-setting-label tsf-flex">
479
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
480
  <label for="autodescription_og_title" class="tsf-flex-setting-label-item tsf-flex">
488
  </div>
489
  <div class="tsf-flex-setting-input tsf-flex">
490
  <div id="tsf-og-title-wrap">
491
+ <input class="large-text" type="text" name="autodescription[_open_graph_title]" id="autodescription_og_title" value="<?= $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_open_graph_title' ) ) ?>" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=ogTitle />
492
  </div>
493
  </div>
494
  </div>
495
 
496
+ <div class="tsf-flex-setting tsf-flex" <?= $show_og ? '' : 'style=display:none' ?>>
497
  <div class="tsf-flex-setting-label tsf-flex">
498
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
499
  <label for="autodescription_og_description" class="tsf-flex-setting-label-item tsf-flex">
506
  </div>
507
  </div>
508
  <div class="tsf-flex-setting-input tsf-flex">
509
+ <textarea class="large-text" name="autodescription[_open_graph_description]" id="autodescription_og_description" rows="3" cols="4" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=ogDesc><?= $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_open_graph_description' ) ) ?></textarea>
510
  </div>
511
  </div>
512
 
513
+ <div class="tsf-flex-setting tsf-flex" <?= $show_tw ? '' : 'style=display:none' ?>>
514
  <div class="tsf-flex-setting-label tsf-flex">
515
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
516
  <label for="autodescription_twitter_title" class="tsf-flex-setting-label-item tsf-flex">
524
  </div>
525
  <div class="tsf-flex-setting-input tsf-flex">
526
  <div id="tsf-twitter-title-wrap">
527
+ <input class="large-text" type="text" name="autodescription[_twitter_title]" id="autodescription_twitter_title" value="<?= $this->esc_attr_preserve_amp( $this->get_post_meta_item( '_twitter_title' ) ) ?>" autocomplete=off data-tsf-social-group=autodescription_social_singular data-tsf-social-type=twTitle />
528
  </div>
529
  </div>
530
  </div>
531
 
532
+ <div class="tsf-flex-setting tsf-flex" <?= $show_tw ? '' : 'style=display:none' ?>>
533
  <div class="tsf-flex-setting-label tsf-flex">
534
  <div class="tsf-flex-setting-label-inner-wrap tsf-flex">
535
  <label for="autodescription_twitter_description" class="tsf-flex-setting-label-item tsf-flex">
576
  </div>
577
  </div>
578
  <div class="tsf-flex-setting-input tsf-flex">
579
+ <input class="large-text" type="url" name="autodescription[_social_image_url]" id="autodescription_socialimage-url" placeholder="<?= esc_url( $image_placeholder ) ?>" value="<?= esc_url( $this->get_post_meta_item( '_social_image_url' ) ) ?>" autocomplete=off />
580
+ <input type="hidden" name="autodescription[_social_image_id]" id="autodescription_socialimage-id" value="<?= absint( $this->get_post_meta_item( '_social_image_id' ) ) ?>" disabled class="tsf-enable-media-if-js" />
581
  <div class="hide-if-no-tsf-js tsf-social-image-buttons">
582
  <?php
583
  // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped. (phpcs is broken here?)
inc/views/edit/seo-settings-tt.php CHANGED
@@ -45,7 +45,7 @@ $show_tw = (bool) $this->get_option( 'twitter_tags' );
45
  $image_details = current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) );
46
  $image_placeholder = $image_details['url'] ?? '';
47
 
48
- $canonical_placeholder = $this->create_canonical_url( $_generator_args ); // implies get_custom_field = false
49
  $robots_defaults = $this->generate_robots_meta(
50
  $_generator_args,
51
  [ 'noindex', 'nofollow', 'noarchive' ],
@@ -133,7 +133,7 @@ $robots_settings = [
133
  </th>
134
  <td>
135
  <div class=tsf-title-wrap>
136
- <input type="text" name="autodescription-meta[doctitle]" id="autodescription-meta[doctitle]" value="<?php echo $this->esc_attr_preserve_amp( $title ); ?>" size="40" autocomplete=off />
137
  <?php
138
  $this->output_js_title_elements(); // legacy
139
  $this->output_js_title_data(
@@ -183,7 +183,7 @@ $robots_settings = [
183
  ?>
184
  </th>
185
  <td>
186
- <textarea name="autodescription-meta[description]" id="autodescription-meta[description]" rows="4" cols="50" class="large-text" autocomplete=off><?php echo $this->esc_attr_preserve_amp( $description ); ?></textarea>
187
  <?php
188
  $this->output_js_description_elements(); // legacy
189
  $this->output_js_description_data(
@@ -227,7 +227,7 @@ $this->output_js_social_data(
227
 
228
  <table class="form-table tsf-term-meta">
229
  <tbody>
230
- <tr class="form-field" <?php echo $show_og ? '' : 'style=display:none'; ?>>
231
  <th scope="row" valign="top">
232
  <label for="autodescription-meta[og_title]">
233
  <strong><?php esc_html_e( 'Open Graph Title', 'autodescription' ); ?></strong>
@@ -239,12 +239,12 @@ $this->output_js_social_data(
239
  </th>
240
  <td>
241
  <div id="tsf-og-title-wrap">
242
- <input name="autodescription-meta[og_title]" id="autodescription-meta[og_title]" type="text" value="<?php echo $this->esc_attr_preserve_amp( $og_title ); ?>" size="40" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=ogTitle />
243
  </div>
244
  </td>
245
  </tr>
246
 
247
- <tr class="form-field" <?php echo $show_og ? '' : 'style=display:none'; ?>>
248
  <th scope="row" valign="top">
249
  <label for="autodescription-meta[og_description]">
250
  <strong><?php esc_html_e( 'Open Graph Description', 'autodescription' ); ?></strong>
@@ -255,11 +255,11 @@ $this->output_js_social_data(
255
  ?>
256
  </th>
257
  <td>
258
- <textarea name="autodescription-meta[og_description]" id="autodescription-meta[og_description]" rows="4" cols="50" class="large-text" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=ogDesc><?php echo $this->esc_attr_preserve_amp( $og_description ); ?></textarea>
259
  </td>
260
  </tr>
261
 
262
- <tr class="form-field" <?php echo $show_tw ? '' : 'style=display:none'; ?>>
263
  <th scope="row" valign="top">
264
  <label for="autodescription-meta[tw_title]">
265
  <strong><?php esc_html_e( 'Twitter Title', 'autodescription' ); ?></strong>
@@ -271,12 +271,12 @@ $this->output_js_social_data(
271
  </th>
272
  <td>
273
  <div id="tsf-tw-title-wrap">
274
- <input name="autodescription-meta[tw_title]" id="autodescription-meta[tw_title]" type="text" value="<?php echo $this->esc_attr_preserve_amp( $tw_title ); ?>" size="40" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=twTitle />
275
  </div>
276
  </td>
277
  </tr>
278
 
279
- <tr class="form-field" <?php echo $show_tw ? '' : 'style=display:none'; ?>>
280
  <th scope="row" valign="top">
281
  <label for="autodescription-meta[tw_description]">
282
  <strong><?php esc_html_e( 'Twitter Description', 'autodescription' ); ?></strong>
@@ -287,7 +287,7 @@ $this->output_js_social_data(
287
  ?>
288
  </th>
289
  <td>
290
- <textarea name="autodescription-meta[tw_description]" id="autodescription-meta[tw_description]" rows="4" cols="50" class="large-text" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=twDesc><?php echo $this->esc_attr_preserve_amp( $tw_description ); ?></textarea>
291
  </td>
292
  </tr>
293
 
@@ -305,8 +305,8 @@ $this->output_js_social_data(
305
  </label>
306
  </th>
307
  <td>
308
- <input type="url" name="autodescription-meta[social_image_url]" id="autodescription_meta_socialimage-url" placeholder="<?php echo esc_attr( $image_placeholder ); ?>" value="<?php echo esc_attr( $social_image_url ); ?>" size="40" autocomplete=off />
309
- <input type="hidden" name="autodescription-meta[social_image_id]" id="autodescription_meta_socialimage-id" value="<?php echo absint( $social_image_id ); ?>" disabled class="tsf-enable-media-if-js" />
310
  <div class="hide-if-no-tsf-js tsf-term-button-wrap">
311
  <?php
312
  // phpcs:ignore, WordPress.Security.EscapeOutput -- Already escaped.
@@ -336,7 +336,7 @@ $this->output_js_social_data(
336
  </label>
337
  </th>
338
  <td>
339
- <input type=url name="autodescription-meta[canonical]" id="autodescription-meta[canonical]" placeholder="<?php echo esc_attr( $canonical_placeholder ); ?>" value="<?php echo esc_attr( $canonical ); ?>" size="40" autocomplete=off />
340
  </td>
341
  </tr>
342
 
@@ -394,7 +394,7 @@ $this->output_js_social_data(
394
  </label>
395
  </th>
396
  <td>
397
- <input type=url name="autodescription-meta[redirect]" id="autodescription-meta[redirect]" value="<?php echo esc_attr( $redirect ); ?>" size="40" autocomplete=off />
398
  </td>
399
  </tr>
400
  </tbody>
45
  $image_details = current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) );
46
  $image_placeholder = $image_details['url'] ?? '';
47
 
48
+ $canonical_placeholder = $this->get_canonical_url( $_generator_args ); // implies get_custom_field = false
49
  $robots_defaults = $this->generate_robots_meta(
50
  $_generator_args,
51
  [ 'noindex', 'nofollow', 'noarchive' ],
133
  </th>
134
  <td>
135
  <div class=tsf-title-wrap>
136
+ <input type="text" name="autodescription-meta[doctitle]" id="autodescription-meta[doctitle]" value="<?= $this->esc_attr_preserve_amp( $title ) ?>" size="40" autocomplete=off />
137
  <?php
138
  $this->output_js_title_elements(); // legacy
139
  $this->output_js_title_data(
183
  ?>
184
  </th>
185
  <td>
186
+ <textarea name="autodescription-meta[description]" id="autodescription-meta[description]" rows="4" cols="50" class="large-text" autocomplete=off><?= $this->esc_attr_preserve_amp( $description ) ?></textarea>
187
  <?php
188
  $this->output_js_description_elements(); // legacy
189
  $this->output_js_description_data(
227
 
228
  <table class="form-table tsf-term-meta">
229
  <tbody>
230
+ <tr class="form-field" <?= $show_og ? '' : 'style=display:none' ?>>
231
  <th scope="row" valign="top">
232
  <label for="autodescription-meta[og_title]">
233
  <strong><?php esc_html_e( 'Open Graph Title', 'autodescription' ); ?></strong>
239
  </th>
240
  <td>
241
  <div id="tsf-og-title-wrap">
242
+ <input name="autodescription-meta[og_title]" id="autodescription-meta[og_title]" type="text" value="<?= $this->esc_attr_preserve_amp( $og_title ) ?>" size="40" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=ogTitle />
243
  </div>
244
  </td>
245
  </tr>
246
 
247
+ <tr class="form-field" <?= $show_og ? '' : 'style=display:none' ?>>
248
  <th scope="row" valign="top">
249
  <label for="autodescription-meta[og_description]">
250
  <strong><?php esc_html_e( 'Open Graph Description', 'autodescription' ); ?></strong>
255
  ?>
256
  </th>
257
  <td>
258
+ <textarea name="autodescription-meta[og_description]" id="autodescription-meta[og_description]" rows="4" cols="50" class="large-text" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=ogDesc><?= $this->esc_attr_preserve_amp( $og_description ) ?></textarea>
259
  </td>
260
  </tr>
261
 
262
+ <tr class="form-field" <?= $show_tw ? '' : 'style=display:none' ?>>
263
  <th scope="row" valign="top">
264
  <label for="autodescription-meta[tw_title]">
265
  <strong><?php esc_html_e( 'Twitter Title', 'autodescription' ); ?></strong>
271
  </th>
272
  <td>
273
  <div id="tsf-tw-title-wrap">
274
+ <input name="autodescription-meta[tw_title]" id="autodescription-meta[tw_title]" type="text" value="<?= $this->esc_attr_preserve_amp( $tw_title ) ?>" size="40" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=twTitle />
275
  </div>
276
  </td>
277
  </tr>
278
 
279
+ <tr class="form-field" <?= $show_tw ? '' : 'style=display:none' ?>>
280
  <th scope="row" valign="top">
281
  <label for="autodescription-meta[tw_description]">
282
  <strong><?php esc_html_e( 'Twitter Description', 'autodescription' ); ?></strong>
287
  ?>
288
  </th>
289
  <td>
290
+ <textarea name="autodescription-meta[tw_description]" id="autodescription-meta[tw_description]" rows="4" cols="50" class="large-text" autocomplete=off data-tsf-social-group=autodescription_social_tt data-tsf-social-type=twDesc><?= $this->esc_attr_preserve_amp( $tw_description ) ?></textarea>
291
  </td>
292
  </tr>
293
 
305
  </label>
306
  </th>
307
  <td>
308
+ <input type="url" name="autodescription-meta[social_image_url]" id="autodescription_meta_socialimage-url" placeholder="<?= esc_attr( $image_placeholder ) ?>" value="<?= esc_attr( $social_image_url ) ?>" size="40" autocomplete=off />
309
+ <input type="hidden" name="autodescription-meta[social_image_id]" id="autodescription_meta_socialimage-id" value="<?= absint( $social_image_id ) ?>" disabled class="tsf-enable-media-if-js" />
310
  <div class="hide-if-no-tsf-js tsf-term-button-wrap">
311
  <?php
312
  // phpcs:ignore, WordPress.Security.EscapeOutput -- Already escaped.
336
  </label>
337
  </th>
338
  <td>
339
+ <input type=url name="autodescription-meta[canonical]" id="autodescription-meta[canonical]" placeholder="<?= esc_attr( $canonical_placeholder ) ?>" value="<?= esc_attr( $canonical ) ?>" size="40" autocomplete=off />
340
  </td>
341
  </tr>
342
 
394
  </label>
395
  </th>
396
  <td>
397
+ <input type=url name="autodescription-meta[redirect]" id="autodescription-meta[redirect]" value="<?= esc_attr( $redirect ) ?>" size="40" autocomplete=off />
398
  </td>
399
  </tr>
400
  </tbody>
inc/views/edit/wrap-content.php CHANGED
@@ -27,7 +27,7 @@ foreach ( $tabs as $tab => $params ) :
27
  $current_class = 1 === $count ? ' tsf-flex-tab-content-active' : '';
28
 
29
  ?>
30
- <div class="tsf-flex tsf-flex-tab-content <?php echo esc_attr( $radio_class . $current_class ); ?>" id="<?php echo esc_attr( $radio_id ); ?>" >
31
  <?php
32
  // No-JS tabs.
33
  if ( $use_tabs ) :
@@ -38,8 +38,8 @@ foreach ( $tabs as $tab => $params ) :
38
  <div class="tsf-flex tsf-flex-hide-if-js tsf-flex-tabs-content-no-js">
39
  <div class="tsf-flex tsf-flex-nav-tab tsf-flex-tab-no-js">
40
  <span class="tsf-flex tsf-flex-nav-tab">
41
- <?php echo $dashicon ? '<span class="tsf-flex dashicons dashicons-' . esc_attr( $dashicon ) . ' tsf-flex-nav-dashicon"></span>' : ''; ?>
42
- <?php echo $label_name ? '<span class="tsf-flex tsf-flex-nav-name">' . esc_html( $label_name ) . '</span>' : ''; ?>
43
  </span>
44
  </div>
45
  </div>
27
  $current_class = 1 === $count ? ' tsf-flex-tab-content-active' : '';
28
 
29
  ?>
30
+ <div class="tsf-flex tsf-flex-tab-content <?= esc_attr( $radio_class . $current_class ) ?>" id="<?= esc_attr( $radio_id ) ?>" >
31
  <?php
32
  // No-JS tabs.
33
  if ( $use_tabs ) :
38
  <div class="tsf-flex tsf-flex-hide-if-js tsf-flex-tabs-content-no-js">
39
  <div class="tsf-flex tsf-flex-nav-tab tsf-flex-tab-no-js">
40
  <span class="tsf-flex tsf-flex-nav-tab">
41
+ <?= $dashicon ? '<span class="tsf-flex dashicons dashicons-' . esc_attr( $dashicon ) . ' tsf-flex-nav-dashicon"></span>' : '' ?>
42
+ <?= $label_name ? '<span class="tsf-flex tsf-flex-nav-name">' . esc_html( $label_name ) . '</span>' : '' ?>
43
  </span>
44
  </div>
45
  </div>
inc/views/edit/wrap-nav.php CHANGED
@@ -20,7 +20,7 @@ $count = 1;
20
  */
21
  if ( $use_tabs ) :
22
  ?>
23
- <div class="tsf-flex tsf-flex-nav-tab-wrapper tsf-flex-hide-if-no-js" id="<?php echo esc_attr( "tsf-flex-{$id}-tabs-wrapper" ); ?>">
24
  <div class="tsf-flex tsf-flex-nav-tab-inner">
25
  <?php
26
  foreach ( $tabs as $tab => $value ) :
20
  */
21
  if ( $use_tabs ) :
22
  ?>
23
+ <div class="tsf-flex tsf-flex-nav-tab-wrapper tsf-flex-hide-if-no-js" id="<?= esc_attr( "tsf-flex-{$id}-tabs-wrapper" ) ?>">
24
  <div class="tsf-flex tsf-flex-nav-tab-inner">
25
  <?php
26
  foreach ( $tabs as $tab => $value ) :
inc/views/profile/author.php CHANGED
@@ -32,18 +32,18 @@ $fields = [
32
  <?php
33
  foreach ( $fields as $field => $labels ) :
34
  ?>
35
- <tr class="user-<?php echo esc_attr( $field ); ?>-wrap">
36
- <th><label for="<?php echo esc_attr( $field ); ?>">
37
- <?php echo esc_html( $labels['name'] ); ?>
38
  </label></th>
39
  <td>
40
  <input
41
- type="<?php echo esc_attr( $labels['type'] ); ?>"
42
- name="<?php echo esc_attr( $field ); ?>"
43
- id="<?php echo esc_attr( $field ); ?>"
44
- value="<?php echo esc_attr( $labels['value'] ); ?>"
45
- placeholder="<?php echo esc_attr( $labels['placeholder'] ); ?>"
46
- class="regular-text <?php echo esc_attr( $labels['class'] ); ?>" />
47
  <p class="description"><?php esc_html_e( 'This may be shown publicly.', 'autodescription' ); ?></p>
48
  </td>
49
  </tr>
32
  <?php
33
  foreach ( $fields as $field => $labels ) :
34
  ?>
35
+ <tr class="user-<?= esc_attr( $field ) ?>-wrap">
36
+ <th><label for="<?= esc_attr( $field ) ?>">
37
+ <?= esc_html( $labels['name'] ) ?>
38
  </label></th>
39
  <td>
40
  <input
41
+ type="<?= esc_attr( $labels['type'] ) ?>"
42
+ name="<?= esc_attr( $field ) ?>"
43
+ id="<?= esc_attr( $field ) ?>"
44
+ value="<?= esc_attr( $labels['value'] ) ?>"
45
+ placeholder="<?= esc_attr( $labels['placeholder'] ) ?>"
46
+ class="regular-text <?= esc_attr( $labels['class'] ) ?>" />
47
  <p class="description"><?php esc_html_e( 'This may be shown publicly.', 'autodescription' ); ?></p>
48
  </td>
49
  </tr>
inc/views/settings/metaboxes/general.php CHANGED
@@ -252,7 +252,7 @@ switch ( $this->get_view_instance( 'general', $instance ) ) :
252
  HTML::header_title( __( 'Scheme Settings', 'autodescription' ) );
253
  HTML::description( __( 'If your website is accessible via both HTTP as HTTPS, you may want to set this to HTTPS if not detected automatically. Secure connections are preferred by search engines.', 'autodescription' ) );
254
  ?>
255
- <label for="<?php Input::field_id( 'canonical_scheme' ); ?>"><?php echo esc_html_x( 'Preferred canonical URL scheme:', '= Detect Automatically, HTTPS, HTTP', 'autodescription' ); ?></label>
256
  <select name="<?php Input::field_name( 'canonical_scheme' ); ?>" id="<?php Input::field_id( 'canonical_scheme' ); ?>">
257
  <?php
258
  $scheme_types = (array) apply_filters(
252
  HTML::header_title( __( 'Scheme Settings', 'autodescription' ) );
253
  HTML::description( __( 'If your website is accessible via both HTTP as HTTPS, you may want to set this to HTTPS if not detected automatically. Secure connections are preferred by search engines.', 'autodescription' ) );
254
  ?>
255
+ <label for="<?php Input::field_id( 'canonical_scheme' ); ?>"><?= esc_html_x( 'Preferred canonical URL scheme:', '= Detect Automatically, HTTPS, HTTP', 'autodescription' ) ?></label>
256
  <select name="<?php Input::field_name( 'canonical_scheme' ); ?>" id="<?php Input::field_id( 'canonical_scheme' ); ?>">
257
  <?php
258
  $scheme_types = (array) apply_filters(
inc/views/settings/metaboxes/homepage.php CHANGED
@@ -79,7 +79,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
79
  Form::output_pixel_counter_wrap( Input::get_field_id( 'homepage_title' ), 'title', (bool) $this->get_option( 'display_pixel_counter' ) );
80
  ?>
81
  <p class=tsf-title-wrap>
82
- <input type="text" name="<?php Input::field_name( 'homepage_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_title' ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_option( 'homepage_title' ) ); ?>" autocomplete=off />
83
  <?php
84
  $this->output_js_title_elements(); // legacy
85
  $this->output_js_title_data(
@@ -146,7 +146,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
146
  Form::output_pixel_counter_wrap( Input::get_field_id( 'homepage_description' ), 'description', (bool) $this->get_option( 'display_pixel_counter' ) );
147
  ?>
148
  <p>
149
- <textarea name="<?php Input::field_name( 'homepage_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_description' ); ?>" rows="3" cols="70"><?php echo esc_attr( $this->get_option( 'homepage_description' ) ); ?></textarea>
150
  <?php
151
  $this->output_js_description_elements(); // legacy
152
  $this->output_js_description_data(
@@ -215,7 +215,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
215
  </label>
216
  </p>
217
  <p>
218
- <input type="text" name="<?php Input::field_name( 'homepage_title_tagline' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_title_tagline' ); ?>" placeholder="<?php echo esc_attr( $this->s_title_raw( $this->get_blogdescription() ) ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_option( 'homepage_title_tagline' ) ); ?>" autocomplete=off />
219
  </p>
220
 
221
  <div class=tsf-title-tagline-toggle>
@@ -314,7 +314,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
314
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_og_title' ), (bool) $this->get_option( 'display_character_counter' ) );
315
  ?>
316
  <p>
317
- <input type="text" name="<?php Input::field_name( 'homepage_og_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_og_title' ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_option( 'homepage_og_title' ) ); ?>" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=ogTitle />
318
  </p>
319
  <?php
320
  if ( $this->has_page_on_front() && $custom_og_title ) {
@@ -334,7 +334,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
334
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_og_description' ), (bool) $this->get_option( 'display_character_counter' ) );
335
  ?>
336
  <p>
337
- <textarea name="<?php Input::field_name( 'homepage_og_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_og_description' ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=ogDesc><?php echo esc_attr( $this->get_option( 'homepage_og_description' ) ); ?></textarea>
338
  </p>
339
  <?php
340
  if ( $this->has_page_on_front() && $custom_og_desc ) {
@@ -355,7 +355,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
355
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_twitter_title' ), (bool) $this->get_option( 'display_character_counter' ) );
356
  ?>
357
  <p>
358
- <input type="text" name="<?php Input::field_name( 'homepage_twitter_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_twitter_title' ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_option( 'homepage_twitter_title' ) ); ?>" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=twTitle />
359
  </p>
360
  <?php
361
  if ( $this->has_page_on_front() && ( $custom_og_title || $custom_tw_title ) ) {
@@ -375,7 +375,7 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
375
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_twitter_description' ), (bool) $this->get_option( 'display_character_counter' ) );
376
  ?>
377
  <p>
378
- <textarea name="<?php Input::field_name( 'homepage_twitter_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_twitter_description' ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=twDesc><?php echo esc_attr( $this->get_option( 'homepage_twitter_description' ) ); ?></textarea>
379
  </p>
380
  <?php
381
  if ( $this->has_page_on_front() && ( $custom_og_desc || $custom_tw_desc ) ) {
@@ -401,8 +401,8 @@ switch ( $this->get_view_instance( 'homepage', $instance ) ) :
401
  </label>
402
  </p>
403
  <p>
404
- <input class="large-text" type="url" name="<?php Input::field_name( 'homepage_social_image_url' ); ?>" id="tsf_homepage_socialimage-url" placeholder="<?php echo esc_url( current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) )['url'] ?? '' ); ?>" value="<?php echo esc_url( $this->get_option( 'homepage_social_image_url' ) ); ?>" />
405
- <input type="hidden" name="<?php Input::field_name( 'homepage_social_image_id' ); ?>" id="tsf_homepage_socialimage-id" value="<?php echo absint( $this->get_option( 'homepage_social_image_id' ) ); ?>" disabled class="tsf-enable-media-if-js" />
406
  </p>
407
  <p class="hide-if-no-tsf-js">
408
  <?php
79
  Form::output_pixel_counter_wrap( Input::get_field_id( 'homepage_title' ), 'title', (bool) $this->get_option( 'display_pixel_counter' ) );
80
  ?>
81
  <p class=tsf-title-wrap>
82
+ <input type="text" name="<?php Input::field_name( 'homepage_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_title' ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_option( 'homepage_title' ) ) ?>" autocomplete=off />
83
  <?php
84
  $this->output_js_title_elements(); // legacy
85
  $this->output_js_title_data(
146
  Form::output_pixel_counter_wrap( Input::get_field_id( 'homepage_description' ), 'description', (bool) $this->get_option( 'display_pixel_counter' ) );
147
  ?>
148
  <p>
149
+ <textarea name="<?php Input::field_name( 'homepage_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_description' ); ?>" rows="3" cols="70"><?= esc_attr( $this->get_option( 'homepage_description' ) ) ?></textarea>
150
  <?php
151
  $this->output_js_description_elements(); // legacy
152
  $this->output_js_description_data(
215
  </label>
216
  </p>
217
  <p>
218
+ <input type="text" name="<?php Input::field_name( 'homepage_title_tagline' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_title_tagline' ); ?>" placeholder="<?= esc_attr( $this->s_title_raw( $this->get_blogdescription() ) ) ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_option( 'homepage_title_tagline' ) ) ?>" autocomplete=off />
219
  </p>
220
 
221
  <div class=tsf-title-tagline-toggle>
314
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_og_title' ), (bool) $this->get_option( 'display_character_counter' ) );
315
  ?>
316
  <p>
317
+ <input type="text" name="<?php Input::field_name( 'homepage_og_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_og_title' ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_option( 'homepage_og_title' ) ) ?>" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=ogTitle />
318
  </p>
319
  <?php
320
  if ( $this->has_page_on_front() && $custom_og_title ) {
334
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_og_description' ), (bool) $this->get_option( 'display_character_counter' ) );
335
  ?>
336
  <p>
337
+ <textarea name="<?php Input::field_name( 'homepage_og_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_og_description' ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=ogDesc><?= esc_attr( $this->get_option( 'homepage_og_description' ) ) ?></textarea>
338
  </p>
339
  <?php
340
  if ( $this->has_page_on_front() && $custom_og_desc ) {
355
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_twitter_title' ), (bool) $this->get_option( 'display_character_counter' ) );
356
  ?>
357
  <p>
358
+ <input type="text" name="<?php Input::field_name( 'homepage_twitter_title' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_twitter_title' ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_option( 'homepage_twitter_title' ) ) ?>" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=twTitle />
359
  </p>
360
  <?php
361
  if ( $this->has_page_on_front() && ( $custom_og_title || $custom_tw_title ) ) {
375
  Form::output_character_counter_wrap( Input::get_field_id( 'homepage_twitter_description' ), (bool) $this->get_option( 'display_character_counter' ) );
376
  ?>
377
  <p>
378
+ <textarea name="<?php Input::field_name( 'homepage_twitter_description' ); ?>" class="large-text" id="<?php Input::field_id( 'homepage_twitter_description' ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=homepage_social_settings data-tsf-social-type=twDesc><?= esc_attr( $this->get_option( 'homepage_twitter_description' ) ) ?></textarea>
379
  </p>
380
  <?php
381
  if ( $this->has_page_on_front() && ( $custom_og_desc || $custom_tw_desc ) ) {
401
  </label>
402
  </p>
403
  <p>
404
+ <input class="large-text" type="url" name="<?php Input::field_name( 'homepage_social_image_url' ); ?>" id="tsf_homepage_socialimage-url" placeholder="<?= esc_url( current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) )['url'] ?? '' ) ?>" value="<?= esc_url( $this->get_option( 'homepage_social_image_url' ) ) ?>" />
405
+ <input type="hidden" name="<?php Input::field_name( 'homepage_social_image_id' ); ?>" id="tsf_homepage_socialimage-id" value="<?= absint( $this->get_option( 'homepage_social_image_id' ) ) ?>" disabled class="tsf-enable-media-if-js" />
406
  </p>
407
  <p class="hide-if-no-tsf-js">
408
  <?php
inc/views/settings/metaboxes/post-type-archive.php CHANGED
@@ -24,7 +24,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
24
  foreach ( $post_types as $post_type ) {
25
  $post_types_data[ $post_type ] = [
26
  'label' => $this->get_post_type_label( $post_type ),
27
- 'url' => $this->create_canonical_url( [ 'pta' => $post_type ] ),
28
  'hasPosts' => $this->has_posts_in_post_type_archive( $post_type ),
29
  ];
30
  }
@@ -172,7 +172,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
172
  );
173
  ?>
174
  <p class=tsf-title-wrap>
175
- <input type="text" name="<?php Input::field_name( $_option_map['doctitle'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['doctitle'] ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'doctitle', $post_type ) ); ?>" autocomplete=off />
176
  <?php
177
  [ $_full_title, $_prefix_value, $_default_title ] =
178
  $this->get_raw_generated_archive_title_items( get_post_type_object( $post_type ), 'admin' );
@@ -234,7 +234,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
234
  Form::output_pixel_counter_wrap( Input::get_field_id( $_option_map['description'] ), 'description', (bool) $this->get_option( 'display_pixel_counter' ) );
235
  ?>
236
  <p>
237
- <textarea name="<?php Input::field_name( $_option_map['description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['description'] ); ?>" rows="3" cols="70"><?php echo esc_attr( $this->get_post_type_archive_meta_item( 'description', $post_type ) ); ?></textarea>
238
  <?php
239
  $this->output_js_description_elements(); // legacy
240
  $this->output_js_description_data(
@@ -281,7 +281,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
281
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['og_title'] ), (bool) $this->get_option( 'display_character_counter' ) );
282
  ?>
283
  <p>
284
- <input type="text" name="<?php Input::field_name( $_option_map['og_title'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['og_title'] ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'og_title', $post_type ) ); ?>" autocomplete=off data-tsf-social-group=<?php echo esc_attr( "pta_social_settings_{$post_type}" ); ?> data-tsf-social-type=ogTitle />
285
  </p>
286
 
287
  <p>
@@ -294,7 +294,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
294
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['og_description'] ), (bool) $this->get_option( 'display_character_counter' ) );
295
  ?>
296
  <p>
297
- <textarea name="<?php Input::field_name( $_option_map['og_description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['og_description'] ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=<?php echo esc_attr( "pta_social_settings_{$post_type}" ); ?> data-tsf-social-type=ogDesc><?php echo esc_attr( $this->get_post_type_archive_meta_item( 'og_description', $post_type ) ); ?></textarea>
298
  </p>
299
 
300
  <hr>
@@ -309,7 +309,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
309
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['tw_title'] ), (bool) $this->get_option( 'display_character_counter' ) );
310
  ?>
311
  <p>
312
- <input type="text" name="<?php Input::field_name( $_option_map['tw_title'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['tw_title'] ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'tw_title', $post_type ) ); ?>" autocomplete=off data-tsf-social-group=<?php echo esc_attr( "pta_social_settings_{$post_type}" ); ?> data-tsf-social-type=twTitle />
313
  </p>
314
 
315
  <p>
@@ -322,13 +322,13 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
322
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['tw_description'] ), (bool) $this->get_option( 'display_character_counter' ) );
323
  ?>
324
  <p>
325
- <textarea name="<?php Input::field_name( $_option_map['tw_description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['tw_description'] ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=<?php echo esc_attr( "pta_social_settings_{$post_type}" ); ?> data-tsf-social-type=twDesc><?php echo esc_attr( $this->get_post_type_archive_meta_item( 'tw_description', $post_type ) ); ?></textarea>
326
  </p>
327
 
328
  <hr>
329
 
330
  <p>
331
- <label for="<?php echo esc_attr( "tsf_pta_socialimage_{$post_type}" ); ?>-url">
332
  <strong><?php esc_html_e( 'Social Image URL', 'autodescription' ); ?></strong>
333
  <?php
334
  HTML::make_info(
@@ -339,8 +339,8 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
339
  </label>
340
  </p>
341
  <p>
342
- <input class="large-text" type="url" name="<?php Input::field_name( $_option_map['social_image_url'] ); ?>" id="<?php echo esc_attr( "tsf_pta_socialimage_{$post_type}" ); ?>-url" placeholder="<?php echo esc_url( current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) )['url'] ?? '' ); ?>" value="<?php echo esc_url( $this->get_post_type_archive_meta_item( 'social_image_url', $post_type ) ); ?>" />
343
- <input type="hidden" name="<?php Input::field_name( $_option_map['social_image_id'] ); ?>" id="<?php echo esc_attr( "tsf_pta_socialimage_{$post_type}" ); ?>-id" value="<?php echo absint( $this->get_post_type_archive_meta_item( 'social_image_id', $post_type ) ); ?>" disabled class="tsf-enable-media-if-js" />
344
  </p>
345
  <p class="hide-if-no-tsf-js">
346
  <?php
@@ -365,7 +365,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
365
  </label>
366
  </p>
367
  <p>
368
- <input type="url" name="<?php Input::field_name( $_option_map['canonical'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['canonical'] ); ?>" placeholder="<?php echo esc_url( $this->create_canonical_url( $_generator_args ) ); ?>" value="<?php echo esc_url( $this->get_post_type_archive_meta_item( 'canonical', $post_type ) ); ?>" autocomplete=off />
369
  </p>
370
 
371
  <hr>
@@ -462,7 +462,7 @@ switch ( $this->get_view_instance( 'post_type_archive', $instance ) ) :
462
  </label>
463
  </p>
464
  <p>
465
- <input type="url" name="<?php Input::field_name( $_option_map['redirect'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['redirect'] ); ?>" value="<?php echo esc_url( $this->get_post_type_archive_meta_item( 'redirect', $post_type ) ); ?>" autocomplete=off />
466
  </p>
467
  <?php
468
  break;
24
  foreach ( $post_types as $post_type ) {
25
  $post_types_data[ $post_type ] = [
26
  'label' => $this->get_post_type_label( $post_type ),
27
+ 'url' => $this->get_canonical_url( [ 'pta' => $post_type ] ),
28
  'hasPosts' => $this->has_posts_in_post_type_archive( $post_type ),
29
  ];
30
  }
172
  );
173
  ?>
174
  <p class=tsf-title-wrap>
175
+ <input type="text" name="<?php Input::field_name( $_option_map['doctitle'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['doctitle'] ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'doctitle', $post_type ) ) ?>" autocomplete=off />
176
  <?php
177
  [ $_full_title, $_prefix_value, $_default_title ] =
178
  $this->get_raw_generated_archive_title_items( get_post_type_object( $post_type ), 'admin' );
234
  Form::output_pixel_counter_wrap( Input::get_field_id( $_option_map['description'] ), 'description', (bool) $this->get_option( 'display_pixel_counter' ) );
235
  ?>
236
  <p>
237
+ <textarea name="<?php Input::field_name( $_option_map['description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['description'] ); ?>" rows="3" cols="70"><?= esc_attr( $this->get_post_type_archive_meta_item( 'description', $post_type ) ) ?></textarea>
238
  <?php
239
  $this->output_js_description_elements(); // legacy
240
  $this->output_js_description_data(
281
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['og_title'] ), (bool) $this->get_option( 'display_character_counter' ) );
282
  ?>
283
  <p>
284
+ <input type="text" name="<?php Input::field_name( $_option_map['og_title'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['og_title'] ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'og_title', $post_type ) ) ?>" autocomplete=off data-tsf-social-group=<?= esc_attr( "pta_social_settings_{$post_type}" ) ?> data-tsf-social-type=ogTitle />
285
  </p>
286
 
287
  <p>
294
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['og_description'] ), (bool) $this->get_option( 'display_character_counter' ) );
295
  ?>
296
  <p>
297
+ <textarea name="<?php Input::field_name( $_option_map['og_description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['og_description'] ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=<?= esc_attr( "pta_social_settings_{$post_type}" ) ?> data-tsf-social-type=ogDesc><?= esc_attr( $this->get_post_type_archive_meta_item( 'og_description', $post_type ) ) ?></textarea>
298
  </p>
299
 
300
  <hr>
309
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['tw_title'] ), (bool) $this->get_option( 'display_character_counter' ) );
310
  ?>
311
  <p>
312
+ <input type="text" name="<?php Input::field_name( $_option_map['tw_title'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['tw_title'] ); ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_post_type_archive_meta_item( 'tw_title', $post_type ) ) ?>" autocomplete=off data-tsf-social-group=<?= esc_attr( "pta_social_settings_{$post_type}" ) ?> data-tsf-social-type=twTitle />
313
  </p>
314
 
315
  <p>
322
  Form::output_character_counter_wrap( Input::get_field_id( $_option_map['tw_description'] ), (bool) $this->get_option( 'display_character_counter' ) );
323
  ?>
324
  <p>
325
+ <textarea name="<?php Input::field_name( $_option_map['tw_description'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['tw_description'] ); ?>" rows="3" cols="70" autocomplete=off data-tsf-social-group=<?= esc_attr( "pta_social_settings_{$post_type}" ) ?> data-tsf-social-type=twDesc><?= esc_attr( $this->get_post_type_archive_meta_item( 'tw_description', $post_type ) ) ?></textarea>
326
  </p>
327
 
328
  <hr>
329
 
330
  <p>
331
+ <label for="<?= esc_attr( "tsf_pta_socialimage_{$post_type}" ) ?>-url">
332
  <strong><?php esc_html_e( 'Social Image URL', 'autodescription' ); ?></strong>
333
  <?php
334
  HTML::make_info(
339
  </label>
340
  </p>
341
  <p>
342
+ <input class="large-text" type="url" name="<?php Input::field_name( $_option_map['social_image_url'] ); ?>" id="<?= esc_attr( "tsf_pta_socialimage_{$post_type}" ) ?>-url" placeholder="<?= esc_url( current( $this->get_generated_image_details( $_generator_args, true, 'social', true ) )['url'] ?? '' ) ?>" value="<?= esc_url( $this->get_post_type_archive_meta_item( 'social_image_url', $post_type ) ) ?>" />
343
+ <input type="hidden" name="<?php Input::field_name( $_option_map['social_image_id'] ); ?>" id="<?= esc_attr( "tsf_pta_socialimage_{$post_type}" ) ?>-id" value="<?= absint( $this->get_post_type_archive_meta_item( 'social_image_id', $post_type ) ) ?>" disabled class="tsf-enable-media-if-js" />
344
  </p>
345
  <p class="hide-if-no-tsf-js">
346
  <?php
365
  </label>
366
  </p>
367
  <p>
368
+ <input type="url" name="<?php Input::field_name( $_option_map['canonical'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['canonical'] ); ?>" placeholder="<?= esc_url( $this->get_canonical_url( $_generator_args ) ) ?>" value="<?= esc_url( $this->get_post_type_archive_meta_item( 'canonical', $post_type ) ) ?>" autocomplete=off />
369
  </p>
370
 
371
  <hr>
462
  </label>
463
  </p>
464
  <p>
465
+ <input type="url" name="<?php Input::field_name( $_option_map['redirect'] ); ?>" class="large-text" id="<?php Input::field_id( $_option_map['redirect'] ); ?>" value="<?= esc_url( $this->get_post_type_archive_meta_item( 'redirect', $post_type ) ) ?>" autocomplete=off />
466
  </p>
467
  <?php
468
  break;
inc/views/settings/metaboxes/schema.php CHANGED
@@ -76,7 +76,7 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
76
 
77
  ?>
78
  <hr>
79
- <h4><?php echo esc_html( _x( 'Sitelinks Searchbox', 'Product name', 'autodescription' ) ); ?></h4>
80
  <?php
81
  HTML::description( __( 'When Search users search for your brand name, the following option allows them to search through this website directly from the search results.', 'autodescription' ) );
82
 
@@ -117,7 +117,7 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
117
 
118
  <?php HTML::header_title( __( 'About this website', 'autodescription' ) ); ?>
119
  <p>
120
- <label for="<?php Input::field_id( 'knowledge_type' ); ?>"><?php echo esc_html_x( 'This website represents:', '...Organization or Person.', 'autodescription' ); ?></label>
121
  <select name="<?php Input::field_name( 'knowledge_type' ); ?>" id="<?php Input::field_id( 'knowledge_type' ); ?>">
122
  <?php
123
  $knowledge_type = (array) apply_filters(
@@ -140,7 +140,7 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
140
  </label>
141
  </p>
142
  <p>
143
- <input type="text" name="<?php Input::field_name( 'knowledge_name' ); ?>" class="large-text" id="<?php Input::field_id( 'knowledge_name' ); ?>" placeholder="<?php echo esc_attr( $this->get_blogname() ); ?>" value="<?php echo esc_attr( $this->get_option( 'knowledge_name' ) ); ?>" autocomplete=off />
144
  </p>
145
  <hr>
146
  <?php
@@ -168,8 +168,8 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
168
  </p>
169
  <p class="hide-if-tsf-js attention"><?php esc_html_e( 'Setting a logo requires JavaScript.', 'autodescription' ); ?></p>
170
  <p>
171
- <input class="large-text" type="url" readonly="readonly" data-readonly="1" name="<?php Input::field_name( 'knowledge_logo_url' ); ?>" id="knowledge_logo-url" placeholder="<?php echo esc_url( $logo_placeholder ); ?>" value="<?php echo esc_url( $this->get_option( 'knowledge_logo_url' ) ); ?>" />
172
- <input type="hidden" name="<?php Input::field_name( 'knowledge_logo_id' ); ?>" id="knowledge_logo-id" value="<?php echo absint( $this->get_option( 'knowledge_logo_id' ) ); ?>" />
173
  </p>
174
  <p class="hide-if-no-tsf-js">
175
  <?php
@@ -303,7 +303,7 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
303
  ?>
304
  <p>
305
  <label for="<?php Input::field_id( $v['option'] ); ?>">
306
- <strong><?php echo esc_html( $v['desc'] ); ?></strong>
307
  <?php
308
  if ( $v['examplelink'] ) {
309
  HTML::make_info(
@@ -315,7 +315,7 @@ switch ( $this->get_view_instance( 'schema', $instance ) ) :
315
  </label>
316
  </p>
317
  <p>
318
- <input type="url" name="<?php Input::field_name( $v['option'] ); ?>" class="large-text" id="<?php Input::field_id( $v['option'] ); ?>" placeholder="<?php echo esc_attr( $v['placeholder'] ); ?>" value="<?php echo esc_attr( $this->get_option( $v['option'] ) ); ?>" autocomplete=off />
319
  </p>
320
  <?php
321
  }
76
 
77
  ?>
78
  <hr>
79
+ <h4><?= esc_html( _x( 'Sitelinks Searchbox', 'Product name', 'autodescription' ) ) ?></h4>
80
  <?php
81
  HTML::description( __( 'When Search users search for your brand name, the following option allows them to search through this website directly from the search results.', 'autodescription' ) );
82
 
117
 
118
  <?php HTML::header_title( __( 'About this website', 'autodescription' ) ); ?>
119
  <p>
120
+ <label for="<?php Input::field_id( 'knowledge_type' ); ?>"><?= esc_html_x( 'This website represents:', '...Organization or Person.', 'autodescription' ) ?></label>
121
  <select name="<?php Input::field_name( 'knowledge_type' ); ?>" id="<?php Input::field_id( 'knowledge_type' ); ?>">
122
  <?php
123
  $knowledge_type = (array) apply_filters(
140
  </label>
141
  </p>
142
  <p>
143
+ <input type="text" name="<?php Input::field_name( 'knowledge_name' ); ?>" class="large-text" id="<?php Input::field_id( 'knowledge_name' ); ?>" placeholder="<?= esc_attr( $this->get_blogname() ) ?>" value="<?= esc_attr( $this->get_option( 'knowledge_name' ) ) ?>" autocomplete=off />
144
  </p>
145
  <hr>
146
  <?php
168
  </p>
169
  <p class="hide-if-tsf-js attention"><?php esc_html_e( 'Setting a logo requires JavaScript.', 'autodescription' ); ?></p>
170
  <p>
171
+ <input class="large-text" type="url" readonly="readonly" data-readonly="1" name="<?php Input::field_name( 'knowledge_logo_url' ); ?>" id="knowledge_logo-url" placeholder="<?= esc_url( $logo_placeholder ) ?>" value="<?= esc_url( $this->get_option( 'knowledge_logo_url' ) ) ?>" />
172
+ <input type="hidden" name="<?php Input::field_name( 'knowledge_logo_id' ); ?>" id="knowledge_logo-id" value="<?= absint( $this->get_option( 'knowledge_logo_id' ) ) ?>" />
173
  </p>
174
  <p class="hide-if-no-tsf-js">
175
  <?php
303
  ?>
304
  <p>
305
  <label for="<?php Input::field_id( $v['option'] ); ?>">
306
+ <strong><?= esc_html( $v['desc'] ) ?></strong>
307
  <?php
308
  if ( $v['examplelink'] ) {
309
  HTML::make_info(
315
  </label>
316
  </p>
317
  <p>
318
+ <input type="url" name="<?php Input::field_name( $v['option'] ); ?>" class="large-text" id="<?php Input::field_id( $v['option'] ); ?>" placeholder="<?= esc_attr( $v['placeholder'] ) ?>" value="<?= esc_attr( $this->get_option( $v['option'] ) ) ?>" autocomplete=off />
319
  </p>
320
  <?php
321
  }
inc/views/settings/metaboxes/sitemaps.php CHANGED
@@ -158,7 +158,7 @@ switch ( $this->get_view_instance( 'sitemaps', $instance ) ) :
158
 
159
  ?>
160
  <p>
161
- <input type="number" min=1 max=50000 name="<?php Input::field_name( 'sitemap_query_limit' ); ?>" id="<?php Input::field_id( 'sitemap_query_limit' ); ?>" placeholder="<?php echo absint( $this->get_default_option( 'sitemap_query_limit' ) ); ?>" value="<?php echo absint( $this->get_option( 'sitemap_query_limit' ) ); ?>" />
162
  </p>
163
  <?php
164
  HTML::description( __( 'Consider lowering this value when the sitemap shows a white screen or notifies you of memory exhaustion.', 'autodescription' ) );
@@ -336,7 +336,7 @@ switch ( $this->get_view_instance( 'sitemaps', $instance ) ) :
336
  </label>
337
  </p>
338
  <p>
339
- <input type="text" name="<?php Input::field_name( 'sitemap_color_main' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'sitemap_color_main' ); ?>" placeholder="<?php echo esc_attr( $default_colors['main'] ); ?>" value="<?php echo esc_attr( $current_colors['main'] ); ?>" data-tsf-default-color="<?php echo esc_attr( $default_colors['main'] ); ?>" />
340
  </p>
341
 
342
  <p>
@@ -345,7 +345,7 @@ switch ( $this->get_view_instance( 'sitemaps', $instance ) ) :
345
  </label>
346
  </p>
347
  <p>
348
- <input type="text" name="<?php Input::field_name( 'sitemap_color_accent' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'sitemap_color_accent' ); ?>" placeholder="<?php echo esc_attr( $default_colors['accent'] ); ?>" value="<?php echo esc_attr( $current_colors['accent'] ); ?>" data-tsf-default-color="<?php echo esc_attr( $default_colors['accent'] ); ?>" />
349
  </p>
350
 
351
  <hr>
@@ -373,8 +373,8 @@ switch ( $this->get_view_instance( 'sitemaps', $instance ) ) :
373
  </p>
374
  <p class="hide-if-tsf-js attention"><?php esc_html_e( 'Setting a logo requires JavaScript.', 'autodescription' ); ?></p>
375
  <p>
376
- <input class="large-text" type="url" readonly="readonly" data-readonly="1" name="<?php Input::field_name( 'sitemap_logo_url' ); ?>" id="sitemap_logo-url" placeholder="<?php echo esc_url( $logo_placeholder ); ?>" value="<?php echo esc_url( $this->get_option( 'sitemap_logo_url' ) ); ?>" />
377
- <input type="hidden" name="<?php Input::field_name( 'sitemap_logo_id' ); ?>" id="sitemap_logo-id" value="<?php echo absint( $this->get_option( 'sitemap_logo_id' ) ); ?>" />
378
  </p>
379
  <p class="hide-if-no-tsf-js">
380
  <?php
158
 
159
  ?>
160
  <p>
161
+ <input type="number" min=1 max=50000 name="<?php Input::field_name( 'sitemap_query_limit' ); ?>" id="<?php Input::field_id( 'sitemap_query_limit' ); ?>" placeholder="<?= absint( $this->get_default_option( 'sitemap_query_limit' ) ) ?>" value="<?= absint( $this->get_option( 'sitemap_query_limit' ) ) ?>" />
162
  </p>
163
  <?php
164
  HTML::description( __( 'Consider lowering this value when the sitemap shows a white screen or notifies you of memory exhaustion.', 'autodescription' ) );
336
  </label>
337
  </p>
338
  <p>
339
+ <input type="text" name="<?php Input::field_name( 'sitemap_color_main' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'sitemap_color_main' ); ?>" placeholder="<?= esc_attr( $default_colors['main'] ) ?>" value="<?= esc_attr( $current_colors['main'] ) ?>" data-tsf-default-color="<?= esc_attr( $default_colors['main'] ) ?>" />
340
  </p>
341
 
342
  <p>
345
  </label>
346
  </p>
347
  <p>
348
+ <input type="text" name="<?php Input::field_name( 'sitemap_color_accent' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'sitemap_color_accent' ); ?>" placeholder="<?= esc_attr( $default_colors['accent'] ) ?>" value="<?= esc_attr( $current_colors['accent'] ) ?>" data-tsf-default-color="<?= esc_attr( $default_colors['accent'] ) ?>" />
349
  </p>
350
 
351
  <hr>
373
  </p>
374
  <p class="hide-if-tsf-js attention"><?php esc_html_e( 'Setting a logo requires JavaScript.', 'autodescription' ); ?></p>
375
  <p>
376
+ <input class="large-text" type="url" readonly="readonly" data-readonly="1" name="<?php Input::field_name( 'sitemap_logo_url' ); ?>" id="sitemap_logo-url" placeholder="<?= esc_url( $logo_placeholder ) ?>" value="<?= esc_url( $this->get_option( 'sitemap_logo_url' ) ) ?>" />
377
+ <input type="hidden" name="<?php Input::field_name( 'sitemap_logo_id' ); ?>" id="sitemap_logo-id" value="<?= absint( $this->get_option( 'sitemap_logo_id' ) ) ?>" />
378
  </p>
379
  <p class="hide-if-no-tsf-js">
380
  <?php
inc/views/settings/metaboxes/social.php CHANGED
@@ -149,8 +149,8 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
149
  </label>
150
  </p>
151
  <p>
152
- <input class="large-text" type="url" name="<?php Input::field_name( 'social_image_fb_url' ); ?>" id="tsf_fb_socialimage-url" value="<?php echo esc_url( $this->get_option( 'social_image_fb_url' ) ); ?>" />
153
- <input type="hidden" name="<?php Input::field_name( 'social_image_fb_id' ); ?>" id="tsf_fb_socialimage-id" value="<?php echo absint( $this->get_option( 'social_image_fb_id' ) ); ?>" disabled class="tsf-enable-media-if-js" />
154
  </p>
155
  <p class="hide-if-no-tsf-js">
156
  <?php
@@ -169,7 +169,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
169
  </label>
170
  </p>
171
  <p>
172
- <input type="text" name="<?php Input::field_name( 'theme_color' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'theme_color' ); ?>" value="<?php echo esc_attr( $this->get_option( 'theme_color' ) ); ?>" data-tsf-default-color="" />
173
  </p>
174
  <hr>
175
  <?php
@@ -214,7 +214,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
214
  </label>
215
  </p>
216
  <p>
217
- <input type="text" name="<?php Input::field_name( 'facebook_appid' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'facebook_appid' ); ?>" placeholder="<?php echo esc_attr( $fb_appid_placeholder ); ?>" value="<?php echo esc_attr( $fb_appid ); ?>" />
218
  </p>
219
 
220
  <p>
@@ -230,7 +230,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
230
  </label>
231
  </p>
232
  <p>
233
- <input type="url" name="<?php Input::field_name( 'facebook_publisher' ); ?>" class="large-text" id="<?php Input::field_id( 'facebook_publisher' ); ?>" placeholder="<?php echo esc_attr( $fb_publisher_placeholder ); ?>" value="<?php echo esc_attr( $fb_publisher ); ?>" />
234
  </p>
235
 
236
  <p>
@@ -247,7 +247,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
247
  </p>
248
  <?php HTML::description( __( 'Authors can override this option on their profile page.', 'autodescription' ) ); ?>
249
  <p>
250
- <input type="url" name="<?php Input::field_name( 'facebook_author' ); ?>" class="large-text" id="<?php Input::field_id( 'facebook_author' ); ?>" placeholder="<?php echo esc_attr( $fb_author_placeholder ); ?>" value="<?php echo esc_attr( $fb_author ); ?>" />
251
  </p>
252
  <?php
253
  break;
@@ -280,7 +280,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
280
  foreach ( $twitter_card as $type => $name ) {
281
  ?>
282
  <span class="tsf-toblock">
283
- <input type="radio" name="<?php Input::field_name( 'twitter_card' ); ?>" id="<?php Input::field_id( "twitter_card_{$type}" ); ?>" value="<?php echo esc_attr( $type ); ?>" <?php checked( $this->get_option( 'twitter_card' ), $type ); ?> />
284
  <label for="<?php Input::field_id( "twitter_card_{$type}" ); ?>">
285
  <span>
286
  <?php
@@ -321,7 +321,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
321
  </label>
322
  </p>
323
  <p>
324
- <input type="text" name="<?php Input::field_name( 'twitter_site' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'twitter_site' ); ?>" placeholder="<?php echo esc_attr( $tw_site_placeholder ); ?>" value="<?php echo esc_attr( $tw_site ); ?>" />
325
  </p>
326
 
327
  <p>
@@ -338,7 +338,7 @@ switch ( $this->get_view_instance( 'social', $instance ) ) :
338
  </p>
339
  <?php HTML::description( __( 'Authors can override this option on their profile page.', 'autodescription' ) ); ?>
340
  <p>
341
- <input type="text" name="<?php Input::field_name( 'twitter_creator' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'twitter_creator' ); ?>" placeholder="<?php echo esc_attr( $tw_creator_placeholder ); ?>" value="<?php echo esc_attr( $tw_creator ); ?>" />
342
  </p>
343
  <?php
344
  break;
149
  </label>
150
  </p>
151
  <p>
152
+ <input class="large-text" type="url" name="<?php Input::field_name( 'social_image_fb_url' ); ?>" id="tsf_fb_socialimage-url" value="<?= esc_url( $this->get_option( 'social_image_fb_url' ) ) ?>" />
153
+ <input type="hidden" name="<?php Input::field_name( 'social_image_fb_id' ); ?>" id="tsf_fb_socialimage-id" value="<?= absint( $this->get_option( 'social_image_fb_id' ) ) ?>" disabled class="tsf-enable-media-if-js" />
154
  </p>
155
  <p class="hide-if-no-tsf-js">
156
  <?php
169
  </label>
170
  </p>
171
  <p>
172
+ <input type="text" name="<?php Input::field_name( 'theme_color' ); ?>" class="tsf-color-picker" id="<?php Input::field_id( 'theme_color' ); ?>" value="<?= esc_attr( $this->get_option( 'theme_color' ) ) ?>" data-tsf-default-color="" />
173
  </p>
174
  <hr>
175
  <?php
214
  </label>
215
  </p>
216
  <p>
217
+ <input type="text" name="<?php Input::field_name( 'facebook_appid' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'facebook_appid' ); ?>" placeholder="<?= esc_attr( $fb_appid_placeholder ) ?>" value="<?= esc_attr( $fb_appid ) ?>" />
218
  </p>
219
 
220
  <p>
230
  </label>
231
  </p>
232
  <p>
233
+ <input type="url" name="<?php Input::field_name( 'facebook_publisher' ); ?>" class="large-text" id="<?php Input::field_id( 'facebook_publisher' ); ?>" placeholder="<?= esc_attr( $fb_publisher_placeholder ) ?>" value="<?= esc_attr( $fb_publisher ) ?>" />
234
  </p>
235
 
236
  <p>
247
  </p>
248
  <?php HTML::description( __( 'Authors can override this option on their profile page.', 'autodescription' ) ); ?>
249
  <p>
250
+ <input type="url" name="<?php Input::field_name( 'facebook_author' ); ?>" class="large-text" id="<?php Input::field_id( 'facebook_author' ); ?>" placeholder="<?= esc_attr( $fb_author_placeholder ) ?>" value="<?= esc_attr( $fb_author ) ?>" />
251
  </p>
252
  <?php
253
  break;
280
  foreach ( $twitter_card as $type => $name ) {
281
  ?>
282
  <span class="tsf-toblock">
283
+ <input type="radio" name="<?php Input::field_name( 'twitter_card' ); ?>" id="<?php Input::field_id( "twitter_card_{$type}" ); ?>" value="<?= esc_attr( $type ) ?>" <?php checked( $this->get_option( 'twitter_card' ), $type ); ?> />
284
  <label for="<?php Input::field_id( "twitter_card_{$type}" ); ?>">
285
  <span>
286
  <?php
321
  </label>
322
  </p>
323
  <p>
324
+ <input type="text" name="<?php Input::field_name( 'twitter_site' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'twitter_site' ); ?>" placeholder="<?= esc_attr( $tw_site_placeholder ) ?>" value="<?= esc_attr( $tw_site ) ?>" />
325
  </p>
326
 
327
  <p>
338
  </p>
339
  <?php HTML::description( __( 'Authors can override this option on their profile page.', 'autodescription' ) ); ?>
340
  <p>
341
+ <input type="text" name="<?php Input::field_name( 'twitter_creator' ); ?>" class="large-text ltr" id="<?php Input::field_id( 'twitter_creator' ); ?>" placeholder="<?= esc_attr( $tw_creator_placeholder ) ?>" value="<?= esc_attr( $tw_creator ) ?>" />
342
  </p>
343
  <?php
344
  break;
inc/views/settings/metaboxes/title.php CHANGED
@@ -109,10 +109,13 @@ switch ( $this->get_view_instance( 'title', $instance ) ) :
109
  && ! defined( 'TSFEM_E_TITLE_FIX' )
110
  && current_user_can( 'install_plugins' )
111
  ) {
 
 
 
112
  /* translators: %s = title-tag */
113
- $_h4 = sprintf( esc_html__( 'Theme %s Support Missing', 'autodescription' ), '<code>title-tag</code>' );
114
  ?>
115
- <h4 class=attention><?php echo $_h4; // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped ?></h4>
116
  <?php
117
  HTML::description_noesc(
118
  $this->convert_markdown(
@@ -233,7 +236,7 @@ switch ( $this->get_view_instance( 'title', $instance ) ) :
233
  </label>
234
  </p>
235
  <p class=tsf-title-wrap>
236
- <input type="text" name="<?php Input::field_name( 'site_title' ); ?>" class="large-text" id="<?php Input::field_id( 'site_title' ); ?>" placeholder="<?php echo esc_attr( $this->s_title_raw( $this->get_filtered_raw_blogname() ) ); ?>" value="<?php echo $this->esc_attr_preserve_amp( $this->get_option( 'site_title' ) ); ?>" autocomplete=off />
237
  </p>
238
  <?php
239
  HTML::description( __( 'This option does not affect titles displayed directly on your website.', 'autodescription' ) );
109
  && ! defined( 'TSFEM_E_TITLE_FIX' )
110
  && current_user_can( 'install_plugins' )
111
  ) {
112
+ ?>
113
+ <h4>
114
+ <?php
115
  /* translators: %s = title-tag */
116
+ printf( esc_html__( 'Theme %s Support Missing', 'autodescription' ), '<code>title-tag</code>' );
117
  ?>
118
+ </h4>
119
  <?php
120
  HTML::description_noesc(
121
  $this->convert_markdown(
236
  </label>
237
  </p>
238
  <p class=tsf-title-wrap>
239
+ <input type="text" name="<?php Input::field_name( 'site_title' ); ?>" class="large-text" id="<?php Input::field_id( 'site_title' ); ?>" placeholder="<?= esc_attr( $this->s_title_raw( $this->get_filtered_raw_blogname() ) ) ?>" value="<?= $this->esc_attr_preserve_amp( $this->get_option( 'site_title' ) ) ?>" autocomplete=off />
240
  </p>
241
  <?php
242
  HTML::description( __( 'This option does not affect titles displayed directly on your website.', 'autodescription' ) );
inc/views/settings/wrap-content.php CHANGED
@@ -27,7 +27,7 @@ foreach ( $tabs as $tab => $params ) :
27
  $current_class = 1 === $count ? ' tsf-nav-tab-content-active' : '';
28
 
29
  ?>
30
- <div class="tsf-nav-tab-content <?php echo esc_attr( $radio_class . $current_class ); ?>" id="<?php echo esc_attr( $radio_id ); ?>" >
31
  <?php
32
  // No-JS tabs.
33
  if ( $use_tabs ) :
@@ -38,8 +38,8 @@ foreach ( $tabs as $tab => $params ) :
38
  <div class="hide-if-tsf-js tsf-nav-tab-content-no-js">
39
  <div class="tsf-tab tsf-nav-tab-no-js">
40
  <span class="tsf-nav-tab-label tsf-nav-tab-active">
41
- <?php echo $dashicon ? '<span class="dashicons dashicons-' . esc_attr( $dashicon ) . ' tsf-dashicons-tabs"></span>' : ''; ?>
42
- <?php echo $name ? '<span>' . esc_html( $name ) . '</span>' : ''; ?>
43
  </span>
44
  </div>
45
  </div>
27
  $current_class = 1 === $count ? ' tsf-nav-tab-content-active' : '';
28
 
29
  ?>
30
+ <div class="tsf-nav-tab-content <?= esc_attr( $radio_class . $current_class ) ?>" id="<?= esc_attr( $radio_id ) ?>" >
31
  <?php
32
  // No-JS tabs.
33
  if ( $use_tabs ) :
38
  <div class="hide-if-tsf-js tsf-nav-tab-content-no-js">
39
  <div class="tsf-tab tsf-nav-tab-no-js">
40
  <span class="tsf-nav-tab-label tsf-nav-tab-active">
41
+ <?= $dashicon ? '<span class="dashicons dashicons-' . esc_attr( $dashicon ) . ' tsf-dashicons-tabs"></span>' : '' ?>
42
+ <?= $name ? '<span>' . esc_html( $name ) . '</span>' : '' ?>
43
  </span>
44
  </div>
45
  </div>
inc/views/settings/wrap-nav.php CHANGED
@@ -20,7 +20,7 @@ $count = 1;
20
  */
21
  if ( $use_tabs ) :
22
  ?>
23
- <div class="tsf-nav-tab-wrapper hide-if-no-tsf-js" id="<?php echo esc_attr( $id . '-tabs-wrapper' ); ?>">
24
  <?php
25
  foreach ( $tabs as $tab => $value ) :
26
  $dashicon = $value['dashicon'] ?? '';
20
  */
21
  if ( $use_tabs ) :
22
  ?>
23
+ <div class="tsf-nav-tab-wrapper hide-if-no-tsf-js" id="<?= esc_attr( $id . '-tabs-wrapper' ) ?>">
24
  <?php
25
  foreach ( $tabs as $tab => $value ) :
26
  $dashicon = $value['dashicon'] ?? '';
inc/views/settings/wrap.php CHANGED
@@ -40,7 +40,7 @@ $_reset_button = get_submit_button(
40
  <?php settings_fields( THE_SEO_FRAMEWORK_SITE_OPTIONS ); ?>
41
 
42
  <div class=tsf-top-wrap>
43
- <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
44
  <p class=tsf-top-buttons>
45
  <?php
46
  // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped -- submit_button() escapes (mostly...)
@@ -75,7 +75,7 @@ $_reset_button = get_submit_button(
75
  // close postboxes that should be closed
76
  $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
77
  // postboxes setup
78
- postboxes.add_postbox_toggles('<?php echo esc_js( $this->seo_settings_page_hook ); ?>');
79
  } );
80
  //]]>
81
  </script>
40
  <?php settings_fields( THE_SEO_FRAMEWORK_SITE_OPTIONS ); ?>
41
 
42
  <div class=tsf-top-wrap>
43
+ <h1><?= esc_html( get_admin_page_title() ) ?></h1>
44
  <p class=tsf-top-buttons>
45
  <?php
46
  // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped -- submit_button() escapes (mostly...)
75
  // close postboxes that should be closed
76
  $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
77
  // postboxes setup
78
+ postboxes.add_postbox_toggles('<?= esc_js( $this->seo_settings_page_hook ) ?>');
79
  } );
80
  //]]>
81
  </script>
inc/views/sitemap/xsl-stylesheet.php CHANGED
@@ -30,7 +30,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>', PHP_EOL;
30
  do_action( 'the_seo_framework_xsl_head', $this );
31
  ?>
32
  </head>
33
- <body class="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>">
34
  <div id="description">
35
  <div class="wrap">
36
  <?php
30
  do_action( 'the_seo_framework_xsl_head', $this );
31
  ?>
32
  </head>
33
+ <body class="<?= is_rtl() ? 'rtl' : 'ltr' ?>">
34
  <div id="description">
35
  <div class="wrap">
36
  <?php
inc/views/sitemap/xsl/table.php CHANGED
@@ -35,16 +35,16 @@ if ( $this->get_option( 'sitemaps_modified' ) ) {
35
  <table>
36
  <thead>
37
  <tr>
38
- <?php echo $url['th']; ?>
39
- <?php echo $last_updated['th']; ?>
40
  </tr>
41
  </thead>
42
  <tbody>
43
  <xsl:for-each select="sitemap:urlset/sitemap:url">
44
- <?php echo implode( $vars ); ?>
45
  <tr>
46
- <?php echo $url['td']; ?>
47
- <?php echo $last_updated['td']; ?>
48
  </tr>
49
  </xsl:for-each>
50
  </tbody>
35
  <table>
36
  <thead>
37
  <tr>
38
+ <?= $url['th'] ?>
39
+ <?= $last_updated['th'] ?>
40
  </tr>
41
  </thead>
42
  <tbody>
43
  <xsl:for-each select="sitemap:urlset/sitemap:url">
44
+ <?= implode( $vars ) ?>
45
  <tr>
46
+ <?= $url['td'] ?>
47
+ <?= $last_updated['td'] ?>
48
  </tr>
49
  </xsl:for-each>
50
  </tbody>
inc/views/sitemap/xsl/title.php CHANGED
@@ -14,4 +14,4 @@ $sep = $this->get_title_separator();
14
  $addition = $this->get_blogname();
15
 
16
  ?>
17
- <title><?php echo esc_xml( $this->s_title_raw( "$title $sep $addition" ) ); ?></title>
14
  $addition = $this->get_blogname();
15
 
16
  ?>
17
+ <title><?= esc_xml( $this->s_title_raw( "$title $sep $addition" ) ) ?></title>
lib/js/ays.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/c.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/description.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/gbc.js CHANGED
@@ -11,7 +11,7 @@
11
 
12
  /**
13
  * The SEO Framework plugin
14
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
15
  *
16
  * This program is free software: you can redistribute it and/or modify
17
  * it under the terms of the GNU General Public License version 3 as published
11
 
12
  /**
13
  * The SEO Framework plugin
14
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
15
  *
16
  * This program is free software: you can redistribute it and/or modify
17
  * it under the terms of the GNU General Public License version 3 as published
lib/js/le.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
@@ -78,7 +78,8 @@ window.tsfLe = function() {
78
  const data = JSON.parse( document.getElementById( `tsfLeData[${id}]` )?.dataset.le || 0 ) || {};
79
 
80
  for ( const option in data ) {
81
- let element = document.getElementById( 'autodescription-quick[%s]'.replace( '%s', option ) );
 
82
  if ( ! element ) continue;
83
 
84
  if ( data[ option ].isSelect ) {
@@ -90,6 +91,9 @@ window.tsfLe = function() {
90
  _default.innerHTML = _default.innerHTML.replace( '%s', tsf.decodeEntities( data[ option ].default ) );
91
  } else {
92
  element.value = tsf.decodeEntities( data[ option ].value );
 
 
 
93
  }
94
  }
95
  }
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
78
  const data = JSON.parse( document.getElementById( `tsfLeData[${id}]` )?.dataset.le || 0 ) || {};
79
 
80
  for ( const option in data ) {
81
+ const element = document.getElementById( 'autodescription-quick[%s]'.replace( '%s', option ) );
82
+
83
  if ( ! element ) continue;
84
 
85
  if ( data[ option ].isSelect ) {
91
  _default.innerHTML = _default.innerHTML.replace( '%s', tsf.decodeEntities( data[ option ].default ) );
92
  } else {
93
  element.value = tsf.decodeEntities( data[ option ].value );
94
+
95
+ if ( data[ option ].placeholder )
96
+ element.placeholder = tsf.decodeEntities( data[ option ].placeholder );
97
  }
98
  }
99
  }
lib/js/le.min.js CHANGED
@@ -1 +1 @@
1
- 'use strict';window.tsfLe=function(){let a;const b=()=>{clearTimeout(a),a=setTimeout(()=>{document.dispatchEvent(new Event("tsfLeUpdated"))},50)},c=()=>{tsfTT?.triggerReset()},d=a=>{const b=JSON.parse(document.getElementById(`tsfLeData[${a}]`)?.dataset.le||0)||{};for(const c in b){let a=document.getElementById("autodescription-quick[%s]".replace("%s",c));if(a)if(b[c].isSelect){tsf.selectByValue(a,b[c].value);let d=a.querySelector("[value=\"0\"]");d&&(d.innerHTML=d.innerHTML.replace("%s",tsf.decodeEntities(b[c].default)))}else a.value=tsf.decodeEntities(b[c].value)}},e=a=>d(a),f=a=>JSON.parse(document.getElementById(`tsfLePostData[${a}]`)?.dataset.lePostData||0)||{},g=a=>{let b=(a.originalEvent||a).target,c=b.dataset.tsfTitleId,d="",e="public";switch(e="keep_private"===b.name?b.checked?"private":"public":b.value&&b.value.length?"password":"public",e){case"password":d=tsfTitle.protectedPrefix;break;case"private":d=tsfTitle.privatePrefix;break;default:case"public":d="";}tsfTitle.updateStateOf(c,"prefixValue",d)},h=a=>{const b=(a.originalEvent||a).target,c=b.dataset?.tsfTitleId,d=b.value?.trim()||"",e=b.dataset?.termPrefix?.trim()||"";let f=tsfTitle.stripTitleTags?tsf.stripTags(d):d;f||=tsfTitle.untitledTitle,e.length&&(window.isRtl?f=`${f} ${e}`:f=`${e} ${f}`),f=tsf.escapeString(tsf.decodeEntities(f.trim())),tsfTitle.updateStateOf(c,"defaultTitle",f)},i=a=>{const b="autodescription-quick[doctitle]",c=document.getElementById(b);tsfTitle.setInputElement(c);const d=JSON.parse(document.getElementById(`tsfLeTitleData[${a}]`)?.dataset.leTitle||0);d&&(tsfTitle.updateStateOf(b,"allowReferenceChange",!d.refTitleLocked),tsfTitle.updateStateOf(b,"defaultTitle",d.defaultTitle.trim()),tsfTitle.updateStateOf(b,"addAdditions",d.addAdditions),tsfTitle.updateStateOf(b,"additionValue",d.additionValue.trim()),tsfTitle.updateStateOf(b,"additionPlacement",d.additionPlacement));let e=document.getElementById(`edit-${a}`);e&&(e.querySelectorAll("[name=post_password]").forEach(a=>{a.dataset.tsfTitleId=b,a.addEventListener("input",g),a.dispatchEvent(new CustomEvent("input"))}),e.querySelectorAll("[name=keep_private]").forEach(a=>{a.dataset.tsfTitleId=b,a.addEventListener("click",g),a.dispatchEvent(new CustomEvent("click"))}),e.querySelectorAll("[name=post_title]").forEach(c=>{c.dataset.tsfTitleId=b,f(a).isFront||(c.addEventListener("input",h),c.dispatchEvent(new CustomEvent("input")))}),e.querySelectorAll("[name=name]").forEach(a=>{a.dataset.tsfTitleId=b,a.dataset.termPrefix=d.termPrefix||"",a.addEventListener("input",h),a.dispatchEvent(new CustomEvent("input"))})),tsfTT?.triggerReset()},j=a=>{const b="autodescription-quick[description]",c=document.getElementById(b);tsfDescription.setInputElement(c);const d=JSON.parse(document.getElementById(`tsfLeDescriptionData[${a}]`)?.dataset.leDescription||0);d&&(tsfDescription.updateStateOf(b,"allowReferenceChange",!d.refDescriptionLocked),tsfDescription.updateStateOf(b,"defaultDescription",d.defaultDescription.trim())),tsfTT.triggerReset()},k=()=>{document.addEventListener("tsfLeDispatchUpdate",b),document.addEventListener("tsfLeUpdated",c)},l=()=>{let a,b;a=window.inlineEditPost?.edit,a&&(window.inlineEditPost.edit=function(b){let c=a.apply(this,arguments);return("object"==typeof b&&(b=window.inlineEditPost?.getId(b)),!b)?c:(d(b),i(b),j(b),window.tsfC?.resetCounterListener(),c)}),b=window.inlineEditTax?.edit,b&&(window.inlineEditTax.edit=function(a){let c=b.apply(this,arguments);return("object"==typeof a&&(a=window.inlineEditTax?.getId(a)),!a)?c:(e(a),i(a),j(a),window.tsfC?.resetCounterListener(),c)})};return{load:()=>{document.body.addEventListener("tsf-onload",k),document.body.addEventListener("tsf-onload",l)}}}(),window.tsfLe.load();
1
+ 'use strict';window.tsfLe=function(){let a;const b=()=>{clearTimeout(a),a=setTimeout(()=>{document.dispatchEvent(new Event("tsfLeUpdated"))},50)},c=()=>{tsfTT?.triggerReset()},d=a=>{const b=JSON.parse(document.getElementById(`tsfLeData[${a}]`)?.dataset.le||0)||{};for(const c in b){const a=document.getElementById("autodescription-quick[%s]".replace("%s",c));if(a)if(b[c].isSelect){tsf.selectByValue(a,b[c].value);let d=a.querySelector("[value=\"0\"]");d&&(d.innerHTML=d.innerHTML.replace("%s",tsf.decodeEntities(b[c].default)))}else a.value=tsf.decodeEntities(b[c].value),b[c].placeholder&&(a.placeholder=tsf.decodeEntities(b[c].placeholder))}},e=a=>d(a),f=a=>JSON.parse(document.getElementById(`tsfLePostData[${a}]`)?.dataset.lePostData||0)||{},g=a=>{let b=(a.originalEvent||a).target,c=b.dataset.tsfTitleId,d="",e="public";switch(e="keep_private"===b.name?b.checked?"private":"public":b.value&&b.value.length?"password":"public",e){case"password":d=tsfTitle.protectedPrefix;break;case"private":d=tsfTitle.privatePrefix;break;default:case"public":d="";}tsfTitle.updateStateOf(c,"prefixValue",d)},h=a=>{const b=(a.originalEvent||a).target,c=b.dataset?.tsfTitleId,d=b.value?.trim()||"",e=b.dataset?.termPrefix?.trim()||"";let f=tsfTitle.stripTitleTags?tsf.stripTags(d):d;f||=tsfTitle.untitledTitle,e.length&&(window.isRtl?f=`${f} ${e}`:f=`${e} ${f}`),f=tsf.escapeString(tsf.decodeEntities(f.trim())),tsfTitle.updateStateOf(c,"defaultTitle",f)},i=a=>{const b="autodescription-quick[doctitle]",c=document.getElementById(b);tsfTitle.setInputElement(c);const d=JSON.parse(document.getElementById(`tsfLeTitleData[${a}]`)?.dataset.leTitle||0);d&&(tsfTitle.updateStateOf(b,"allowReferenceChange",!d.refTitleLocked),tsfTitle.updateStateOf(b,"defaultTitle",d.defaultTitle.trim()),tsfTitle.updateStateOf(b,"addAdditions",d.addAdditions),tsfTitle.updateStateOf(b,"additionValue",d.additionValue.trim()),tsfTitle.updateStateOf(b,"additionPlacement",d.additionPlacement));let e=document.getElementById(`edit-${a}`);e&&(e.querySelectorAll("[name=post_password]").forEach(a=>{a.dataset.tsfTitleId=b,a.addEventListener("input",g),a.dispatchEvent(new CustomEvent("input"))}),e.querySelectorAll("[name=keep_private]").forEach(a=>{a.dataset.tsfTitleId=b,a.addEventListener("click",g),a.dispatchEvent(new CustomEvent("click"))}),e.querySelectorAll("[name=post_title]").forEach(c=>{c.dataset.tsfTitleId=b,f(a).isFront||(c.addEventListener("input",h),c.dispatchEvent(new CustomEvent("input")))}),e.querySelectorAll("[name=name]").forEach(a=>{a.dataset.tsfTitleId=b,a.dataset.termPrefix=d.termPrefix||"",a.addEventListener("input",h),a.dispatchEvent(new CustomEvent("input"))})),tsfTT?.triggerReset()},j=a=>{const b="autodescription-quick[description]",c=document.getElementById(b);tsfDescription.setInputElement(c);const d=JSON.parse(document.getElementById(`tsfLeDescriptionData[${a}]`)?.dataset.leDescription||0);d&&(tsfDescription.updateStateOf(b,"allowReferenceChange",!d.refDescriptionLocked),tsfDescription.updateStateOf(b,"defaultDescription",d.defaultDescription.trim())),tsfTT.triggerReset()},k=()=>{document.addEventListener("tsfLeDispatchUpdate",b),document.addEventListener("tsfLeUpdated",c)},l=()=>{let a,b;a=window.inlineEditPost?.edit,a&&(window.inlineEditPost.edit=function(b){let c=a.apply(this,arguments);return("object"==typeof b&&(b=window.inlineEditPost?.getId(b)),!b)?c:(d(b),i(b),j(b),window.tsfC?.resetCounterListener(),c)}),b=window.inlineEditTax?.edit,b&&(window.inlineEditTax.edit=function(a){let c=b.apply(this,arguments);return("object"==typeof a&&(a=window.inlineEditTax?.getId(a)),!a)?c:(e(a),i(a),j(a),window.tsfC?.resetCounterListener(),c)})};return{load:()=>{document.body.addEventListener("tsf-onload",k),document.body.addEventListener("tsf-onload",l)}}}(),window.tsfLe.load();
lib/js/media.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2018 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2018 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/post.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/pt-gb.js CHANGED
@@ -7,7 +7,7 @@
7
 
8
  /**
9
  * The SEO Framework plugin
10
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
7
 
8
  /**
9
  * The SEO Framework plugin
10
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
11
  *
12
  * This program is free software: you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License version 3 as published
lib/js/pt.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/settings.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/social.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/tabs.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2020 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2020 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/term.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/title.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/tsf.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2015 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2015 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
lib/js/tt.js CHANGED
@@ -8,7 +8,7 @@
8
 
9
  /**
10
  * The SEO Framework plugin
11
- * Copyright (C) 2019 - 2021 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
8
 
9
  /**
10
  * The SEO Framework plugin
11
+ * Copyright (C) 2019 - 2022 Sybre Waaijer, CyberWire B.V. (https://cyberwire.nl/)
12
  *
13
  * This program is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License version 3 as published
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === The SEO Framework ===
2
  Contributors: Cybr
3
  Donate link: https://github.com/sponsors/sybrew
4
  Tags: seo, xml sitemap, google search, open graph, schema.org, twitter card, performance, headless
5
  Requires at least: 5.5.0
6
- Tested up to: 5.8
7
  Requires PHP: 7.2.0
8
- Stable tag: 4.2.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -141,7 +141,7 @@ If you wish to learn more, please refer to the [EU commission on copyright](http
141
  = This plugin requires: =
142
 
143
  * PHP 7.2 or higher.
144
- * WordPress 5.1 or higher.
145
  * Any modern browser for administration.
146
 
147
  = Installation instructions: =
@@ -247,6 +247,10 @@ If you wish to display breadcrumbs, then your theme should provide this. Alterna
247
 
248
  == Changelog ==
249
 
 
 
 
 
250
  = 4.2.2 =
251
 
252
  This minor update addresses a regression where the homepage canonical URL was [missing a trailing slash](https://theseoframework.com/?p=3841).
1
+ === The SEO Framework – Automated, Effortless, Fast. ===
2
  Contributors: Cybr
3
  Donate link: https://github.com/sponsors/sybrew
4
  Tags: seo, xml sitemap, google search, open graph, schema.org, twitter card, performance, headless
5
  Requires at least: 5.5.0
6
+ Tested up to: 5.9
7
  Requires PHP: 7.2.0
8
+ Stable tag: 4.2.3
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
141
  = This plugin requires: =
142
 
143
  * PHP 7.2 or higher.
144
+ * WordPress 5.5 or higher.
145
  * Any modern browser for administration.
146
 
147
  = Installation instructions: =
247
 
248
  == Changelog ==
249
 
250
+ = 4.2.3 =
251
+
252
+ This minor update addresses a regression where the singular-archive canonical URLs always [pointed to the first page](https://theseoframework.com/?p=3858).
253
+
254
  = 4.2.2 =
255
 
256
  This minor update addresses a regression where the homepage canonical URL was [missing a trailing slash](https://theseoframework.com/?p=3841).