Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update plugin php min version to 7.4 #2035

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/faustwp/.phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.2-" />
<config name="testVersion" value="7.4-" />

<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP" />
Expand Down
3 changes: 2 additions & 1 deletion plugins/faustwp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
}
},
"require": {
"symfony/process": "^6.4.14"
"symfony/process": "^6.4.14",
"php": "^7.4 || ^8.0"
}
}
43 changes: 42 additions & 1 deletion plugins/faustwp/faustwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Text Domain: faustwp
* Domain Path: /languages
* Version: 1.6.0
* Requires PHP: 7.2
* Requires PHP: 7.4
* Requires at least: 5.7
* Update URI: false
*
Expand All @@ -29,6 +29,47 @@
define( 'FAUSTWP_PATH', plugin_basename( FAUSTWP_FILE ) );
define( 'FAUSTWP_SLUG', dirname( plugin_basename( FAUSTWP_FILE ) ) );


/**
* Get the minimum version of PHP required for this plugin.
*
* @return string Minimum version required.
*/
function faustwp_minimum_php_requirement() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to suggest to have only one place for specifying the min php version - in plugin's header. That will allow us to edit min php version only once, and move the functionality into a standalone class in future. We can use get_plugins or get_file_data or get_plugins_data... But I am not sure how relevant it is now, maybe a good thing to keep in mind for future

return '7.4';
}

/**
* Whether PHP installation meets the minimum requirements
*
* @return bool True if meets minimum requirements, false otherwise.
*/
function is_php_version_compatible() {
return version_compare( phpversion(), faustwp_minimum_php_requirement(), '>=' );
theodesp marked this conversation as resolved.
Show resolved Hide resolved
}

if ( ! is_php_version_compatible() ) {
add_action(
'admin_notices',
function () {
?>
<div class="notice notice-error">
<p>
<?php
printf(
/* translators: %s: Minimum required PHP version */
esc_html__( 'FaustWP requires PHP version %s or later. Please upgrade PHP or disable the plugin.', 'faustwp' ),
esc_html( is_php_version_compatible() )
);
?>
</p>
</div>
<?php
}
);
return;
}

require FAUSTWP_DIR . '/includes/updates/class-plugin-updater.php';
require FAUSTWP_DIR . '/includes/updates/check-for-updates.php';
require FAUSTWP_DIR . '/includes/auth/functions.php';
Expand Down
42 changes: 21 additions & 21 deletions plugins/faustwp/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: faustjs, faust, headless, decoupled, composable-architecture
Requires at least: 5.7
Tested up to: 6.6.1
Stable tag: 1.6.0
Requires PHP: 7.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -52,24 +52,24 @@ plugins/faustwp/.wordpress-org/screenshot-1.png
plugins/faustwp/.wordpress-org/screenshot-2.png
plugins/faustwp/.wordpress-org/screenshot-3.png

== Changelog ==

= 1.6.0 =

### Minor Changes

- 28f1f83: Added new filter `faustwp_public_redirect_status_code`, allowing WordPress plugins and themes to choose the [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) to use when generating redirects when the [enable public route redirects](https://faustjs.org/docs/faustwp/settings#enabling-public-route-redirects) setting is active.

= 1.5.0 =

### Minor Changes

- 011cd931: - Added a custom PluginUpdater class to enable FaustWP plugin updates from an external API endpoint.

= 1.4.1 =

### Patch Changes

- e80d80af: Tested up to WordPress v6.6.1

== Changelog ==
= 1.6.0 =
### Minor Changes
- 28f1f83: Added new filter `faustwp_public_redirect_status_code`, allowing WordPress plugins and themes to choose the [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) to use when generating redirects when the [enable public route redirects](https://faustjs.org/docs/faustwp/settings#enabling-public-route-redirects) setting is active.
= 1.5.0 =
### Minor Changes
- 011cd931: - Added a custom PluginUpdater class to enable FaustWP plugin updates from an external API endpoint.
= 1.4.1 =
### Patch Changes
- e80d80af: Tested up to WordPress v6.6.1
[View the full changelog](https://github.com/wpengine/faustjs/blob/canary/plugins/faustwp/CHANGELOG.md)
Loading