Plugin Updates

This commit is contained in:
Tony Volpe
2024-03-19 15:33:31 +00:00
parent ff5b56dc44
commit 3a70a6e4bf
317 changed files with 8178 additions and 2933 deletions

View File

@@ -11,6 +11,7 @@ use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Indexable_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Permalink_Helper;
use Yoast\WP\SEO\Helpers\Request_Helper;
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Helpers\Site_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
@@ -121,6 +122,13 @@ class Meta_Tags_Context extends Abstract_Presentation {
*/
private $id_helper;
/**
* The request helper.
*
* @var Request_Helper
*/
private $request_helper;
/**
* The WPSEO Replace Vars object.
*
@@ -176,6 +184,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
* @param Permalink_Helper $permalink_helper The permalink helper.
* @param Indexable_Helper $indexable_helper The indexable helper.
* @param Indexable_Repository $indexable_repository The indexable repository.
* @param Request_Helper $request_helper The request helper.
*/
public function __construct(
Options_Helper $options,
@@ -187,7 +196,8 @@ class Meta_Tags_Context extends Abstract_Presentation {
User_Helper $user,
Permalink_Helper $permalink_helper,
Indexable_Helper $indexable_helper,
Indexable_Repository $indexable_repository
Indexable_Repository $indexable_repository,
Request_Helper $request_helper
) {
$this->options = $options;
$this->url = $url;
@@ -199,6 +209,7 @@ class Meta_Tags_Context extends Abstract_Presentation {
$this->permalink_helper = $permalink_helper;
$this->indexable_helper = $indexable_helper;
$this->indexable_repository = $indexable_repository;
$this->request_helper = $request_helper;
}
/**
@@ -614,6 +625,10 @@ class Meta_Tags_Context extends Abstract_Presentation {
return $this->image->get_attachment_image_url( $this->main_image_id, 'full' );
}
if ( $this->request_helper->is_rest_request() ) {
return $this->get_main_image_url_for_rest_request();
}
if ( ! \is_singular() ) {
return null;
}
@@ -627,11 +642,15 @@ class Meta_Tags_Context extends Abstract_Presentation {
}
/**
* Gets the main image ID.
* Generates the main image ID.
*
* @return int|null The main image ID.
*/
public function generate_main_image_id() {
if ( $this->request_helper->is_rest_request() ) {
return $this->get_main_image_id_for_rest_request();
}
switch ( true ) {
case \is_singular():
return $this->get_singular_post_image( $this->id );
@@ -712,6 +731,44 @@ class Meta_Tags_Context extends Abstract_Presentation {
return null;
}
/**
* Gets the main image ID for REST requests.
*
* @return int|null The main image ID.
*/
private function get_main_image_id_for_rest_request() {
switch ( $this->page_type ) {
case 'Post_Type':
if ( $this->post instanceof WP_Post ) {
return $this->get_singular_post_image( $this->post->ID );
}
return null;
default:
return null;
}
}
/**
* Gets the main image URL for REST requests.
*
* @return string|null The main image URL.
*/
private function get_main_image_url_for_rest_request() {
switch ( $this->page_type ) {
case 'Post_Type':
if ( $this->post instanceof WP_Post ) {
$url = $this->image->get_post_content_image( $this->post->ID );
if ( $url === '' ) {
return null;
}
return $url;
}
return null;
default:
return null;
}
}
}
\class_alias( Meta_Tags_Context::class, 'WPSEO_Schema_Context' );

View File

@@ -1 +1 @@
<?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'));
<?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' => '76035b0e4ac0170e0d11'), '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' => '213d4771384b98e2e23a'), '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' => '7b293df6725796aee3e5'));

View File

@@ -1 +1 @@
<?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'));
<?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' => 'e3ea4db44fd2d2e88d79'), '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' => '8e4aac0747a3c7dddf8a'), 'de.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '98d3917d5bd467213b06'), 'el.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'd72edcab364d544c2469'), 'en.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8f2a235aba4e9602cf7a'), 'es.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'ff82c0b2cbb874d38d66'), 'fa.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5afc40a75db2d68cacf2'), 'fr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'a23c2630b045abc90aec'), 'he.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8fc43156b5d47a4f8176'), 'hu.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'd173d9d977c5b068443b'), 'id.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '0d5dd486f955d8a407f0'), 'it.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'fb28921dba0da6614c80'), 'ja.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '399d0e938b91bde27f04'), 'nb.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '04746196da02bb736987'), 'nl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'c324d67321be4de5dba8'), 'pl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5908ab61bfa52f1abf82'), 'pt.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1b29b34cd8ec54326129'), 'ru.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '74de056aa417f584ada3'), 'sk.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'be3d5afc018c7be19ca5'), 'sv.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'aa3c53ba0e8c760d56ec'), 'tr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'f48abbda9bf8076db264'));

File diff suppressed because one or more lines are too long

View File

@@ -2686,7 +2686,7 @@ class Cached_Container extends Container
*/
protected function getMetaTagsContextService()
{
return $this->services['Yoast\\WP\\SEO\\Context\\Meta_Tags_Context'] = new \Yoast\WP\SEO\Context\Meta_Tags_Context(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper'] = new \Yoast\WP\SEO\Helpers\Url_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper'] : $this->getImageHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper'] = new \Yoast\WP\SEO\Helpers\Schema\ID_Helper())) && false ?: '_'}, ${($_ = isset($this->services['WPSEO_Replace_Vars']) ? $this->services['WPSEO_Replace_Vars'] : $this->getWPSEOReplaceVarsService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper'] = new \Yoast\WP\SEO\Helpers\Site_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] = new \Yoast\WP\SEO\Helpers\User_Helper())) && 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\\Indexable_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Indexable_Helper'] : $this->getIndexableHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'});
return $this->services['Yoast\\WP\\SEO\\Context\\Meta_Tags_Context'] = new \Yoast\WP\SEO\Context\Meta_Tags_Context(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Url_Helper'] = new \Yoast\WP\SEO\Helpers\Url_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper'] : $this->getImageHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Schema\\ID_Helper'] = new \Yoast\WP\SEO\Helpers\Schema\ID_Helper())) && false ?: '_'}, ${($_ = isset($this->services['WPSEO_Replace_Vars']) ? $this->services['WPSEO_Replace_Vars'] : $this->getWPSEOReplaceVarsService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Site_Helper'] = new \Yoast\WP\SEO\Helpers\Site_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] = new \Yoast\WP\SEO\Helpers\User_Helper())) && 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\\Indexable_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Indexable_Helper'] : $this->getIndexableHelperService()) && false ?: '_'}, ${($_ = 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\\Helpers\\Request_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Request_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Request_Helper'] = new \Yoast\WP\SEO\Helpers\Request_Helper())) && false ?: '_'});
}
/**

View File

@@ -89,7 +89,7 @@ class Breadcrumbs_Generator implements Generator_Interface {
*
* @param Meta_Tags_Context $context The meta tags context.
*
* @return array An array of associative arrays that each have a 'text' and a 'url'.
* @return array<array<int,string>> An array of associative arrays that each have a 'text' and a 'url'.
*/
public function generate( Meta_Tags_Context $context ) {
$static_ancestors = [];
@@ -136,9 +136,11 @@ class Breadcrumbs_Generator implements Generator_Interface {
}
}
}
// Get all ancestors of the indexable and append itself to get all indexables in the full crumb.
$indexables = $this->repository->get_ancestors( $context->indexable );
$indexables = [];
if ( ! \in_array( $this->current_page_helper->get_page_type(), [ 'Home_Page', 'Static_Home_Page' ], true ) ) {
// Get all ancestors of the indexable and append itself to get all indexables in the full crumb.
$indexables = $this->repository->get_ancestors( $context->indexable );
}
$indexables[] = $context->indexable;
if ( ! empty( $static_ancestors ) ) {
@@ -154,34 +156,7 @@ class Breadcrumbs_Generator implements Generator_Interface {
}
);
$callback = function ( Indexable $ancestor ) {
$crumb = [
'url' => $ancestor->permalink,
'text' => $ancestor->breadcrumb_title,
];
switch ( $ancestor->object_type ) {
case 'post':
$crumb = $this->get_post_crumb( $crumb, $ancestor );
break;
case 'post-type-archive':
$crumb = $this->get_post_type_archive_crumb( $crumb, $ancestor );
break;
case 'term':
$crumb = $this->get_term_crumb( $crumb, $ancestor );
break;
case 'system-page':
$crumb = $this->get_system_page_crumb( $crumb, $ancestor );
break;
case 'user':
$crumb = $this->get_user_crumb( $crumb, $ancestor );
break;
case 'date-archive':
$crumb = $this->get_date_archive_crumb( $crumb );
break;
}
return $crumb;
};
$crumbs = \array_map( $callback, $indexables );
$crumbs = \array_map( [ $this,'get_post_type_crumb' ], $indexables );
if ( $breadcrumbs_home !== '' ) {
$crumbs[0]['text'] = $breadcrumbs_home;
@@ -224,10 +199,10 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Returns the modified post crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
* @param Indexable $ancestor The indexable.
*
* @return array The crumb.
* @return array<int,string> The crumb.
*/
private function get_post_crumb( $crumb, $ancestor ) {
$crumb['id'] = $ancestor->object_id;
@@ -235,13 +210,53 @@ class Breadcrumbs_Generator implements Generator_Interface {
return $crumb;
}
/**
* Adds the correct ID to the crumb array based on the ancestor provided.
*
* @param Indexable $ancestor The ancestor indexable.
*
* @return string[]
*/
private function get_post_type_crumb( Indexable $ancestor ) {
$crumb = [
'url' => $ancestor->permalink,
'text' => $ancestor->breadcrumb_title,
];
switch ( $ancestor->object_type ) {
case 'post':
$crumb = $this->get_post_crumb( $crumb, $ancestor );
break;
case 'post-type-archive':
$crumb = $this->get_post_type_archive_crumb( $crumb, $ancestor );
break;
case 'term':
$crumb = $this->get_term_crumb( $crumb, $ancestor );
break;
case 'system-page':
$crumb = $this->get_system_page_crumb( $crumb, $ancestor );
break;
case 'user':
$crumb = $this->get_user_crumb( $crumb, $ancestor );
break;
case 'date-archive':
$crumb = $this->get_date_archive_crumb( $crumb );
break;
default:
// Handle unknown object types (optional).
break;
}
return $crumb;
}
/**
* Returns the modified post type crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
* @param Indexable $ancestor The indexable.
*
* @return array The crumb.
* @return string[] The crumb.
*/
private function get_post_type_archive_crumb( $crumb, $ancestor ) {
$crumb['ptarchive'] = $ancestor->object_sub_type;
@@ -252,10 +267,10 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Returns the modified term crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
* @param Indexable $ancestor The indexable.
*
* @return array The crumb.
* @return array<int,string> The crumb.
*/
private function get_term_crumb( $crumb, $ancestor ) {
$crumb['term_id'] = $ancestor->object_id;
@@ -267,10 +282,10 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Returns the modified system page crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
* @param Indexable $ancestor The indexable.
*
* @return array The crumb.
* @return string[] The crumb.
*/
private function get_system_page_crumb( $crumb, $ancestor ) {
if ( $ancestor->object_sub_type === 'search-result' ) {
@@ -287,10 +302,10 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Returns the modified user crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
* @param Indexable $ancestor The indexable.
*
* @return array The crumb.
* @return string[] The crumb.
*/
private function get_user_crumb( $crumb, $ancestor ) {
$display_name = \get_the_author_meta( 'display_name', $ancestor->object_id );
@@ -302,9 +317,9 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Returns the modified date archive crumb.
*
* @param array $crumb The crumb.
* @param string[] $crumb The crumb.
*
* @return array The crumb.
* @return string[] The crumb.
*/
protected function get_date_archive_crumb( $crumb ) {
$home_url = $this->url_helper->home();
@@ -380,10 +395,10 @@ class Breadcrumbs_Generator implements Generator_Interface {
/**
* Adds a crumb for the current page, if we're on an archive page or paginated post.
*
* @param array $crumbs The array of breadcrumbs.
* @param string[] $crumbs The array of breadcrumbs.
* @param Indexable $current_indexable The current indexable.
*
* @return array The breadcrumbs.
* @return string[] The breadcrumbs.
*/
protected function add_paged_crumb( array $crumbs, $current_indexable ) {
$is_simple_page = $this->current_page_helper->is_simple_page();

View File

@@ -29,13 +29,13 @@ class Asset_Helper {
*
* @param string $handle The handle.
*
* @return string[]|bool All dependencies of the given handle.
* @return string[] All dependencies of the given handle.
*/
public function get_dependency_handles( $handle ) {
$scripts = \wp_scripts();
if ( ! isset( $scripts->registered[ $handle ] ) ) {
return false;
return [];
}
$obj = $scripts->registered[ $handle ];

View File

@@ -240,7 +240,7 @@ class Social_Profiles_Helper {
*/
if ( $field_name === 'twitter_site' ) {
$current_option = $this->options_helper->get( $field_name );
if ( ! \strpos( $social_profiles[ $field_name ], 'twitter.com/' . $current_option ) ) {
if ( ! \strpos( $social_profiles[ $field_name ], 'twitter.com/' . $current_option ) && ! \strpos( $social_profiles[ $field_name ], 'x.com/' . $current_option ) ) {
$failures[] = $field_name;
}
}

View File

@@ -157,7 +157,6 @@ class Workouts_Integration implements Integration_Interface {
'usersPageUrl' => \esc_url( \admin_url( 'users.php' ) ),
'firstTimeConfigurationUrl' => \esc_url( \admin_url( 'admin.php?page=wpseo_dashboard#top#first-time-configuration' ) ),
'isPremium' => $this->product_helper->is_premium(),
'shouldUpdatePremium' => $this->should_update_premium(),
'upsellText' => $this->get_upsell_text(),
'upsellLink' => $this->get_upsell_link(),
]