Skip to content

Commit 639acb6

Browse files
committed
refactor: use build-in is_php_version_compatible
1 parent 5a29702 commit 639acb6

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

plugins/faustwp/faustwp.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,7 @@ function faustwp_minimum_php_requirement() {
3939
return '7.4';
4040
}
4141

42-
/**
43-
* Whether PHP installation meets the minimum requirements
44-
*
45-
* @return bool True if meets minimum requirements, false otherwise.
46-
*/
47-
function is_php_version_compatible() {
48-
return version_compare( phpversion(), faustwp_minimum_php_requirement(), '>=' );
49-
}
50-
51-
if ( ! is_php_version_compatible() ) {
42+
if ( ! is_php_version_compatible( faustwp_minimum_php_requirement() ) ) {
5243
add_action(
5344
'admin_notices',
5445
function () {
@@ -59,7 +50,7 @@ function () {
5950
printf(
6051
/* translators: %s: Minimum required PHP version */
6152
esc_html__( 'FaustWP requires PHP version %s or later. Please upgrade PHP or disable the plugin.', 'faustwp' ),
62-
esc_html( is_php_version_compatible() )
53+
esc_html( faustwp_minimum_php_requirement() )
6354
);
6455
?>
6556
</p>

0 commit comments

Comments
 (0)