gateway = $gateway; } /** * Only execute the migration if not applied yet. */ public function maybe_migrate() { $previous_version = get_option( 'woocommerce_woocommerce_payments_version' ); if ( version_compare( self::VERSION_SINCE, $previous_version, '>' ) ) { $this->migrate(); } } /** * Does the actual migration as described in the class docblock. */ private function migrate() { $button_size = $this->gateway->get_option( 'payment_request_button_size' ); if ( 'default' === $button_size ) { $this->gateway->update_option( 'payment_request_button_size', 'small' ); } } }