php_version = $php_version; $this->wp_version = $wp_version; } /** * Whether all requirements are met. */ public function met(): bool { return version_compare( $this->php_version, KEEPWATCH_MIN_PHP, '>=' ) && version_compare( $this->wp_version, KEEPWATCH_MIN_WP, '>=' ); } /** * Admin notice shown when requirements are not met. */ public function render_notice(): void { if ( ! current_user_can( 'activate_plugins' ) ) { return; } printf( '

%s

', esc_html( sprintf( /* translators: 1: required PHP version, 2: required WordPress version */ __( 'Keepwatch requires PHP %1$s and WordPress %2$s or newer.', 'keepwatch' ), KEEPWATCH_MIN_PHP, KEEPWATCH_MIN_WP ) ) ); } }