Yoast SEO - Version 16.4

Version Description

Release Date: June 1st, 2021

Meet Yoast SEO 16.4: This brand-new version of Yoast SEO comes with a rewritten language analysis, plus a newly supported language: Czech. People who write in this language can now fully use our tools to improve their content. We hope you enjoy this update! Read more about whats new in Yoast SEO 16.4 in our release post!

Enhancements:

  • Completes the readability analysis for Czech by adding the transition words, sentence beginnings and passive voice assessments.
  • Improves keyphrase recognition in Czech by filtering out function words such as dvou, tvmu, njak.
  • Improves the accuracy of passive voice detection in Portuguese.
  • Adds the missing Polish transition word jak wiemy (props to @jarekherisz).
  • Makes all twitter meta tags self-closing, for the sake of consistency and to allow pages to pass validation in some tools.
  • Improves the UX consistency between the notification counter in the admin bar and in the sidebar.

Bugfixes:

  • Fixes a bug where new feature notification couldn't be dismissed.
  • Fixes a bug where the primary term for custom post types was not always properly set for posts edited in the Gutenberg editor.
  • Fixes a bug where the schema output could be incorrect on terms with the same ID as the static posts page.

Other:

  • Adds a missing space to the feedback text in the keyphrase in introduction assessment.
Download this release

Release Info

Developer Yoast
Plugin Icon 128x128 Yoast SEO
Version 16.4
Comparing to
See all releases

Code changes from version 16.3 to 16.4

Files changed (162) hide show
  1. admin/class-admin-asset-analysis-worker-location.php +3 -3
  2. admin/class-admin-asset-dev-server-location.php +2 -2
  3. admin/class-admin-asset-manager.php +262 -599
  4. admin/class-admin-asset-seo-location.php +15 -3
  5. admin/class-admin-asset-yoast-components-l10n.php +1 -1
  6. admin/class-admin-init.php +1 -1
  7. admin/class-admin.php +6 -8
  8. admin/class-asset.php +3 -3
  9. admin/class-bulk-editor-list-table.php +3 -3
  10. admin/class-config.php +2 -1
  11. admin/class-customizer.php +7 -7
  12. admin/class-database-proxy.php +7 -7
  13. admin/class-export.php +2 -2
  14. admin/class-gutenberg-compatibility.php +2 -2
  15. admin/class-helpscout.php +2 -0
  16. admin/class-meta-columns.php +3 -3
  17. admin/class-my-yoast-proxy.php +2 -2
  18. admin/class-option-tabs.php +1 -1
  19. admin/class-paper-presenter.php +4 -4
  20. admin/class-plugin-availability.php +1 -1
  21. admin/class-premium-popup.php +10 -10
  22. admin/class-primary-term-admin.php +2 -38
  23. admin/class-product-upsell-notice.php +4 -2
  24. admin/class-remote-request.php +1 -1
  25. admin/class-yoast-form.php +9 -9
  26. admin/class-yoast-input-validation.php +4 -4
  27. admin/class-yoast-network-admin.php +3 -3
  28. admin/class-yoast-notification-center.php +12 -12
  29. admin/class-yoast-notification.php +3 -3
  30. admin/class-yoast-notifications.php +15 -15
  31. admin/config-ui/class-configuration-options-adapter.php +2 -2
  32. admin/config-ui/class-configuration-page.php +1 -1
  33. admin/config-ui/class-configuration-storage.php +1 -1
  34. admin/config-ui/components/class-component-mailchimp-signup.php +1 -1
  35. admin/config-ui/fields/class-field-multiple-authors.php +1 -1
  36. admin/config-ui/fields/class-field-site-name.php +1 -1
  37. admin/filters/class-cornerstone-filter.php +2 -2
  38. admin/formatter/class-metabox-formatter.php +3 -3
  39. admin/formatter/class-post-metabox-formatter.php +1 -1
  40. admin/formatter/class-term-metabox-formatter.php +1 -1
  41. admin/import/plugins/class-import-jetpack.php +1 -1
  42. admin/import/plugins/class-import-seopressor.php +3 -3
  43. admin/import/plugins/class-import-wpseo.php +1 -1
  44. admin/menu/class-base-menu.php +4 -4
  45. admin/metabox/class-metabox-null-tab.php +2 -2
  46. admin/metabox/class-metabox.php +7 -8
  47. admin/notifiers/dismissible-notification.php +8 -8
  48. admin/roles/class-abstract-role-manager.php +1 -1
  49. admin/roles/class-role-manager.php +1 -1
  50. admin/ryte/class-ryte-option.php +1 -1
  51. admin/ryte/class-ryte-request.php +4 -1
  52. admin/ryte/class-ryte.php +2 -2
  53. admin/taxonomy/class-taxonomy-columns.php +5 -5
  54. admin/taxonomy/class-taxonomy-fields-presenter.php +4 -0
  55. admin/taxonomy/class-taxonomy.php +8 -13
  56. admin/tracking/class-tracking-settings-data.php +2 -2
  57. admin/tracking/class-tracking-theme-data.php +1 -1
  58. admin/views/licenses.php +3 -1
  59. admin/views/tabs/metas/paper-content/general/knowledge-graph.php +1 -0
  60. admin/watchers/class-slug-change-watcher.php +3 -3
  61. css/dist/{admin-global-1630-rtl.css → admin-global-1640-rtl.css} +0 -0
  62. css/dist/{admin-global-1630.css → admin-global-1640.css} +0 -0
  63. css/dist/{adminbar-1630-rtl.css → adminbar-1640-rtl.css} +1 -1
  64. css/dist/{adminbar-1630.css → adminbar-1640.css} +1 -1
  65. css/dist/{alerts-1630-rtl.css → alerts-1640-rtl.css} +0 -0
  66. css/dist/{alerts-1630.css → alerts-1640.css} +0 -0
  67. css/dist/{badge-1630-rtl.css → badge-1640-rtl.css} +0 -0
  68. css/dist/{badge-1630.css → badge-1640.css} +0 -0
  69. css/dist/{dashboard-1630-rtl.css → dashboard-1640-rtl.css} +1 -1
  70. css/dist/{dashboard-1630.css → dashboard-1640.css} +1 -1
  71. css/dist/{edit-page-1630-rtl.css → edit-page-1640-rtl.css} +0 -0
  72. css/dist/{edit-page-1630.css → edit-page-1640.css} +0 -0
  73. css/dist/{elementor-1630-rtl.css → elementor-1640-rtl.css} +0 -0
  74. css/dist/{elementor-1630.css → elementor-1640.css} +0 -0
  75. css/dist/{featured-image-1630-rtl.css → featured-image-1640-rtl.css} +0 -0
  76. css/dist/{featured-image-1630.css → featured-image-1640.css} +0 -0
  77. css/dist/{filter-explanation-1630-rtl.css → filter-explanation-1640-rtl.css} +0 -0
  78. css/dist/{filter-explanation-1630.css → filter-explanation-1640.css} +0 -0
  79. css/dist/{icons-1630-rtl.css → icons-1640-rtl.css} +0 -0
  80. css/dist/{icons-1630.css → icons-1640.css} +0 -0
  81. css/dist/{inside-editor-1630-rtl.css → inside-editor-1640-rtl.css} +0 -0
  82. css/dist/{inside-editor-1630.css → inside-editor-1640.css} +0 -0
  83. css/dist/{metabox-1630-rtl.css → metabox-1640-rtl.css} +1 -1
  84. css/dist/{metabox-1630.css → metabox-1640.css} +1 -1
  85. css/dist/{metabox-primary-category-1630-rtl.css → metabox-primary-category-1640-rtl.css} +0 -0
  86. css/dist/{metabox-primary-category-1630.css → metabox-primary-category-1640.css} +0 -0
  87. css/dist/modal-1630-rtl.css +0 -1
  88. css/dist/modal-1630.css +0 -1
  89. css/dist/modal-1640-rtl.css +1 -0
  90. css/dist/modal-1640.css +1 -0
  91. css/dist/monorepo-1630-rtl.css +0 -1
  92. css/dist/monorepo-1630.css +0 -1
  93. css/dist/monorepo-1640-rtl.css +1 -0
  94. css/dist/monorepo-1640.css +1 -0
  95. css/dist/{notifications-1630-rtl.css → notifications-1640-rtl.css} +0 -0
  96. css/dist/{notifications-1630.css → notifications-1640.css} +0 -0
  97. css/dist/schema-blocks-1630-rtl.css +0 -1
  98. css/dist/schema-blocks-1630.css +0 -1
  99. css/dist/schema-blocks-1640-rtl.css +1 -0
  100. css/dist/schema-blocks-1640.css +1 -0
  101. css/dist/{score_icon-1630-rtl.css → score_icon-1640-rtl.css} +0 -0
  102. css/dist/{score_icon-1630.css → score_icon-1640.css} +0 -0
  103. css/dist/{search-appearance-1630-rtl.css → search-appearance-1640-rtl.css} +0 -0
  104. css/dist/{search-appearance-1630.css → search-appearance-1640.css} +0 -0
  105. css/dist/select2/select2-rtl.css +1 -1
  106. css/dist/select2/select2.min.css +1 -1
  107. css/dist/{structured-data-blocks-1630-rtl.css → structured-data-blocks-1640-rtl.css} +0 -0
  108. css/dist/{structured-data-blocks-1630.css → structured-data-blocks-1640.css} +0 -0
  109. css/dist/toggle-switch-1630-rtl.css +0 -1
  110. css/dist/toggle-switch-1630.css +0 -1
  111. css/dist/toggle-switch-1640-rtl.css +1 -0
  112. css/dist/toggle-switch-1640.css +1 -0
  113. css/dist/{wpseo-dismissible-1630-rtl.css → wpseo-dismissible-1640-rtl.css} +0 -0
  114. css/dist/{wpseo-dismissible-1630.css → wpseo-dismissible-1640.css} +0 -0
  115. css/dist/{yoast-components-1630-rtl.css → yoast-components-1640-rtl.css} +0 -0
  116. css/dist/{yoast-components-1630.css → yoast-components-1640.css} +0 -0
  117. css/dist/yoast-extensions-1630-rtl.css +0 -1
  118. css/dist/yoast-extensions-1630.css +0 -1
  119. css/dist/yoast-extensions-1640-rtl.css +1 -0
  120. css/dist/yoast-extensions-1640.css +1 -0
  121. css/dist/{yst_plugin_tools-1630-rtl.css → yst_plugin_tools-1640-rtl.css} +1 -1
  122. css/dist/{yst_plugin_tools-1630.css → yst_plugin_tools-1640.css} +1 -1
  123. css/dist/{yst_seo_score-1630-rtl.css → yst_seo_score-1640-rtl.css} +0 -0
  124. css/dist/{yst_seo_score-1630.css → yst_seo_score-1640.css} +0 -0
  125. inc/class-addon-manager.php +76 -21
  126. inc/class-upgrade-history.php +1 -1
  127. inc/class-upgrade.php +2 -2
  128. inc/class-wpseo-admin-bar-menu.php +1 -1
  129. inc/class-wpseo-content-images.php +2 -2
  130. inc/class-wpseo-image-utils.php +3 -3
  131. inc/class-wpseo-meta.php +6 -6
  132. inc/class-wpseo-rank.php +2 -2
  133. inc/class-wpseo-replace-vars.php +7 -5
  134. inc/class-wpseo-shortlinker.php +1 -1
  135. inc/class-wpseo-statistics.php +2 -2
  136. inc/class-wpseo-utils.php +24 -31
  137. inc/health-check.php +1 -1
  138. inc/language-utils.php +1 -1
  139. inc/options/class-wpseo-option-ms.php +0 -20
  140. inc/options/class-wpseo-option-social.php +6 -6
  141. inc/options/class-wpseo-option-titles.php +7 -7
  142. inc/options/class-wpseo-option-wpseo.php +6 -6
  143. inc/options/class-wpseo-option.php +13 -11
  144. inc/options/class-wpseo-options.php +7 -7
  145. inc/options/class-wpseo-taxonomy-meta.php +10 -64
  146. inc/sitemaps/class-author-sitemap-provider.php +3 -3
  147. inc/sitemaps/class-post-type-sitemap-provider.php +4 -4
  148. inc/sitemaps/class-sitemap-cache-data.php +4 -4
  149. inc/sitemaps/class-sitemap-image-parser.php +4 -4
  150. inc/sitemaps/class-sitemaps-cache-validator.php +7 -7
  151. inc/sitemaps/class-sitemaps-cache.php +3 -3
  152. inc/sitemaps/class-sitemaps-renderer.php +2 -2
  153. inc/sitemaps/class-sitemaps-router.php +1 -1
  154. inc/sitemaps/class-sitemaps.php +6 -5
  155. inc/sitemaps/class-taxonomy-sitemap-provider.php +11 -10
  156. inc/sitemaps/interface-sitemap-provider.php +1 -1
  157. inc/wpseo-functions.php +2 -2
  158. inc/wpseo-non-ajax-functions.php +1 -1
  159. js/dist/addon-installation-1640.js +5 -0
  160. js/dist/admin-global-1630.js +0 -1
  161. js/dist/admin-global-1640.js +1 -0
  162. js/dist/analysis-1630.js +0 -10
admin/class-admin-asset-analysis-worker-location.php CHANGED
@@ -13,14 +13,14 @@ final class WPSEO_Admin_Asset_Analysis_Worker_Location implements WPSEO_Admin_As
13
  /**
14
  * Holds the asset's location.
15
  *
16
- * @var WPSEO_Admin_Asset_Location $asset_location.
17
  */
18
  private $asset_location;
19
 
20
  /**
21
  * Holds the asset itself.
22
  *
23
- * @var WPSEO_Admin_Asset $asset.
24
  */
25
  private $asset;
26
 
@@ -36,7 +36,7 @@ final class WPSEO_Admin_Asset_Analysis_Worker_Location implements WPSEO_Admin_As
36
  $flat_version = $asset_manager->flatten_version( WPSEO_VERSION );
37
  }
38
 
39
- $analysis_worker = $name . '-' . $flat_version;
40
 
41
  $this->asset_location = WPSEO_Admin_Asset_Manager::create_default_location();
42
  $this->asset = new WPSEO_Admin_Asset(
13
  /**
14
  * Holds the asset's location.
15
  *
16
+ * @var WPSEO_Admin_Asset_Location
17
  */
18
  private $asset_location;
19
 
20
  /**
21
  * Holds the asset itself.
22
  *
23
+ * @var WPSEO_Admin_Asset
24
  */
25
  private $asset;
26
 
36
  $flat_version = $asset_manager->flatten_version( WPSEO_VERSION );
37
  }
38
 
39
+ $analysis_worker = $name . '-' . $flat_version . '.js';
40
 
41
  $this->asset_location = WPSEO_Admin_Asset_Manager::create_default_location();
42
  $this->asset = new WPSEO_Admin_Asset(
admin/class-admin-asset-dev-server-location.php CHANGED
@@ -27,7 +27,7 @@ final class WPSEO_Admin_Asset_Dev_Server_Location implements WPSEO_Admin_Asset_L
27
  /**
28
  * Class constructor.
29
  *
30
- * @param string $url Where the dev server is located.
31
  */
32
  public function __construct( $url = null ) {
33
  if ( $url === null ) {
@@ -46,7 +46,7 @@ final class WPSEO_Admin_Asset_Dev_Server_Location implements WPSEO_Admin_Asset_L
46
  * @return string The URL of the asset.
47
  */
48
  public function get_url( WPSEO_Admin_Asset $asset, $type ) {
49
- if ( WPSEO_Admin_Asset::TYPE_CSS === $type ) {
50
  return $this->get_default_url( $asset, $type );
51
  }
52
 
27
  /**
28
  * Class constructor.
29
  *
30
+ * @param string|null $url Where the dev server is located.
31
  */
32
  public function __construct( $url = null ) {
33
  if ( $url === null ) {
46
  * @return string The URL of the asset.
47
  */
48
  public function get_url( WPSEO_Admin_Asset $asset, $type ) {
49
+ if ( $type === WPSEO_Admin_Asset::TYPE_CSS ) {
50
  return $this->get_default_url( $asset, $type );
51
  }
52
 
admin/class-admin-asset-manager.php CHANGED
@@ -37,8 +37,8 @@ class WPSEO_Admin_Asset_Manager {
37
  /**
38
  * Constructs a manager of assets. Needs a location to know where to register assets at.
39
  *
40
- * @param WPSEO_Admin_Asset_Location $asset_location The provider of the asset location.
41
- * @param string $prefix The prefix for naming assets.
42
  */
43
  public function __construct( WPSEO_Admin_Asset_Location $asset_location = null, $prefix = self::PREFIX ) {
44
  if ( $asset_location === null ) {
@@ -67,6 +67,13 @@ class WPSEO_Admin_Asset_Manager {
67
  wp_enqueue_style( $this->prefix . $style );
68
  }
69
 
 
 
 
 
 
 
 
70
  /**
71
  * Registers scripts based on it's parameters.
72
  *
@@ -186,7 +193,7 @@ class WPSEO_Admin_Asset_Manager {
186
  return new WPSEO_Admin_Asset_Dev_Server_Location( $url );
187
  }
188
 
189
- return new WPSEO_Admin_Asset_SEO_Location( WPSEO_FILE );
190
  }
191
 
192
  /**
@@ -208,6 +215,184 @@ class WPSEO_Admin_Asset_Manager {
208
  * @return array The scripts that need to be registered.
209
  */
210
  protected function scripts_to_be_registered() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  $select2_language = 'en';
212
  $user_locale = \get_user_locale();
213
  $language = WPSEO_Language_Utils::get_language( $user_locale );
@@ -219,605 +404,80 @@ class WPSEO_Admin_Asset_Manager {
219
  $select2_language = $language;
220
  }
221
 
222
- $flat_version = $this->flatten_version( WPSEO_VERSION );
223
-
224
- return [
225
- [
226
- 'name' => 'commons',
227
- // Load webpack-commons for bundle support.
228
- 'src' => 'commons-' . $flat_version,
229
- 'in_footer' => false,
230
- 'deps' => [
231
- 'lodash',
232
- 'wp-polyfill',
233
- ],
234
- ],
235
- [
236
- 'name' => 'schema-blocks',
237
- 'src' => 'schema-blocks-' . $flat_version,
238
- 'deps' => [
239
- self::PREFIX . 'schema-blocks-package',
240
- ],
241
- ],
242
- [
243
- 'name' => 'yoast-modal',
244
- 'src' => 'modal-' . $flat_version,
245
- 'deps' => [
246
- 'jquery',
247
- 'wp-element',
248
- 'wp-i18n',
249
- self::PREFIX . 'yoast-components',
250
- self::PREFIX . 'commons',
251
- ],
252
- ],
253
- [
254
- 'name' => 'settings',
255
- 'src' => 'settings-' . $flat_version,
256
- 'deps' => [
257
- 'lodash',
258
- 'jquery',
259
- 'jquery-ui-core',
260
- 'jquery-ui-progressbar',
261
- 'wp-api',
262
- 'wp-data',
263
- 'wp-element',
264
- 'yoast-seo-api',
265
- self::PREFIX . 'yoast-components',
266
- self::PREFIX . 'helpers',
267
- self::PREFIX . 'replacement-variable-editor',
268
- self::PREFIX . 'select2',
269
- self::PREFIX . 'select2-translations',
270
- self::PREFIX . 'commons',
271
- ],
272
- ],
273
- [
274
- 'name' => 'network-admin-script',
275
- 'src' => 'network-admin-' . $flat_version,
276
- 'deps' => [
277
- 'jquery',
278
- 'wp-element',
279
- 'wp-i18n',
280
- self::PREFIX . 'commons',
281
- ],
282
- ],
283
- [
284
- 'name' => 'bulk-editor',
285
- 'src' => 'bulk-editor-' . $flat_version,
286
- 'deps' => [
287
- 'jquery',
288
- self::PREFIX . 'commons',
289
- ],
290
- ],
291
- [
292
- 'name' => 'admin-global-script',
293
- 'src' => 'admin-global-' . $flat_version,
294
- 'deps' => [
295
- 'jquery',
296
- self::PREFIX . 'commons',
297
- ],
298
- 'in_footer' => false,
299
- ],
300
- [
301
- 'name' => 'block-editor',
302
- 'src' => 'block-editor-' . $flat_version,
303
- 'deps' => [
304
- 'lodash',
305
- 'wp-annotations',
306
- 'wp-blocks',
307
- 'wp-components',
308
- 'wp-compose',
309
- 'wp-data',
310
- 'wp-edit-post',
311
- 'wp-element',
312
- 'wp-i18n',
313
- 'wp-plugins',
314
- 'wp-rich-text',
315
- 'yoast-seo-api',
316
- self::PREFIX . 'yoast-components',
317
- self::PREFIX . 'legacy-components',
318
- self::PREFIX . 'search-metadata-previews',
319
- self::PREFIX . 'social-metadata-forms',
320
- self::PREFIX . 'analysis',
321
- ],
322
- 'in_footer' => false,
323
- ],
324
- [
325
- 'name' => 'classic-editor',
326
- 'src' => 'classic-editor-' . $flat_version,
327
- 'deps' => [
328
- 'lodash',
329
- 'wp-api-fetch',
330
- 'wp-components',
331
- 'wp-compose',
332
- 'wp-data',
333
- 'wp-element',
334
- 'yoast-seo-api',
335
- self::PREFIX . 'redux',
336
- self::PREFIX . 'yoast-components',
337
- self::PREFIX . 'legacy-components',
338
- self::PREFIX . 'search-metadata-previews',
339
- self::PREFIX . 'social-metadata-forms',
340
- self::PREFIX . 'analysis',
341
- self::PREFIX . 'helpers',
342
- ],
343
- 'in_footer' => false,
344
- ],
345
- [
346
- 'name' => 'post-edit',
347
- 'src' => 'post-edit-' . $flat_version,
348
- 'deps' => [
349
- 'jquery',
350
- 'lodash',
351
- 'wp-api',
352
- 'wp-api-fetch',
353
- 'wp-data',
354
- 'wp-i18n',
355
- 'wp-is-shallow-equal',
356
- 'wp-sanitize',
357
- 'wp-url',
358
- 'wp-util',
359
- self::PREFIX . 'analysis',
360
- self::PREFIX . 'block-editor',
361
- self::PREFIX . 'commons',
362
- self::PREFIX . 'redux',
363
- self::PREFIX . 'draft-js',
364
- self::PREFIX . 'jed',
365
- self::PREFIX . 'style-guide',
366
- self::PREFIX . 'feature-flag',
367
- self::PREFIX . 'replacement-variable-editor',
368
- self::PREFIX . 'search-metadata-previews',
369
- self::PREFIX . 'select2',
370
- self::PREFIX . 'select2-translations',
371
- ],
372
- 'in_footer' => false,
373
- ],
374
- [
375
- 'name' => 'post-edit-classic',
376
- 'src' => 'post-edit-' . $flat_version,
377
- 'deps' => [
378
- 'jquery',
379
- 'lodash',
380
- 'wp-api',
381
- 'wp-api-fetch',
382
- 'wp-data',
383
- 'wp-i18n',
384
- 'wp-is-shallow-equal',
385
- 'wp-sanitize',
386
- 'wp-url',
387
- 'wp-util',
388
- self::PREFIX . 'analysis',
389
- self::PREFIX . 'classic-editor',
390
- self::PREFIX . 'commons',
391
- self::PREFIX . 'draft-js',
392
- self::PREFIX . 'jed',
393
- self::PREFIX . 'style-guide',
394
- self::PREFIX . 'replacement-variable-editor',
395
- self::PREFIX . 'search-metadata-previews',
396
- self::PREFIX . 'redux',
397
- self::PREFIX . 'select2',
398
- self::PREFIX . 'select2-translations',
399
- ],
400
- 'in_footer' => false,
401
- ],
402
- [
403
- 'name' => 'term-edit',
404
- 'src' => 'term-edit-' . $flat_version,
405
- 'deps' => [
406
- 'jquery',
407
- 'lodash',
408
- 'wp-sanitize',
409
- 'wp-element',
410
- 'wp-i18n',
411
- 'wp-data',
412
- 'wp-api-fetch',
413
- 'wp-components',
414
- 'wp-compose',
415
- 'wp-is-shallow-equal',
416
- self::PREFIX . 'redux',
417
- self::PREFIX . 'draft-js',
418
- self::PREFIX . 'jed',
419
- self::PREFIX . 'style-guide',
420
- self::PREFIX . 'feature-flag',
421
- self::PREFIX . 'analysis',
422
- self::PREFIX . 'classic-editor',
423
- self::PREFIX . 'commons',
424
- self::PREFIX . 'yoast-components',
425
- self::PREFIX . 'legacy-components',
426
- self::PREFIX . 'replacement-variable-editor',
427
- self::PREFIX . 'search-metadata-previews',
428
- self::PREFIX . 'social-metadata-forms',
429
- self::PREFIX . 'select2',
430
- self::PREFIX . 'select2-translations',
431
- ],
432
- ],
433
- [
434
- 'name' => 'select2',
435
- 'src' => 'select2/select2.full',
436
- 'suffix' => '.min',
437
- 'deps' => [
438
- 'jquery',
439
- ],
440
- 'version' => '4.0.3',
441
- ],
442
- [
443
- 'name' => 'select2-translations',
444
- 'src' => 'select2/i18n/' . $select2_language,
445
- 'deps' => [
446
- 'jquery',
447
- self::PREFIX . 'select2',
448
- ],
449
- 'version' => '4.0.3',
450
- ],
451
- [
452
- 'name' => 'configuration-wizard',
453
- 'src' => 'configuration-wizard-' . $flat_version,
454
- 'deps' => [
455
- 'jquery',
456
- 'wp-element',
457
- 'wp-i18n',
458
- 'wp-api',
459
- self::PREFIX . 'helpers',
460
- self::PREFIX . 'legacy-components',
461
- self::PREFIX . 'commons',
462
- self::PREFIX . 'configuration-wizard-package',
463
- ],
464
- ],
465
- [
466
- 'name' => 'configuration-wizard-package',
467
- 'src' => 'yoast/configuration-wizard-' . $flat_version,
468
- 'deps' => [
469
- 'jquery',
470
- 'lodash',
471
- 'wp-element',
472
- 'wp-i18n',
473
- 'wp-api',
474
- self::PREFIX . 'helpers',
475
- self::PREFIX . 'style-guide',
476
- self::PREFIX . 'yoast-components',
477
- self::PREFIX . 'commons',
478
- ],
479
- ],
480
- [
481
- 'name' => 'schema-blocks-package',
482
- 'src' => 'yoast/schema-blocks-' . $flat_version,
483
- 'deps' => [
484
- 'lodash',
485
- 'moment',
486
- 'wp-element',
487
- 'wp-blocks',
488
- 'wp-block-editor',
489
- 'wp-data',
490
- 'wp-hooks',
491
- 'wp-components',
492
- 'wp-i18n',
493
- 'wp-editor',
494
- ],
495
- ],
496
- [
497
- 'name' => 'reindex-links',
498
- 'src' => 'reindex-links-' . $flat_version,
499
- 'deps' => [
500
- 'jquery',
501
- 'jquery-ui-core',
502
- 'jquery-ui-progressbar',
503
- self::PREFIX . 'commons',
504
- ],
505
- ],
506
- [
507
- 'name' => 'indexation',
508
- 'src' => 'indexation-' . $flat_version,
509
- 'deps' => [
510
- 'jquery',
511
- 'jquery-ui-core',
512
- 'jquery-ui-progressbar',
513
- self::PREFIX . 'admin-global-script',
514
- self::PREFIX . 'commons',
515
- self::PREFIX . 'style-guide',
516
- self::PREFIX . 'yoast-components',
517
- ],
518
- ],
519
- [
520
- 'name' => 'edit-page-script',
521
- 'src' => 'edit-page-' . $flat_version,
522
- 'deps' => [
523
- 'jquery',
524
- self::PREFIX . 'commons',
525
- ],
526
- ],
527
- [
528
- 'name' => 'quick-edit-handler',
529
- 'src' => 'quick-edit-handler-' . $flat_version,
530
- 'deps' => [
531
- 'jquery',
532
- self::PREFIX . 'commons',
533
- ],
534
- 'in_footer' => true,
535
- ],
536
- [
537
- 'name' => 'api',
538
- 'src' => 'api-client-' . $flat_version,
539
- 'deps' => [
540
- 'wp-api',
541
- 'jquery',
542
- self::PREFIX . 'commons',
543
- ],
544
- ],
545
- [
546
- 'name' => 'dashboard-widget',
547
- 'src' => 'dashboard-widget-' . $flat_version,
548
- 'deps' => [
549
- self::PREFIX . 'api',
550
- 'jquery',
551
- 'wp-element',
552
- 'wp-i18n',
553
- self::PREFIX . 'helpers',
554
- self::PREFIX . 'yoast-components',
555
- self::PREFIX . 'style-guide',
556
- self::PREFIX . 'analysis-report',
557
- self::PREFIX . 'commons',
558
- ],
559
- ],
560
- [
561
- 'name' => 'filter-explanation',
562
- 'src' => 'filter-explanation-' . $flat_version,
563
- 'deps' => [
564
- 'jquery',
565
- self::PREFIX . 'commons',
566
- ],
567
- ],
568
- [
569
- 'name' => 'analysis',
570
- 'src' => 'analysis-' . $flat_version,
571
- 'deps' => [
572
- 'lodash',
573
- 'wp-autop',
574
- self::PREFIX . 'feature-flag',
575
- self::PREFIX . 'jed',
576
- self::PREFIX . 'commons',
577
- ],
578
- ],
579
- [
580
- /**
581
- * Asset for backwards-compatibility, to make sure
582
- * the addons don't break when we change dependencies.
583
- */
584
- 'name' => 'components',
585
- 'src' => false,
586
- 'deps' => [
587
- self::PREFIX . 'feature-flag',
588
- self::PREFIX . 'helpers',
589
- self::PREFIX . 'style-guide',
590
- self::PREFIX . 'configuration-wizard-package',
591
- self::PREFIX . 'analysis-report',
592
- self::PREFIX . 'yoast-components',
593
- self::PREFIX . 'replacement-variable-editor',
594
- self::PREFIX . 'search-metadata-previews',
595
- self::PREFIX . 'social-metadata-forms',
596
- self::PREFIX . 'legacy-components',
597
- ],
598
- ],
599
- [
600
- /**
601
- * Asset exposing Yoast editor modules which are used in Yoast add-ons.
602
- */
603
- 'name' => 'editor-modules',
604
- 'src' => 'editor-modules-' . $flat_version,
605
- 'deps' => [
606
- 'lodash',
607
- 'wp-api-fetch',
608
- 'wp-compose',
609
- 'wp-components',
610
- 'wp-data',
611
- 'wp-element',
612
- 'wp-i18n',
613
- 'wp-url',
614
- self::PREFIX . 'analysis',
615
- self::PREFIX . 'analysis-report',
616
- self::PREFIX . 'helpers',
617
- self::PREFIX . 'legacy-components',
618
- self::PREFIX . 'style-guide',
619
- self::PREFIX . 'styled-components',
620
- self::PREFIX . 'yoast-components',
621
- ],
622
- ],
623
- [
624
- /**
625
- * Yoast dynamic blocks
626
- */
627
- 'name' => 'dynamic-blocks',
628
- 'src' => 'dynamic-blocks-' . $flat_version,
629
- 'deps' => [
630
- 'wp-blocks',
631
- 'wp-i18n',
632
- 'wp-server-side-render',
633
- ],
634
- ],
635
- [
636
- // The `@yoast/components` package.
637
- 'name' => 'yoast-components',
638
- 'src' => 'yoast/components-' . $flat_version,
639
- 'deps' => [
640
- 'lodash',
641
- 'wp-a11y',
642
- 'wp-i18n',
643
- self::PREFIX . 'helpers',
644
- self::PREFIX . 'style-guide',
645
- self::PREFIX . 'styled-components',
646
- self::PREFIX . 'commons',
647
- ],
648
- ],
649
- [
650
- // The `yoast-components` package.
651
- 'name' => 'legacy-components',
652
- 'src' => 'yoast/yoast-components-' . $flat_version,
653
- 'deps' => [
654
- 'lodash',
655
- 'wp-a11y',
656
- 'wp-i18n',
657
- 'wp-dom-ready',
658
- self::PREFIX . 'style-guide',
659
- self::PREFIX . 'helpers',
660
- self::PREFIX . 'yoast-components',
661
- self::PREFIX . 'analysis-report',
662
- self::PREFIX . 'search-metadata-previews',
663
- self::PREFIX . 'replacement-variable-editor',
664
- self::PREFIX . 'jed',
665
- self::PREFIX . 'redux',
666
- self::PREFIX . 'styled-components',
667
- self::PREFIX . 'draft-js',
668
- self::PREFIX . 'commons',
669
- ],
670
- ],
671
- [
672
- 'name' => 'structured-data-blocks',
673
- 'src' => 'structured-data-blocks-' . $flat_version,
674
- 'deps' => [
675
- 'wp-blocks',
676
- 'wp-i18n',
677
- 'wp-element',
678
- 'wp-is-shallow-equal',
679
- self::PREFIX . 'styled-components',
680
- self::PREFIX . 'commons',
681
- ],
682
- ],
683
- [
684
- 'name' => 'helpers',
685
- 'src' => 'yoast/helpers-' . $flat_version,
686
- 'deps' => [
687
- self::PREFIX . 'styled-components',
688
- self::PREFIX . 'commons',
689
- ],
690
- ],
691
- [
692
- 'name' => 'feature-flag',
693
- 'src' => 'yoast/feature-flag-' . $flat_version,
694
- 'deps' => [
695
- self::PREFIX . 'commons',
696
- ],
697
- ],
698
- [
699
- 'name' => 'analysis-report',
700
- 'src' => 'yoast/analysis-report-' . $flat_version,
701
- 'deps' => [
702
- 'wp-i18n',
703
- 'react',
704
- 'react-dom',
705
- 'lodash',
706
- self::PREFIX . 'styled-components',
707
- self::PREFIX . 'helpers',
708
- self::PREFIX . 'style-guide',
709
- self::PREFIX . 'yoast-components',
710
- self::PREFIX . 'commons',
711
- ],
712
- ],
713
- [
714
- 'name' => 'style-guide',
715
- 'src' => 'yoast/style-guide-' . $flat_version,
716
- 'deps' => [
717
- self::PREFIX . 'helpers',
718
- self::PREFIX . 'styled-components',
719
- self::PREFIX . 'commons',
720
- ],
721
- ],
722
- [
723
- 'name' => 'replacement-variable-editor',
724
- 'src' => 'yoast/replacement-variable-editor-' . $flat_version,
725
- 'deps' => [
726
- 'lodash',
727
- 'wp-a11y',
728
- 'wp-i18n',
729
- self::PREFIX . 'helpers',
730
- self::PREFIX . 'yoast-components',
731
- self::PREFIX . 'style-guide',
732
- self::PREFIX . 'styled-components',
733
- self::PREFIX . 'draft-js',
734
- self::PREFIX . 'commons',
735
- ],
736
- ],
737
- [
738
- 'name' => 'search-metadata-previews',
739
- 'src' => 'yoast/search-metadata-previews-' . $flat_version,
740
- 'deps' => [
741
- 'lodash',
742
- 'wp-a11y',
743
- 'wp-i18n',
744
- self::PREFIX . 'helpers',
745
- self::PREFIX . 'style-guide',
746
- self::PREFIX . 'yoast-components',
747
- self::PREFIX . 'analysis',
748
- self::PREFIX . 'replacement-variable-editor',
749
- self::PREFIX . 'draft-js',
750
- self::PREFIX . 'commons',
751
- ],
752
  ],
753
- [
754
- 'name' => 'social-metadata-forms',
755
- 'src' => 'yoast/social-metadata-forms-' . $flat_version,
756
- 'deps' => [
757
- 'lodash',
758
- 'wp-i18n',
759
- self::PREFIX . 'redux',
760
- self::PREFIX . 'yoast-components',
761
- self::PREFIX . 'replacement-variable-editor',
762
- self::PREFIX . 'style-guide',
763
- self::PREFIX . 'styled-components',
764
- self::PREFIX . 'commons',
765
- ],
766
- ],
767
- [
768
- 'name' => 'styled-components',
769
- 'src' => 'styled-components-' . $flat_version,
770
- 'deps' => [
771
- 'wp-element',
772
- ],
773
- ],
774
- [
775
- 'name' => 'redux',
776
- 'src' => 'redux-' . $flat_version,
777
- ],
778
- [
779
- 'name' => 'jed',
780
- 'src' => 'jed-' . $flat_version,
781
- ],
782
- [
783
- 'name' => 'help-scout-beacon',
784
- 'src' => 'help-scout-beacon-' . $flat_version,
785
- 'in_footer' => false,
786
- 'deps' => [
787
- self::PREFIX . 'styled-components',
788
- 'wp-element',
789
- 'wp-i18n',
790
- ],
791
- ],
792
- [
793
- 'name' => 'draft-js',
794
- 'src' => 'draft-js-' . $flat_version,
795
- ],
796
- [
797
- 'name' => 'elementor',
798
- 'src' => 'elementor-' . $flat_version,
799
- 'deps' => [
800
- 'jquery',
801
- 'lodash',
802
- 'wp-data',
803
- 'wp-element',
804
- 'wp-components',
805
- 'wp-compose',
806
- 'wp-i18n',
807
- 'wp-sanitize',
808
- 'wp-api-fetch',
809
- 'wp-hooks',
810
- 'yoast-seo-api',
811
- self::PREFIX . 'components',
812
- self::PREFIX . 'analysis',
813
- self::PREFIX . 'commons',
814
- self::PREFIX . 'redux',
815
- self::PREFIX . 'select2',
816
- self::PREFIX . 'select2-translations',
817
- ],
818
- 'footer' => true,
819
  ],
 
 
 
 
 
 
 
 
 
 
820
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
821
  }
822
 
823
  /**
@@ -910,6 +570,9 @@ class WPSEO_Admin_Asset_Manager {
910
  [
911
  'name' => 'extensions',
912
  'src' => 'yoast-extensions-' . $flat_version,
 
 
 
913
  ],
914
  [
915
  'name' => 'filter-explanation',
37
  /**
38
  * Constructs a manager of assets. Needs a location to know where to register assets at.
39
  *
40
+ * @param WPSEO_Admin_Asset_Location|null $asset_location The provider of the asset location.
41
+ * @param string $prefix The prefix for naming assets.
42
  */
43
  public function __construct( WPSEO_Admin_Asset_Location $asset_location = null, $prefix = self::PREFIX ) {
44
  if ( $asset_location === null ) {
67
  wp_enqueue_style( $this->prefix . $style );
68
  }
69
 
70
+ /**
71
+ * Enqueues the appropriate language for the user.
72
+ */
73
+ public function enqueue_user_language_script() {
74
+ $this->enqueue_script( 'language-' . YoastSEO()->helpers->language->get_researcher_language() );
75
+ }
76
+
77
  /**
78
  * Registers scripts based on it's parameters.
79
  *
193
  return new WPSEO_Admin_Asset_Dev_Server_Location( $url );
194
  }
195
 
196
+ return new WPSEO_Admin_Asset_SEO_Location( WPSEO_FILE, false );
197
  }
198
 
199
  /**
215
  * @return array The scripts that need to be registered.
216
  */
217
  protected function scripts_to_be_registered() {
218
+ $flat_version = $this->flatten_version( WPSEO_VERSION );
219
+ $ext_length = ( strlen( $flat_version ) + 4 );
220
+
221
+ $header_scripts = [
222
+ 'admin-global',
223
+ 'block-editor',
224
+ 'classic-editor',
225
+ 'post-edit',
226
+ 'help-scout-beacon',
227
+ ];
228
+ $additional_dependencies = [
229
+ 'analysis-worker' => [ self::PREFIX . 'analysis-package' ],
230
+ 'api-client' => [ 'wp-api' ],
231
+ 'dashboard-widget' => [ self::PREFIX . 'api-client' ],
232
+ 'elementor' => [ self::PREFIX . 'api-client' ],
233
+ 'indexation' => [
234
+ 'jquery-ui-core',
235
+ 'jquery-ui-progressbar',
236
+ ],
237
+ 'post-edit' => [
238
+ self::PREFIX . 'api-client',
239
+ self::PREFIX . 'block-editor',
240
+ self::PREFIX . 'select2',
241
+ ],
242
+ 'reindex-links' => [
243
+ 'jquery-ui-core',
244
+ 'jquery-ui-progressbar',
245
+ ],
246
+ 'settings' => [
247
+ 'jquery-ui-core',
248
+ 'jquery-ui-progressbar',
249
+ self::PREFIX . 'api-client',
250
+ self::PREFIX . 'select2',
251
+ ],
252
+ 'term-edit' => [
253
+ self::PREFIX . 'api-client',
254
+ self::PREFIX . 'classic-editor',
255
+ self::PREFIX . 'select2',
256
+ ],
257
+ ];
258
+
259
+ $plugin_scripts = $this->load_generated_asset_file(
260
+ [
261
+ 'asset_file' => __DIR__ . '/../src/generated/assets/plugin.php',
262
+ 'ext_length' => $ext_length,
263
+ 'additional_deps' => $additional_dependencies,
264
+ 'header_scripts' => $header_scripts,
265
+ ]
266
+ );
267
+ $external_scripts = $this->load_generated_asset_file(
268
+ [
269
+ 'asset_file' => __DIR__ . '/../src/generated/assets/externals.php',
270
+ 'ext_length' => $ext_length,
271
+ 'suffix' => '-package',
272
+ 'base_dir' => 'externals/',
273
+ 'additional_deps' => $additional_dependencies,
274
+ 'header_scripts' => $header_scripts,
275
+ ]
276
+ );
277
+ $language_scripts = $this->load_generated_asset_file(
278
+ [
279
+ 'asset_file' => __DIR__ . '/../src/generated/assets/languages.php',
280
+ 'ext_length' => $ext_length,
281
+ 'suffix' => '-language',
282
+ 'base_dir' => 'languages/',
283
+ 'additional_deps' => $additional_dependencies,
284
+ 'header_scripts' => $header_scripts,
285
+ ]
286
+ );
287
+ $select2_scripts = $this->load_select2_scripts();
288
+ $renamed_scripts = $this->load_renamed_scripts();
289
+
290
+ $scripts = array_merge(
291
+ $plugin_scripts,
292
+ $external_scripts,
293
+ $language_scripts,
294
+ $select2_scripts,
295
+ $renamed_scripts
296
+ );
297
+
298
+ $scripts['post-edit-classic'] = [
299
+ 'name' => 'post-edit-classic',
300
+ 'src' => $scripts['post-edit']['src'],
301
+ 'deps' => array_map(
302
+ function( $dep ) {
303
+ if ( $dep === self::PREFIX . 'block-editor' ) {
304
+ return self::PREFIX . 'classic-editor';
305
+ }
306
+ return $dep;
307
+ },
308
+ $scripts['post-edit']['deps']
309
+ ),
310
+ 'in_footer' => ! in_array( 'post-edit-classic', $header_scripts, true ),
311
+ ];
312
+
313
+ // Add the current language to every script that requires the analysis package.
314
+ foreach ( $scripts as $name => $script ) {
315
+ if ( substr( $name, -8 ) === 'language' ) {
316
+ continue;
317
+ }
318
+ if ( in_array( self::PREFIX . 'analysis-package', $script['deps'], true ) ) {
319
+ $scripts[ $name ]['deps'][] = self::PREFIX . YoastSEO()->helpers->language->get_researcher_language() . '-language';
320
+ }
321
+ }
322
+
323
+ return $scripts;
324
+ }
325
+
326
+ /**
327
+ * Loads a generated asset file.
328
+ *
329
+ * @param array $args {
330
+ * The arguments.
331
+ *
332
+ * @type string $asset_file The asset file to load.
333
+ * @type int $ext_length The length of the extension, including suffix, of the filename.
334
+ * @type string $suffix Optional. The suffix of the asset name.
335
+ * @type array<string, string[]> $additional_deps Optional. The additional dependencies assets may have.
336
+ * @type string $base_dir Optional. The base directory of the asset.
337
+ * @type string[] $header_scripts Optional. The script names that should be in the header.
338
+ * }
339
+ *
340
+ * @return array {
341
+ * The scripts to be registered.
342
+ *
343
+ * @type string $name The name of the asset.
344
+ * @type string $src The src of the asset.
345
+ * @type string[] $deps The dependenies of the asset.
346
+ * @type bool $in_footer Whether or not the asset should be in the footer.
347
+ * }
348
+ */
349
+ protected function load_generated_asset_file( $args ) {
350
+ $args = wp_parse_args(
351
+ $args,
352
+ [
353
+ 'suffix' => '',
354
+ 'additional_deps' => [],
355
+ 'base_dir' => '',
356
+ 'header_scripts' => [],
357
+ ]
358
+ );
359
+ $scripts = [];
360
+ $assets = require $args['asset_file'];
361
+ foreach ( $assets as $file => $data ) {
362
+ $name = substr( $file, 0, -$args['ext_length'] );
363
+ $name = strtolower( preg_replace( '/([A-Z])/', '-$1', $name ) );
364
+ $name = $name . $args['suffix'];
365
+
366
+ $deps = $data['dependencies'];
367
+ if ( isset( $args['additional_deps'][ $name ] ) ) {
368
+ $deps = array_merge( $deps, $args['additional_deps'][ $name ] );
369
+ }
370
+
371
+ $scripts[ $name ] = [
372
+ 'name' => $name,
373
+ 'src' => $args['base_dir'] . $file,
374
+ 'deps' => $deps,
375
+ 'in_footer' => ! in_array( $name, $args['header_scripts'], true ),
376
+ ];
377
+ }
378
+
379
+ return $scripts;
380
+ }
381
+
382
+ /**
383
+ * Loads the select2 scripts.
384
+ *
385
+ * @return array {
386
+ * The scripts to be registered.
387
+ *
388
+ * @type string $name The name of the asset.
389
+ * @type string $src The src of the asset.
390
+ * @type string[] $deps The dependenies of the asset.
391
+ * @type bool $in_footer Whether or not the asset should be in the footer.
392
+ * }
393
+ */
394
+ protected function load_select2_scripts() {
395
+ $scripts = [];
396
  $select2_language = 'en';
397
  $user_locale = \get_user_locale();
398
  $language = WPSEO_Language_Utils::get_language( $user_locale );
404
  $select2_language = $language;
405
  }
406
 
407
+ $scripts['select2'] = [
408
+ 'name' => 'select2',
409
+ 'src' => false,
410
+ 'deps' => [
411
+ self::PREFIX . 'select2-translations',
412
+ self::PREFIX . 'select2-core',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  ],
414
+ ];
415
+ $scripts['select2-core'] = [
416
+ 'name' => 'select2-core',
417
+ 'src' => 'select2/select2.full.min.js',
418
+ 'deps' => [
419
+ 'jquery',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  ],
421
+ 'version' => '4.0.3',
422
+ ];
423
+ $scripts['select2-translations'] = [
424
+ 'name' => 'select2-translations',
425
+ 'src' => 'select2/i18n/' . $select2_language . '.js',
426
+ 'deps' => [
427
+ 'jquery',
428
+ self::PREFIX . 'select2-core',
429
+ ],
430
+ 'version' => '4.0.3',
431
  ];
432
+
433
+ return $scripts;
434
+ }
435
+
436
+ /**
437
+ * Loads the scripts that should be renamed for BC.
438
+ *
439
+ * @return array {
440
+ * The scripts to be registered.
441
+ *
442
+ * @type string $name The name of the asset.
443
+ * @type string $src The src of the asset.
444
+ * @type string[] $deps The dependenies of the asset.
445
+ * @type bool $in_footer Whether or not the asset should be in the footer.
446
+ * }
447
+ */
448
+ protected function load_renamed_scripts() {
449
+ $scripts = [];
450
+ $renamed_scripts = [
451
+ 'admin-global-script' => 'admin-global',
452
+ 'analysis' => 'analysis-package',
453
+ 'analysis-report' => 'analysis-report-package',
454
+ 'api' => 'api-client',
455
+ 'commons' => 'commons-package',
456
+ 'edit-page' => 'edit-page-script',
457
+ 'draft-js' => 'draft-js-package',
458
+ 'feature-flag' => 'feature-flag-package',
459
+ 'helpers' => 'helpers-package',
460
+ 'jed' => 'jed-package',
461
+ 'legacy-components' => 'components-package',
462
+ 'network-admin-script' => 'network-admin',
463
+ 'redux' => 'redux-package',
464
+ 'replacement-variable-editor' => 'replacement-variable-editor-package',
465
+ 'search-metadata-previews' => 'search-metadata-previews-package',
466
+ 'social-metadata-forms' => 'social-metadata-forms-package',
467
+ 'styled-components' => 'styled-components-package',
468
+ 'style-guide' => 'style-guide-package',
469
+ 'yoast-components' => 'components-new-package',
470
+ ];
471
+
472
+ foreach ( $renamed_scripts as $original => $replacement ) {
473
+ $scripts[] = [
474
+ 'name' => $original,
475
+ 'src' => false,
476
+ 'deps' => [ self::PREFIX . $replacement ],
477
+ ];
478
+ }
479
+
480
+ return $scripts;
481
  }
482
 
483
  /**
570
  [
571
  'name' => 'extensions',
572
  'src' => 'yoast-extensions-' . $flat_version,
573
+ 'deps' => [
574
+ 'wp-components',
575
+ ],
576
  ],
577
  [
578
  'name' => 'filter-explanation',
admin/class-admin-asset-seo-location.php CHANGED
@@ -17,13 +17,22 @@ final class WPSEO_Admin_Asset_SEO_Location implements WPSEO_Admin_Asset_Location
17
  */
18
  protected $plugin_file;
19
 
 
 
 
 
 
 
 
20
  /**
21
  * The plugin file to base the asset location upon.
22
  *
23
- * @param string $plugin_file The plugin file string.
 
24
  */
25
- public function __construct( $plugin_file ) {
26
  $this->plugin_file = $plugin_file;
 
27
  }
28
 
29
  /**
@@ -57,7 +66,10 @@ final class WPSEO_Admin_Asset_SEO_Location implements WPSEO_Admin_Asset_Location
57
 
58
  switch ( $type ) {
59
  case WPSEO_Admin_Asset::TYPE_JS:
60
- $relative_path = 'js/dist/' . $asset->get_src() . $asset->get_suffix() . '.js';
 
 
 
61
  break;
62
 
63
  case WPSEO_Admin_Asset::TYPE_CSS:
17
  */
18
  protected $plugin_file;
19
 
20
+ /**
21
+ * Whether or not to add the file suffix to the asset.
22
+ *
23
+ * @var boolean
24
+ */
25
+ protected $add_suffix = true;
26
+
27
  /**
28
  * The plugin file to base the asset location upon.
29
  *
30
+ * @param string $plugin_file The plugin file string.
31
+ * @param boolean $add_suffix Optional. Whether or not a file suffix should be added.
32
  */
33
+ public function __construct( $plugin_file, $add_suffix = true ) {
34
  $this->plugin_file = $plugin_file;
35
+ $this->add_suffix = $add_suffix;
36
  }
37
 
38
  /**
66
 
67
  switch ( $type ) {
68
  case WPSEO_Admin_Asset::TYPE_JS:
69
+ $relative_path = 'js/dist/' . $asset->get_src();
70
+ if ( $this->add_suffix ) {
71
+ $relative_path = $relative_path . $asset->get_suffix() . '.js';
72
+ }
73
  break;
74
 
75
  case WPSEO_Admin_Asset::TYPE_CSS:
admin/class-admin-asset-yoast-components-l10n.php CHANGED
@@ -44,7 +44,7 @@ final class WPSEO_Admin_Asset_Yoast_Components_L10n {
44
  * Returns translations necessary for JS files.
45
  *
46
  * @param string $component The component to retrieve the translations for.
47
- * @return object The translations in a Jed format for JS files.
48
  */
49
  protected function get_translations( $component ) {
50
  $locale = \get_user_locale();
44
  * Returns translations necessary for JS files.
45
  *
46
  * @param string $component The component to retrieve the translations for.
47
+ * @return object|null The translations in a Jed format for JS files.
48
  */
49
  protected function get_translations( $component ) {
50
  $locale = \get_user_locale();
admin/class-admin-init.php CHANGED
@@ -144,7 +144,7 @@ class WPSEO_Admin_Init {
144
  /**
145
  * Gets the latest released major WordPress version from the WordPress stable-check api.
146
  *
147
- * @return float The latest released major WordPress version. 0 The stable-check api doesn't respond.
148
  */
149
  private function get_latest_major_wordpress_version() {
150
  $core_updates = get_core_updates( [ 'dismissed' => true ] );
144
  /**
145
  * Gets the latest released major WordPress version from the WordPress stable-check api.
146
  *
147
+ * @return float|int The latest released major WordPress version. 0 when the stable-check API doesn't respond.
148
  */
149
  private function get_latest_major_wordpress_version() {
150
  $core_updates = get_core_updates( [ 'dismissed' => true ] );
admin/class-admin.php CHANGED
@@ -210,15 +210,13 @@ class WPSEO_Admin {
210
  /**
211
  * Adds links to Premium Support and FAQ under the plugin in the plugin overview page.
212
  *
213
- * @staticvar string $this_plugin Holds the directory & filename for the plugin.
214
- *
215
  * @param array $links Array of links for the plugins, adapted when the current plugin is found.
216
  * @param string $file The filename for the current plugin, which the filter loops through.
217
  *
218
- * @return array $links
219
  */
220
  public function add_action_link( $links, $file ) {
221
- if ( WPSEO_BASENAME === $file && WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
222
  if ( is_network_admin() ) {
223
  $settings_url = network_admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER );
224
  }
@@ -269,8 +267,8 @@ class WPSEO_Admin {
269
  */
270
  public function config_page_scripts() {
271
  $asset_manager = new WPSEO_Admin_Asset_Manager();
272
- $asset_manager->enqueue_script( 'admin-global-script' );
273
- $asset_manager->localize_script( 'admin-global-script', 'wpseoAdminGlobalL10n', $this->localize_admin_global_script() );
274
  }
275
 
276
  /**
@@ -288,7 +286,7 @@ class WPSEO_Admin {
288
  *
289
  * @param array $contactmethods Currently set contactmethods.
290
  *
291
- * @return array $contactmethods with added contactmethods.
292
  */
293
  public function update_contactmethods( $contactmethods ) {
294
  $contactmethods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' );
@@ -349,7 +347,7 @@ class WPSEO_Admin {
349
  /**
350
  * Whether we are on the admin dashboard page.
351
  *
352
- * @returns bool
353
  */
354
  protected function on_dashboard_page() {
355
  return $GLOBALS['pagenow'] === 'index.php';
210
  /**
211
  * Adds links to Premium Support and FAQ under the plugin in the plugin overview page.
212
  *
 
 
213
  * @param array $links Array of links for the plugins, adapted when the current plugin is found.
214
  * @param string $file The filename for the current plugin, which the filter loops through.
215
  *
216
+ * @return array
217
  */
218
  public function add_action_link( $links, $file ) {
219
+ if ( $file === WPSEO_BASENAME && WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
220
  if ( is_network_admin() ) {
221
  $settings_url = network_admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER );
222
  }
267
  */
268
  public function config_page_scripts() {
269
  $asset_manager = new WPSEO_Admin_Asset_Manager();
270
+ $asset_manager->enqueue_script( 'admin-global' );
271
+ $asset_manager->localize_script( 'admin-global', 'wpseoAdminGlobalL10n', $this->localize_admin_global_script() );
272
  }
273
 
274
  /**
286
  *
287
  * @param array $contactmethods Currently set contactmethods.
288
  *
289
+ * @return array Contactmethods with added contactmethods.
290
  */
291
  public function update_contactmethods( $contactmethods ) {
292
  $contactmethods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' );
347
  /**
348
  * Whether we are on the admin dashboard page.
349
  *
350
+ * @return bool
351
  */
352
  protected function on_dashboard_page() {
353
  return $GLOBALS['pagenow'] === 'index.php';
admin/class-asset.php CHANGED
@@ -207,7 +207,7 @@ class WPSEO_Admin_Asset {
207
  /**
208
  * Returns the asset version.
209
  *
210
- * @return string
211
  */
212
  public function get_version() {
213
  if ( ! empty( $this->version ) ) {
@@ -229,7 +229,7 @@ class WPSEO_Admin_Asset {
229
  /**
230
  * Returns whether a script asset should be loaded in the footer of the page.
231
  *
232
- * @return boolean
233
  */
234
  public function is_in_footer() {
235
  return $this->in_footer;
@@ -238,7 +238,7 @@ class WPSEO_Admin_Asset {
238
  /**
239
  * Returns whether this CSS has a RTL counterpart.
240
  *
241
- * @return boolean
242
  */
243
  public function has_rtl() {
244
  return $this->rtl;
207
  /**
208
  * Returns the asset version.
209
  *
210
+ * @return string|null
211
  */
212
  public function get_version() {
213
  if ( ! empty( $this->version ) ) {
229
  /**
230
  * Returns whether a script asset should be loaded in the footer of the page.
231
  *
232
+ * @return bool
233
  */
234
  public function is_in_footer() {
235
  return $this->in_footer;
238
  /**
239
  * Returns whether this CSS has a RTL counterpart.
240
  *
241
+ * @return bool
242
  */
243
  public function has_rtl() {
244
  return $this->rtl;
admin/class-bulk-editor-list-table.php CHANGED
@@ -636,7 +636,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
636
  *
637
  * @param string $orderby The column by which we want to order.
638
  *
639
- * @return string $orderby
640
  */
641
  protected function sanitize_orderby( $orderby ) {
642
  $valid_column_names = [
@@ -658,7 +658,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
658
  *
659
  * @param string $order Whether we want to sort ascending or descending.
660
  *
661
- * @return string $order SQL order string (ASC, DESC).
662
  */
663
  protected function sanitize_order( $order ) {
664
  if ( in_array( strtoupper( $order ), [ 'ASC', 'DESC' ], true ) ) {
@@ -894,7 +894,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
894
  /**
895
  * Parse the field where the existing meta-data value is displayed.
896
  *
897
- * @param integer $record_id Record ID.
898
  * @param string $attributes HTML attributes.
899
  * @param bool|array $values Optional values data array.
900
  *
636
  *
637
  * @param string $orderby The column by which we want to order.
638
  *
639
+ * @return string
640
  */
641
  protected function sanitize_orderby( $orderby ) {
642
  $valid_column_names = [
658
  *
659
  * @param string $order Whether we want to sort ascending or descending.
660
  *
661
+ * @return string SQL order string (ASC, DESC).
662
  */
663
  protected function sanitize_order( $order ) {
664
  if ( in_array( strtoupper( $order ), [ 'ASC', 'DESC' ], true ) ) {
894
  /**
895
  * Parse the field where the existing meta-data value is displayed.
896
  *
897
+ * @param int $record_id Record ID.
898
  * @param string $attributes HTML attributes.
899
  * @param bool|array $values Optional values data array.
900
  *
admin/class-config.php CHANGED
@@ -65,7 +65,7 @@ class WPSEO_Admin_Pages {
65
  $this->asset_manager->enqueue_style( 'search-appearance' );
66
  }
67
 
68
- if ( $page === 'wpseo_social' ) {
69
  $this->asset_manager->enqueue_style( 'monorepo' );
70
  }
71
  }
@@ -136,6 +136,7 @@ class WPSEO_Admin_Pages {
136
  }
137
 
138
  $this->asset_manager->localize_script( 'settings', 'wpseoScriptData', $script_data );
 
139
  }
140
 
141
  /**
65
  $this->asset_manager->enqueue_style( 'search-appearance' );
66
  }
67
 
68
+ if ( $page === 'wpseo_social' || $page === 'wpseo_licenses' ) {
69
  $this->asset_manager->enqueue_style( 'monorepo' );
70
  }
71
  }
136
  }
137
 
138
  $this->asset_manager->localize_script( 'settings', 'wpseoScriptData', $script_data );
139
+ $this->asset_manager->enqueue_user_language_script();
140
  }
141
 
142
  /**
admin/class-customizer.php CHANGED
@@ -199,13 +199,13 @@ class WPSEO_Customizer {
199
  /**
200
  * Adds the customizer setting and control.
201
  *
202
- * @param string $index Array key index to use for the customizer setting.
203
- * @param array $control_args Customizer control object arguments.
204
- * Only those different from the default need to be passed.
205
- * @param string $id Optional. Customizer control object ID.
206
- * Will default to 'wpseo-' . $index.
207
- * @param array $custom_settings Optional. Customizer setting arguments.
208
- * Only those different from the default need to be passed.
209
  */
210
  private function add_setting_and_control( $index, $control_args, $id = null, $custom_settings = [] ) {
211
  $setting = sprintf( $this->setting_template, $index );
199
  /**
200
  * Adds the customizer setting and control.
201
  *
202
+ * @param string $index Array key index to use for the customizer setting.
203
+ * @param array $control_args Customizer control object arguments.
204
+ * Only those different from the default need to be passed.
205
+ * @param string|null $id Optional. Customizer control object ID.
206
+ * Will default to 'wpseo-' . $index.
207
+ * @param array $custom_settings Optional. Customizer setting arguments.
208
+ * Only those different from the default need to be passed.
209
  */
210
  private function add_setting_and_control( $index, $control_args, $id = null, $custom_settings = [] ) {
211
  $setting = sprintf( $this->setting_template, $index );
admin/class-database-proxy.php CHANGED
@@ -93,7 +93,7 @@ class WPSEO_Database_Proxy {
93
  *
94
  * @param array $data Data to update on the table.
95
  * @param array $where Where condition as key => value array.
96
- * @param null $format Optional. data prepare format.
97
  * @param null $where_format Optional. Where prepare format.
98
  *
99
  * @return false|int False when the update request is invalid, int on number of rows changed.
@@ -113,10 +113,10 @@ class WPSEO_Database_Proxy {
113
  *
114
  * Performs an insert into and if key is duplicate it will update the existing record.
115
  *
116
- * @param array $data Data to update on the table.
117
- * @param array $where Unused. Where condition as key => value array.
118
- * @param null $format Optional. Data prepare format.
119
- * @param null $where_format Deprecated. Where prepare format.
120
  *
121
  * @return false|int False when the upsert request is invalid, int on number of rows changed.
122
  */
@@ -159,7 +159,7 @@ class WPSEO_Database_Proxy {
159
  * Deletes a record from the database.
160
  *
161
  * @param array $where Where clauses for the query.
162
- * @param null|array $format Formats for the data.
163
  *
164
  * @return false|int
165
  */
@@ -178,7 +178,7 @@ class WPSEO_Database_Proxy {
178
  *
179
  * @param string $query The query to execute.
180
  *
181
- * @return array|null|object The resultset
182
  */
183
  public function get_results( $query ) {
184
  $this->pre_execution();
93
  *
94
  * @param array $data Data to update on the table.
95
  * @param array $where Where condition as key => value array.
96
+ * @param null $format Optional. Data prepare format.
97
  * @param null $where_format Optional. Where prepare format.
98
  *
99
  * @return false|int False when the update request is invalid, int on number of rows changed.
113
  *
114
  * Performs an insert into and if key is duplicate it will update the existing record.
115
  *
116
+ * @param array $data Data to update on the table.
117
+ * @param array|null $where Unused. Where condition as key => value array.
118
+ * @param null $format Optional. Data prepare format.
119
+ * @param null $where_format Deprecated. Where prepare format.
120
  *
121
  * @return false|int False when the upsert request is invalid, int on number of rows changed.
122
  */
159
  * Deletes a record from the database.
160
  *
161
  * @param array $where Where clauses for the query.
162
+ * @param array|null $format Formats for the data.
163
  *
164
  * @return false|int
165
  */
178
  *
179
  * @param string $query The query to execute.
180
  *
181
+ * @return array|object|null The resultset
182
  */
183
  public function get_results( $query ) {
184
  $this->pre_execution();
admin/class-export.php CHANGED
@@ -96,8 +96,8 @@ class WPSEO_Export {
96
  /**
97
  * Writes a line to the export.
98
  *
99
- * @param string $line Line string.
100
- * @param boolean $newline_first Boolean flag whether to prepend with new line.
101
  */
102
  private function write_line( $line, $newline_first = false ) {
103
  if ( $newline_first ) {
96
  /**
97
  * Writes a line to the export.
98
  *
99
+ * @param string $line Line string.
100
+ * @param bool $newline_first Boolean flag whether to prepend with new line.
101
  */
102
  private function write_line( $line, $newline_first = false ) {
103
  if ( $newline_first ) {
admin/class-gutenberg-compatibility.php CHANGED
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
15
  *
16
  * @var string
17
  */
18
- const CURRENT_RELEASE = '10.6.0';
19
 
20
  /**
21
  * The minimally supported version of Gutenberg by the plugin.
22
  *
23
  * @var string
24
  */
25
- const MINIMUM_SUPPORTED = '10.6.0';
26
 
27
  /**
28
  * Holds the current version.
15
  *
16
  * @var string
17
  */
18
+ const CURRENT_RELEASE = '10.7.1';
19
 
20
  /**
21
  * The minimally supported version of Gutenberg by the plugin.
22
  *
23
  * @var string
24
  */
25
+ const MINIMUM_SUPPORTED = '10.7.1';
26
 
27
  /**
28
  * Holds the current version.
admin/class-helpscout.php CHANGED
@@ -87,6 +87,8 @@ class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
87
 
88
  /**
89
  * Checks if the current page is a page containing the beacon.
 
 
90
  */
91
  private function is_beacon_page() {
92
  return in_array( $this->get_current_page(), $this->pages, true );
87
 
88
  /**
89
  * Checks if the current page is a page containing the beacon.
90
+ *
91
+ * @return bool
92
  */
93
  private function is_beacon_page() {
94
  return in_array( $this->get_current_page(), $this->pages, true );
admin/class-meta-columns.php CHANGED
@@ -590,7 +590,7 @@ class WPSEO_Meta_Columns {
590
  /**
591
  * Determines whether the given post ID uses the default indexing settings.
592
  *
593
- * @param integer $post_id The post ID to check.
594
  *
595
  * @return bool Whether or not the default indexing is being used for the post.
596
  */
@@ -626,7 +626,7 @@ class WPSEO_Meta_Columns {
626
  /**
627
  * Parses the score column.
628
  *
629
- * @param integer $post_id The ID of the post for which to show the score.
630
  *
631
  * @return string The HTML for the SEO score indicator.
632
  */
@@ -697,7 +697,7 @@ class WPSEO_Meta_Columns {
697
  *
698
  * @since 7.0
699
  *
700
- * @param string $post_type Optional. The post type to test, defaults to the current post post_type.
701
  *
702
  * @return bool Whether or not the meta box (and associated columns etc) should be hidden.
703
  */
590
  /**
591
  * Determines whether the given post ID uses the default indexing settings.
592
  *
593
+ * @param int $post_id The post ID to check.
594
  *
595
  * @return bool Whether or not the default indexing is being used for the post.
596
  */
626
  /**
627
  * Parses the score column.
628
  *
629
+ * @param int $post_id The ID of the post for which to show the score.
630
  *
631
  * @return string The HTML for the SEO score indicator.
632
  */
697
  *
698
  * @since 7.0
699
  *
700
+ * @param string|null $post_type Optional. The post type to test, defaults to the current post post_type.
701
  *
702
  * @return bool Whether or not the meta box (and associated columns etc) should be hidden.
703
  */
admin/class-my-yoast-proxy.php CHANGED
@@ -112,10 +112,10 @@ class WPSEO_MyYoast_Proxy implements WPSEO_WordPress_Integration {
112
  *
113
  * @param string $url The url to load.
114
  *
 
 
115
  * @throws Exception When `wp_remote_get` returned an error.
116
  * @throws Exception When the response code is not 200.
117
- *
118
- * @return string The body of the response.
119
  */
120
  protected function get_remote_url_body( $url ) {
121
  $response = wp_remote_get( $url );
112
  *
113
  * @param string $url The url to load.
114
  *
115
+ * @return string The body of the response.
116
+ *
117
  * @throws Exception When `wp_remote_get` returned an error.
118
  * @throws Exception When the response code is not 200.
 
 
119
  */
120
  protected function get_remote_url_body( $url ) {
121
  $response = wp_remote_get( $url );
admin/class-option-tabs.php CHANGED
@@ -71,7 +71,7 @@ class WPSEO_Option_Tabs {
71
  /**
72
  * Get active tab.
73
  *
74
- * @return null|WPSEO_Option_Tab Get the active tab.
75
  */
76
  public function get_active_tab() {
77
  if ( empty( $this->active_tab ) ) {
71
  /**
72
  * Get active tab.
73
  *
74
+ * @return WPSEO_Option_Tab|null Get the active tab.
75
  */
76
  public function get_active_tab() {
77
  if ( empty( $this->active_tab ) ) {
admin/class-paper-presenter.php CHANGED
@@ -34,10 +34,10 @@ class WPSEO_Paper_Presenter {
34
  /**
35
  * WPSEO_presenter_paper constructor.
36
  *
37
- * @param string $title The title of the paper.
38
- * @param string $view_file Optional. The path to the view file. Use the content setting if you do not wish to use
39
- * a view file.
40
- * @param array $settings Optional. Settings for the paper.
41
  */
42
  public function __construct( $title, $view_file = null, array $settings = [] ) {
43
  $defaults = [
34
  /**
35
  * WPSEO_presenter_paper constructor.
36
  *
37
+ * @param string $title The title of the paper.
38
+ * @param string|null $view_file Optional. The path to the view file. Use the content setting
39
+ * if do not wish to use a view file.
40
+ * @param array $settings Optional. Settings for the paper.
41
  */
42
  public function __construct( $title, $view_file = null, array $settings = [] ) {
43
  $defaults = [
admin/class-plugin-availability.php CHANGED
@@ -259,7 +259,7 @@ class WPSEO_Plugin_Availability {
259
  * @return bool Whether or not the dependency is available.
260
  */
261
  public function is_dependency_available( $dependency ) {
262
- return in_array( $dependency['slug'], array_keys( get_plugins() ), true );
263
  }
264
 
265
  /**
259
  * @return bool Whether or not the dependency is available.
260
  */
261
  public function is_dependency_available( $dependency ) {
262
+ return isset( get_plugins()[ $dependency['slug'] ] );
263
  }
264
 
265
  /**
admin/class-premium-popup.php CHANGED
@@ -20,39 +20,39 @@ class WPSEO_Premium_Popup {
20
  /**
21
  * The heading level of the title of the popup.
22
  *
23
- * @var String
24
  */
25
  private $heading_level = '';
26
 
27
  /**
28
  * The title of the popup.
29
  *
30
- * @var String
31
  */
32
  private $title = '';
33
 
34
  /**
35
  * The content of the popup.
36
  *
37
- * @var String
38
  */
39
  private $content = '';
40
 
41
  /**
42
  * The URL for where the button should link to.
43
  *
44
- * @var String
45
  */
46
  private $url = '';
47
 
48
  /**
49
  * Wpseo_Premium_Popup constructor.
50
  *
51
- * @param String $identifier An unique identifier for the popup.
52
- * @param String $heading_level The heading level for the title of the popup.
53
- * @param String $title The title of the popup.
54
- * @param String $content The content of the popup.
55
- * @param String $url The URL for where the button should link to.
56
  */
57
  public function __construct( $identifier, $heading_level, $title, $content, $url ) {
58
  $this->identifier = $identifier;
@@ -89,7 +89,7 @@ class WPSEO_Premium_Popup {
89
 
90
  $popup = <<<EO_POPUP
91
  <div id="wpseo-{$this->identifier}-popup" class="wpseo-premium-popup wp-clearfix$classes">
92
- <img class="alignright wpseo-premium-popup-icon" src="{$assets_uri}images/Yoast_SEO_Icon.svg" width="150" height="150" alt="Yoast SEO"/>
93
  <{$this->heading_level} id="wpseo-contact-support-popup-title" class="wpseo-premium-popup-title">{$this->title}</{$this->heading_level}>
94
  {$this->content}
95
  <a id="wpseo-{$this->identifier}-popup-button" class="yoast-button-upsell" href="{$this->url}" target="_blank">
20
  /**
21
  * The heading level of the title of the popup.
22
  *
23
+ * @var string
24
  */
25
  private $heading_level = '';<