plugin updates

This commit is contained in:
Tony Volpe
2024-02-21 16:19:46 +00:00
parent c72f206574
commit 21d4c85c00
1214 changed files with 102269 additions and 179257 deletions

View File

@@ -162,7 +162,8 @@ class Indexable_Link_Builder {
}
/**
* Fixes existing SEO links that are supposed to have a target indexable but don't, because of prior indexable cleanup.
* Fixes existing SEO links that are supposed to have a target indexable but don't, because of prior indexable
* cleanup.
*
* @param Indexable $indexable The indexable to be the target of SEO Links.
*
@@ -214,7 +215,8 @@ class Indexable_Link_Builder {
}
/**
* Gathers all images from content with WP's WP_HTML_Tag_Processor() and returns them along with their IDs, if possible.
* Gathers all images from content with WP's WP_HTML_Tag_Processor() and returns them along with their IDs, if
* possible.
*
* @param string $content The content.
*
@@ -483,9 +485,9 @@ class Indexable_Link_Builder {
$model->size = null;
}
list( , $width, $height ) = \wp_get_attachment_image_src( $model->target_post_id, 'full' );
$model->width = $width;
$model->height = $height;
[ , $width, $height ] = \wp_get_attachment_image_src( $model->target_post_id, 'full' );
$model->width = $width;
$model->height = $height;
}
else {
$model->width = 0;
@@ -704,8 +706,11 @@ class Indexable_Link_Builder {
}
$counts = $this->seo_links_repository->get_incoming_link_counts_for_indexable_ids( $related_indexable_ids );
foreach ( $counts as $count ) {
if ( \wp_cache_supports( 'flush_group' ) ) {
\wp_cache_flush_group( 'orphaned_counts' );
}
foreach ( $counts as $count ) {
$this->indexable_repository->update_incoming_link_count( $count['target_indexable_id'], $count['incoming'] );
}
}

View File

@@ -43,7 +43,7 @@ use Yoast\WP\SEO\Repositories\Indexable_Repository;
* @property int $site_user_id
* @property string $site_represents
* @property array|false $site_represents_reference
* @property string $schema_page_type
* @property string|string[] $schema_page_type
* @property string|string[] $schema_article_type Represents the type of article.
* @property string $main_schema_id
* @property string|array $main_entity_of_page
@@ -238,7 +238,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
return $this->presentation->permalink;
}
return \add_query_arg( 's', \get_search_query(), \trailingslashit( $this->site_url ) );
return \add_query_arg( 's', \rawurlencode( \get_search_query() ), \trailingslashit( $this->site_url ) );
}
/**
@@ -349,7 +349,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Retrieve the person logo meta.
*
* @return array|bool
* @return array<string|array<int>>|bool
*/
public function generate_person_logo_meta() {
$person_logo_meta = $this->image->get_attachment_meta_from_settings( 'person_logo' );
@@ -390,7 +390,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Retrieve the company logo meta.
*
* @return array|bool
* @return array<string|array<int>>|bool
*/
public function generate_company_logo_meta() {
$company_logo_meta = $this->image->get_attachment_meta_from_settings( 'company_logo' );
@@ -449,7 +449,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Returns the site represents reference.
*
* @return array|bool The site represents reference. False if none.
* @return array<string>|bool The site represents reference. False if none.
*/
public function generate_site_represents_reference() {
if ( $this->site_represents === 'person' ) {
@@ -499,7 +499,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Returns the schema page type.
*
* @return string|array The schema page type.
* @return string|array<string> The schema page type.
*/
public function generate_schema_page_type() {
switch ( $this->indexable->object_type ) {
@@ -549,7 +549,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Returns the schema article type.
*
* @return string|array The schema article type.
* @return string|array<string> The schema article type.
*/
public function generate_schema_article_type() {
$additional_type = $this->indexable->schema_article_type;
@@ -667,7 +667,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
/**
* Strips all nested dependencies from the debug info.
*
* @return array
* @return array<Indexable,Indexable_Presentation>
*/
public function __debugInfo() {
return [

View File

@@ -1 +1 @@
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => '7b1d457a2bb74008e9d5dc825bf4ffee'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '3da0a1534f032fd1d93dd68640b0ae7d'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'cfc4110e2731f88fa98a79bdd9bfbea6'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'da2a94d1aa004c8f82293a439727e9c2'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => '33de598883eb2ecb2f37e57aa7d8b526'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '991bc77e067128be49654a851ad34c96'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '33c3725096f0692f3b800cc5fe63377a'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'c3adb86cb1a0125b5d466bfeecdbe356'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => 'e14d917b865498fe0d4e1b043a9c054b'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => '538bad97e86caa3082dd32b866d71efd'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ec419913bb5b7c66842141107387fa8e'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '57e3ec3e0be75be9ae305d85aede87c1'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'ab9ae4f1d8d72c555bdd4a654c85fa20'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f62c8cfc745b688b458e026846e3fb0d'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => '3678b7c6efc5751cfdb7b32085645eed'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '73ed60e5a3677a7350b55c88e8bef1c4'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => '77610b98d9ce5d7e8490cd8aba5582f7'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'ad3c948e2e99cc68e9a0800c5ae5004f'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => 'a95b12dac49ef5655eceb9b989dfbf80'));
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => 'ef72d909c73f8a3f7fa5'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'f4095bb34618cc5f80db'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '524df14230a70ab3143c'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => '2edab8ebb3cafb5fbb2a'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => '6a486d8aa1671ac1f318'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '3eec1206625288fa0881'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '4620aece3f6cd1e53fce'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '57caaa6d6ae501fbe201'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => '05f4cef63d920b5eb358'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => 'ef3b7b45d3c7ce53a051'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => '159bddf20f5641835a87'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '341685f1960d4b203c8a'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => '508b30f9e592b1086988'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => '79f9372cd192042f45c7'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => '9366fe7e12f8417a5f4a'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3fd1e012d6c18995c0c0'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => 'a2b71f5c7fdfdfe24575'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'a7b401608d2c19887ed4'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => 'bbab0dd10c0ee7cca42f'));

View File

@@ -1 +1 @@
<?php return array('default.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '65079526b2bd5af3d8bd5d09d6806cda'), 'ar.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '549764bd09cca9423a81aa06abdbffe4'), 'ca.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'a7ac27b6bf433cc0d2493756cac6968c'), 'cs.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7c0cb8a9dd806edd9b13527aa26cc69a'), 'de.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '92da955824b8fa7c71101c5e8ada5169'), 'el.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '00782d41ca1a893d277028eb1ff44b82'), 'en.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1ef1e2e39236f908aad25ecea1a9292d'), 'es.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'f0d0c17c785c23f2d927d545e66b9ebb'), 'fa.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'dfb2f30e6c2971db4a58c7d8822697ef'), 'fr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7dbcb1da78c507bed374530594d3c753'), 'he.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4417eb623239f76da23650e79564871f'), 'hu.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7f56c3766fce72b1bc41e0a2e5b14044'), 'id.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8f8d5a7da7c1c1e28e57cfe75f748c01'), 'it.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7110a99dce1950e0f070eec0cb8ceb19'), 'ja.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '265b1ef8d3a4373439c7f6fe58d4878b'), 'nb.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '311d444ddc2e37dc013ce25ca4b33fbf'), 'nl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'ec51dfdb8d63ad3fcccc207d30abffd0'), 'pl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '71321f7580871ab56be755dd5a41e7e0'), 'pt.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1d6e7d7a5d7e51830d913c0849c46b3b'), 'ru.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'efa5f2f74045cae2f2544bcfe0d51a2a'), 'sk.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5c9a0ff3cb9cd03909c98ea16e0db621'), 'sv.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '01db404508180ecc349cae6f12038a73'), 'tr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '745186a7d3bb1478b58df111e163c04a'));
<?php return array('default.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'dcd5887e134799f6ade3'), 'ar.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '0b5f3afadc88641fa942'), 'ca.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '469209f8725d57e2dd13'), 'cs.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7ee044f92ac22d009f0d'), 'de.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8ad7fbf0eb33affae0a2'), 'el.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'ee5ddf7ee551f5026c49'), 'en.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1c1f4e9e9cbe1acc9d4a'), 'es.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'a3140230eafbf5adb220'), 'fa.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8c8b9d8bb3e359855eba'), 'fr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4081e1d03e6749161c3f'), 'he.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'cddf10b466a6cc16c444'), 'hu.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'bfe639b26feb0b0ed4a6'), 'id.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '53c6a6ab948855bfcc31'), 'it.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'a6ba808ca11bcd1204da'), 'ja.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '9fb45d3d7f89eb7b01ec'), 'nb.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'a0d3fda26a44f6987891'), 'nl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '053bbca360e39f9f40c2'), 'pl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'b3279cbebccb19d792c3'), 'pt.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'd566478f325d6694ea30'), 'ru.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'efa02baad0eafd15bfb0'), 'sk.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'f1b04454e69dd7c29e48'), 'sv.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '283f3acb6f0dce12b0a5'), 'tr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '864e2a92a589d8a9ca51'));

File diff suppressed because one or more lines are too long

View File

@@ -4423,7 +4423,7 @@ class Cached_Container extends Container
*/
protected function getIndexableAncestorWatcherService()
{
return $this->services['Yoast\\WP\\SEO\\Integrations\\Watchers\\Indexable_Ancestor_Watcher'] = new \Yoast\WP\SEO\Integrations\Watchers\Indexable_Ancestor_Watcher(${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Hierarchy_Builder']) ? $this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Hierarchy_Builder'] : $this->getIndexableHierarchyBuilderService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository'] : $this->getIndexableHierarchyRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['wpdb']) ? $this->services['wpdb'] : $this->getWpdbService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper'] = new \Yoast\WP\SEO\Helpers\Permalink_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper'] : $this->getPostTypeHelperService()) && false ?: '_'});
return $this->services['Yoast\\WP\\SEO\\Integrations\\Watchers\\Indexable_Ancestor_Watcher'] = new \Yoast\WP\SEO\Integrations\Watchers\Indexable_Ancestor_Watcher(${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Hierarchy_Builder']) ? $this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Hierarchy_Builder'] : $this->getIndexableHierarchyBuilderService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository'] : $this->getIndexableHierarchyRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Permalink_Helper'] = new \Yoast\WP\SEO\Helpers\Permalink_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper'] : $this->getPostTypeHelperService()) && false ?: '_'});
}
/**

View File

@@ -8,7 +8,7 @@ namespace Yoast\WP\SEO\Generators\Schema;
class FAQ extends Abstract_Schema_Piece {
/**
* Determines whether or not a piece should be added to the graph.
* Determines whether a piece should be added to the graph.
*
* @return bool
*/
@@ -34,11 +34,13 @@ class FAQ extends Abstract_Schema_Piece {
private function generate_ids() {
$ids = [];
foreach ( $this->context->blocks['yoast/faq-block'] as $block ) {
foreach ( $block['attrs']['questions'] as $question ) {
if ( ! isset( $question['jsonAnswer'] ) || empty( $question['jsonAnswer'] ) ) {
continue;
if ( isset( $block['attrs']['questions'] ) ) {
foreach ( $block['attrs']['questions'] as $question ) {
if ( empty( $question['jsonAnswer'] ) ) {
continue;
}
$ids[] = [ '@id' => $this->context->canonical . '#' . \esc_attr( $question['id'] ) ];
}
$ids[] = [ '@id' => $this->context->canonical . '#' . \esc_attr( $question['id'] ) ];
}
}
@@ -54,8 +56,10 @@ class FAQ extends Abstract_Schema_Piece {
$graph = [];
$questions = [];
foreach ( $this->context->blocks['yoast/faq-block'] as $index => $block ) {
$questions = \array_merge( $questions, $block['attrs']['questions'] );
foreach ( $this->context->blocks['yoast/faq-block'] as $block ) {
if ( isset( $block['attrs']['questions'] ) ) {
$questions = \array_merge( $questions, $block['attrs']['questions'] );
}
}
foreach ( $questions as $index => $question ) {
if ( ! isset( $question['jsonAnswer'] ) || empty( $question['jsonAnswer'] ) ) {
@@ -88,9 +92,7 @@ class FAQ extends Abstract_Schema_Piece {
'acceptedAnswer' => $this->add_accepted_answer_property( $question ),
];
$data = $this->helpers->schema->language->add_piece_language( $data );
return $data;
return $this->helpers->schema->language->add_piece_language( $data );
}
/**
@@ -106,8 +108,6 @@ class FAQ extends Abstract_Schema_Piece {
'text' => $this->helpers->schema->html->sanitize( $question['jsonAnswer'] ),
];
$data = $this->helpers->schema->language->add_piece_language( $data );
return $data;
return $this->helpers->schema->language->add_piece_language( $data );
}
}

View File

@@ -174,7 +174,10 @@ class HowTo extends Abstract_Schema_Piece {
}
$this->add_duration( $data, $block['attrs'] );
$this->add_steps( $data, $block['attrs']['steps'] );
if ( isset( $block['attrs']['steps'] ) ) {
$this->add_steps( $data, $block['attrs']['steps'] );
}
$data = $this->helpers->schema->language->add_piece_language( $data );

View File

@@ -52,6 +52,12 @@ class Organization extends Abstract_Schema_Piece {
$organization['sameAs'] = $same_as;
}
if ( \is_array( $this->context->schema_page_type ) && \in_array( 'ProfilePage', $this->context->schema_page_type, true ) ) {
$organization['mainEntityOfPage'] = [
'@id' => $this->context->main_schema_id,
];
}
return $organization;
}

View File

@@ -52,7 +52,7 @@ class Person extends Abstract_Schema_Piece {
/**
* Returns Person Schema data.
*
* @return bool|array Person data on success, false on failure.
* @return bool|array<string|string[]> Person data on success, false on failure.
*/
public function generate() {
$user_id = $this->determine_user_id();
@@ -87,8 +87,8 @@ class Person extends Abstract_Schema_Piece {
/**
* Retrieve a list of social profile URLs for Person.
*
* @param array $same_as_urls Array of SameAs URLs.
* @param int $user_id User ID.
* @param string[] $same_as_urls Array of SameAs URLs.
* @param int $user_id User ID.
*
* @return string[] A list of SameAs URLs.
*/
@@ -128,7 +128,7 @@ class Person extends Abstract_Schema_Piece {
* @param int $user_id The user ID to use.
* @param bool $add_hash Wether or not the person's image url hash should be added to the image id.
*
* @return array An array of Schema Person data.
* @return array<string|string[]> An array of Schema Person data.
*/
protected function build_person_data( $user_id, $add_hash = false ) {
$user_data = \get_userdata( $user_id );
@@ -149,6 +149,11 @@ class Person extends Abstract_Schema_Piece {
$data['description'] = $this->helpers->schema->html->smart_strip_tags( $user_data->description );
}
if ( \is_array( $this->context->schema_page_type ) && \in_array( 'ProfilePage', $this->context->schema_page_type, true ) ) {
$data['mainEntityOfPage'] = [
'@id' => $this->context->main_schema_id,
];
}
$data = $this->add_same_as_urls( $data, $user_data, $user_id );
/**
@@ -165,11 +170,11 @@ class Person extends Abstract_Schema_Piece {
/**
* Returns an ImageObject for the persons avatar.
*
* @param array $data The Person schema.
* @param WP_User $user_data User data.
* @param bool $add_hash Wether or not the person's image url hash should be added to the image id.
* @param array<string|string[]> $data The Person schema.
* @param WP_User $user_data User data.
* @param bool $add_hash Wether or not the person's image url hash should be added to the image id.
*
* @return array The Person schema.
* @return array<string|string[]> The Person schema.
*/
protected function add_image( $data, $user_data, $add_hash = false ) {
$schema_id = $this->context->site_url . Schema_IDs::PERSON_LOGO_HASH;
@@ -190,12 +195,12 @@ class Person extends Abstract_Schema_Piece {
/**
* Generate the person image from our settings.
*
* @param array $data The Person schema.
* @param string $schema_id The string used in the `@id` for the schema.
* @param bool $add_hash Whether or not the person's image url hash should be added to the image id.
* @param WP_User $user_data User data.
* @param array<string|string[]> $data The Person schema.
* @param string $schema_id The string used in the `@id` for the schema.
* @param bool $add_hash Whether or not the person's image url hash should be added to the image id.
* @param WP_User $user_data User data.
*
* @return array The Person schema.
* @return array<string|string[]> The Person schema.
*/
protected function set_image_from_options( $data, $schema_id, $add_hash = false, $user_data = null ) {
if ( $this->context->site_represents !== 'person' ) {
@@ -211,12 +216,12 @@ class Person extends Abstract_Schema_Piece {
/**
* Generate the person logo from gravatar.
*
* @param array $data The Person schema.
* @param WP_User $user_data User data.
* @param string $schema_id The string used in the `@id` for the schema.
* @param bool $add_hash Wether or not the person's image url hash should be added to the image id.
* @param array<string|string[]> $data The Person schema.
* @param WP_User $user_data User data.
* @param string $schema_id The string used in the `@id` for the schema.
* @param bool $add_hash Wether or not the person's image url hash should be added to the image id.
*
* @return array The Person schema.
* @return array<string|string[]> The Person schema.
*/
protected function set_image_from_avatar( $data, $user_data, $schema_id, $add_hash = false ) {
// If we don't have an image in our settings, fall back to an avatar, if we're allowed to.
@@ -238,8 +243,8 @@ class Person extends Abstract_Schema_Piece {
/**
* Returns an author's social site URL.
*
* @param string $social_site The social site to retrieve the URL for.
* @param mixed $user_id The user ID to use function outside of the loop.
* @param string $social_site The social site to retrieve the URL for.
* @param int|false $user_id The user ID to use function outside of the loop.
*
* @return string
*/
@@ -284,11 +289,11 @@ class Person extends Abstract_Schema_Piece {
/**
* Builds our SameAs array.
*
* @param array $data The Person schema data.
* @param WP_User $user_data The user data object.
* @param int $user_id The user ID to use.
* @param array<string|string[]> $data The Person schema data.
* @param WP_User $user_data The user data object.
* @param int $user_id The user ID to use.
*
* @return array The Person schema data.
* @return array<string|string[]> The Person schema data.
*/
protected function add_same_as_urls( $data, $user_data, $user_id ) {
$same_as_urls = [];

View File

@@ -25,7 +25,7 @@ class WebPage extends Abstract_Schema_Piece {
/**
* Returns WebPage schema data.
*
* @return array WebPage schema data.
* @return array<string|array<string>> WebPage schema data.
*/
public function generate() {
$data = [
@@ -82,10 +82,10 @@ class WebPage extends Abstract_Schema_Piece {
/**
* Adds an author property to the $data if the WebPage is not represented.
*
* @param array $data The WebPage schema.
* @param WP_Post $post The post the context is representing.
* @param array<string|array<string>> $data The WebPage schema.
* @param WP_Post $post The post the context is representing.
*
* @return array The WebPage schema.
* @return array<string|array<string>> The WebPage schema.
*/
public function add_author( $data, $post ) {
if ( $this->context->site_represents === false ) {
@@ -98,9 +98,9 @@ class WebPage extends Abstract_Schema_Piece {
/**
* If we have an image, make it the primary image of the page.
*
* @param array $data WebPage schema data.
* @param array<string|array<string>> $data WebPage schema data.
*
* @return array
* @return array<string|array<string>>
*/
public function add_image( $data ) {
if ( $this->context->has_image ) {
@@ -127,9 +127,9 @@ class WebPage extends Abstract_Schema_Piece {
/**
* Adds the potential action property to the WebPage Schema piece.
*
* @param array $data The WebPage data.
* @param array<string|array<string>> $data The WebPage data.
*
* @return array The WebPage data with the potential action added.
* @return array<string|array<string>> The WebPage data with the potential action added.
*/
private function add_potential_action( $data ) {
$url = $this->context->canonical;
@@ -140,7 +140,7 @@ class WebPage extends Abstract_Schema_Piece {
/**
* Filter: 'wpseo_schema_webpage_potential_action_target' - Allows filtering of the schema WebPage potentialAction target.
*
* @param array $targets The URLs for the WebPage potentialAction target.
* @param array<string> $targets The URLs for the WebPage potentialAction target.
*/
$targets = \apply_filters( 'wpseo_schema_webpage_potential_action_target', [ $url ] );
@@ -158,6 +158,6 @@ class WebPage extends Abstract_Schema_Piece {
* @return string Search URL.
*/
private function build_search_url() {
return $this->context->site_url . '?s=' . \get_search_query();
return $this->context->site_url . '?s=' . \rawurlencode( \get_search_query() );
}
}

View File

@@ -308,7 +308,7 @@ class Front_End_Integration implements Integration_Interface {
}
/**
* Returns correct adjacent pages when QUery loop block does not inherit query from template.
* Returns correct adjacent pages when Query loop block does not inherit query from template.
*
* @param string $link The current link.
* @param string $rel Link relationship, prev or next.
@@ -322,26 +322,16 @@ class Front_End_Integration implements Integration_Interface {
}
if ( $rel === 'next' || $rel === 'prev' ) {
// WP_HTML_Tag_Processor was introduced in WordPress 6.2.
// Reconstruct url if it's relative.
if ( \class_exists( WP_HTML_Tag_Processor::class ) ) {
$processor = new WP_HTML_Tag_Processor( $this->$rel );
while ( $processor->next_tag( [ 'tag_name' => 'a' ] ) ) {
$href = $processor->get_attribute( 'href' );
if ( $href ) {
if ( $href && \strpos( $href, '/' ) === 0 ) {
return $presentation->permalink . \substr( $href, 1 );
}
}
}
// Remove else when dropping support for WordPress 6.1 and lower.
else {
$pattern = '/"(.*?)"/';
// Find all matches of the pattern in the HTML string.
\preg_match_all( $pattern, $this->$rel, $matches );
if ( isset( $matches[1] ) && isset( $matches[1][0] ) && $matches[1][0] ) {
return $presentation->permalink . \substr( $matches[1][0], 1 );
}
}
}
return $link;

View File

@@ -11,6 +11,7 @@ use WPSEO_Admin_Editor_Specific_Replace_Vars;
use WPSEO_Admin_Recommended_Replace_Vars;
use WPSEO_Option_Titles;
use WPSEO_Options;
use WPSEO_Plugin_Availability;
use WPSEO_Replace_Vars;
use WPSEO_Shortlinker;
use WPSEO_Sitemaps_Router;
@@ -453,10 +454,24 @@ class Settings_Integration implements Integration_Interface {
$page_on_front = \get_option( 'page_on_front' );
$page_for_posts = \get_option( 'page_for_posts' );
$wpseo_plugin_availability_checker = new WPSEO_Plugin_Availability();
$woocommerce_seo_file = 'wpseo-woocommerce/wpseo-woocommerce.php';
$woocommerce_seo_active = $wpseo_plugin_availability_checker->is_active( $woocommerce_seo_file );
if ( empty( $page_on_front ) ) {
$page_on_front = $page_for_posts;
}
$business_settings_url = \get_admin_url( null, 'admin.php?page=wpseo_local' );
if ( \defined( 'WPSEO_LOCAL_FILE' ) ) {
$local_options = \get_option( 'wpseo_local' );
$multiple_locations = $local_options['use_multiple_locations'];
$same_organization = $local_options['multiple_locations_same_organization'];
if ( $multiple_locations === 'on' && $same_organization !== 'on' ) {
$business_settings_url = \get_admin_url( null, 'edit.php?post_type=wpseo_locations' );
}
}
return [
'isPremium' => $this->product_helper->is_premium(),
'isRtl' => \is_rtl(),
@@ -466,6 +481,7 @@ class Settings_Integration implements Integration_Interface {
'isWooCommerceActive' => $this->woocommerce_helper->is_active(),
'isLocalSeoActive' => \defined( 'WPSEO_LOCAL_FILE' ),
'isNewsSeoActive' => \defined( 'WPSEO_NEWS_FILE' ),
'isWooCommerceSEOActive' => $woocommerce_seo_active,
'promotions' => \YoastSEO()->classes->get( Promotion_Manager::class )->get_current_promotions(),
'siteUrl' => \get_bloginfo( 'url' ),
'siteTitle' => \get_bloginfo( 'name' ),
@@ -473,6 +489,7 @@ class Settings_Integration implements Integration_Interface {
'hasWooCommerceShopPage' => $shop_page_id !== -1,
'editWooCommerceShopPageUrl' => \get_edit_post_link( $shop_page_id, 'js' ),
'wooCommerceShopPageSettingUrl' => \get_admin_url( null, 'admin.php?page=wc-settings&tab=products' ),
'localSeoPageSettingUrl' => $business_settings_url,
'homepageIsLatestPosts' => $homepage_is_latest_posts,
'homepagePageEditUrl' => \get_edit_post_link( $page_on_front, 'js' ),
'homepagePostsEditUrl' => \get_edit_post_link( $page_for_posts, 'js' ),
@@ -548,7 +565,7 @@ class Settings_Integration implements Integration_Interface {
* @param int $policy The policy id to check.
* @param string $key The option key name.
*
* @return array The policy data.
* @return array<int,string> The policy data.
*/
private function maybe_add_policy( $policies, $policy, $key ) {
$policy_array = [
@@ -575,7 +592,7 @@ class Settings_Integration implements Integration_Interface {
/**
* Returns settings for the Call to Buy (CTB) buttons.
*
* @return string[] The array of CTB settings.
* @return array<string> The array of CTB settings.
*/
public function get_upsell_settings() {
return [
@@ -614,6 +631,64 @@ class Settings_Integration implements Integration_Interface {
}
}
if ( \defined( 'WPSEO_LOCAL_FILE' ) ) {
$defaults = $this->get_defaults_from_local_seo( $defaults );
}
return $defaults;
}
/**
* Retrieves the organization schema values from Local SEO for defaults in Site representation fields.
* Specifically for the org-vat-id, org-tax-id, org-email and org-phone options.
*
* @param array<string|int|bool> $defaults The settings defaults.
*
* @return array<string|int|bool> The settings defaults with local seo overides.
*/
protected function get_defaults_from_local_seo( $defaults ) {
$local_options = \get_option( 'wpseo_local' );
$multiple_locations = $local_options['use_multiple_locations'];
$same_organization = $local_options['multiple_locations_same_organization'];
$shared_info = $local_options['multiple_locations_shared_business_info'];
if ( $multiple_locations !== 'on' || ( $multiple_locations === 'on' && $same_organization === 'on' && $shared_info === 'on' ) ) {
$defaults['wpseo_titles']['org-vat-id'] = $local_options['location_vat_id'];
$defaults['wpseo_titles']['org-tax-id'] = $local_options['location_tax_id'];
$defaults['wpseo_titles']['org-email'] = $local_options['location_email'];
$defaults['wpseo_titles']['org-phone'] = $local_options['location_phone'];
}
if ( \wpseo_has_primary_location() ) {
$primary_location = $local_options['multiple_locations_primary_location'];
$location_keys = [
'org-phone' => [
'is_overridden' => '_wpseo_is_overridden_business_phone',
'value' => '_wpseo_business_phone',
],
'org-email' => [
'is_overridden' => '_wpseo_is_overridden_business_email',
'value' => '_wpseo_business_email',
],
'org-tax-id' => [
'is_overridden' => '_wpseo_is_overridden_business_tax_id',
'value' => '_wpseo_business_tax_id',
],
'org-vat-id' => [
'is_overridden' => '_wpseo_is_overridden_business_vat_id',
'value' => '_wpseo_business_vat_id',
],
];
foreach ( $location_keys as $key => $meta_keys ) {
$is_overridden = ( $shared_info === 'on' ) ? \get_post_meta( $primary_location, $meta_keys['is_overridden'], true ) : false;
if ( $is_overridden === 'on' || $shared_info !== 'on' ) {
$post_meta_value = \get_post_meta( $primary_location, $meta_keys['value'], true );
$defaults['wpseo_titles'][ $key ] = ( $post_meta_value ) ? $post_meta_value : '';
}
}
}
return $defaults;
}

View File

@@ -2,7 +2,6 @@
namespace Yoast\WP\SEO\Integrations\Watchers;
use wpdb;
use Yoast\WP\SEO\Builders\Indexable_Hierarchy_Builder;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Helpers\Permalink_Helper;
@@ -40,13 +39,6 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
*/
protected $indexable_hierarchy_repository;
/**
* Represents the WordPress database object.
*
* @var wpdb
*/
protected $wpdb;
/**
* Represents the permalink helper.
*
@@ -67,7 +59,6 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
* @param Indexable_Repository $indexable_repository The indexable repository.
* @param Indexable_Hierarchy_Builder $indexable_hierarchy_builder The indexable hierarchy builder.
* @param Indexable_Hierarchy_Repository $indexable_hierarchy_repository The indexable hierarchy repository.
* @param wpdb $wpdb The wpdb object.
* @param Permalink_Helper $permalink_helper The permalink helper.
* @param Post_Type_Helper $post_type_helper The post type helper.
*/
@@ -75,13 +66,11 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
Indexable_Repository $indexable_repository,
Indexable_Hierarchy_Builder $indexable_hierarchy_builder,
Indexable_Hierarchy_Repository $indexable_hierarchy_repository,
wpdb $wpdb,
Permalink_Helper $permalink_helper,
Post_Type_Helper $post_type_helper
) {
$this->indexable_repository = $indexable_repository;
$this->indexable_hierarchy_builder = $indexable_hierarchy_builder;
$this->wpdb = $wpdb;
$this->indexable_hierarchy_repository = $indexable_hierarchy_repository;
$this->permalink_helper = $permalink_helper;
$this->post_type_helper = $post_type_helper;
@@ -99,7 +88,7 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
* @return array<Migrations_Conditional>
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
@@ -139,10 +128,10 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
/**
* Finds all child indexables for the given term.
*
* @param int $term_id Term to fetch the indexable for.
* @param Indexable[] $child_indexables The already known child indexables.
* @param int $term_id Term to fetch the indexable for.
* @param array<Indexable> $child_indexables The already known child indexables.
*
* @return array The list of additional child indexables for a given term.
* @return array<Indexable> The list of additional child indexables for a given term.
*/
public function get_children_for_term( $term_id, array $child_indexables ) {
// Finds object_ids (posts) for the term.
@@ -195,26 +184,29 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
/**
* Retrieves the object id's for a term based on the term-post relationship.
*
* @param int $term_id The term to get the object id's for.
* @param Indexable[] $child_indexables The child indexables.
* @param int $term_id The term to get the object id's for.
* @param array<Indexable> $child_indexables The child indexables.
*
* @return array List with object ids for the term.
* @return array<int> List with object ids for the term.
*/
protected function get_object_ids_for_term( $term_id, $child_indexables ) {
global $wpdb;
$filter_terms = static function ( $child ) {
return $child->object_type === 'term';
};
$child_terms = \array_filter( $child_indexables, $filter_terms );
$child_object_ids = \wp_list_pluck( $child_terms, 'object_id' );
$child_object_ids = \array_merge( [ $term_id ], \wp_list_pluck( $child_terms, 'object_id' ) );
// Get the term-taxonomy id's for the term and its children.
$term_taxonomy_ids = $this->wpdb->get_col(
$this->wpdb->prepare(
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
$term_taxonomy_ids = $wpdb->get_col(
$wpdb->prepare(
'SELECT term_taxonomy_id
FROM ' . $this->wpdb->term_taxonomy . '
WHERE term_id IN( ' . \implode( ', ', \array_fill( 0, ( \count( $child_object_ids ) + 1 ), '%s' ) ) . ' )',
$term_id,
FROM %i
WHERE term_id IN( ' . \implode( ', ', \array_fill( 0, ( \count( $child_object_ids ) ), '%s' ) ) . ' )',
$wpdb->term_taxonomy,
...$child_object_ids
)
);
@@ -225,11 +217,13 @@ class Indexable_Ancestor_Watcher implements Integration_Interface {
}
// Get the (post) object id's that are attached to the term.
return $this->wpdb->get_col(
$this->wpdb->prepare(
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
return $wpdb->get_col(
$wpdb->prepare(
'SELECT DISTINCT object_id
FROM ' . $this->wpdb->term_relationships . '
FROM %i
WHERE term_taxonomy_id IN( ' . \implode( ', ', \array_fill( 0, \count( $term_taxonomy_ids ), '%s' ) ) . ' )',
$wpdb->term_relationships,
...$term_taxonomy_ids
)
);

View File

@@ -28,7 +28,7 @@ class Option_Titles_Watcher implements Integration_Interface {
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
* @return array<Migrations_Conditional>
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
@@ -37,8 +37,8 @@ class Option_Titles_Watcher implements Integration_Interface {
/**
* Checks if one of the relevant options has been changed.
*
* @param array $old_value The old value of the option.
* @param array $new_value The new value of the option.
* @param array<string,int,bool> $old_value The old value of the option.
* @param array<string,int,bool> $new_value The new value of the option.
*
* @return bool Whether or not the ancestors are removed.
*/
@@ -76,7 +76,7 @@ class Option_Titles_Watcher implements Integration_Interface {
/**
* Retrieves the relevant keys.
*
* @return array Array with the relevant keys.
* @return array<string> Array with the relevant keys.
*/
protected function get_relevant_keys() {
$post_types = \get_post_types( [ 'public' => true ], 'names' );
@@ -95,7 +95,7 @@ class Option_Titles_Watcher implements Integration_Interface {
/**
* Removes the ancestors for given post types.
*
* @param array $post_types The post types to remove hierarchy for.
* @param array<string> $post_types The post types to remove hierarchy for.
*
* @return bool True when delete query was successful.
*/
@@ -105,21 +105,23 @@ class Option_Titles_Watcher implements Integration_Interface {
}
$wpdb = Wrapper::get_wpdb();
$total = \count( $post_types );
$hierarchy_table = Model::get_table_name( 'Indexable_Hierarchy' );
$indexable_table = Model::get_table_name( 'Indexable' );
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Delete query.
$result = $wpdb->query(
$wpdb->prepare(
"
DELETE FROM `$hierarchy_table`
DELETE FROM %i
WHERE indexable_id IN(
SELECT id
FROM `$indexable_table`
FROM %i
WHERE object_type = 'post'
AND object_sub_type IN( " . \implode( ', ', \array_fill( 0, $total, '%s' ) ) . ' )
AND object_sub_type IN( " . \implode( ', ', \array_fill( 0, \count( $post_types ), '%s' ) ) . ' )
)',
$post_types
$hierarchy_table,
$indexable_table,
...$post_types
)
);

View File

@@ -60,7 +60,7 @@ class Sidebar_Presenter extends Abstract_Presenter {
</h2>
<p>
<?php
echo \esc_html__( 'Get AI to write SEO titles and meta descriptions faster. Reach a wider audience with multiple keywords. Get automatic internal linking suggestions. And much, much more!', 'wordpress-seo' );
echo \esc_html__( 'Use AI to generate titles and meta descriptions, automatically redirect deleted pages, get 24/7 support, and much, much more!', 'wordpress-seo' );
?>
</p>
<?php if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) : ?>
@@ -81,12 +81,22 @@ class Sidebar_Presenter extends Abstract_Presenter {
}
else {
/* translators: %s expands to Yoast SEO Premium */
\printf( \esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
\printf( \esc_html__( 'Get %1$s', 'wordpress-seo' ), 'Yoast SEO Premium' );
}
?>
<span aria-hidden="true" class="yoast-button-upsell__caret"></span>
</a>
</p>
<p class="yoast-price-micro-copy">
<?php
echo \esc_html__( 'Only $/€/£99 per year (ex VAT)', 'wordpress-seo' );
?>
<br />
<?php
echo \esc_html__( '30-day money back guarantee.', 'wordpress-seo' );
?>
</p>
<hr class="yoast-upsell-hr" aria-hidden="true">
<div class="review-container">
<a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
<span class="claim">

View File

@@ -4,6 +4,7 @@ namespace Yoast\WP\SEO\Routes;
use WP_REST_Request;
use WP_REST_Response;
use WPSEO_Utils;
use Yoast\WP\SEO\Actions\Indexables\Indexable_Head_Action;
use Yoast\WP\SEO\Conditionals\Headless_Rest_Endpoints_Enabled_Conditional;
use Yoast\WP\SEO\Main;
@@ -46,7 +47,7 @@ class Indexables_Head_Route implements Route_Interface {
/**
* Returns the conditionals based in which this loadable should be active.
*
* @return array
* @return array<string>
*/
public static function get_conditionals() {
return [ Headless_Rest_Endpoints_Enabled_Conditional::class ];
@@ -94,7 +95,8 @@ class Indexables_Head_Route implements Route_Interface {
* @return bool Whether or not the url is valid.
*/
public function is_valid_url( $url ) {
if ( \filter_var( \utf8_uri_encode( $url ), \FILTER_VALIDATE_URL ) === false ) {
$url = WPSEO_Utils::sanitize_url( \utf8_uri_encode( $url ) );
if ( \filter_var( $url, \FILTER_VALIDATE_URL ) === false ) {
return false;
}
return true;