Skip to content

Commit

Permalink
Merge branch 'release/3.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobattocchi committed May 16, 2023
2 parents 98fefaf + ce7c991 commit f71f101
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
11 changes: 7 additions & 4 deletions inc/dependencies/dependency-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
final class Yoast_ACF_Analysis_Dependency_ACF implements Yoast_ACF_Analysis_Dependency {

const MINIMAL_REQUIRED_ACF_VERSION = '6.0.0';

/**
* Checks if ACF is active.
*
Expand All @@ -20,7 +22,7 @@ public function is_met() {
return false;
}

if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, '5.7.0', '<' ) ) {
if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, self::MINIMAL_REQUIRED_ACF_VERSION, '<' ) ) {
return false;
}

Expand All @@ -39,10 +41,11 @@ public function register_notifications() {
*/
public function message_plugin_not_activated() {
$message = sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Advanced Custom Fields */
__( '%1$s requires %2$s (free or pro) 5.7 or higher to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Advanced Custom Fields, %3$s resolves to the minimum required ACF version. */
__( '%1$s requires %2$s (free or pro) %3$s or higher to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO',
'Advanced Custom Fields'
'Advanced Custom Fields',
self::MINIMAL_REQUIRED_ACF_VERSION
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
Expand Down
18 changes: 8 additions & 10 deletions inc/dependencies/dependency-yoast-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
final class Yoast_ACF_Analysis_Dependency_Yoast_SEO implements Yoast_ACF_Analysis_Dependency {

const MINIMAL_REQUIRED_VERSION = 14.9;
const MINIMAL_REQUIRED_VERSION = '20.8-RC1';

/**
* Checks if this dependency is met.
Expand Down Expand Up @@ -48,11 +48,10 @@ public function register_notifications() {
*/
public function message_plugin_not_activated() {
$message = sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO for WordPress, %3$s resolves to the minimal plugin version */
__( '%1$s requires %2$s %3$s (or higher) to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO. */
__( '%1$s requires %2$s to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO',
'Yoast SEO for WordPress',
self::MINIMAL_REQUIRED_VERSION
'Yoast SEO'
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
Expand All @@ -63,11 +62,10 @@ public function message_plugin_not_activated() {
*/
public function message_minimum_version() {
$message = sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO for WordPress, %3$s resolves to the minimal plugin version */
__( '%1$s requires %2$s %3$s or higher, please update the plugin.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO',
'Yoast SEO for WordPress',
self::MINIMAL_REQUIRED_VERSION
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to ACF Content Analysis for Yoast SEO. */
__( 'Please upgrade the %1$s plugin to the latest version to allow the %2$s module to work.', 'acf-content-analysis-for-yoast-seo' ),
'Yoast SEO',
'ACF Content Analysis for Yoast SEO'
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ Previously called Yoast ACF Analysis.

Released May 23rd, 2023

Enhancements:

* Improves the analysis by excluding content from the URL and email fields.

Bugfixes:

* Fixes a bug where the content in ACF fields was not included in the analysis in Classic editor when WordProof plugin was activated.

Enhancements:
Other:

* Improves the analysis by excluding content from the URL and email fields.
* Sets the minimum required Yoast SEO version to 20.8.
* Sets the minimum required ACF version to 6.0.0.
* Sets the minimum supported WordPress version to 6.1 and "Tested up to" to 6.2.
* Drops compatibility with PHP 5.6, 7.0 and 7.1.

= 3.0.1 =

Expand Down
4 changes: 2 additions & 2 deletions tests/php/unit/Dependencies/yoast-seo-dependency-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testFail() {
* @return void
*/
public function testPass() {
\define( 'WPSEO_VERSION', '14.9.0' );
\define( 'WPSEO_VERSION', '20.8' );

$testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
$this->assertTrue( $testee->is_met() );
Expand All @@ -55,7 +55,7 @@ public function testPass() {
* @return void
*/
public function testOldVersion() {
\define( 'WPSEO_VERSION', '14.5.0' );
\define( 'WPSEO_VERSION', '20.7' );

$testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
$this->assertFalse( $testee->is_met() );
Expand Down

0 comments on commit f71f101

Please sign in to comment.