Skip to content

Commit

Permalink
remove requirement check, rely on Requires PHP header
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Nov 4, 2024
1 parent 02ca931 commit 8181b80
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/Git_Updater/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public function deactivate_die() {
* @return void
*/
public function run() {
if ( ! $this->check_requirements() ) {
return;
}

register_deactivation_hook( $this->file, [ $this, 'remove_cron_events' ] );
require_once ABSPATH . 'wp-admin/includes/plugin.php';
deactivate_plugins( [ 'git-updater-pro/git-updater-pro.php', 'git-updater-additions/git-updater-additions.php' ] );
Expand All @@ -96,33 +92,6 @@ public function run() {
new \WP_Dismiss_Notice();
}

/**
* Check PHP requirements and deactivate plugin if not met.
*
* @return void|bool
*/
public function check_requirements() {
if ( version_compare( phpversion(), '7.2', '<=' ) ) {
add_action(
'admin_init',
function () {
echo '<div class="error notice is-dismissible"><p>';
printf(
/* translators: 1: minimum PHP version required */
wp_kses_post( __( 'Git Updater cannot run on PHP versions older than %1$s.', 'git-updater' ) ),
'7.2'
);
echo '</p></div>';
\deactivate_plugins( plugin_basename( $this->file ) );
}
);

return false;
}

return true;
}

/**
* Remove scheduled cron events on deactivation.
*
Expand Down

0 comments on commit 8181b80

Please sign in to comment.