From 07b33a4659e70339a73589add7037fa33648bb6b Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Wed, 19 Sep 2018 20:53:53 -0400 Subject: [PATCH 1/7] Enforced minimum PHP and WP version requirements. --- functions.php | 6 ++- lib/minimum-requirements.php | 88 ++++++++++++++++++++++++++++++++++++ phpcs.xml.dist | 1 + 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 lib/minimum-requirements.php diff --git a/functions.php b/functions.php index 0d615c9..d506c1c 100644 --- a/functions.php +++ b/functions.php @@ -10,7 +10,11 @@ * @link https://www.christophherr.com/ */ -namespace ChristophHerr\Prometheus2; +// Check minimum requirements. +if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) || version_compare( PHP_VERSION, '5.6', '<' ) ) { + require_once 'lib/minimum-requirements.php'; + return; +} // Start the Child Theme. require_once 'lib/init.php'; diff --git a/lib/minimum-requirements.php b/lib/minimum-requirements.php new file mode 100644 index 0000000..acee0de --- /dev/null +++ b/lib/minimum-requirements.php @@ -0,0 +1,88 @@ + true ) ); +} + +add_action( 'template_redirect', 'prometheus_2_do_not_load_customizer_preview' ); +/** + * Don't load the Customizer preview on installs prior to WordPress 4.7. + * + * @since 2.0.0 + * + * @return void + */ +function prometheus_2_do_not_load_customizer_preview() { + if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification -- Just checking, no processing going on. + wp_die( esc_html( prometheus_2_upgrade_message() ) ); + } +} + +/** + * Show an admin notice. + * + * @since 2.0.0 + * + * @return void + */ +function prometheus_2_show_deactivation_and_upgrade_notice() { + printf( '

%s

', esc_html( prometheus_2_upgrade_message() ) ); +} + +/** + * Content of the admin notice detailing that the theme was not activated and which requirement wasn't met. + * + * @since 2.0.0 + * + * @return string + */ +function prometheus_2_upgrade_message() { + if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ) { + return sprintf( + // Translators: 1 is the required WordPress version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires a minimum WordPress version of %1$s. You are running version %2$s. Please upgrade WordPress and try again.', 'prometheus2' ), + '4.9.6', + $GLOBALS['wp_version'] + ); + } elseif ( version_compare( PHP_VERSION, '5.6', '<' ) ) { + return sprintf( + // Translators: 1 is the required PHP version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. You are running version %2$s. Please upgrade your PHP version and try again.', 'prometheus2' ), + '5.6', + PHP_VERSION + ); + } + return ''; +} diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e69c170..d0cca88 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -61,6 +61,7 @@ + From 617c7f306f54e9fa21f998c5934f9c3e059f6df0 Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Wed, 19 Sep 2018 22:15:35 -0400 Subject: [PATCH 2/7] Changed fallback and added message if WP and PHP requirements not met. --- lib/minimum-requirements.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/minimum-requirements.php b/lib/minimum-requirements.php index acee0de..b01df9b 100644 --- a/lib/minimum-requirements.php +++ b/lib/minimum-requirements.php @@ -11,15 +11,14 @@ add_action( 'after_switch_theme', 'prometheus_2_switch_theme' ); /** - * Switch to the previously active theme after the theme has been activated. + * Switch to the Genesis parent theme after the theme has been activated. * * @since 2.0.0 * - * @param string $previous_theme Previous theme name/slug. * @return void */ -function prometheus_2_switch_theme( $previous_theme ) { - switch_theme( $previous_theme ? $previous_theme : WP_DEFAULT_THEME ); +function prometheus_2_switch_theme() { + switch_theme( 'genesis' ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'prometheus_2_show_deactivation_and_upgrade_notice' ); } @@ -69,17 +68,26 @@ function prometheus_2_show_deactivation_and_upgrade_notice() { * @return string */ function prometheus_2_upgrade_message() { - if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ) { + if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) && version_compare( PHP_VERSION, '5.6', '<' ) ) { return sprintf( // Translators: 1 is the required WordPress version and 2 is the user's current version. - __( 'Prometheus 2 was not activated because it requires a minimum WordPress version of %1$s. You are running version %2$s. Please upgrade WordPress and try again.', 'prometheus2' ), + __( 'Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again.', 'prometheus2' ), + '4.9.6', + '5.6', + $GLOBALS['wp_version'], + PHP_VERSION + ); + } elseif ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ) { + return sprintf( + // Translators: 1 is the required WordPress version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again.', 'prometheus2' ), '4.9.6', $GLOBALS['wp_version'] ); } elseif ( version_compare( PHP_VERSION, '5.6', '<' ) ) { return sprintf( // Translators: 1 is the required PHP version and 2 is the user's current version. - __( 'Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. You are running version %2$s. Please upgrade your PHP version and try again.', 'prometheus2' ), + __( 'Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade your PHP version and try again.', 'prometheus2' ), '5.6', PHP_VERSION ); From 5c6deed5066a33712ab00a22d8c3132df1258018 Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Wed, 19 Sep 2018 22:30:49 -0400 Subject: [PATCH 3/7] Updated .pot file --- languages/prometheus-2.pot | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/languages/prometheus-2.pot b/languages/prometheus-2.pot index c6c820d..c173acf 100644 --- a/languages/prometheus-2.pot +++ b/languages/prometheus-2.pot @@ -55,6 +55,21 @@ msgstr "" msgid "The maximum width of the logo in pixels." msgstr "" +#. translators: 1 is the required WordPress version and 2 is the user's current version. +#: lib/minimum-requirements.php:74 +msgid "Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again." +msgstr "" + +#. translators: 1 is the required WordPress version and 2 is the user's current version. +#: lib/minimum-requirements.php:83 +msgid "Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again." +msgstr "" + +#. translators: 1 is the required PHP version and 2 is the user's current version. +#: lib/minimum-requirements.php:90 +msgid "Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade your PHP version and try again." +msgstr "" + #: lib/plugins/woocommerce/woocommerce-setup.php:67 msgid "Previous Page" msgstr "" From c3785217ee1ed2b6ff9c80ad34d7ce3f59c51f14 Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Thu, 20 Sep 2018 15:43:37 -0400 Subject: [PATCH 4/7] Added check and messages for Genesis version requirement. --- functions.php | 6 ++++- languages/prometheus-2.pot | 28 ++++++++++++++++++--- lib/minimum-requirements.php | 49 +++++++++++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 9 deletions(-) diff --git a/functions.php b/functions.php index d506c1c..b8377e2 100644 --- a/functions.php +++ b/functions.php @@ -10,8 +10,12 @@ * @link https://www.christophherr.com/ */ +function get_genesis_version() { + return wp_get_theme( 'genesis' )->get( 'Version' ); +} + // Check minimum requirements. -if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) || version_compare( PHP_VERSION, '5.6', '<' ) ) { +if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) || version_compare( PHP_VERSION, '5.6', '<' ) || version_compare( get_genesis_version(), '2.6', '<' ) ) { require_once 'lib/minimum-requirements.php'; return; } diff --git a/languages/prometheus-2.pot b/languages/prometheus-2.pot index c173acf..11ac014 100644 --- a/languages/prometheus-2.pot +++ b/languages/prometheus-2.pot @@ -56,18 +56,38 @@ msgid "The maximum width of the logo in pixels." msgstr "" #. translators: 1 is the required WordPress version and 2 is the user's current version. -#: lib/minimum-requirements.php:74 +#: lib/minimum-requirements.php:79 +msgid "Prometheus 2 cannot be activated because it requires Genesis version %1$s, WordPress version %2$s and PHP version %3$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %4$s, WordPress version %5$s and PHP version %6$s. Please upgrade Genesis, WordPress and PHP and try again." +msgstr "" + +#. translators: 1 is the required WordPress version and 2 is the user's current version. +#: lib/minimum-requirements.php:90 msgid "Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again." msgstr "" #. translators: 1 is the required WordPress version and 2 is the user's current version. -#: lib/minimum-requirements.php:83 +#: lib/minimum-requirements.php:99 +msgid "Prometheus 2 was not activated because it requires Genesis version %1$s and WordPress version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and WordPress version %4$s. Please upgrade Genesis and WordPress and try again." +msgstr "" + +#. translators: 1 is the required PHP version and 2 is the user's current version. +#: lib/minimum-requirements.php:108 +msgid "Prometheus 2 was not activated because it requires Genesis version %1$s and PHP version of %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and PHP version %4$s. Please upgrade Genesis and PHP and try again." +msgstr "" + +#. translators: 1 is the required WordPress version and 2 is the user's current version. +#: lib/minimum-requirements.php:117 msgid "Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again." msgstr "" #. translators: 1 is the required PHP version and 2 is the user's current version. -#: lib/minimum-requirements.php:90 -msgid "Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade your PHP version and try again." +#: lib/minimum-requirements.php:124 +msgid "Prometheus 2 was not activated because it requires PHP version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade PHP and try again." +msgstr "" + +#. translators: 1 is the required PHP version and 2 is the user's current version. +#: lib/minimum-requirements.php:131 +msgid "Prometheus 2 was not activated because it requires Genesis version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %2$s. Please upgrade Genesis and try again." msgstr "" #: lib/plugins/woocommerce/woocommerce-setup.php:67 diff --git a/lib/minimum-requirements.php b/lib/minimum-requirements.php index b01df9b..36782d5 100644 --- a/lib/minimum-requirements.php +++ b/lib/minimum-requirements.php @@ -68,7 +68,23 @@ function prometheus_2_show_deactivation_and_upgrade_notice() { * @return string */ function prometheus_2_upgrade_message() { - if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) && version_compare( PHP_VERSION, '5.6', '<' ) ) { + $genesis_version = get_genesis_version(); + $compare_wp_version = version_compare( $GLOBALS['wp_version'], '4.8', '<' ); + $compare_php_version = version_compare( PHP_VERSION, '5.6', '<' ); + $compare_genesis_version = version_compare( $genesis_version, '2.6', '<' ); + + if ( $compare_wp_version && $compare_php_version && $compare_genesis_version ) { + return sprintf( + // Translators: 1 is the required WordPress version and 2 is the user's current version. + __( 'Prometheus 2 cannot be activated because it requires Genesis version %1$s, WordPress version %2$s and PHP version %3$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %4$s, WordPress version %5$s and PHP version %6$s. Please upgrade Genesis, WordPress and PHP and try again.', 'prometheus2' ), + '2.6', + '4.9.6', + '5.6', + $genesis_version, + $GLOBALS['wp_version'], + PHP_VERSION + ); + } elseif ( $compare_wp_version && $compare_php_version ) { return sprintf( // Translators: 1 is the required WordPress version and 2 is the user's current version. __( 'Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again.', 'prometheus2' ), @@ -77,20 +93,45 @@ function prometheus_2_upgrade_message() { $GLOBALS['wp_version'], PHP_VERSION ); - } elseif ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ) { + } elseif ( $compare_genesis_version && $compare_wp_version ) { + return sprintf( + // Translators: 1 is the required WordPress version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires Genesis version %1$s and WordPress version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and WordPress version %4$s. Please upgrade Genesis and WordPress and try again.', 'prometheus2' ), + '2.6', + '4.9.6', + $genesis_version, + $GLOBALS['wp_version'] + ); + } elseif ( $compare_genesis_version && $compare_php_version ) { + return sprintf( + // Translators: 1 is the required PHP version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires Genesis version %1$s and PHP version of %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and PHP version %4$s. Please upgrade Genesis and PHP and try again.', 'prometheus2' ), + '2.6', + '5.6', + $genesis_version, + PHP_VERSION + ); + } elseif ( $compare_wp_version ) { return sprintf( // Translators: 1 is the required WordPress version and 2 is the user's current version. __( 'Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again.', 'prometheus2' ), '4.9.6', $GLOBALS['wp_version'] ); - } elseif ( version_compare( PHP_VERSION, '5.6', '<' ) ) { + } elseif ( $compare_php_version ) { return sprintf( // Translators: 1 is the required PHP version and 2 is the user's current version. - __( 'Prometheus 2 was not activated because it requires a minimum PHP version of %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade your PHP version and try again.', 'prometheus2' ), + __( 'Prometheus 2 was not activated because it requires PHP version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade PHP and try again.', 'prometheus2' ), '5.6', PHP_VERSION ); + } elseif ( $compare_genesis_version ) { + return sprintf( + // Translators: 1 is the required PHP version and 2 is the user's current version. + __( 'Prometheus 2 was not activated because it requires Genesis version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %2$s. Please upgrade Genesis and try again.', 'prometheus2' ), + '2.6', + $genesis_version + ); } return ''; } From 42a329a6f4dbcb54f4b677041dc597858c8a9cf1 Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Thu, 20 Sep 2018 16:17:37 -0400 Subject: [PATCH 5/7] Fixed CS. --- functions.php | 9 ++++++++- lib/minimum-requirements.php | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index b8377e2..e01c2b0 100644 --- a/functions.php +++ b/functions.php @@ -10,7 +10,14 @@ * @link https://www.christophherr.com/ */ -function get_genesis_version() { +/** + * Get the version of the Genesis framework. + * + * @since 2.0 + * + * @return string + */ +function prometheus_2_get_genesis_version() { return wp_get_theme( 'genesis' )->get( 'Version' ); } diff --git a/lib/minimum-requirements.php b/lib/minimum-requirements.php index 36782d5..f9bd6b4 100644 --- a/lib/minimum-requirements.php +++ b/lib/minimum-requirements.php @@ -68,9 +68,9 @@ function prometheus_2_show_deactivation_and_upgrade_notice() { * @return string */ function prometheus_2_upgrade_message() { - $genesis_version = get_genesis_version(); - $compare_wp_version = version_compare( $GLOBALS['wp_version'], '4.8', '<' ); - $compare_php_version = version_compare( PHP_VERSION, '5.6', '<' ); + $genesis_version = prometheus_2_get_genesis_version(); + $compare_wp_version = version_compare( $GLOBALS['wp_version'], '4.8', '<' ); + $compare_php_version = version_compare( PHP_VERSION, '5.6', '<' ); $compare_genesis_version = version_compare( $genesis_version, '2.6', '<' ); if ( $compare_wp_version && $compare_php_version && $compare_genesis_version ) { From 4b5c5c95b85ff693b4a8c97c35043fd8eacb577e Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Sat, 29 Sep 2018 07:48:13 -0400 Subject: [PATCH 6/7] Fixed function name --- functions.php | 2 +- package.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index e01c2b0..96d0998 100644 --- a/functions.php +++ b/functions.php @@ -22,7 +22,7 @@ function prometheus_2_get_genesis_version() { } // Check minimum requirements. -if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) || version_compare( PHP_VERSION, '5.6', '<' ) || version_compare( get_genesis_version(), '2.6', '<' ) ) { +if ( version_compare( $GLOBALS['wp_version'], '4.8', '<' ) || version_compare( PHP_VERSION, '5.6', '<' ) || version_compare( prometheus_2_get_genesis_version(), '2.6', '<' ) ) { require_once 'lib/minimum-requirements.php'; return; } diff --git a/package.json b/package.json index 29bf42c..5f95061 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "bump": "node ./node_modules/gulp/bin/gulp.js bump", "watchFiles": "node ./node_modules/gulp/bin/gulp.js watchFiles", "serve": "node ./node_modules/gulp/bin/gulp.js serve", - "translation": "node ./node_modules/gulp/bin/gulp.js translation", - "wc": "node ./node_modules/gulp/bin/gulp.js wc" + "translation": "node ./node_modules/gulp/bin/gulp.js translation", + "wc": "node ./node_modules/gulp/bin/gulp.js wc" }, "repository": { "type": "git", @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/christophherr/prometheus#readme", "devDependencies": { - "ajv": "^6.5.0", + "ajv": "^6.5.4", "autoprefixer": "^9.0.0", "babel-core": "^6.26.0", "babel-preset-env": "^1.7.0", @@ -67,8 +67,8 @@ "prettier-eslint": "^8.2.1", "prettier-stylelint": "^0.4.2", "pump": "^3.0.0", - "sort-css-media-queries": "^1.3.4", - "stylelint": "^9.2.1", + "sort-css-media-queries": "^1.4.1", + "stylelint": "^9.6.0", "stylelint-config-wordpress": "^13.0.0", "stylelint-order": "^0.8.1" }, From 4d6248134331e0736b8869c0328e33087d1da155 Mon Sep 17 00:00:00 2001 From: Christoph Herr Date: Thu, 18 Oct 2018 00:24:54 -0400 Subject: [PATCH 7/7] Updated translator comments and .pot file --- languages/prometheus-2.pot | 14 +++++++------- lib/minimum-requirements.php | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/languages/prometheus-2.pot b/languages/prometheus-2.pot index 11ac014..11a3015 100644 --- a/languages/prometheus-2.pot +++ b/languages/prometheus-2.pot @@ -55,37 +55,37 @@ msgstr "" msgid "The maximum width of the logo in pixels." msgstr "" -#. translators: 1 is the required WordPress version and 2 is the user's current version. +#. translators: 1 is the required Genesis Version, 2 is the required WordPress version, 3 is the required PHP version, 4 is the user's current Genesis version, 5 is the user's current WordPress version and 6 is the user's current PHP version. #: lib/minimum-requirements.php:79 msgid "Prometheus 2 cannot be activated because it requires Genesis version %1$s, WordPress version %2$s and PHP version %3$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %4$s, WordPress version %5$s and PHP version %6$s. Please upgrade Genesis, WordPress and PHP and try again." msgstr "" -#. translators: 1 is the required WordPress version and 2 is the user's current version. +#. translators: 1 is the required WordPress version, 2 is the required PHP version, 3 is the user's current WordPress version amd 4 is the user's current PHP version. #: lib/minimum-requirements.php:90 msgid "Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again." msgstr "" -#. translators: 1 is the required WordPress version and 2 is the user's current version. +#. translators: 1 is the required Genesis version, 2 is the required WordPress version, 3 is the user's current Genesis version and 4 is the user's current WordPress version. #: lib/minimum-requirements.php:99 msgid "Prometheus 2 was not activated because it requires Genesis version %1$s and WordPress version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and WordPress version %4$s. Please upgrade Genesis and WordPress and try again." msgstr "" -#. translators: 1 is the required PHP version and 2 is the user's current version. +#. translators: 1 is the required Genesis version, 2 is the required PHP version, 3 is the user's current Genesis version and 4 is the user's current PHP version. #: lib/minimum-requirements.php:108 msgid "Prometheus 2 was not activated because it requires Genesis version %1$s and PHP version of %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and PHP version %4$s. Please upgrade Genesis and PHP and try again." msgstr "" -#. translators: 1 is the required WordPress version and 2 is the user's current version. +#. translators: 1 is the required WordPress version and 2 is the user's current WordPress version. #: lib/minimum-requirements.php:117 msgid "Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again." msgstr "" -#. translators: 1 is the required PHP version and 2 is the user's current version. +#. translators: 1 is the required PHP version and 2 is the user's current PHP version. #: lib/minimum-requirements.php:124 msgid "Prometheus 2 was not activated because it requires PHP version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade PHP and try again." msgstr "" -#. translators: 1 is the required PHP version and 2 is the user's current version. +#. translators: 1 is the required Genesis version and 2 is the user's current Genesis version. #: lib/minimum-requirements.php:131 msgid "Prometheus 2 was not activated because it requires Genesis version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %2$s. Please upgrade Genesis and try again." msgstr "" diff --git a/lib/minimum-requirements.php b/lib/minimum-requirements.php index f9bd6b4..8d79eaf 100644 --- a/lib/minimum-requirements.php +++ b/lib/minimum-requirements.php @@ -75,7 +75,7 @@ function prometheus_2_upgrade_message() { if ( $compare_wp_version && $compare_php_version && $compare_genesis_version ) { return sprintf( - // Translators: 1 is the required WordPress version and 2 is the user's current version. + // Translators: 1 is the required Genesis Version, 2 is the required WordPress version, 3 is the required PHP version, 4 is the user's current Genesis version, 5 is the user's current WordPress version and 6 is the user's current PHP version. __( 'Prometheus 2 cannot be activated because it requires Genesis version %1$s, WordPress version %2$s and PHP version %3$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %4$s, WordPress version %5$s and PHP version %6$s. Please upgrade Genesis, WordPress and PHP and try again.', 'prometheus2' ), '2.6', '4.9.6', @@ -86,7 +86,7 @@ function prometheus_2_upgrade_message() { ); } elseif ( $compare_wp_version && $compare_php_version ) { return sprintf( - // Translators: 1 is the required WordPress version and 2 is the user's current version. + // Translators: 1 is the required WordPress version, 2 is the required PHP version, 3 is the user's current WordPress version amd 4 is the user's current PHP version. __( 'Prometheus 2 cannot be activated because it requires WordPress version %1$s and PHP version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %3$s and PHP version %4$s. Please upgrade WordPress and PHP and try again.', 'prometheus2' ), '4.9.6', '5.6', @@ -95,7 +95,7 @@ function prometheus_2_upgrade_message() { ); } elseif ( $compare_genesis_version && $compare_wp_version ) { return sprintf( - // Translators: 1 is the required WordPress version and 2 is the user's current version. + // Translators: 1 is the required Genesis version, 2 is the required WordPress version, 3 is the user's current Genesis version and 4 is the user's current WordPress version. __( 'Prometheus 2 was not activated because it requires Genesis version %1$s and WordPress version %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and WordPress version %4$s. Please upgrade Genesis and WordPress and try again.', 'prometheus2' ), '2.6', '4.9.6', @@ -104,7 +104,7 @@ function prometheus_2_upgrade_message() { ); } elseif ( $compare_genesis_version && $compare_php_version ) { return sprintf( - // Translators: 1 is the required PHP version and 2 is the user's current version. + // Translators: 1 is the required Genesis version, 2 is the required PHP version, 3 is the user's current Genesis version and 4 is the user's current PHP version. __( 'Prometheus 2 was not activated because it requires Genesis version %1$s and PHP version of %2$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %3$s and PHP version %4$s. Please upgrade Genesis and PHP and try again.', 'prometheus2' ), '2.6', '5.6', @@ -113,21 +113,21 @@ function prometheus_2_upgrade_message() { ); } elseif ( $compare_wp_version ) { return sprintf( - // Translators: 1 is the required WordPress version and 2 is the user's current version. + // Translators: 1 is the required WordPress version and 2 is the user's current WordPress version. __( 'Prometheus 2 was not activated because it requires WordPress version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running WordPress version %2$s. Please upgrade WordPress and try again.', 'prometheus2' ), '4.9.6', $GLOBALS['wp_version'] ); } elseif ( $compare_php_version ) { return sprintf( - // Translators: 1 is the required PHP version and 2 is the user's current version. + // Translators: 1 is the required PHP version and 2 is the user's current PHP version. __( 'Prometheus 2 was not activated because it requires PHP version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running PHP version %2$s. Please upgrade PHP and try again.', 'prometheus2' ), '5.6', PHP_VERSION ); } elseif ( $compare_genesis_version ) { return sprintf( - // Translators: 1 is the required PHP version and 2 is the user's current version. + // Translators: 1 is the required Genesis version and 2 is the user's current Genesis version. __( 'Prometheus 2 was not activated because it requires Genesis version %1$s. The Genesis Framework (parent theme) has been activated instead. You are running Genesis version %2$s. Please upgrade Genesis and try again.', 'prometheus2' ), '2.6', $genesis_version