diff --git a/payment/uc_credit/uc_credit.module b/payment/uc_credit/uc_credit.module
index 63f784c..310f7cb 100644
--- a/payment/uc_credit/uc_credit.module
+++ b/payment/uc_credit/uc_credit.module
@@ -165,7 +165,7 @@ function uc_credit_uc_store_status() {
     $statuses[] = array(
       'status' => 'error',
       'title' => t('Credit card encryption'),
-      'desc' => t('You must review your <a href="@url">credit card security settings</a> and enable encryption before you can accept credit card payments.', ['@url' => \Drupal::url('uc_payment.method_settings', ['method' => 'credit'])]),
+      'desc' => t('You must review your <a href="@url">credit card security settings</a> and enable encryption before you can accept credit card payments.', ['@url' => Url::fromRoute('uc_payment.method_settings', ['method' => 'credit'])]),
     );
   }
 
diff --git a/payment/uc_cybersource/uc_cybersource.module b/payment/uc_cybersource/uc_cybersource.module
index 9f418e3..06af8d9 100644
--- a/payment/uc_cybersource/uc_cybersource.module
+++ b/payment/uc_cybersource/uc_cybersource.module
@@ -5,6 +5,7 @@
  * CyberSource's Silent Order POST and Hosted Order Page methods of payment.
  */
 
+use Drupal\Core\Url;
 use Drupal\uc_order\Entity\Order;
 use Drupal\uc_store\Encryption;
 
@@ -119,7 +120,7 @@ function uc_cybersource_settings_form($form, &$form_state) {
   $form['uc_cybersource_method'] = array(
     '#type' => 'radios',
     '#title' => t('Payment method'),
-    '#description' => t('You must ensure your CyberSource account and web server are able to use the service you select.<br />Silent Order POST requires a modified <a href="!url">HOP.php</a>.<br />The SOAP Toolkit API requires the SOAP and DOM extensions for PHP.', ['!url' => \Drupal::url('http://www.ubercart.org/contrib/139', ['absolute' => TRUE])]),
+    '#description' => t('You must ensure your CyberSource account and web server are able to use the service you select.<br />Silent Order POST requires a modified <a href=":url">HOP.php</a>.<br />The SOAP Toolkit API requires the SOAP and DOM extensions for PHP.', [':url' => Url::fromRoute('http://www.ubercart.org/contrib/139', ['absolute' => TRUE])]),
     '#options' => array(
       'post' => t('Silent Order POST'),
       // 'api' => t('Simple Order API'),
@@ -346,9 +347,9 @@ function uc_cybersource_hop_form($form, $form_state, $order) {
   $data['orderPage_sendMerchantReceiptEmail'] = variable_get('uc_cybersource_hop_merchant_receipt_email', 'true');
   $data['orderPage_sendMerchantURLPost'] = 'true';
   // CyberSource posts payment confirmation to this URL.
-  $data['orderPage_merchantURLPostAddress']= \Drupal::url('cybersource/hop-post', ['absolute' => TRUE]);
+  $data['orderPage_merchantURLPostAddress']= Url::fromRoute('cybersource/hop-post', ['absolute' => TRUE]);
   $data['orderPage_buyButtonText'] = t('Checkout');
-  $receipt_url = \Drupal::url('cybersource/hop-complete/' . $order->id(), ['absolute' => TRUE]);
+  $receipt_url = Url::fromRoute('cybersource/hop-complete/' . $order->id(), ['absolute' => TRUE]);
   $data['orderPage_receiptResponseURL'] = $receipt_url;
   $data['orderPage_buyButtonText'] = variable_get('uc_cybersource_cs_hop_button_text', t('Process payment'));
   $comments = t('Order @order-id at @store-name', ['@order-id' => $order->id(), '@store-name' => uc_store_name()]);
@@ -738,7 +739,7 @@ function _uc_cybersource_soap_charge($order, $amount, $data, $cc_type) {
   catch (SoapFault $exception) {
     // Log and display errors if Ubercart is unable to connect via SOAP.
     \Drupal::logger('uc_cybersource')->error('Unable to connect to CyberSource via SOAP.');
-    drupal_set_message(t('We apologize for the delay, but we are unable to process your credit card at this time. Please <a href="@url">contact sales</a> to complete your order.', ['@url' => \Drupal::url('contact')]), 'error');
+    drupal_set_message(t('We apologize for the delay, but we are unable to process your credit card at this time. Please <a href="@url">contact sales</a> to complete your order.', ['@url' => Url::fromRoute('contact')]), 'error');
   }
 
   // Process a reply from CyberSource.
@@ -968,7 +969,7 @@ function uc_cybersource_uc_calculate_tax($order) {
   catch (SoapFault $exception) {
     // Log and display errors if Ubercart is unable to connect via SOAP.
     \Drupal::logger('uc_cybersource')->error('Unable to connect to CyberSource via SOAP.');
-    drupal_set_message(t('We apologize for the delay, but we are unable to process your credit card at this time. Please <a href="@url">contact sales</a> to complete your order.', ['@url' => \Drupal::url('contact')]), 'error');
+    drupal_set_message(t('We apologize for the delay, but we are unable to process your credit card at this time. Please <a href="@url">contact sales</a> to complete your order.', ['@url' => Url::fromRoute('contact')]), 'error');
   }
 
   // Process a reply from CyberSource.
diff --git a/payment/uc_payment/uc_payment.module b/payment/uc_payment/uc_payment.module
index c29c2d9..cc261d2 100644
--- a/payment/uc_payment/uc_payment.module
+++ b/payment/uc_payment/uc_payment.module
@@ -239,7 +239,7 @@ function uc_payment_process_payment($method, $order_id, $amount, $data = NULL, $
 
   // Head back to the order if a redirect was specified.
   if ($redirect) {
-    return new RedirectResponse(\Drupal::url('uc_order.admin_view', ['uc_order' => $order_id]));
+    return new RedirectResponse(Url::fromRoute('uc_order.admin_view', ['uc_order' => $order_id]));
   }
 
   return $result['success'];
diff --git a/payment/uc_paypal/uc_paypal.module b/payment/uc_paypal/uc_paypal.module
index 78d5f2a..5c34859 100644
--- a/payment/uc_paypal/uc_paypal.module
+++ b/payment/uc_paypal/uc_paypal.module
@@ -94,7 +94,7 @@ function uc_paypal_form_uc_cart_checkout_review_form_alter(&$form, &$form_state,
  */
 function uc_paypal_uc_payment_gateway() {
   if (!\Drupal::moduleHandler()->moduleExists('uc_credit')) {
-    drupal_set_message(t('You must <a href="@modules">enable the Credit Card module</a> to use PayPal Website Payments Pro.', ['@modules' => \Drupal::url('system.modules_list', [], ['fragment' => 'edit-modules-ubercart-payment'])]), 'warning');
+    drupal_set_message(t('You must <a href="@modules">enable the Credit Card module</a> to use PayPal Website Payments Pro.', ['@modules' => Url::fromRoute('system.modules_list', [], ['fragment' => 'edit-modules-ubercart-payment'])]), 'warning');
     return;
   }
 
@@ -252,7 +252,7 @@ function uc_paypal_wpp_charge($order_id, $amount, $data) {
       'DESC' => substr($desc, 0, 127),
       'INVNUM' => $order_id . '-' . REQUEST_TIME,
       'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
-      'NOTIFYURL' => \Drupal::url(new Url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE])),
+      'NOTIFYURL' => Url::fromRoute(new Url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE])),
       'EMAIL' => substr($order->getEmail(), 0, 127),
       'PHONENUM' => substr($order->billing_phone, 0, 20),
     );
@@ -431,7 +431,7 @@ function uc_payment_method_paypal_wps($op, &$order) {
         '#description' => t('Specify the path customers who cancel their PayPal WPS payment will be directed to when they return to your site.'),
         '#default_value' => variable_get('uc_paypal_wps_cancel_return_url', 'cart'),
         '#size' => 32,
-        '#field_prefix' => \Drupal::url('<front>', [], ['absolute' => TRUE]),
+        '#field_prefix' => Url::fromRoute('<front>', [], ['absolute' => TRUE]),
       );
       $form['uc_paypal_wps_submit_method'] = array(
         '#type' => 'radios',
@@ -612,8 +612,8 @@ function uc_paypal_ec_checkout($form, FormStateInterface $form_state) {
 
   $nvp_request = array(
     'METHOD' => 'SetExpressCheckout',
-    'RETURNURL' => \Drupal::url('cart/echeckout/selected', [], ['absolute' => TRUE]),
-    'CANCELURL' => \Drupal::url('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
+    'RETURNURL' => Url::fromRoute('cart/echeckout/selected', [], ['absolute' => TRUE]),
+    'CANCELURL' => Url::fromRoute('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
     'AMT' => uc_currency_format($order->getTotal(), FALSE, FALSE, '.'),
     'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_pg_paypal_wpp_cc_txn_type', 'auth_capture') == 'authorize' ? 'Authorization' : 'Sale',
@@ -622,7 +622,7 @@ function uc_paypal_ec_checkout($form, FormStateInterface $form_state) {
     'REQCONFIRMSHIPPING' => variable_get('uc_paypal_ec_rqconfirmed_addr', 0),
     'ADDROVERRIDE' => 1,
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
-    'NOTIFYURL' => \Drupal::url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
+    'NOTIFYURL' => Url::fromRoute('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
     'SHIPTONAME' => substr($order->delivery_first_name . ' ' . $order->delivery_last_name, 0, 32),
     'SHIPTOSTREET' => substr($order->delivery_street1, 0, 100),
     'SHIPTOSTREET2' => substr($order->delivery_street2, 0, 100),
@@ -694,8 +694,8 @@ function uc_paypal_ec_form_submit($form, &$form_state) {
 
   $nvp_request = array(
     'METHOD' => 'SetExpressCheckout',
-    'RETURNURL' => \Drupal::url('cart/echeckout/review', [], ['absolute' => TRUE]),
-    'CANCELURL' => \Drupal::url('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
+    'RETURNURL' => Url::fromRoute('cart/echeckout/review', [], ['absolute' => TRUE]),
+    'CANCELURL' => Url::fromRoute('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
     'AMT' => uc_currency_format($subtotal, FALSE, FALSE, '.'),
     'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_pg_paypal_wpp_cc_txn_type', 'auth_capture') == 'authorize' ? 'Authorization' : 'Sale',
@@ -703,7 +703,7 @@ function uc_paypal_ec_form_submit($form, &$form_state) {
     'INVNUM' => $order->id() . '-' . REQUEST_TIME,
     'REQCONFIRMSHIPPING' => variable_get('uc_paypal_ec_rqconfirmed_addr', 0),
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
-    'NOTIFYURL' => \Drupal::url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
+    'NOTIFYURL' => Url::fromRoute('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
     'LANDINGPAGE' => variable_get('uc_paypal_ec_landingpage_style', 'Billing'),
   );
 
@@ -766,7 +766,7 @@ function uc_paypal_ec_submit_form_submit($form, &$form_state) {
     'DESC' => substr($desc, 0, 127),
     'INVNUM' => $order->id() . '-' . REQUEST_TIME,
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
-    'NOTIFYURL' => \Drupal::url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
+    'NOTIFYURL' => Url::fromRoute('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
     'ITEMAMT' => uc_currency_format($subtotal, FALSE, FALSE, '.'),
     'SHIPPINGAMT' => uc_currency_format($shipping, FALSE, FALSE, '.'),
     'TAXAMT' => uc_currency_format($tax, FALSE, FALSE, '.'),
@@ -836,13 +836,13 @@ function uc_paypal_wps_form($form, &$form_state, $order) {
     'charset' => 'utf-8',
 
     // IPN control notify URL.
-    'notify_url' => \Drupal::url('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
+    'notify_url' => Url::fromRoute('uc_paypal/ipn/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
 
     // Display information.
-    'cancel_return' => \Drupal::url('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
+    'cancel_return' => Url::fromRoute('uc_paypal/wps/cancel', [], ['absolute' => TRUE]),
     'no_note' => 1,
     'no_shipping' => variable_get('uc_paypal_wps_no_shipping', 1),
-    'return' => \Drupal::url('uc_paypal/wps/complete/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
+    'return' => Url::fromRoute('uc_paypal/wps/complete/', ['uc_order' => $order->id()], ['absolute' => TRUE]),
     'rm' => 1,
 
     // Transaction information.
diff --git a/shipping/uc_quote/uc_quote.module b/shipping/uc_quote/uc_quote.module
index 0cb0177..83474d3 100644
--- a/shipping/uc_quote/uc_quote.module
+++ b/shipping/uc_quote/uc_quote.module
@@ -14,6 +14,7 @@ use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
 use Drupal\uc_order\OrderInterface;
 
 /**
@@ -177,7 +178,7 @@ function uc_quote_form_node_form_alter(&$form, FormStateInterface $form_state) {
     $form['shipping']['shipping_address'] = array(
       '#type' => 'details',
       '#title' => t('Default product pickup address'),
-      '#description' => t('When delivering products to customers, the original location of the product must be known in order to accurately quote the shipping cost and set up a delivery. If this pickup address is left blank, this product will default to the <a href=":url">store pickup address</a>.', [':url' => \Drupal::url('uc_quote.settings')]),
+      '#description' => t('When delivering products to customers, the original location of the product must be known in order to accurately quote the shipping cost and set up a delivery. If this pickup address is left blank, this product will default to the <a href=":url">store pickup address</a>.', [':url' => Url::fromRoute('uc_quote.settings')]),
       '#weight' => -6,
     );
     $form['shipping']['shipping_address']['#tree'] = TRUE;
diff --git a/shipping/uc_ups/uc_ups.module b/shipping/uc_ups/uc_ups.module
index 5ad9695..f550f29 100644
--- a/shipping/uc_ups/uc_ups.module
+++ b/shipping/uc_ups/uc_ups.module
@@ -304,7 +304,7 @@ function uc_ups_uc_store_status() {
     $messages[] = array(
       'status' => 'error',
       'title' => t('UPS Online Tools'),
-      'desc' => t('More information is needed to access UPS Online Tools. Please enter it <a href="@url">here</a>.', ['@url' => \Drupal::url('uc_ups.settings')]),
+      'desc' => t('More information is needed to access UPS Online Tools. Please enter it <a href="@url">here</a>.', ['@url' => Url::fromRoute('uc_ups.settings')]),
     );
   }
 
diff --git a/uc_attribute/uc_attribute.module b/uc_attribute/uc_attribute.module
index b213cf5..d35a790 100644
--- a/uc_attribute/uc_attribute.module
+++ b/uc_attribute/uc_attribute.module
@@ -21,6 +21,7 @@ use Drupal\Core\Database\Query\Merge;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 use Drupal\node\NodeInterface;
 use Drupal\node\NodeTypeInterface;
 use Drupal\uc_cart\Entity\CartItem;
@@ -32,9 +33,9 @@ function uc_attribute_help($route_name, RouteMatchInterface $route_match) {
   switch ($route_name) {
     // Help messages for the attributes overview on products and classes.
     case 'uc_attribute.product_attributes':
-      return '<p>' . t('Add attributes to this product using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [':url' => \Drupal::url('uc_attribute.product_attributes_add', ['node' => $route_match->getRawParameter('node')])]) . '</p>';
+      return '<p>' . t('Add attributes to this product using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [':url' => Url::fromRoute('uc_attribute.product_attributes_add', ['node' => $route_match->getRawParameter('node')])]) . '</p>';
     case 'uc_attribute.product_class_attributes':
-      return '<p>' . t('Add attributes to the product class using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [':url' => \Drupal::url('uc_attribute.product_class_attributes_add', ['node_type' => $route_match->getRawParameter('node_type')])]) . '</p>';
+      return '<p>' . t('Add attributes to the product class using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [':url' => Url::fromRoute('uc_attribute.product_class_attributes_add', ['node_type' => $route_match->getRawParameter('node_type')])]) . '</p>';
 
     // Help message for adding an attribute to a product or class.
     case 'uc_attribute.product_attributes_add':
diff --git a/uc_cart/src/Plugin/Ubercart/CheckoutPane/CustomerInfoPane.php b/uc_cart/src/Plugin/Ubercart/CheckoutPane/CustomerInfoPane.php
index 592153f..d7348af 100644
--- a/uc_cart/src/Plugin/Ubercart/CheckoutPane/CustomerInfoPane.php
+++ b/uc_cart/src/Plugin/Ubercart/CheckoutPane/CustomerInfoPane.php
@@ -9,6 +9,7 @@ namespace Drupal\uc_cart\Plugin\Ubercart\CheckoutPane;
 
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
 use Drupal\uc_cart\CheckoutPanePluginBase;
 use Drupal\uc_order\OrderInterface;
 
@@ -35,12 +36,12 @@ class CustomerInfoPane extends CheckoutPanePluginBase {
       $contents['#description'] = t('Order information will be sent to your account e-mail listed below.');
       $contents['primary_email'] = array('#type' => 'hidden', '#value' => $email);
       $contents['email_text'] = array(
-        '#markup' => '<div>' . t('<b>E-mail address:</b> @email (<a href=":url">edit</a>)', ['@email' => $email, ':url' => \Drupal::url('entity.user.edit_form', ['user' => $user->id()], ['query' => drupal_get_destination()])]) . '</div>',
+        '#markup' => '<div>' . t('<b>E-mail address:</b> @email (<a href=":url">edit</a>)', ['@email' => $email, ':url' => Url::fromRoute('entity.user.edit_form', ['user' => $user->id()], ['query' => drupal_get_destination()])]) . '</div>',
       );
     }
     else {
       $email = $order->getEmail();
-      $contents['#description'] = t('Enter a valid email address for this order or <a href=":url">click here</a> to login with an existing account and return to checkout.', [':url' => \Drupal::url('user.login', [], ['query' => drupal_get_destination()])]);
+      $contents['#description'] = t('Enter a valid email address for this order or <a href=":url">click here</a> to login with an existing account and return to checkout.', [':url' => Url::fromRoute('user.login', [], ['query' => drupal_get_destination()])]);
       $contents['primary_email'] = array(
         '#type' => 'email',
         '#title' => t('E-mail address'),
diff --git a/uc_cart/src/Tests/CartSettingsTest.php b/uc_cart/src/Tests/CartSettingsTest.php
index a904e34..cc2ff7f 100644
--- a/uc_cart/src/Tests/CartSettingsTest.php
+++ b/uc_cart/src/Tests/CartSettingsTest.php
@@ -73,7 +73,7 @@ class CartSettingsTest extends UbercartTestBase {
     );
 
     $this->drupalPostForm('node/' . $this->product->id(), [], t('Add to cart'), ['query' => ['test' => 'querystring']]);
-    $url = \Drupal::url('entity.node.canonical', ['node' => $this->product->id()], ['absolute' => TRUE, 'query' => ['test' => 'querystring']]);
+    $url = Url::fromRoute('entity.node.canonical', ['node' => $this->product->id()], ['absolute' => TRUE, 'query' => ['test' => 'querystring']]);
     $this->assertTrue($this->getUrl() == $url, 'Add to cart no-redirect preserves the query string.');
   }
 
@@ -138,7 +138,7 @@ class CartSettingsTest extends UbercartTestBase {
       0,
       'Continue shopping link appears on the page.'
     );
-    $links = $this->xpath('//a[@href="' . \Drupal::url('entity.node.canonical', ['node' => $this->product->id()]) . '"]');
+    $links = $this->xpath('//a[@href="' . Url::fromRoute('entity.node.canonical', ['node' => $this->product->id()]) . '"]');
     $this->assertTrue(
       isset($links[0]),
       'Continue shopping link returns to the product page.'
diff --git a/uc_cart/uc_cart.install b/uc_cart/uc_cart.install
index 8aab22c..37eaefc 100644
--- a/uc_cart/uc_cart.install
+++ b/uc_cart/uc_cart.install
@@ -23,7 +23,7 @@ function uc_cart_uninstall() {
       array(
         '%status' => $status_names[0],
         '%statuses' => implode(', ', $status_names),
-        '@url' => \Drupal::url('uc_order.workflow'),
+        '@url' => \Drupal\Core\Url::fromRoute('uc_order.workflow'),
       )
     ), 'warning');
   }
@@ -40,7 +40,7 @@ function uc_cart_uninstall() {
       array(
         '%style' => $style_names[0],
         '%styles' => implode(', ', $style_names),
-        '@url' => \Drupal::url('entity.image_style.collection'),
+        '@url' => \Drupal\Core\Url::fromRoute('entity.image_style.collection'),
       )
     ), 'warning');
   }
diff --git a/uc_cart/uc_cart.module b/uc_cart/uc_cart.module
index e346195..85a7c06 100644
--- a/uc_cart/uc_cart.module
+++ b/uc_cart/uc_cart.module
@@ -12,6 +12,7 @@
 
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Render\Element;
+use Drupal\Core\Url;
 use Drupal\uc_cart\Controller\Cart;
 
 /**
@@ -108,7 +109,7 @@ function uc_cart_theme() {
  * Default template: uc-cart-block-title.html.twig.
  */
 function template_preprocess_uc_cart_block_title(&$variables) {
-  $variables['cart_url'] = \Drupal::url('uc_cart.cart');
+  $variables['cart_url'] = Url::fromRoute('uc_cart.cart');
 }
 
 /**
@@ -141,7 +142,7 @@ function template_preprocess_uc_cart_block(&$variables) {
  * Default template: uc-cart-complete-sale.html.twig.
  */
 function template_preprocess_uc_cart_complete_sale(&$variables) {
-  $variables['front_page'] = \Drupal::url('<front>');
+  $variables['front_page'] = Url::fromRoute('<front>');
 }
 
 /**
diff --git a/uc_cart_links/src/Controller/CartLinksHelp.php b/uc_cart_links/src/Controller/CartLinksHelp.php
index d6d8bb6..e98616d 100644
--- a/uc_cart_links/src/Controller/CartLinksHelp.php
+++ b/uc_cart_links/src/Controller/CartLinksHelp.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\uc_cart_links\Controller;
 
+use Drupal\Core\Url;
+
 /**
  * Provides instructions on how to create Cart Links.
  *
@@ -52,7 +54,7 @@ class CartLinksHelp {
     $rows = array(
       array('p', t('Adds a product to the cart.'), t('A product node number, followed by optional arguments described in the table below.')),
       array('i', t('Sets the ID of the cart link.'), t('An alphanumeric string (32 characters max) to identify the link.')),
-      array('m', t('Displays a message to the customer when the link is clicked.'), t('A <a href="@url">numeric message ID</a> to identify which message to display.', ['@url' => \Drupal::url('uc_cart_links.settings')])),
+      array('m', t('Displays a message to the customer when the link is clicked.'), t('A <a href="@url">numeric message ID</a> to identify which message to display.', ['@url' => Url::fromRoute('uc_cart_links.settings')])),
       array('e', t('Empties the cart. If used, this should be the first action.'), t('None.')),
     );
 
@@ -74,7 +76,7 @@ class CartLinksHelp {
       array('q', t('Specifies quantity of this product to add.'), t('A positive integer.')),
       array('a<aid>o<oid>', t('Specifies attribute/option for this product.'), t('aid is the integer attribute ID. oid is the integer option ID for radio, checkbox, and select options, or a url-escaped text string for textfield options.')),
       array('s', t('Silent.  Suppresses add-to-cart message for this product.
-      (The add-to-cart message may be enabled on the <a href="@url">cart settings page</a>).', ['@url' => \Drupal::url('uc_cart.cart_settings')]), t('None.')),
+      (The add-to-cart message may be enabled on the <a href="@url">cart settings page</a>).', ['@url' => Url::fromRoute('uc_cart.cart_settings')]), t('None.')),
     );
     $build['args'] = array(
       '#prefix' => t('Optional arguments for "p" allow you to control the quantity, set product attributes and options, and suppress the default product action message normally shown when a product is added to a cart. These optional arguments are appended to the "p" action and separated with an underscore.  Allowed arguments for "p" are:'),
@@ -124,7 +126,7 @@ class CartLinksHelp {
 
     $build['help'] = array(
       '#prefix' => '<p>',
-      '#markup' => t('<a href=":url">Visit the settings page</a> to set preferences, define messages, and restrict links that may be used.', [':url' => \Drupal::url('uc_cart_links.settings')]),
+      '#markup' => t('<a href=":url">Visit the settings page</a> to set preferences, define messages, and restrict links that may be used.', [':url' => Url::fromRoute('uc_cart_links.settings')]),
       '#suffix' => '</p>',
     );
 
diff --git a/uc_cart_links/uc_cart_links.module b/uc_cart_links/uc_cart_links.module
index b55b037..2f2c637 100644
--- a/uc_cart_links/uc_cart_links.module
+++ b/uc_cart_links/uc_cart_links.module
@@ -7,6 +7,7 @@
  */
 
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 
 /**
  * Implements hook_help().
@@ -14,7 +15,7 @@ use Drupal\Core\Routing\RouteMatchInterface;
 function uc_cart_links_help($route_name, RouteMatchInterface $route_match) {
   switch ($route_name) {
     case 'uc_cart_links.settings':
-      return '<p>' . t('<a href=":url">View the help page</a> to learn how to create Cart Links.', [':url' => \Drupal::url('help.page', ['name' => 'uc_cart_links'])]) . '</p>';
+      return '<p>' . t('<a href=":url">View the help page</a> to learn how to create Cart Links.', [':url' => Url::fromRoute('help.page', ['name' => 'uc_cart_links'])]) . '</p>';
 
     case 'help.page.uc_cart_links':
       $build = \Drupal\uc_cart_links\Controller\CartLinksHelp::creationHelp();
diff --git a/uc_catalog/uc_catalog.install b/uc_catalog/uc_catalog.install
index a301e7d..f0bcef3 100644
--- a/uc_catalog/uc_catalog.install
+++ b/uc_catalog/uc_catalog.install
@@ -21,7 +21,7 @@ function uc_catalog_install() {
 function uc_catalog_uninstall() {
   if ($vid = \Drupal::config('uc_catalog.settings')->get('vocabulary')) {
     $vocab = \Drupal\taxonomy\Entity\Vocabulary::load($vid);
-    drupal_set_message(t('The Ubercart %catalog vocabulary has not been deleted. If you need to delete it, <a href="@url">please do so manually</a>.', ['%catalog' => $vocab->label(), '@url' => \Drupal::url('entity.taxonomy_vocabulary.edit_form', ['taxonomy_vocabulary' => $vocab->id()])]), 'warning');
+    drupal_set_message(t('The Ubercart %catalog vocabulary has not been deleted. If you need to delete it, <a href="@url">please do so manually</a>.', ['%catalog' => $vocab->label(), '@url' => \Drupal\Core\Url::fromRoute('entity.taxonomy_vocabulary.edit_form', ['taxonomy_vocabulary' => $vocab->id()])]), 'warning');
   }
 
   $styles = \Drupal\image\Entity\ImageStyle::loadMultiple(['uc_category', 'uc_product_list']);
@@ -36,7 +36,7 @@ function uc_catalog_uninstall() {
       array(
         '%style' => $style_names[0],
         '%styles' => implode(', ', $style_names),
-        '@url' => \Drupal::url('entity.image_style.collection'),
+        '@url' => \Drupal\Core\Url::fromRoute('entity.image_style.collection'),
       )
     ), 'warning');
   }
diff --git a/uc_catalog/uc_catalog.module b/uc_catalog/uc_catalog.module
index 495ce5a..a8b086a 100644
--- a/uc_catalog/uc_catalog.module
+++ b/uc_catalog/uc_catalog.module
@@ -28,7 +28,7 @@ function uc_catalog_help($route_name, RouteMatchInterface $route_match) {
 
     case 'uc_catalog.settings':
       if (!\Drupal::moduleHandler()->moduleExists('views_ui')) {
-        return '<p>' . t('<a href="@modules">Enable the Views UI module</a> to edit the catalog display.', ['@modules' => \Drupal::url('system.modules_list', [], ['fragment' => 'edit-modules-views'])]) . '</p>';
+        return '<p>' . t('<a href="@modules">Enable the Views UI module</a> to edit the catalog display.', ['@modules' => Url::fromRoute('system.modules_list', [], ['fragment' => 'edit-modules-views'])]) . '</p>';
       }
       break;
   }
@@ -120,7 +120,7 @@ function uc_catalog_uc_store_status() {
     return array(array(
       'status' => 'error',
       'title' => t('Catalog field'),
-      'desc' => t('The catalog taxonomy reference field is missing. <a href="@url">Click here to create it</a>.', ['@url' => \Drupal::url('uc_catalog.repair')]),
+      'desc' => t('The catalog taxonomy reference field is missing. <a href="@url">Click here to create it</a>.', ['@url' => Url::fromRoute('uc_catalog.repair')]),
     ));
   }
 
@@ -161,7 +161,7 @@ function uc_catalog_uc_store_status() {
     $statuses[] = array(
       'status' => 'error',
       'title' => t('Catalog vocabulary'),
-      'desc' => t('No vocabulary has been recognized as the Ubercart catalog. Choose one on <a href="@admin_catalog">this page</a> or add one on the <a href="@admin_vocab">taxonomy admin page</a> first, if needed.', ['@admin_catalog' => \Drupal::url('uc_catalog.settings'), '@admin_vocab' => \Drupal::url('entity.taxonomy_vocabulary.collection')]),
+      'desc' => t('No vocabulary has been recognized as the Ubercart catalog. Choose one on <a href="@admin_catalog">this page</a> or add one on the <a href="@admin_vocab">taxonomy admin page</a> first, if needed.', ['@admin_catalog' => Url::fromRoute('uc_catalog.settings'), '@admin_vocab' => Url::fromRoute('entity.taxonomy_vocabulary.collection')]),
     );
   }
 
diff --git a/uc_file/src/Form/ShowForm.php b/uc_file/src/Form/ShowForm.php
index 2d65359..611007d 100644
--- a/uc_file/src/Form/ShowForm.php
+++ b/uc_file/src/Form/ShowForm.php
@@ -173,7 +173,7 @@ class ShowForm extends FormBase {
     $form = $variables['form'];
 
     // Render everything.
-    $output = '<p>' . $this->t('File downloads can be attached to any Ubercart product as a product feature. For security reasons the <a href="!download_url">file downloads directory</a> is separated from the Drupal <a href="!file_url">file system</a>. Below is the list of files (and their associated Ubercart products, if any) that can be used for file downloads.', array('!download_url' => \Drupal::url('uc_product.admin', [], ['query' => ['destination' => 'admin/store/products/files']]), '!file_url' => \Drupal::url('system.file_system_settings'))) . '</p>';
+    $output = '<p>' . $this->t('File downloads can be attached to any Ubercart product as a product feature. For security reasons the <a href="!download_url">file downloads directory</a> is separated from the Drupal <a href="!file_url">file system</a>. Below is the list of files (and their associated Ubercart products, if any) that can be used for file downloads.', array('!download_url' => Url::fromRoute('uc_product.admin', [], ['query' => ['destination' => 'admin/store/products/files']]), '!file_url' => Url::fromRoute('system.file_system_settings'))) . '</p>';
     $output .= drupal_render($form['uc_file_action']);
     $output .= drupal_render($form['file_select']);
     $output .= theme('pager');
diff --git a/uc_file/uc_file.admin.inc b/uc_file/uc_file.admin.inc
index 51075ea..f784087 100644
--- a/uc_file/uc_file.admin.inc
+++ b/uc_file/uc_file.admin.inc
@@ -8,6 +8,7 @@
 use Drupal\Component\Serialization\Json;
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
 
 /**
  * Form step values.
@@ -200,7 +201,7 @@ function theme_uc_file_admin_files_form_show(array $variables) {
   $form = $variables['form'];
 
   // Render everything.
-  $output = '<p>' . t('File downloads can be attached to any Ubercart product as a product feature. For security reasons the <a href="!download_url">file downloads directory</a> is separated from the Drupal <a href="!file_url">file system</a>. Below is the list of files (and their associated Ubercart products, if any) that can be used for file downloads.', array('!download_url' => \Drupal::url('uc_product.admin', [], ['query' => ['destination' => 'admin/store/products/files']]), '!file_url' => \Drupal::url('system.file_system_settings'))) . '</p>';
+  $output = '<p>' . t('File downloads can be attached to any Ubercart product as a product feature. For security reasons the <a href="!download_url">file downloads directory</a> is separated from the Drupal <a href="!file_url">file system</a>. Below is the list of files (and their associated Ubercart products, if any) that can be used for file downloads.', array('!download_url' => Url::fromRoute('uc_product.admin', [], ['query' => ['destination' => 'admin/store/products/files']]), '!file_url' => Url::fromRoute('system.file_system_settings'))) . '</p>';
   $output .= drupal_render($form['uc_file_action']);
   $output .= drupal_render($form['file_select']);
   $output .= theme('pager');
diff --git a/uc_file/uc_file.module b/uc_file/uc_file.module
index d5f9a60..8563fb3 100644
--- a/uc_file/uc_file.module
+++ b/uc_file/uc_file.module
@@ -121,7 +121,7 @@ function uc_file_user_form($form, FormStateInterface $form_state, $account) {
     $form['file']['file_message'] = array(
       '#markup' => '<p>' . t(
         'You must add files at the <a href=":url">Ubercart file download administration page</a> in order to attach them to a user.',
-        [':url' => \Drupal::url('uc_file.downloads', [], ['query' => ['destination' => 'user/' . $account->id() . '/edit']])]
+        [':url' => Url::fromRoute('uc_file.downloads', [], ['query' => ['destination' => 'user/' . $account->id() . '/edit']])]
       ) . '</p>',
     );
 
@@ -429,7 +429,7 @@ function uc_file_uc_add_to_cart($nid, $qty, $data) {
         // But still show the message if it does.
         drupal_set_message(t('You already have privileges to <a href=":url">download %file</a>. If you complete the purchase of this item, your new download limit will be %download_limit, your access location limit will be %address_limit, and your new expiration time will be %expiration.',
           array(
-            ':url' => $user->id() ? \Drupal::url('user/' . $user->id() . '/purchased-files') : \Drupal::url('user.login'),
+            ':url' => $user->id() ? Url::fromRoute('user/' . $user->id() . '/purchased-files') : Url::fromRoute('user.login'),
             '%file' => $product_feature->filename,
             '%download_limit' => $file_user['download_limit'] ? $file_user['download_limit'] : t('unlimited'),
             '%address_limit'  => $file_user['address_limit' ] ? $file_user['address_limit' ] : t('unlimited'),
@@ -440,7 +440,7 @@ function uc_file_uc_add_to_cart($nid, $qty, $data) {
         return array(array(
           'success' => FALSE,
           'message' => t('You already have privileges to <a href=":url">download %file</a>.', array(
-            ':url' => $user->id() ? \Drupal::url('user/' . $user->id() . '/purchased-files') : \Drupal::url('user.login'),
+            ':url' => $user->id() ? Url::fromRoute('user/' . $user->id() . '/purchased-files') : Url::fromRoute('user.login'),
             '%file' => $product_feature->filename,
           )),
         ));
@@ -496,7 +496,7 @@ function uc_file_uc_store_status() {
     $message[] = array(
       'status' => 'warning',
       'title' => t('File downloads'),
-      'desc' => t('The file downloads directory is not valid or set. Set a valid directory in the <a href="@url">product settings</a> under the file download settings tab.', array('@url' => \Drupal::url('uc_product.settings'))),
+      'desc' => t('The file downloads directory is not valid or set. Set a valid directory in the <a href="@url">product settings</a> under the file download settings tab.', array('@url' => Url::fromRoute('uc_product.settings'))),
     );
   }
   else {
diff --git a/uc_order/uc_order.module b/uc_order/uc_order.module
index b4146c8..0a14beb 100644
--- a/uc_order/uc_order.module
+++ b/uc_order/uc_order.module
@@ -115,7 +115,7 @@ function uc_order_page_attachments(&$page) {
       substr($route, 0, 15) == 'view.uc_orders.' ||
       substr($route, 0, 18) == 'view.uc_customers.') {
     $page['#attached']['library'][] = 'uc_order/uc_order.scripts';
-    $page['#attached']['drupalSettings']['ucURL']['adminOrders'] = \Drupal::url('uc_order.order_admin');
+    $page['#attached']['drupalSettings']['ucURL']['adminOrders'] = Url::fromRoute('uc_order.order_admin');
   }
 }
 
diff --git a/uc_product/uc_product.install b/uc_product/uc_product.install
index 5022409..8cfe65b 100644
--- a/uc_product/uc_product.install
+++ b/uc_product/uc_product.install
@@ -188,7 +188,7 @@ function uc_product_uninstall() {
       array(
         '%style' => $style_names[0],
         '%styles' => implode(', ', $style_names),
-        '@url' => \Drupal::url('entity.image_style.collection'),
+        '@url' => \Drupal\Core\Url::fromRoute('entity.image_style.collection'),
       )
     ), 'warning');
   }
diff --git a/uc_product/uc_product.module b/uc_product/uc_product.module
index 1b41ea1..06de66e 100644
--- a/uc_product/uc_product.module
+++ b/uc_product/uc_product.module
@@ -572,7 +572,7 @@ function uc_product_uc_store_status() {
   }
   else {
     $status = 'warning';
-    $description = t('<a href=":url">Click here</a> to automatically configure core image support.', [':url' => \Drupal::url('uc_product.image_defaults')])
+    $description = t('<a href=":url">Click here</a> to automatically configure core image support.', [':url' => Url::fromRoute('uc_product.image_defaults')])
       . ' ' . t('(This action is not required and should not be taken if you do not need images or have implemented your own image support.)');
   }
 
diff --git a/uc_product_kit/uc_product_kit.module b/uc_product_kit/uc_product_kit.module
index 83b63ce..3af5263 100644
--- a/uc_product_kit/uc_product_kit.module
+++ b/uc_product_kit/uc_product_kit.module
@@ -732,7 +732,7 @@ function uc_product_kit_add_to_cart_form_validate($form, FormStateInterface $for
 function uc_product_kit_add_to_cart_form_submit($form, FormStateInterface $form_state) {
   if (\Drupal::config('uc_cart.settings')->get('add_item_msg')) {
     $node = node_load($form_state->getValue('nid'));
-    drupal_set_message(t('<strong>!product-title</strong> added to <a href=":url">your shopping cart</a>.', ['!product-title' => $node->label(), ':url' => \Drupal::url('uc_cart.cart')]));
+    drupal_set_message(t('<strong>!product-title</strong> added to <a href=":url">your shopping cart</a>.', ['!product-title' => $node->label(), ':url' => Url::fromRoute('uc_cart.cart')]));
   }
   $cart = \Drupal\uc_cart\Controller\Cart::create(\Drupal::getContainer());
   $redirect = $cart->addItem($form_state->getValue('nid'), $form_state->getValue('qty'), $form_state->getValues());
diff --git a/uc_report/uc_report.module b/uc_report/uc_report.module
index d407a06..3c9a6b5 100644
--- a/uc_report/uc_report.module
+++ b/uc_report/uc_report.module
@@ -12,6 +12,7 @@
 
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 use Drupal\uc_order\Entity\OrderStatus;
 
 /**
@@ -58,7 +59,7 @@ function uc_report_help($path, RouteMatchInterface $route_match) {
         $output .= t("The following are total orders, products, sales, and average order totals for each store customer. Clicking on the header links will toggle a descending or ascending order for that column. Clicking on a customer's name will take you to a detailed list of orders that customer has made. Clicking on a customers username will take you to their account page.");
         break;
       case 'uc_report.products':
-        $output .= t('The table lists each product listed in the store, its amount sold, how many times it has been viewed, revenue it has produced, and gross profit it has generated. If you do not see the number of views you must enable the Statistics module on the <a href=":url">module administration page</a>.', [':url' => \Drupal::url('admin/modules')]);
+        $output .= t('The table lists each product listed in the store, its amount sold, how many times it has been viewed, revenue it has produced, and gross profit it has generated. If you do not see the number of views you must enable the Statistics module on the <a href=":url">module administration page</a>.', [':url' => Url::fromRoute('system.modules_list')]);
         break;
       case 'uc_report.sales':
         $output .= t('These are the sales for the last two days, average sales for the month, and the projected sales for the rest of the month. Further down the list you will see other sales statistics.');
diff --git a/uc_role/uc_role.module b/uc_role/uc_role.module
index b3fec5c..6a93047 100644
--- a/uc_role/uc_role.module
+++ b/uc_role/uc_role.module
@@ -13,6 +13,7 @@
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 use Drupal\user\Entity\User;
 
 /**
@@ -20,7 +21,7 @@ use Drupal\user\Entity\User;
  */
 function uc_role_help($path, RouteMatchInterface $route_match) {
   if ($path == '/node/%/edit/features/%/%' && $arg[4] == 'role') {
-    return '<p>' . t('Add roles through this page and then use the <a href=":url">Rules interface</a> to limit which orders they are applied to. Most important is the order status on which role granting will be triggered.', [':url' => \Drupal::url('admin/config/workflow/rules/reaction')]) . '</p>';
+    return '<p>' . t('Add roles through this page and then use the <a href=":url">Rules interface</a> to limit which orders they are applied to. Most important is the order status on which role granting will be triggered.', [':url' => Url::fromRoute('admin/config/workflow/rules/reaction')]) . '</p>';
   }
   switch ($path) {
     case 'uc_role.expiration':
@@ -384,7 +385,7 @@ function uc_role_uc_store_status() {
     $message[] = array(
       'status' => 'warning',
       'title' => t('Roles'),
-      'desc' => t('There are no product role(s) that can be assigned upon product purchase. Set product roles in the <a href=":url">product settings</a> under the role assignment settings tab.', [':url' => \Drupal::url('uc_product.settings')]),
+      'desc' => t('There are no product role(s) that can be assigned upon product purchase. Set product roles in the <a href=":url">product settings</a> under the role assignment settings tab.', [':url' => Url::fromRoute('uc_product.settings')]),
     );
   }
   else {
@@ -410,7 +411,7 @@ function uc_role_feature_settings($form, FormStateInterface $form_state) {
 
   if (!count($default_role_choices)) {
     $form['no_roles'] = array(
-      '#markup' => t('You need to <a href=":url">create new roles</a> before any can be added as product features.', [':url' => \Drupal::url('user.role_add', [], ['query' => ['destination' => 'admin/store/config/products']])]),
+      '#markup' => t('You need to <a href=":url">create new roles</a> before any can be added as product features.', [':url' => Url::fromRoute('user.role_add', [], ['query' => ['destination' => 'admin/store/config/products']])]),
       '#prefix' => '<p>',
       '#suffix' => '</p>',
     );
diff --git a/uc_store/src/Encryption.php b/uc_store/src/Encryption.php
index 12af16d..a575544 100644
--- a/uc_store/src/Encryption.php
+++ b/uc_store/src/Encryption.php
@@ -8,11 +8,15 @@
 namespace Drupal\uc_store;
 
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Url;
 use Drupal\uc_store\EncryptionInterface;
 
 /**
  * Handles encryption of credit-card information.
  *
+ * This class is provided for backwards-compatibility with Drupal 6 and
+ * Drupal 7 Ubercart sites.
+ *
  * Trimmed down version of GPL class by Tony Marston.  Details available at
  * http://www.tonymarston.co.uk/php-mysql/encryption.html
  *
@@ -180,7 +184,7 @@ class Encryption implements EncryptionInterface {
       if (!$alerted) {
         // Throw an error that makes sense so this stops getting reported.
         $this->errors[] = t('No encryption key was found.');
-        drupal_set_message(t('Ubercart cannot find a necessary encryption key. Refer to the store admin <a href="@url">dashboard</a> to isolate which one.', ['@url' => \Drupal::url('uc_store.admin')]), 'error');
+        drupal_set_message(t('Ubercart cannot find a necessary encryption key. Refer to the store admin <a href="@url">dashboard</a> to isolate which one.', ['@url' => Url::fromRoute('uc_store.admin')]), 'error');
 
         $alerted = TRUE;
       }
diff --git a/uc_store/uc_store.install b/uc_store/uc_store.install
index e724ad3..7def51a 100644
--- a/uc_store/uc_store.install
+++ b/uc_store/uc_store.install
@@ -67,6 +67,6 @@ function uc_store_install() {
 function uc_store_uninstall() {
   $format = \Drupal\Core\Datetime\Entity\DateFormat::load('uc_store');
   if ($format) {
-    drupal_set_message(t('The date format %format has not been deleted. If you need to delete it, <a href="@url">please do so manually</a>.', ['%format' => $format->label(), '@url' => \Drupal::url('entity.date_format.collection')]), 'warning');
+    drupal_set_message(t('The date format %format has not been deleted. If you need to delete it, <a href="@url">please do so manually</a>.', ['%format' => $format->label(), '@url' => \Drupal\Core\Url::fromRoute('entity.date_format.collection')]), 'warning');
   }
 }
diff --git a/uc_store/uc_store.module b/uc_store/uc_store.module
index 4286fa2..c255d5d 100644
--- a/uc_store/uc_store.module
+++ b/uc_store/uc_store.module
@@ -152,7 +152,7 @@ function uc_store_help($route_name, RouteMatchInterface $route_match) {
     case 'uc_store.reports':
       $output = '<p>' . t('Various reports generated by Ubercart modules can be found here. Click the links below to view the reports.') . '</p>';
       if (!\Drupal::moduleHandler()->moduleExists('uc_report')) {
-        $output .= '<p>' . t('To view core Ubercart statistics enable the <strong>Reports</strong> module on the <a href=":url">module administration page</a>.', [':url' => \Drupal::url('system.modules_list', [], ['fragment' => 'edit-modules-ubercart-core-optional'])]) . '</p>';
+        $output .= '<p>' . t('To view core Ubercart statistics enable the <strong>Reports</strong> module on the <a href=":url">module administration page</a>.', [':url' => Url::fromRoute('system.modules_list', [], ['fragment' => 'edit-modules-ubercart-core-optional'])]) . '</p>';
       }
       return $output;
   }
@@ -777,14 +777,14 @@ function uc_store_uc_store_status() {
     $messages[] = [
       'status' => 'error',
       'title'  => t('Countries'),
-      'desc'   => t('No countries are enabled. You may enable countries on the <a href="@url">country settings</a> page.', ['@url' => \Drupal::url('entity.uc_country.collection')]),
+      'desc'   => t('No countries are enabled. You may enable countries on the <a href="@url">country settings</a> page.', ['@url' => Url::fromRoute('entity.uc_country.collection')]),
     ];
   }
   elseif (count($updates)) { // This will always == FALSE
     $messages[] = array(
       'status' => 'warning',
       'title'  => t('Countries'),
-      'desc'   => t('Updates are available for the following installed countries: %countries. You may update these countries on the <a href="@url">country settings</a> page.', ['%countries' => implode(', ', $updates), '@url' => \Drupal::url('entity.uc_country.collection')]),
+      'desc'   => t('Updates are available for the following installed countries: %countries. You may update these countries on the <a href="@url">country settings</a> page.', ['%countries' => implode(', ', $updates), '@url' => Url::fromRoute('entity.uc_country.collection')]),
     );
   }
   else {
@@ -800,7 +800,7 @@ function uc_store_uc_store_status() {
     $messages[] = array(
       'status' => 'error',
       'title'  => t('Store settings'),
-      'desc'   => t('Store e-mail address has not been set. Please enter it on the <a href="@url">store settings</a> page.', ['@url' => \Drupal::url('uc_store.config_form')]),
+      'desc'   => t('Store e-mail address has not been set. Please enter it on the <a href="@url">store settings</a> page.', ['@url' => Url::fromRoute('uc_store.config_form')]),
     );
   }
   else {
diff --git a/uc_store/uc_store.tokens.inc b/uc_store/uc_store.tokens.inc
index 83f05aa..24d70fb 100644
--- a/uc_store/uc_store.tokens.inc
+++ b/uc_store/uc_store.tokens.inc
@@ -77,7 +77,7 @@ function uc_store_tokens($type, $tokens, array $data, array $options, Bubbleable
     foreach ($tokens as $name => $original) {
       switch ($name) {
         case 'login-link':
-          $login_link = \Drupal::url('user.page', [], ['absolute' => TRUE]);
+          $login_link = Url::fromRoute('user.page', [], ['absolute' => TRUE]);
           $replacements[$original] = \Drupal::l($login_link, Url::fromUri($login_link));
           break;
 
