=' ) && defined( 'WC_VERSION' ) && version_compare( WC_VERSION, self::MINIMUM_WC, '>=' ); } /** * Register an actionable admin notice when needed. * * @return void */ public function register_notice() { add_action( 'admin_notices', array( $this, 'render_notice' ) ); } /** * Render requirements notice. * * @return void */ public function render_notice() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $message = defined( 'WC_VERSION' ) ? sprintf( /* translators: 1: WooCommerce version, 2: PHP version. */ esc_html__( 'Devoynx Rewards requires WooCommerce %1$s or newer and PHP %2$s or newer.', 'devoynx-rewards' ), esc_html( self::MINIMUM_WC ), esc_html( self::MINIMUM_PHP ) ) : esc_html__( 'Devoynx Rewards requires WooCommerce to be installed and active.', 'devoynx-rewards' ); printf( '

%s

', $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. } }