Skip to content

Commit

Permalink
Merge branch 'release/21.4' of github.com:Yoast/wordpress-seo into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkuu committed Oct 10, 2023
2 parents dacddab + 3593066 commit 93a63d7
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 25 deletions.
4 changes: 2 additions & 2 deletions admin/class-gutenberg-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '16.7.0';
const CURRENT_RELEASE = '16.7.1';

/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '16.7.0';
const MINIMUM_SUPPORTED = '16.7.1';

/**
* Holds the current version.
Expand Down
5 changes: 3 additions & 2 deletions admin/class-premium-upsell-admin-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,16 @@ public function render() {
$button_text
);

echo '<div class="' . esc_attr( $class ) . '">';

if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
$bf_label = \esc_html__( 'BLACK FRIDAY', 'wordpress-seo' );
$sale_label = \esc_html__( '30% OFF', 'wordpress-seo' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped above.
echo "<div class='black-friday-container'><span>$bf_label</span> <span style='margin-left: auto;'>$sale_label</span> </div>";
}

echo '<div class="' . esc_attr( $class ) . '">';
echo '<div>';
echo '<div class="' . esc_attr( $class . '--container' ) . '">';
echo '<h2 class="' . esc_attr( $class . '--header' ) . '">' .
sprintf(
/* translators: %s expands to Yoast SEO Premium */
Expand Down
9 changes: 7 additions & 2 deletions admin/views/licenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,19 @@
esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' )
);

$sale_badge = '';
$sale_badge = '';
$premium_sale_badge = '';

if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
/* translators: %1$s expands to opening span, %2$s expands to closing span */
$sale_badge_span = sprintf( esc_html__( '%1$sSALE 30%% OFF!%2$s', 'wordpress-seo' ), '<span>', '</span>' );

$sale_badge = '<div class="yoast-seo-premium-extension-sale-badge">' . $sale_badge_span . '</div>';

$premium_sale_badge = ( $has_valid_premium_subscription ) ? '' : $sale_badge;

}

?>

<div class="wrap yoast wpseo_table_page">
Expand All @@ -145,7 +150,7 @@

<div id="extensions">
<section class="yoast-seo-premium-extension">
<?php echo $sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is already escaped ?>
<?php echo $premium_sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is already escaped ?>
<h2>
<?php
printf(
Expand Down
15 changes: 9 additions & 6 deletions css/src/yst_plugin_tools.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"typescript": "^4.2.4"
},
"yoast": {
"pluginVersion": "21.4-RC3"
"pluginVersion": "21.4-RC4"
},
"version": "0.0.0"
}
3 changes: 2 additions & 1 deletion packages/js/src/analysis/collectAnalysisData.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default function collectAnalysisData( editorData, store, customAnalysisDa
// Retrieve the block editor blocks from WordPress and filter on useful information.
let blocks = null;
if ( blockEditorDataModule ) {
blocks = blockEditorDataModule.getBlocks();
blocks = blockEditorDataModule.getBlocks() || [];
blocks = blocks.filter( block => block.isValid );
}

// Make a data structure for the paper data.
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/decorator/gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function removeAllAnnotationsFromBlock( blockClientId ) {
* @returns {void}
*/
export function reapplyAnnotationsForSelectedBlock() {
const block = select( "core/editor" ).getSelectedBlock();
const block = select( "core/block-editor" ).getSelectedBlock();
const activeMarkerId = select( "yoast-seo/editor" ).getActiveMarker();

if ( ! block || ! activeMarkerId ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ describe( "An assessment to check whether there is more than one H1 in the text"

describe( "A test for marking incorrect H1s in the body", function() {
it( "returns markers for incorrect H1s in the body", function() {
const mockPaper = new Paper( "<p>a paragraph</p><h1>heading</h1>" );
const mockPaper = new Paper( "<p>a paragraph</p><h1>this is a <strong>heading</strong></h1>" );
const mockResearcher = new EnglishResearcher( mockPaper );
buildTree( mockPaper, mockResearcher );
h1Assessment.getResult( mockPaper, mockResearcher );

const expected = [
new Mark( {
original: "<h1>heading</h1>",
marked: "<h1><yoastmark class='yoast-text-mark'>heading</yoastmark></h1>",
original: "<h1>this is a heading</h1>",
marked: "<h1><yoastmark class='yoast-text-mark'>this is a heading</yoastmark></h1>",
position: {
startOffset: 22,
endOffset: 29,
clientId: "",
endOffsetBlock: 7,
startOffset: 22,
endOffset: 56,
startOffsetBlock: 0,
endOffsetBlock: 34,
} } ),
];

Expand Down
2 changes: 1 addition & 1 deletion packages/yoastseo/src/pluggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Pluggable.prototype._reloaded = function( pluginName ) {
* @param {string} pluginName The plugin that is registering the modification.
* @param {number} priority (optional) Used to specify the order in which the callables associated with a particular filter are called.
* Lower numbers correspond with earlier execution.
* @returns {boolean} Whether or not applying the hook was successfull.
* @returns {boolean} Whether or not applying the hook was successful.
*/
Pluggable.prototype._registerModification = function( modification, callable, pluginName, priority ) {
if ( typeof modification !== "string" ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class SingleH1Assessment extends Assessment {
startOffset: h1.position.startOffset,
endOffset: h1.position.endOffset,
startOffsetBlock: 0,
endOffsetBlock: h1.content.length,
endOffsetBlock: h1.position.endOffset - h1.position.startOffset,
clientId: h1.position.clientId,
},
} );
Expand Down
2 changes: 1 addition & 1 deletion wp-seo-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* {@internal Nobody should be able to overrule the real version number as this can cause
* serious issues with the options, so no if ( ! defined() ).}}
*/
define( 'WPSEO_VERSION', '21.4-RC3' );
define( 'WPSEO_VERSION', '21.4-RC4' );


if ( ! defined( 'WPSEO_PATH' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @wordpress-plugin
* Plugin Name: Yoast SEO
* Version: 21.4-RC3
* Version: 21.4-RC4
* Plugin URI: https://yoa.st/1uj
* Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.
* Author: Team Yoast
Expand Down

0 comments on commit 93a63d7

Please sign in to comment.