Skip to content

Commit

Permalink
Merge pull request #1512 from xwp/update/1499-php-7
Browse files Browse the repository at this point in the history
Require PHP ≥ 7.0 and WordPress ≥ 4.6
  • Loading branch information
tharsheblows authored Jul 19, 2024
2 parents e78e3d6 + b914d2c commit d37d19f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=5.6.20",
"php": ">=7.0",
"composer/installers": "~1.0",
"ext-json": "*"
},
Expand All @@ -23,7 +23,7 @@
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^9.6",
"roots/wordpress": "^6.5",
"roots/wordpress": "^6.6",
"wp-cli/wp-cli-bundle": "^2.6",
"wp-coding-standards/wpcs": "^3.1",
"wp-phpunit/wp-phpunit": "^6.6",
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<arg value="sp" /><!-- Show sniff codes in all reports and progress. -->

<rule ref="PHPCompatibilityWP" />
<config name="testVersion" value="5.6-" /><!-- Test for PHP compatibility for 5.6 and above. -->
<config name="testVersion" value="7.0-" /><!-- Test for PHP compatibility for 7.0 and above. -->

<rule ref="WordPress-Docs">
<type>warning</type><!-- FIXME Report but ignore for now. -->
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Stream ===
Contributors: xwp
Tags: wp stream, stream, activity, logs, track
Requires at least: 4.5
Tested up to: 6.4
Requires at least: 4.6
Tested up to: 6.6
Stable tag: 4.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
7 changes: 5 additions & 2 deletions stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
const WP_STREAM_MIN_PHP_VERSION = '7.0';

if ( version_compare( PHP_VERSION, WP_STREAM_MIN_PHP_VERSION, '<' ) ) {
add_action( 'shutdown', 'wp_stream_fail_php_version' );
} else {
require __DIR__ . '/classes/class-plugin.php';
Expand All @@ -49,7 +51,8 @@
function wp_stream_fail_php_version() {
load_plugin_textdomain( 'stream', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

$message = esc_html__( 'Stream requires PHP version 5.3+, plugin is currently NOT ACTIVE.', 'stream' );
/* translators: %s is the minimum PHP version. */
$message = sprintf( __( 'Stream requires PHP version %s or newer. Plugin is currently NOT ACTIVE.', 'stream' ), WP_STREAM_MIN_PHP_VERSION );
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );

echo wp_kses_post( $html_message );
Expand Down

0 comments on commit d37d19f

Please sign in to comment.