Skip to content

Commit 8d9b98f

Browse files
Merge pull request #346 from Yoast/fix-required-version-numbers
Fix required version numbers
2 parents 69811ea + eb25246 commit 8d9b98f

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

inc/dependencies/dependency-acf.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*/
1111
final class Yoast_ACF_Analysis_Dependency_ACF implements Yoast_ACF_Analysis_Dependency {
1212

13+
const MINIMAL_REQUIRED_ACF_VERSION = '6.0.0';
14+
1315
/**
1416
* Checks if ACF is active.
1517
*
@@ -20,7 +22,7 @@ public function is_met() {
2022
return false;
2123
}
2224

23-
if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, '5.7.0', '<' ) ) {
25+
if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, self::MINIMAL_REQUIRED_ACF_VERSION, '<' ) ) {
2426
return false;
2527
}
2628

@@ -39,10 +41,11 @@ public function register_notifications() {
3941
*/
4042
public function message_plugin_not_activated() {
4143
$message = sprintf(
42-
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Advanced Custom Fields */
43-
__( '%1$s requires %2$s (free or pro) 5.7 or higher to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
44+
/* 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. */
45+
__( '%1$s requires %2$s (free or pro) %3$s or higher to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
4446
'ACF Content Analysis for Yoast SEO',
45-
'Advanced Custom Fields'
47+
'Advanced Custom Fields',
48+
self::MINIMAL_REQUIRED_ACF_VERSION
4649
);
4750

4851
printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );

inc/dependencies/dependency-yoast-seo.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
final class Yoast_ACF_Analysis_Dependency_Yoast_SEO implements Yoast_ACF_Analysis_Dependency {
1212

13-
const MINIMAL_REQUIRED_VERSION = 14.9;
13+
const MINIMAL_REQUIRED_VERSION = '20.8-RC1';
1414

1515
/**
1616
* Checks if this dependency is met.
@@ -48,11 +48,10 @@ public function register_notifications() {
4848
*/
4949
public function message_plugin_not_activated() {
5050
$message = sprintf(
51-
/* 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 */
52-
__( '%1$s requires %2$s %3$s (or higher) to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
51+
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO. */
52+
__( '%1$s requires %2$s to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
5353
'ACF Content Analysis for Yoast SEO',
54-
'Yoast SEO for WordPress',
55-
self::MINIMAL_REQUIRED_VERSION
54+
'Yoast SEO'
5655
);
5756

5857
printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
@@ -63,11 +62,10 @@ public function message_plugin_not_activated() {
6362
*/
6463
public function message_minimum_version() {
6564
$message = sprintf(
66-
/* 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 */
67-
__( '%1$s requires %2$s %3$s or higher, please update the plugin.', 'acf-content-analysis-for-yoast-seo' ),
68-
'ACF Content Analysis for Yoast SEO',
69-
'Yoast SEO for WordPress',
70-
self::MINIMAL_REQUIRED_VERSION
65+
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to ACF Content Analysis for Yoast SEO. */
66+
__( 'Please upgrade the %1$s plugin to the latest version to allow the %2$s module to work.', 'acf-content-analysis-for-yoast-seo' ),
67+
'Yoast SEO',
68+
'ACF Content Analysis for Yoast SEO'
7169
);
7270

7371
printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );

tests/php/unit/Dependencies/yoast-seo-dependency-test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testFail() {
4343
* @return void
4444
*/
4545
public function testPass() {
46-
\define( 'WPSEO_VERSION', '14.9.0' );
46+
\define( 'WPSEO_VERSION', '20.8' );
4747

4848
$testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
4949
$this->assertTrue( $testee->is_met() );
@@ -55,7 +55,7 @@ public function testPass() {
5555
* @return void
5656
*/
5757
public function testOldVersion() {
58-
\define( 'WPSEO_VERSION', '14.5.0' );
58+
\define( 'WPSEO_VERSION', '20.7' );
5959

6060
$testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
6161
$this->assertFalse( $testee->is_met() );

0 commit comments

Comments
 (0)