Repository: scrapy-plugins/scrapy-zyte-smartproxy (language: python)

Issue:
[CRAWLERA-6655] Rebranding



Discussion / hints:
# [Codecov](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=h1) Report
> Merging [#96](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=desc) (2725b87) into [master](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/commit/019987f68345079db176405c9f9fbb155ee26f20?el=desc) (019987f) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96/graphs/tree.svg?width=650&height=150&src=pr&token=KDcW6Z9rlx)](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##            master       #96   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          229       229           
=========================================
  Hits           229       229           
```


| [Impacted Files](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [scrapy\_zyte\_proxy/utils.py](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96/diff?src=pr&el=tree#diff-c2NyYXB5X3p5dGVfcHJveHkvdXRpbHMucHk=) | `100.00% <ø> (ø)` | |
| [scrapy\_zyte\_proxy/\_\_init\_\_.py](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96/diff?src=pr&el=tree#diff-c2NyYXB5X3p5dGVfcHJveHkvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | |
| [scrapy\_zyte\_proxy/middleware.py](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96/diff?src=pr&el=tree#diff-c2NyYXB5X3p5dGVfcHJveHkvbWlkZGxld2FyZS5weQ==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=footer). Last update [019987f...2725b87](https://codecov.io/gh/scrapy-plugins/scrapy-crawlera/pull/96?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Please add CRAWLERA-6655 somewhere either on your commits or on the branch name or on the title for this PR (last option preferred).

Fix patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index c94de70..de67af0 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -6,4 +6,4 @@ tag_name = v{new_version}
 
 [bumpversion:file:setup.py]
 
-[bumpversion:file:scrapy_crawlera/__init__.py]
+[bumpversion:file:scrapy_zyte_smartproxy/__init__.py]
diff --git a/README.rst b/README.rst
index e91ee2c..2956bda 100644
--- a/README.rst
+++ b/README.rst
@@ -1,20 +1,21 @@
-===============
-scrapy-crawlera
-===============
+======================
+scrapy-zyte-smartproxy
+======================
 
-.. image:: https://img.shields.io/pypi/v/scrapy-crawlera.svg
-   :target: https://pypi.python.org/pypi/scrapy-crawlera
+.. image:: https://img.shields.io/pypi/v/scrapy-zyte-smartproxy.svg
+   :target: https://pypi.python.org/pypi/scrapy-zyte-smartproxy
    :alt: PyPI Version
 
-.. image:: https://travis-ci.org/scrapy-plugins/scrapy-crawlera.svg?branch=master
-   :target: http://travis-ci.org/scrapy-plugins/scrapy-crawlera
+.. image:: https://travis-ci.org/scrapy-plugins/scrapy-zyte-smartproxy.svg?branch=master
+   :target: http://travis-ci.org/scrapy-plugins/scrapy-zyte-smartproxy
    :alt: Build Status
 
-.. image:: http://codecov.io/github/scrapy-plugins/scrapy-crawlera/coverage.svg?branch=master
-   :target: http://codecov.io/github/scrapy-plugins/scrapy-crawlera?branch=master
+.. image:: http://codecov.io/github/scrapy-plugins/scrapy-zyte-smartproxy/coverage.svg?branch=master
+   :target: http://codecov.io/github/scrapy-plugins/scrapy-zyte-smartproxy?branch=master
    :alt: Code Coverage
 
-scrapy-crawlera provides easy use of `Crawlera <http://scrapinghub.com/crawlera>`_ with Scrapy.
+scrapy-zyte-smartproxy provides easy use of `Zyte Smart Proxy Manager
+<https://www.zyte.com/smart-proxy-manager/>`_ (formerly Crawlera) with Scrapy.
 
 Requirements
 ============
@@ -25,12 +26,13 @@ Requirements
 Installation
 ============
 
-You can install scrapy-crawlera using pip::
+You can install scrapy-zyte-smartproxy using pip::
 
-    pip install scrapy-crawlera
+    pip install scrapy-zyte-smartproxy
 
 
 Documentation
 =============
 
-Documentation is available online at https://scrapy-crawlera.readthedocs.io/ and in the ``docs`` directory.
+Documentation is available online at
+https://scrapy-zyte-smartproxy.readthedocs.io/ and in the ``docs`` directory.
diff --git a/docs/Makefile b/docs/Makefile
index 03f6908..5a90528 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -4,7 +4,7 @@
 # You can set these variables from the command line.
 SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
-SPHINXPROJ    = scrapy-crawlera
+SPHINXPROJ    = scrapy-zyte-smartproxy
 SOURCEDIR     = .
 BUILDDIR      = _build
 
diff --git a/docs/conf.py b/docs/conf.py
index 0c685ae..9ac73d3 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# scrapy-crawlera documentation build configuration file, created by
+# scrapy-zyte-smartproxy documentation build configuration file, created by
 # sphinx-quickstart on Sat Jan 21 13:17:41 2017.
 #
 # This file is execfile()d with the current directory set to its
@@ -54,9 +54,9 @@
 master_doc = 'index'
 
 # General information about the project.
-project = u'scrapy-crawlera'
-copyright = u'2011-2017, Scrapinghub'
-author = u'Scrapinghub'
+project = u'scrapy-zyte-smartproxy'
+copyright = u'2011-2021, Zyte Group Ltd'
+author = u'Zyte'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -64,9 +64,9 @@
 #
 
 try:
-    import scrapy_crawlera
-    version = '.'.join(scrapy_crawlera.__version__.split('.')[:2])
-    release = scrapy_crawlera.__version__
+    import scrapy_zyte_smartproxy
+    version = '.'.join(scrapy_zyte_smartproxy.__version__.split('.')[:2])
+    release = scrapy_zyte_smartproxy.__version__
 except ImportError:
     version = ''
     release = ''
@@ -111,7 +111,7 @@
 # -- Options for HTMLHelp output ------------------------------------------
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'scrapy-crawleradoc'
+htmlhelp_basename = 'scrapy-zyte-smartproxydoc'
 
 
 # -- Options for LaTeX output ---------------------------------------------
@@ -138,8 +138,13 @@
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-    (master_doc, 'scrapy-crawlera.tex', u'scrapy-crawlera Documentation',
-     u'Scrapinghub', 'manual'),
+    (
+        master_doc,
+        'scrapy-zyte-smartproxy.tex',
+        u'scrapy-zyte-smartproxy Documentation',
+        u'Zyte',
+        'manual',
+    ),
 ]
 
 
@@ -148,7 +153,7 @@
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    (master_doc, 'scrapy-crawlera', u'scrapy-crawlera Documentation',
+    (master_doc, 'scrapy-zyte-smartproxy', u'scrapy-zyte-smartproxy Documentation',
      [author], 1)
 ]
 
@@ -159,8 +164,8 @@
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-    (master_doc, 'scrapy-crawlera', u'scrapy-crawlera Documentation',
-     author, 'scrapy-crawlera', 'One line description of project.',
+    (master_doc, 'scrapy-zyte-smartproxy', u'scrapy-zyte-smartproxy Documentation',
+     author, 'scrapy-zyte-smartproxy', 'One line description of project.',
      'Miscellaneous'),
 ]
 
diff --git a/docs/index.rst b/docs/index.rst
index 3dc1d51..1292b07 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,9 +1,12 @@
-=======================================
-scrapy-crawlera |version| documentation
-=======================================
+==============================================
+scrapy-zyte-smartproxy |version| documentation
+==============================================
 
-scrapy-crawlera is a Scrapy `Downloader Middleware <https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#downloader-middleware>`_
-to interact with `Crawlera <http://scrapinghub.com/crawlera>`_ automatically.
+scrapy-zyte-smartproxy is a `Scrapy downloader middleware`_ to interact with
+`Zyte Smart Proxy Manager`_ (formerly Crawlera) automatically.
+
+.. _Scrapy downloader middleware: https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
+.. _Zyte Smart Proxy Manager: https://www.zyte.com/smart-proxy-manager/
 
 Configuration
 =============
@@ -12,32 +15,32 @@ Configuration
    :caption: Configuration
 
 
-* Add the Crawlera middleware including it into the ``DOWNLOADER_MIDDLEWARES`` in your ``settings.py`` file::
+* Add the Zyte Smart Proxy Manager middleware including it into the ``DOWNLOADER_MIDDLEWARES`` in your ``settings.py`` file::
 
     DOWNLOADER_MIDDLEWARES = {
         ...
-        'scrapy_crawlera.CrawleraMiddleware': 610
+        'scrapy_zyte_smartproxy.ZyteSmartProxyMiddleware': 610
     }
 
 * Then there are two ways to enable it
 
   * Through ``settings.py``::
 
-      CRAWLERA_ENABLED = True
-      CRAWLERA_APIKEY = 'apikey'
+      ZYTE_SMARTPROXY_ENABLED = True
+      ZYTE_SMARTPROXY_APIKEY = 'apikey'
 
   * Through spider attributes::
 
       class MySpider:
-          crawlera_enabled = True
-          crawlera_apikey = 'apikey'
+          zyte_smartproxy_enabled = True
+          zyte_smartproxy_apikey = 'apikey'
 
 
-* (optional) If you are not using the default Crawlera proxy (``http://proxy.crawlera.com:8010``),
+* (optional) If you are not using the default Zyte Smart Proxy Manager proxy (``http://proxy.zyte.com:8011``),
   for example if you have a dedicated or private instance,
-  make sure to also set ``CRAWLERA_URL`` in ``settings.py``, e.g.::
+  make sure to also set ``ZYTE_SMARTPROXY_URL`` in ``settings.py``, e.g.::
 
-    CRAWLERA_URL = 'http://myinstance.crawlera.com:8010'
+    ZYTE_SMARTPROXY_URL = 'http://myinstance.zyte.com:8011'
 
 How to use it
 =============
@@ -52,8 +55,8 @@ How to use it
     All configurable Scrapy Settings added by the Middleware.
 
 
-With the middleware, the usage of crawlera is automatic, every request will go through crawlera without nothing to worry about.
-If you want to *disable* crawlera on a specific Request, you can do so by updating `meta` with `dont_proxy=True`::
+With the middleware, the usage of Zyte Smart Proxy Manager is automatic, every request will go through Zyte Smart Proxy Manager without nothing to worry about.
+If you want to *disable* Zyte Smart Proxy Manager on a specific Request, you can do so by updating `meta` with `dont_proxy=True`::
 
 
     scrapy.Request(
@@ -65,11 +68,11 @@ If you want to *disable* crawlera on a specific Request, you can do so by updati
     )
 
 
-Remember that you are now making requests to Crawlera, and the Crawlera service will be the one actually making the requests to the different sites.
+Remember that you are now making requests to Zyte Smart Proxy Manager, and the Zyte Smart Proxy Manager service will be the one actually making the requests to the different sites.
 
-If you need to specify special `Crawlera Headers <https://doc.scrapinghub.com/crawlera.html#request-headers>`_, just apply them as normal `Scrapy Headers <https://doc.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request.headers>`_.
+If you need to specify special `Zyte Smart Proxy Manager headers <https://docs.zyte.com/smart-proxy-manager.html#request-headers>`_, just apply them as normal `Scrapy headers <https://doc.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request.headers>`_.
 
-Here we have an example of specifying a Crawlera header into a Scrapy request::
+Here we have an example of specifying a Zyte Smart Proxy Manager header into a Scrapy request::
 
     scrapy.Request(
         'http://example.com',
@@ -82,8 +85,8 @@ Here we have an example of specifying a Crawlera header into a Scrapy request::
 Remember that you could also set which headers to use by default by all
 requests with `DEFAULT_REQUEST_HEADERS <http://doc.scrapy.org/en/1.0/topics/settings.html#default-request-headers>`_
 
-.. note:: Crawlera headers are removed from requests when the middleware is activated but Crawlera
-    is disabled. For example, if you accidentally disable Crawlera via ``crawlera_enabled = False``
+.. note:: Zyte Smart Proxy Manager headers are removed from requests when the middleware is activated but Zyte Smart Proxy Manager
+    is disabled. For example, if you accidentally disable Zyte Smart Proxy Manager via ``zyte_smartproxy_enabled = False``
     but keep sending ``X-Crawlera-*`` headers in your requests, those will be removed from the
     request headers.
 
@@ -99,4 +102,4 @@ All the rest
    news
 
 :doc:`news`
-    See what has changed in recent scrapy-crawlera versions.
+    See what has changed in recent scrapy-zyte-smartproxy versions.
diff --git a/docs/news.rst b/docs/news.rst
index d706274..d1945fa 100644
--- a/docs/news.rst
+++ b/docs/news.rst
@@ -3,6 +3,35 @@
 Changes
 =======
 
+v2.0.0 (2021-05-NN)
+-------------------
+
+Following the upstream rebranding of Crawlera as Zyte Smart Proxy Manager,
+``scrapy-crawlera`` has been renamed as ``scrapy-zyte-smartproxy``, with the
+following backward-incompatible changes:
+
+-   The repository name and Python Package Index (PyPI) name are now
+    ``scrapy-zyte-smartproxy``.
+
+-   Setting prefixes have switched from ``CRAWLERA_`` to ``ZYTE_SMARTPROXY_``.
+
+-   Spider attribute prefixes and request meta key prefixes have switched from
+    ``crawlera_`` to ``zyte_smartproxy_``.
+
+-   ``scrapy_crawlera`` is now ``scrapy_zyte_smartproxy``.
+
+-   ``CrawleraMiddleware`` is now ``ZyteSmartProxyMiddleware``, and its default
+    ``url`` is now ``http://proxy.zyte.com:8011``.
+
+-   Stat prefixes have switched from ``crawlera/`` to ``zyte_smartproxy/``.
+
+-   The online documentation is moving to
+    https://scrapy-zyte-smartproxy.readthedocs.io/
+
+.. note:: Zyte Smart Proxy Manager headers continue to use the ``X-Crawlera-``
+          prefix.
+
+
 v1.7.2 (2020-12-01)
 -------------------
 - Use request.meta than response.meta in the middleware
diff --git a/docs/settings.rst b/docs/settings.rst
index f457acf..31f9d9e 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -2,76 +2,77 @@
 Settings
 ========
 
-This Middleware adds some settings to configure how to work with Crawlera.
+This Scrapy downloader middleware adds some settings to configure how to work
+with Zyte Smart Proxy Manager.
 
-CRAWLERA_APIKEY
----------------
+ZYTE_SMARTPROXY_APIKEY
+----------------------
 
 Default: ``None``
 
-Unique Crawlera API Key provided for authentication.
+Unique Zyte Smart Proxy Manager API key provided for authentication.
 
-CRAWLERA_URL
-------------
+ZYTE_SMARTPROXY_URL
+-------------------
 
-Default: ``'http://proxy.crawlera.com:8010'``
+Default: ``'http://proxy.zyte.com:8011'``
 
-Crawlera instance url, it varies depending on adquiring a private or dedicated instance. If Crawlera didn't provide
-you with a private instance url, you don't need to specify it.
+Zyte Smart Proxy Manager instance URL, it varies depending on adquiring a private or dedicated instance. If Zyte Smart Proxy Manager didn't provide
+you with a private instance URL, you don't need to specify it.
 
-CRAWLERA_MAXBANS
-----------------
+ZYTE_SMARTPROXY_MAXBANS
+-----------------------
 
 Default: ``400``
 
-Number of consecutive bans from Crawlera necessary to stop the spider.
+Number of consecutive bans from Zyte Smart Proxy Manager necessary to stop the spider.
 
-CRAWLERA_DOWNLOAD_TIMEOUT
--------------------------
+ZYTE_SMARTPROXY_DOWNLOAD_TIMEOUT
+--------------------------------
 
 Default: ``190``
 
-Timeout for processing Crawlera requests. It overrides Scrapy's ``DOWNLOAD_TIMEOUT``.
+Timeout for processing Zyte Smart Proxy Manager requests. It overrides Scrapy's ``DOWNLOAD_TIMEOUT``.
 
-CRAWLERA_PRESERVE_DELAY
------------------------
+ZYTE_SMARTPROXY_PRESERVE_DELAY
+------------------------------
 
 Default: ``False``
 
 If ``False`` Sets Scrapy's ``DOWNLOAD_DELAY`` to ``0``, making the spider to crawl faster. If set to ``True``, it will
 respect the provided ``DOWNLOAD_DELAY`` from Scrapy.
 
-CRAWLERA_DEFAULT_HEADERS
-------------------------
+ZYTE_SMARTPROXY_DEFAULT_HEADERS
+-------------------------------
 
 Default: ``{}``
 
-Default headers added only to crawlera requests. Headers defined on ``DEFAULT_REQUEST_HEADERS`` will take precedence as long as the ``CrawleraMiddleware`` is placed after the ``DefaultHeadersMiddleware``. Headers set on the requests have precedence over the two settings.
+Default headers added only to Zyte Smart Proxy Manager requests. Headers defined on ``DEFAULT_REQUEST_HEADERS`` will take precedence as long as the ``ZyteSmartProxyMiddleware`` is placed after the ``DefaultHeadersMiddleware``. Headers set on the requests have precedence over the two settings.
 
-* This is the default behavior, ``DefaultHeadersMiddleware`` default priority is ``400`` and we recommend ``CrawleraMiddleware`` priority to be ``610``
+* This is the default behavior, ``DefaultHeadersMiddleware`` default priority is ``400`` and we recommend ``ZyteSmartProxyMiddleware`` priority to be ``610``
 
-CRAWLERA_BACKOFF_STEP
------------------------
+ZYTE_SMARTPROXY_BACKOFF_STEP
+----------------------------
 
 Default: ``15``
 
 Step size used for calculating exponential backoff according to the formula: ``random.uniform(0, min(max, step * 2 ** attempt))``.
 
-CRAWLERA_BACKOFF_MAX
------------------------
+ZYTE_SMARTPROXY_BACKOFF_MAX
+---------------------------
 
 Default: ``180``
 
 Max value for exponential backoff as showed in the formula above.
 
-CRAWLERA_FORCE_ENABLE_ON_HTTP_CODES
-------------------------------------
+ZYTE_SMARTPROXY_FORCE_ENABLE_ON_HTTP_CODES
+------------------------------------------
 
 Default: ``[]``
 
-List of HTTP response status codes that warrant enabling Crawlera for the
+List of HTTP response status codes that warrant enabling Zyte Smart Proxy Manager for the
 corresponding domain.
 
 When a response with one of these HTTP status codes is received after a request
-that did not go through Crawlera, the request is retried with Crawlera, and any
-new request to the same domain is also sent through Crawlera.
+that did not go through Zyte Smart Proxy Manager, the request is retried with Zyte Smart Proxy Manager, and any
+new request to the same domain is also sent through Zyte Smart Proxy Manager.
diff --git a/scrapy_crawlera/__init__.py b/scrapy_crawlera/__init__.py
deleted file mode 100644
index db61d0f..0000000
--- a/scrapy_crawlera/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from .middleware import CrawleraMiddleware
-
-
-__version__ = '1.7.2'
diff --git a/scrapy_zyte_smartproxy/__init__.py b/scrapy_zyte_smartproxy/__init__.py
new file mode 100644
index 0000000..0bbef74
--- /dev/null
+++ b/scrapy_zyte_smartproxy/__init__.py
@@ -0,0 +1,4 @@
+from .middleware import ZyteSmartProxyMiddleware
+
+
+__version__ = '1.7.2'
diff --git a/scrapy_crawlera/middleware.py b/scrapy_zyte_smartproxy/middleware.py
similarity index 71%
rename from scrapy_crawlera/middleware.py
rename to scrapy_zyte_smartproxy/middleware.py
index af6ad8c..3b053fe 100644
--- a/scrapy_crawlera/middleware.py
+++ b/scrapy_zyte_smartproxy/middleware.py
@@ -10,16 +10,16 @@
 from scrapy.exceptions import ScrapyDeprecationWarning
 from twisted.internet.error import ConnectionRefusedError, ConnectionDone
 
-from scrapy_crawlera.utils import exp_backoff
+from scrapy_zyte_smartproxy.utils import exp_backoff
 
 
-class CrawleraMiddleware(object):
+class ZyteSmartProxyMiddleware(object):
 
-    url = 'http://proxy.crawlera.com:8010'
+    url = 'http://proxy.zyte.com:8011'
     maxbans = 400
     ban_code = 503
     download_timeout = 190
-    # Handle crawlera server failures
+    # Handle Zyte Smart Proxy Manager server failures
     connection_refused_delay = 90
     preserve_delay = False
     header_prefix = 'X-Crawlera-'
@@ -64,20 +64,25 @@ def open_spider(self, spider):
             setattr(self, k, self._get_setting_value(spider, k, type_))
 
         self._fix_url_protocol()
-        self._headers = self.crawler.settings.get('CRAWLERA_DEFAULT_HEADERS', {}).items()
+        self._headers = self.crawler.settings.get('ZYTE_SMARTPROXY_DEFAULT_HEADERS', {}).items()
         self.exp_backoff = exp_backoff(self.backoff_step, self.backoff_max)
 
         if not self.enabled and not self.force_enable_on_http_codes:
             return
 
         if not self.apikey:
-            logging.warning("Crawlera can't be used without a APIKEY", extra={'spider': spider})
+            logging.warning(
+                "Zyte Smart Proxy Manager cannot be used without an API key",
+                extra={'spider': spider},
+            )
             return
 
         self._proxyauth = self.get_proxyauth(spider)
 
         logging.info(
-            "Using crawlera at %s (apikey: %s)" % (self.url, self.apikey[:7]),
+            "Using Zyte Smart Proxy Manager at %s (apikey: %s)" % (
+                self.url, self.apikey[:7]
+            ),
             extra={'spider': spider},
         )
 
@@ -85,8 +90,11 @@ def open_spider(self, spider):
             # Setting spider download delay to 0 to get maximum crawl rate
             spider.download_delay = 0
             logging.info(
-                "CrawleraMiddleware: disabling download delays on Scrapy side to optimize delays introduced by Crawlera. "
-                "To avoid this behaviour you can use the CRAWLERA_PRESERVE_DELAY setting but keep in mind that this may slow down the crawl significantly",
+                "ZyteSmartProxyMiddleware: disabling download delays in "
+                "Scrapy to optimize delays introduced by Zyte Smart Proxy "
+                "Manager. To avoid this behaviour you can use the "
+                "ZYTE_SMARTPROXY_PRESERVE_DELAY setting, but keep in mind "
+                "that this may slow down the crawl significantly",
                 extra={'spider': spider},
             )
 
@@ -105,41 +113,41 @@ def _settings_get(self, type_, *a, **kw):
     def _get_setting_value(self, spider, k, type_):
         if hasattr(spider, 'hubproxy_' + k):
             warnings.warn('hubproxy_%s attribute is deprecated, '
-                          'use crawlera_%s instead.' % (k, k),
+                          'use zyte_smartproxy_%s instead.' % (k, k),
                           category=ScrapyDeprecationWarning, stacklevel=1)
 
         if self.crawler.settings.get('HUBPROXY_%s' % k.upper()) is not None:
             warnings.warn('HUBPROXY_%s setting is deprecated, '
-                          'use CRAWLERA_%s instead.' % (k.upper(), k.upper()),
+                          'use ZYTE_SMARTPROXY_%s instead.' % (k.upper(), k.upper()),
                           category=ScrapyDeprecationWarning, stacklevel=1)
 
         o = getattr(self, k, None)
         s = self._settings_get(
-            type_, 'CRAWLERA_' + k.upper(), self._settings_get(
+            type_, 'ZYTE_SMARTPROXY_' + k.upper(), self._settings_get(
                 type_, 'HUBPROXY_' + k.upper(), o))
         return getattr(
-            spider, 'crawlera_' + k, getattr(spider, 'hubproxy_' + k, s))
+            spider, 'zyte_smartproxy_' + k, getattr(spider, 'hubproxy_' + k, s))
 
     def _fix_url_protocol(self):
         if self.url.startswith('https://'):
-            logging.warning('CRAWLERA_URL "%s" set with "https://" protocol.' % self.url)
+            logging.warning('ZYTE_SMARTPROXY_URL "%s" set with "https://" protocol.' % self.url)
         elif not self.url.startswith('http://'):
-            logging.warning('Adding "http://" to CRAWLERA_URL %s' % self.url)
+            logging.warning('Adding "http://" to ZYTE_SMARTPROXY_URL %s' % self.url)
             self.url = 'http://' + self.url
 
     def is_enabled(self, spider):
         """Hook to enable middleware by custom rules."""
         if hasattr(spider, 'use_hubproxy'):
             warnings.warn('use_hubproxy attribute is deprecated, '
-                          'use crawlera_enabled instead.',
+                          'use zyte_smartproxy_enabled instead.',
                           category=ScrapyDeprecationWarning, stacklevel=1)
 
         if self.crawler.settings.get('HUBPROXY_ENABLED') is not None:
             warnings.warn('HUBPROXY_ENABLED setting is deprecated, '
-                          'use CRAWLERA_ENABLED instead.',
+                          'use ZYTE_SMARTPROXY_ENABLED instead.',
                           category=ScrapyDeprecationWarning, stacklevel=1)
         return (
-            getattr(spider, 'crawlera_enabled', self.crawler.settings.getbool('CRAWLERA_ENABLED')) or
+            getattr(spider, 'zyte_smartproxy_enabled', self.crawler.settings.getbool('ZYTE_SMARTPROXY_ENABLED')) or
             getattr(spider, 'use_hubproxy', self.crawler.settings.getbool("HUBPROXY_ENABLED"))
         )
 
@@ -148,19 +156,19 @@ def get_proxyauth(self, spider):
         return basic_auth_header(self.apikey, '')
 
     def process_request(self, request, spider):
-        from scrapy_crawlera import __version__
+        from scrapy_zyte_smartproxy import __version__
         if self._is_enabled_for_request(request):
-            self._set_crawlera_default_headers(request)
+            self._set_zyte_smartproxy_default_headers(request)
             request.meta['proxy'] = self.url
             request.meta['download_timeout'] = self.download_timeout
             request.headers['Proxy-Authorization'] = self._proxyauth
             if self.job_id:
                 request.headers['X-Crawlera-Jobid'] = self.job_id
-            request.headers['X-Crawlera-Client'] = 'scrapy-crawlera/%s' % __version__
-            self.crawler.stats.inc_value('crawlera/request')
-            self.crawler.stats.inc_value('crawlera/request/method/%s' % request.method)
+            request.headers['X-Crawlera-Client'] = 'scrapy-zyte-smartproxy/%s' % __version__
+            self.crawler.stats.inc_value('zyte_smartproxy/request')
+            self.crawler.stats.inc_value('zyte_smartproxy/request/method/%s' % request.method)
         else:
-            self._clean_crawlera_headers(request)
+            self._clean_zyte_smartproxy_headers(request)
 
     def _is_banned(self, response):
         return (
@@ -184,7 +192,7 @@ def process_response(self, request, response, spider):
         if not self._is_enabled_for_request(request):
             return self._handle_not_enabled_response(request, response)
 
-        if not self._is_crawlera_response(response):
+        if not self._is_zyte_smartproxy_response(response):
             return response
 
         key = self._get_slot_key(request)
@@ -197,17 +205,17 @@ def process_response(self, request, response, spider):
                 reason = 'autherror'
             self._set_custom_delay(request, next(self.exp_backoff), reason=reason)
         else:
-            self.crawler.stats.inc_value('crawlera/delay/reset_backoff')
+            self.crawler.stats.inc_value('zyte_smartproxy/delay/reset_backoff')
             self.exp_backoff = exp_backoff(self.backoff_step, self.backoff_max)
 
         if self._is_auth_error(response):
-            # When crawlera has issues it might not be able to authenticate users
-            # we must retry
-            retries = request.meta.get('crawlera_auth_retry_times', 0)
+            # When Zyte Smart Proxy Manager has issues it might not be able to
+            # authenticate users we must retry
+            retries = request.meta.get('zyte_smartproxy_auth_retry_times', 0)
             if retries < self.max_auth_retry_times:
                 return self._retry_auth(response, request, spider)
             else:
-                self.crawler.stats.inc_value('crawlera/retries/auth/max_reached')
+                self.crawler.stats.inc_value('zyte_smartproxy/retries/auth/max_reached')
                 logging.warning(
                     "Max retries for authentication issues reached, please check auth"
                     " information settings",
@@ -222,24 +230,24 @@ def process_response(self, request, response, spider):
                 after = response.headers.get('retry-after')
                 if after:
                     self._set_custom_delay(request, float(after), reason='banned')
-            self.crawler.stats.inc_value('crawlera/response/banned')
+            self.crawler.stats.inc_value('zyte_smartproxy/response/banned')
         else:
             self._bans[key] = 0
         # If placed behind `RedirectMiddleware`, it would not count 3xx responses
-        self.crawler.stats.inc_value('crawlera/response')
-        self.crawler.stats.inc_value('crawlera/response/status/%s' % response.status)
-        crawlera_error = response.headers.get('X-Crawlera-Error')
-        if crawlera_error:
-            self.crawler.stats.inc_value('crawlera/response/error')
+        self.crawler.stats.inc_value('zyte_smartproxy/response')
+        self.crawler.stats.inc_value('zyte_smartproxy/response/status/%s' % response.status)
+        zyte_smartproxy_error = response.headers.get('X-Crawlera-Error')
+        if zyte_smartproxy_error:
+            self.crawler.stats.inc_value('zyte_smartproxy/response/error')
             self.crawler.stats.inc_value(
-                'crawlera/response/error/%s' % crawlera_error.decode('utf8'))
+                'zyte_smartproxy/response/error/%s' % zyte_smartproxy_error.decode('utf8'))
         return response
 
     def process_exception(self, request, exception, spider):
         if not self._is_enabled_for_request(request):
             return
         if isinstance(exception, (ConnectionRefusedError, ConnectionDone)):
-            # Handle crawlera downtime
+            # Handle Zyte Smart Proxy Manager downtime
             self._clear_dns_cache()
             self._set_custom_delay(request, self.connection_refused_delay, reason='conn_refused')
 
@@ -250,20 +258,21 @@ def _handle_not_enabled_response(self, request, response):
 
             retryreq = request.copy()
             retryreq.dont_filter = True
-            self.crawler.stats.inc_value('crawlera/retries/should_have_been_enabled')
+            self.crawler.stats.inc_value('zyte_smartproxy/retries/should_have_been_enabled')
             return retryreq
         return response
 
     def _retry_auth(self, response, request, spider):
         logging.warning(
-            "Retrying crawlera request for authentication issue",
+            "Retrying a Zyte Smart Proxy Manager request due to an "
+            "authentication issue",
             extra={'spider': self.spider},
         )
-        retries = request.meta.get('crawlera_auth_retry_times', 0) + 1
+        retries = request.meta.get('zyte_smartproxy_auth_retry_times', 0) + 1
         retryreq = request.copy()
-        retryreq.meta['crawlera_auth_retry_times'] = retries
+        retryreq.meta['zyte_smartproxy_auth_retry_times'] = retries
         retryreq.dont_filter = True
-        self.crawler.stats.inc_value('crawlera/retries/auth')
+        self.crawler.stats.inc_value('zyte_smartproxy/retries/auth')
         return retryreq
 
     def _clear_dns_cache(self):
@@ -284,7 +293,7 @@ def _get_url_domain(self, url):
         parsed = urlparse(url)
         return parsed.netloc
 
-    def _is_crawlera_response(self, response):
+    def _is_zyte_smartproxy_response(self, response):
         return bool("X-Crawlera-Version" in response.headers)
 
     def _get_slot_key(self, request):
@@ -303,8 +312,8 @@ def _set_custom_delay(self, request, delay, reason=None):
             self._saved_delays[key] = slot.delay
         slot.delay = delay
         if reason is not None:
-            self.crawler.stats.inc_value('crawlera/delay/%s' % reason)
-            self.crawler.stats.inc_value('crawlera/delay/%s/total' % reason, delay)
+            self.crawler.stats.inc_value('zyte_smartproxy/delay/%s' % reason)
+            self.crawler.stats.inc_value('zyte_smartproxy/delay/%s/total' % reason, delay)
 
     def _restore_original_delay(self, request):
         """Restore original delay for slot if it was changed."""
@@ -314,23 +323,23 @@ def _restore_original_delay(self, request):
         if self._saved_delays[key] is not None:
             slot.delay, self._saved_delays[key] = self._saved_delays[key], None
 
-    def _clean_crawlera_headers(self, request):
+    def _clean_zyte_smartproxy_headers(self, request):
         """Remove X-Crawlera-* headers from the request."""
         targets = [
             header
             for header in request.headers
-            if self._is_crawlera_header(header)
+            if self._is_zyte_smartproxy_header(header)
         ]
         for header in targets:
             request.headers.pop(header, None)
 
-    def _is_crawlera_header(self, header_name):
+    def _is_zyte_smartproxy_header(self, header_name):
         if not header_name:
             return False
         header_name = header_name.decode('utf-8').lower()
         return header_name.startswith(self.header_prefix.lower())
 
-    def _set_crawlera_default_headers(self, request):
+    def _set_zyte_smartproxy_default_headers(self, request):
         for header, value in self._headers:
             if value is None:
                 continue
@@ -342,14 +351,17 @@ def _set_crawlera_default_headers(self, request):
             # Send a general warning once, and specific urls if LOG_LEVEL = DEBUG
             warnings.warn(
                 'The headers %s are conflicting on some of your requests. '
-                'Please check https://doc.scrapinghub.com/crawlera.html '
-                'for more information. You can set LOG_LEVEL=DEBUG to see the urls with problems'
+                'Please check '
+                'https://docs.zyte.com/smart-proxy-manager.html#request-headers '
+                'for more information. You can set LOG_LEVEL=DEBUG to see the '
+                'urls with problems.'
                 % str(self.conflicting_headers)
             )
             logging.debug(
                 'The headers %s are conflicting on request %s. X-Crawlera-UA '
-                'will be ignored. Please check https://doc.scrapinghub.com/cr'
-                'awlera.html for more information'
+                'will be ignored. Please check '
+                'https://docs.zyte.com/smart-proxy-manager.html#request-headers '
+                'for more information'
                 % (str(self.conflicting_headers), request.url),
                 extra={'spider': self.spider},
             )
diff --git a/scrapy_crawlera/utils.py b/scrapy_zyte_smartproxy/utils.py
similarity index 100%
rename from scrapy_crawlera/utils.py
rename to scrapy_zyte_smartproxy/utils.py
diff --git a/setup.py b/setup.py
index 66c1cc6..ccee933 100644
--- a/setup.py
+++ b/setup.py
@@ -5,17 +5,17 @@
 
 
 setup(
-    name='scrapy-crawlera',
+    name='scrapy-zyte-smartproxy',
     version='1.7.2',
     license='BSD',
-    description='Crawlera middleware for Scrapy',
+    description='Scrapy middleware for Zyte Smart Proxy Manager',
     long_description=readme,
     maintainer='Raul Gallegos',
     maintainer_email='raul.ogh@gmail.com',
-    author='Scrapinghub',
-    author_email='opensource@scrapinghub.com',
-    url='https://github.com/scrapy-plugins/scrapy-crawlera',
-    packages=['scrapy_crawlera'],
+    author='Zyte',
+    author_email='opensource@zyte.com',
+    url='https://github.com/scrapy-plugins/scrapy-zyte-smartproxy',
+    packages=['scrapy_zyte_smartproxy'],
     platforms=['Any'],
     classifiers=[
         'Development Status :: 5 - Production/Stable',
diff --git a/tox.ini b/tox.ini
index d7446a2..987fe6e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,13 +7,13 @@ deps =
     -rrequirements.txt
     -rtests/requirements.txt
 commands =
-    py.test --doctest-modules --cov=scrapy_crawlera {posargs:scrapy_crawlera tests}
+    py.test --doctest-modules --cov=scrapy_zyte_smartproxy {posargs:scrapy_zyte_smartproxy tests}
 
 [testenv:security]
 deps =
     bandit
 commands =
-    bandit -r {posargs:scrapy_crawlera setup.py}
+    bandit -r {posargs:scrapy_zyte_smartproxy setup.py}
 
 [testenv:stack-scrapy-1.0]
 basepython = python2.7


Test patch:
diff --git a/tests/test_crawlera.py b/tests/test_all.py
similarity index 70%
rename from tests/test_crawlera.py
rename to tests/test_all.py
index a7d092f..b74c979 100644
--- a/tests/test_crawlera.py
+++ b/tests/test_all.py
@@ -1,3 +1,4 @@
+import os
 import pytest
 from random import choice
 from unittest import TestCase
@@ -14,10 +15,8 @@
 from scrapy.exceptions import ScrapyDeprecationWarning
 from twisted.internet.error import ConnectionRefusedError, ConnectionDone
 
-from scrapy_crawlera import CrawleraMiddleware, __version__
-import os
-
-from scrapy_crawlera.utils import exp_backoff
+from scrapy_zyte_smartproxy import __version__, ZyteSmartProxyMiddleware
+from scrapy_zyte_smartproxy.utils import exp_backoff
 
 
 class MockedSlot(object):
@@ -26,15 +25,15 @@ def __init__(self, delay=0.0):
         self.delay = delay
 
 
-class CrawleraMiddlewareTestCase(TestCase):
+class ZyteSmartProxyMiddlewareTestCase(TestCase):
 
-    mwcls = CrawleraMiddleware
+    mwcls = ZyteSmartProxyMiddleware
     bancode = 503
     auth_error_code = 407
 
     def setUp(self):
         self.spider = Spider('foo')
-        self.settings = {'CRAWLERA_APIKEY': 'apikey'}
+        self.settings = {'ZYTE_SMARTPROXY_APIKEY': 'apikey'}
         Response_init_orig = Response.__init__
 
         def Response_init_new(self, *args, **kwargs):
@@ -43,12 +42,12 @@ def Response_init_new(self, *args, **kwargs):
 
         Response.__init__ = Response_init_new
 
-    def _mock_crawlera_response(self, url, headers=None, **kwargs):
-        crawlera_version = choice(("1.36.3-cd5e44", "", None))
-        crawlera_headers = {"X-Crawlera-Version": crawlera_version}
+    def _mock_zyte_smartproxy_response(self, url, headers=None, **kwargs):
+        zyte_smartproxy_version = choice(("1.36.3-cd5e44", "", None))
+        zyte_smartproxy_headers = {"X-Crawlera-Version": zyte_smartproxy_version}
         if headers:
-            crawlera_headers.update(headers)
-        return Response(url, headers=crawlera_headers, **kwargs)
+            zyte_smartproxy_headers.update(headers)
+        return Response(url, headers=zyte_smartproxy_headers, **kwargs)
 
     def _mock_crawler(self, spider, settings=None):
 
@@ -84,7 +83,7 @@ def _assert_disabled(self, spider, settings=None):
 
     def _assert_enabled(self, spider,
                         settings=None,
-                        proxyurl='http://proxy.crawlera.com:8010',
+                        proxyurl='http://proxy.zyte.com:8011',
                         proxyauth=basic_auth_header('apikey', ''),
                         maxbans=400,
                         download_timeout=190):
@@ -96,7 +95,7 @@ def _assert_enabled(self, spider,
         self.assertEqual(req.meta.get('proxy'), proxyurl)
         self.assertEqual(req.meta.get('download_timeout'), download_timeout)
         self.assertEqual(req.headers.get('Proxy-Authorization'), proxyauth)
-        res = self._mock_crawlera_response(req.url)
+        res = self._mock_zyte_smartproxy_response(req.url)
         assert mw.process_response(req, res, spider) is res
 
         # disabled if 'dont_proxy=True' is set
@@ -106,16 +105,16 @@ def _assert_enabled(self, spider,
         self.assertEqual(req.meta.get('proxy'), None)
         self.assertEqual(req.meta.get('download_timeout'), None)
         self.assertEqual(req.headers.get('Proxy-Authorization'), None)
-        res = self._mock_crawlera_response(req.url)
+        res = self._mock_zyte_smartproxy_response(req.url)
         assert mw.process_response(req, res, spider) is res
         del req.meta['dont_proxy']
 
         if maxbans > 0:
             # assert ban count is reseted after a succesful response
-            res = self._mock_crawlera_response('http://ban.me', status=self.bancode)
+            res = self._mock_zyte_smartproxy_response('http://ban.me', status=self.bancode)
             assert mw.process_response(req, res, spider) is res
             self.assertEqual(crawler.engine.fake_spider_closed_result, None)
-            res = self._mock_crawlera_response('http://unban.me')
+            res = self._mock_zyte_smartproxy_response('http://unban.me')
             assert mw.process_response(req, res, spider) is res
             self.assertEqual(crawler.engine.fake_spider_closed_result, None)
             self.assertEqual(mw._bans[None], 0)
@@ -123,7 +122,7 @@ def _assert_enabled(self, spider,
         # check for not banning before maxbans for bancode
         for x in range(maxbans + 1):
             self.assertEqual(crawler.engine.fake_spider_closed_result, None)
-            res = self._mock_crawlera_response(
+            res = self._mock_zyte_smartproxy_response(
                 'http://ban.me/%d' % x,
                 status=self.bancode,
                 headers={'X-Crawlera-Error': 'banned'},
@@ -133,89 +132,89 @@ def _assert_enabled(self, spider,
         # max bans reached and close_spider called
         self.assertEqual(crawler.engine.fake_spider_closed_result, (spider, 'banned'))
 
-    def test_disabled_by_lack_of_crawlera_settings(self):
+    def test_disabled_by_lack_of_zyte_smartproxy_settings(self):
         self._assert_disabled(self.spider, settings={})
 
-    def test_spider_crawlera_enabled(self):
-        self.assertFalse(hasattr(self.spider, 'crawlera_enabled'))
+    def test_spider_zyte_smartproxy_enabled(self):
+        self.assertFalse(hasattr(self.spider, 'zyte_smartproxy_enabled'))
         self._assert_disabled(self.spider, self.settings)
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         self._assert_enabled(self.spider, self.settings)
-        self.spider.crawlera_enabled = False
+        self.spider.zyte_smartproxy_enabled = False
         self._assert_disabled(self.spider, self.settings)
 
     def test_enabled(self):
         self._assert_disabled(self.spider, self.settings)
-        self.settings['CRAWLERA_ENABLED'] = True
+        self.settings['ZYTE_SMARTPROXY_ENABLED'] = True
         self._assert_enabled(self.spider, self.settings)
 
-    def test_spider_crawlera_enabled_priority(self):
-        self.spider.crawlera_enabled = False
-        self.settings['CRAWLERA_ENABLED'] = True
+    def test_spider_zyte_smartproxy_enabled_priority(self):
+        self.spider.zyte_smartproxy_enabled = False
+        self.settings['ZYTE_SMARTPROXY_ENABLED'] = True
         self._assert_disabled(self.spider, self.settings)
 
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_ENABLED'] = False
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_ENABLED'] = False
         self._assert_enabled(self.spider, self.settings)
 
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_ENABLED'] = True
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_ENABLED'] = True
         self._assert_enabled(self.spider, self.settings)
 
-        self.spider.crawlera_enabled = False
-        self.settings['CRAWLERA_ENABLED'] = False
+        self.spider.zyte_smartproxy_enabled = False
+        self.settings['ZYTE_SMARTPROXY_ENABLED'] = False
         self._assert_disabled(self.spider, self.settings)
 
     def test_apikey(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_APIKEY'] = apikey = 'apikey'
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_APIKEY'] = apikey = 'apikey'
         proxyauth = basic_auth_header(apikey, '')
         self._assert_enabled(self.spider, self.settings, proxyauth=proxyauth)
 
-        self.spider.crawlera_apikey = apikey = 'notfromsettings'
+        self.spider.zyte_smartproxy_apikey = apikey = 'notfromsettings'
         proxyauth = basic_auth_header(apikey, '')
         self._assert_enabled(self.spider, self.settings, proxyauth=proxyauth)
 
     def test_proxyurl(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_URL'] = 'http://localhost:8010'
-        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010')
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8011'
+        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011')
 
     def test_proxyurl_no_protocol(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_URL'] = 'localhost:8010'
-        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010')
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_URL'] = 'localhost:8011'
+        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011')
 
     def test_proxyurl_https(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_URL'] = 'https://localhost:8010'
-        self._assert_enabled(self.spider, self.settings, proxyurl='https://localhost:8010')
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_URL'] = 'https://localhost:8011'
+        self._assert_enabled(self.spider, self.settings, proxyurl='https://localhost:8011')
 
     def test_proxyurl_including_noconnect(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_URL'] = 'http://localhost:8010?noconnect'
-        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010?noconnect')
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8011?noconnect'
+        self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011?noconnect')
 
     def test_maxbans(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_MAXBANS'] = maxbans = 0
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_MAXBANS'] = maxbans = 0
         self._assert_enabled(self.spider, self.settings, maxbans=maxbans)
-        self.settings['CRAWLERA_MAXBANS'] = maxbans = 100
+        self.settings['ZYTE_SMARTPROXY_MAXBANS'] = maxbans = 100
         self._assert_enabled(self.spider, self.settings, maxbans=maxbans)
         # Assert setting is coerced into correct type
-        self.settings['CRAWLERA_MAXBANS'] = '123'
+        self.settings['ZYTE_SMARTPROXY_MAXBANS'] = '123'
         self._assert_enabled(self.spider, self.settings, maxbans=123)
-        self.spider.crawlera_maxbans = 99
+        self.spider.zyte_smartproxy_maxbans = 99
         self._assert_enabled(self.spider, self.settings, maxbans=99)
 
     def test_download_timeout(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_DOWNLOAD_TIMEOUT'] = 60
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_DOWNLOAD_TIMEOUT'] = 60
         self._assert_enabled(self.spider, self.settings, download_timeout=60)
         # Assert setting is coerced into correct type
-        self.settings['CRAWLERA_DOWNLOAD_TIMEOUT'] = '42'
+        self.settings['ZYTE_SMARTPROXY_DOWNLOAD_TIMEOUT'] = '42'
         self._assert_enabled(self.spider, self.settings, download_timeout=42)
-        self.spider.crawlera_download_timeout = 120
+        self.spider.zyte_smartproxy_download_timeout = 120
         self._assert_enabled(self.spider, self.settings, download_timeout=120)
 
     def test_hooks(self):
@@ -235,13 +234,13 @@ def get_proxyauth(self, spider):
 
         # test is_enabled returns False
         enabled = False
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         self._assert_disabled(self.spider, self.settings)
         self.assertEqual(wascalled, ['is_enabled'])
 
         wascalled[:] = []  # reset
         enabled = True
-        self.spider.crawlera_enabled = False
+        self.spider.zyte_smartproxy_enabled = False
         self._assert_enabled(self.spider, self.settings, proxyauth=proxyauth)
         self.assertEqual(wascalled, ['is_enabled', 'get_proxyauth'])
 
@@ -251,7 +250,7 @@ def test_delay_adjustment(self):
         url = 'http://www.scrapytest.org'
         ban_url = 'http://ban.me'
 
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
 
         crawler = self._mock_crawler(self.spider, self.settings)
         # ignore spider delay by default
@@ -262,7 +261,7 @@ def test_delay_adjustment(self):
 
         # preserve original delay
         self.spider.download_delay = delay
-        self.spider.crawlera_preserve_delay = True
+        self.spider.zyte_smartproxy_preserve_delay = True
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
         self.assertEqual(self.spider.download_delay, delay)
@@ -273,7 +272,7 @@ def test_delay_adjustment(self):
         # ban without retry-after
         req = Request(url, meta={'download_slot': slot_key})
         headers = {'X-Crawlera-Error': 'banned'}
-        res = self._mock_crawlera_response(
+        res = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.bancode,
             headers=headers,
@@ -288,7 +287,7 @@ def test_delay_adjustment(self):
             'retry-after': str(retry_after),
             'X-Crawlera-Error': 'banned'
         }
-        res = self._mock_crawlera_response(
+        res = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.bancode,
             headers=headers,
@@ -298,46 +297,46 @@ def test_delay_adjustment(self):
         self.assertEqual(self.spider.download_delay, delay)
 
         # DNS cache should be cleared in case of errors
-        dnscache['proxy.crawlera.com'] = '1.1.1.1'
+        dnscache['proxy.zyte.com'] = '1.1.1.1'
 
-        res = self._mock_crawlera_response(url)
+        res = self._mock_zyte_smartproxy_response(url)
         mw.process_response(req, res, self.spider)
         self.assertEqual(slot.delay, delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertIn('proxy.crawlera.com', dnscache)
+        self.assertIn('proxy.zyte.com', dnscache)
 
         # server failures
         mw.process_exception(req, ConnectionRefusedError(), self.spider)
         self.assertEqual(slot.delay, mw.connection_refused_delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertNotIn('proxy.crawlera.com', dnscache)
+        self.assertNotIn('proxy.zyte.com', dnscache)
 
-        dnscache['proxy.crawlera.com'] = '1.1.1.1'
-        res = self._mock_crawlera_response(ban_url)
+        dnscache['proxy.zyte.com'] = '1.1.1.1'
+        res = self._mock_zyte_smartproxy_response(ban_url)
         mw.process_response(req, res, self.spider)
         self.assertEqual(slot.delay, delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertIn('proxy.crawlera.com', dnscache)
+        self.assertIn('proxy.zyte.com', dnscache)
 
         mw.process_exception(req, ConnectionRefusedError(), self.spider)
         self.assertEqual(slot.delay, mw.connection_refused_delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertNotIn('proxy.crawlera.com', dnscache)
+        self.assertNotIn('proxy.zyte.com', dnscache)
 
-        dnscache['proxy.crawlera.com'] = '1.1.1.1'
-        res = self._mock_crawlera_response(ban_url, status=self.bancode)
+        dnscache['proxy.zyte.com'] = '1.1.1.1'
+        res = self._mock_zyte_smartproxy_response(ban_url, status=self.bancode)
         mw.process_response(req, res, self.spider)
         self.assertEqual(slot.delay, delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertIn('proxy.crawlera.com', dnscache)
+        self.assertIn('proxy.zyte.com', dnscache)
 
         mw.process_exception(req, ConnectionDone(), self.spider)
         self.assertEqual(slot.delay, mw.connection_refused_delay)
         self.assertEqual(self.spider.download_delay, delay)
-        self.assertNotIn('proxy.crawlera.com', dnscache)
+        self.assertNotIn('proxy.zyte.com', dnscache)
 
-    def test_process_exception_outside_crawlera(self):
-        self.spider.crawlera_enabled = False
+    def test_process_exception_outside_zyte_smartproxy(self):
+        self.spider.zyte_smartproxy_enabled = False
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -347,7 +346,7 @@ def test_process_exception_outside_crawlera(self):
 
     def test_jobid_header(self):
         # test without the environment variable 'SCRAPY_JOB'
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -357,7 +356,7 @@ def test_jobid_header(self):
 
         # test with the environment variable 'SCRAPY_JOB'
         os.environ['SCRAPY_JOB'] = '2816'
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler1 = self._mock_crawler(self.spider, self.settings)
         mw1 = self.mwcls.from_crawler(crawler)
         mw1.open_spider(self.spider)
@@ -366,7 +365,7 @@ def test_jobid_header(self):
         self.assertEqual(req1.headers.get('X-Crawlera-Jobid'), b'2816')
 
     def test_stats(self):
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         spider = self.spider
         crawler = self._mock_crawler(spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
@@ -374,40 +373,40 @@ def test_stats(self):
 
         req = Request('http://www.scrapytest.org')
         assert mw.process_request(req, spider) is None
-        self.assertEqual(crawler.stats.get_value('crawlera/request'), 1)
-        self.assertEqual(crawler.stats.get_value('crawlera/request/method/GET'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/request'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/request/method/GET'), 1)
 
-        res = self._mock_crawlera_response(req.url)
+        res = self._mock_zyte_smartproxy_response(req.url)
         assert mw.process_response(req, res, spider) is res
-        self.assertEqual(crawler.stats.get_value('crawlera/response'), 1)
-        self.assertEqual(crawler.stats.get_value('crawlera/response/status/200'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response/status/200'), 1)
 
         req = Request('http://www.scrapytest.org/other', method='POST')
         assert mw.process_request(req, spider) is None
-        self.assertEqual(crawler.stats.get_value('crawlera/request'), 2)
-        self.assertEqual(crawler.stats.get_value('crawlera/request/method/POST'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/request'), 2)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/request/method/POST'), 1)
 
-        res = self._mock_crawlera_response(
+        res = self._mock_zyte_smartproxy_response(
             req.url,
             status=mw.ban_code,
             headers={'X-Crawlera-Error': 'somethingbad'}
         )
         assert mw.process_response(req, res, spider) is res
-        self.assertEqual(crawler.stats.get_value('crawlera/response'), 2)
-        self.assertEqual(crawler.stats.get_value('crawlera/response/status/{}'.format(mw.ban_code)), 1)
-        self.assertEqual(crawler.stats.get_value('crawlera/response/error/somethingbad'), 1)
-        res = self._mock_crawlera_response(
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response'), 2)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response/status/{}'.format(mw.ban_code)), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response/error/somethingbad'), 1)
+        res = self._mock_zyte_smartproxy_response(
             req.url,
             status=mw.ban_code,
             headers={'X-Crawlera-Error': 'banned'}
         )
         assert mw.process_response(req, res, spider) is res
-        self.assertEqual(crawler.stats.get_value('crawlera/response'), 3)
-        self.assertEqual(crawler.stats.get_value('crawlera/response/status/{}'.format(mw.ban_code)), 2)
-        self.assertEqual(crawler.stats.get_value('crawlera/response/banned'), 1)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response'), 3)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response/status/{}'.format(mw.ban_code)), 2)
+        self.assertEqual(crawler.stats.get_value('zyte_smartproxy/response/banned'), 1)
 
-    def _make_fake_request(self, spider, crawlera_enabled):
-        spider.crawlera_enabled = crawlera_enabled
+    def _make_fake_request(self, spider, zyte_smartproxy_enabled):
+        spider.zyte_smartproxy_enabled = zyte_smartproxy_enabled
         crawler = self._mock_crawler(spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(spider)
@@ -422,24 +421,24 @@ def _make_fake_request(self, spider, crawlera_enabled):
         return req
 
     def test_clean_headers_when_disabled(self):
-        req = self._make_fake_request(self.spider, crawlera_enabled=False)
+        req = self._make_fake_request(self.spider, zyte_smartproxy_enabled=False)
 
         self.assertNotIn(b'X-Crawlera-Debug', req.headers)
         self.assertNotIn(b'X-Crawlera-Profile', req.headers)
         self.assertIn(b'User-Agent', req.headers)
 
     def test_clean_headers_when_enabled(self):
-        req = self._make_fake_request(self.spider, crawlera_enabled=True)
+        req = self._make_fake_request(self.spider, zyte_smartproxy_enabled=True)
 
         self.assertIn(b'X-Crawlera-Debug', req.headers)
         self.assertIn(b'X-Crawlera-Profile', req.headers)
         self.assertIn(b'User-Agent', req.headers)
 
-    def test_crawlera_default_headers(self):
+    def test_zyte_smartproxy_default_headers(self):
         spider = self.spider
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
 
-        self.settings['CRAWLERA_DEFAULT_HEADERS'] = {
+        self.settings['ZYTE_SMARTPROXY_DEFAULT_HEADERS'] = {
             'X-Crawlera-Profile': 'desktop',
         }
         crawler = self._mock_crawler(spider, self.settings)
@@ -450,7 +449,7 @@ def test_crawlera_default_headers(self):
         self.assertEqual(req.headers['X-Crawlera-Profile'], b'desktop')
 
         # test ignore None headers
-        self.settings['CRAWLERA_DEFAULT_HEADERS'] = {
+        self.settings['ZYTE_SMARTPROXY_DEFAULT_HEADERS'] = {
             'X-Crawlera-Profile': None,
             'X-Crawlera-Cookies': 'disable',
         }
@@ -462,13 +461,13 @@ def test_crawlera_default_headers(self):
         self.assertEqual(req.headers['X-Crawlera-Cookies'], b'disable')
         self.assertNotIn('X-Crawlera-Profile', req.headers)
 
-    @patch('scrapy_crawlera.middleware.warnings')
-    @patch('scrapy_crawlera.middleware.logging')
-    def test_crawlera_default_headers_conflicting_headers(self, mock_logger, mock_warnings):
+    @patch('scrapy_zyte_smartproxy.middleware.warnings')
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
+    def test_zyte_smartproxy_default_headers_conflicting_headers(self, mock_logger, mock_warnings):
         spider = self.spider
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
 
-        self.settings['CRAWLERA_DEFAULT_HEADERS'] = {
+        self.settings['ZYTE_SMARTPROXY_DEFAULT_HEADERS'] = {
             'X-Crawlera-Profile': 'desktop',
         }
         crawler = self._mock_crawler(spider, self.settings)
@@ -480,17 +479,23 @@ def test_crawlera_default_headers_conflicting_headers(self, mock_logger, mock_wa
         assert mw.process_request(req, spider) is None
         self.assertEqual(req.headers['X-Crawlera-UA'], b'desktop')
         self.assertEqual(req.headers['X-Crawlera-Profile'], b'desktop')
-        mock_warnings.warn.assert_called_with(
-            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are conflictin"
-            "g on some of your requests. Please check https://doc.scrapinghub.c"
-            "om/crawlera.html for more information. You can set LOG_LEVEL=DEBUG"
-            " to see the urls with problems"
+        some_requests_warning = (
+            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are "
+            "conflicting on some of your requests. Please check "
+            "https://docs.zyte.com/smart-proxy-manager.html#request-headers "
+            "for more information. You can set LOG_LEVEL=DEBUG to see the "
+            "urls with problems."
+        )
+        mock_warnings.warn.assert_called_with(some_requests_warning)
+        other_request_warning = (
+            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are "
+            "conflicting on request http://www.scrapytest.org/other. "
+            "X-Crawlera-UA will be ignored. Please check "
+            "https://docs.zyte.com/smart-proxy-manager.html#request-headers "
+            "for more information"
         )
         mock_logger.debug.assert_called_with(
-            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are conflictin"
-            "g on request http://www.scrapytest.org/other. X-Crawlera-UA will b"
-            "e ignored. Please check https://doc.scrapinghub.com/crawlera.html "
-            "for more information",
+            other_request_warning,
             extra={'spider': spider}
         )
 
@@ -500,23 +505,15 @@ def test_crawlera_default_headers_conflicting_headers(self, mock_logger, mock_wa
         assert mw.process_request(req, spider) is None
         self.assertEqual(req.headers['X-Crawlera-UA'], b'desktop')
         self.assertEqual(req.headers['X-Crawlera-Profile'], b'desktop')
-        mock_warnings.warn.assert_called_with(
-            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are conflictin"
-            "g on some of your requests. Please check https://doc.scrapinghub.c"
-            "om/crawlera.html for more information. You can set LOG_LEVEL=DEBUG"
-            " to see the urls with problems"
-        )
+        mock_warnings.warn.assert_called_with(some_requests_warning)
         mock_logger.debug.assert_called_with(
-            "The headers ('X-Crawlera-Profile', 'X-Crawlera-UA') are conflictin"
-            "g on request http://www.scrapytest.org/other. X-Crawlera-UA will b"
-            "e ignored. Please check https://doc.scrapinghub.com/crawlera.html "
-            "for more information",
+            other_request_warning,
             extra={'spider': spider}
         )
 
     def test_dont_proxy_false_does_nothing(self):
         spider = self.spider
-        spider.crawlera_enabled = True
+        spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(spider)
@@ -526,11 +523,11 @@ def test_dont_proxy_false_does_nothing(self):
         self.assertIsNotNone(req.meta.get('proxy'))
 
     def test_is_banned(self):
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
-        req = self._make_fake_request(self.spider, crawlera_enabled=True)
+        req = self._make_fake_request(self.spider, zyte_smartproxy_enabled=True)
         res = Response(req.url, status=200)
         self.assertFalse(mw._is_banned(res))
         res = Response(req.url, status=503, headers={'X-Crawlera-Error': 'noslaves'})
@@ -550,10 +547,10 @@ def test_noslaves_delays(self, random_uniform_patch):
         backoff_step = 15
         default_delay = 0
 
-        self.settings['CRAWLERA_BACKOFF_STEP'] = backoff_step
-        self.settings['CRAWLERA_BACKOFF_MAX'] = max_delay
+        self.settings['ZYTE_SMARTPROXY_BACKOFF_STEP'] = backoff_step
+        self.settings['ZYTE_SMARTPROXY_BACKOFF_MAX'] = max_delay
 
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -563,7 +560,7 @@ def test_noslaves_delays(self, random_uniform_patch):
 
         noslaves_req = Request(url, meta={'download_slot': slot_key})
         headers = {'X-Crawlera-Error': 'noslaves'}
-        noslaves_res = self._mock_crawlera_response(
+        noslaves_res = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.bancode,
             headers=headers,
@@ -585,7 +582,7 @@ def test_noslaves_delays(self, random_uniform_patch):
         # other responses reset delay
         ban_req = Request(url, meta={'download_slot': slot_key})
         ban_headers = {'X-Crawlera-Error': 'banned'}
-        ban_res = self._mock_crawlera_response(
+        ban_res = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.bancode,
             headers=ban_headers,
@@ -597,7 +594,7 @@ def test_noslaves_delays(self, random_uniform_patch):
         self.assertEqual(slot.delay, backoff_step)
 
         good_req = Request(url, meta={'download_slot': slot_key})
-        good_res = self._mock_crawlera_response(
+        good_res = self._mock_zyte_smartproxy_response(
             url,
             status=200,
         )
@@ -616,10 +613,10 @@ def test_auth_error_retries(self, random_uniform_patch):
         backoff_step = 15
         default_delay = 0
 
-        self.settings['CRAWLERA_BACKOFF_STEP'] = backoff_step
-        self.settings['CRAWLERA_BACKOFF_MAX'] = max_delay
+        self.settings['ZYTE_SMARTPROXY_BACKOFF_STEP'] = backoff_step
+        self.settings['ZYTE_SMARTPROXY_BACKOFF_MAX'] = max_delay
 
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -630,7 +627,7 @@ def test_auth_error_retries(self, random_uniform_patch):
 
         auth_error_req = Request(url, meta={'download_slot': slot_key})
         auth_error_headers = {'X-Crawlera-Error': 'bad_proxy_auth'}
-        auth_error_response = self._mock_crawlera_response(
+        auth_error_response = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.auth_error_code,
             headers=auth_error_headers
@@ -639,67 +636,71 @@ def test_auth_error_retries(self, random_uniform_patch):
         # delays grow exponentially, retry times increase accordingly
         req = mw.process_response(auth_error_req, auth_error_response, self.spider)
         self.assertEqual(slot.delay, backoff_step)
-        retry_times = req.meta["crawlera_auth_retry_times"]
+        retry_times = req.meta["zyte_smartproxy_auth_retry_times"]
         self.assertEqual(retry_times, 1)
 
-        auth_error_req.meta["crawlera_auth_retry_times"] = retry_times
+        auth_error_req.meta["zyte_smartproxy_auth_retry_times"] = retry_times
         req = mw.process_response(auth_error_req, auth_error_response, self.spider)
         self.assertEqual(slot.delay, backoff_step * 2 ** 1)
-        retry_times = req.meta["crawlera_auth_retry_times"]
+        retry_times = req.meta["zyte_smartproxy_auth_retry_times"]
         self.assertEqual(retry_times, 2)
 
-        auth_error_req.meta["crawlera_auth_retry_times"] = retry_times
+        auth_error_req.meta["zyte_smartproxy_auth_retry_times"] = retry_times
         req = mw.process_response(auth_error_req, auth_error_response, self.spider)
         self.assertEqual(slot.delay, backoff_step * 2 ** 2)
-        retry_times = req.meta["crawlera_auth_retry_times"]
+        retry_times = req.meta["zyte_smartproxy_auth_retry_times"]
         self.assertEqual(retry_times, 3)
 
-        auth_error_req.meta["crawlera_auth_retry_times"] = retry_times
+        auth_error_req.meta["zyte_smartproxy_auth_retry_times"] = retry_times
         req = mw.process_response(auth_error_req, auth_error_response, self.spider)
         self.assertEqual(slot.delay, max_delay)
-        retry_times = req.meta["crawlera_auth_retry_times"]
+        retry_times = req.meta["zyte_smartproxy_auth_retry_times"]
         self.assertEqual(retry_times, 4)
 
         # Should return a response when after max number of retries
-        auth_error_req.meta["crawlera_auth_retry_times"] = retry_times
+        auth_error_req.meta["zyte_smartproxy_auth_retry_times"] = retry_times
         res = mw.process_response(auth_error_req, auth_error_response, self.spider)
         self.assertIsInstance(res, Response)
 
-        # non crawlera 407 is not retried
-        non_crawlera_407_response = self._mock_crawlera_response(
+        # A 407 response not coming directly from Zyte Smart Proxy Manager is
+        # not retried
+        non_zyte_smartproxy_407_response = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.auth_error_code,
         )
-        res = mw.process_response(auth_error_req, non_crawlera_407_response, self.spider)
+        res = mw.process_response(auth_error_req, non_zyte_smartproxy_407_response, self.spider)
         self.assertIsInstance(res, Response)
 
-    @patch('scrapy_crawlera.middleware.logging')
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
     def test_open_spider_logging(self, mock_logger):
         spider = self.spider
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(spider)
         expected_calls = [
             call(
-                "Using crawlera at %s (apikey: %s)" % (
+                "Using Zyte Smart Proxy Manager at %s (apikey: %s)" % (
                     self.mwcls.url, 'apikey'
                 ),
                 extra={'spider': spider},
             ),
             call(
-                "CrawleraMiddleware: disabling download delays on Scrapy side to optimize delays introduced by Crawlera. "
-                "To avoid this behaviour you can use the CRAWLERA_PRESERVE_DELAY setting but keep in mind that this may slow down the crawl significantly",
+                "ZyteSmartProxyMiddleware: disabling download delays in "
+                "Scrapy to optimize delays introduced by Zyte Smart Proxy "
+                "Manager. To avoid this behaviour you can use the "
+                "ZYTE_SMARTPROXY_PRESERVE_DELAY setting, but keep in mind "
+                "that this may slow down the crawl significantly",
                 extra={'spider': spider},
             ),
         ]
         assert mock_logger.info.call_args_list == expected_calls
 
-    def test_process_response_enables_crawlera(self):
+    def test_process_response_enables_zyte_smartproxy(self):
         url = "https://scrapy.org"
 
-        self.spider.crawlera_enabled = False
-        self.settings['CRAWLERA_FORCE_ENABLE_ON_HTTP_CODES'] = [403]
+        self.spider.zyte_smartproxy_enabled = False
+        self.settings['ZYTE_SMARTPROXY_FORCE_ENABLE_ON_HTTP_CODES'] = [403]
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -722,33 +723,34 @@ def test_process_response_enables_crawlera(self):
         self.assertEqual(mw.enabled, False)
         self.assertEqual(mw.enabled_for_domain["scrapy.org"], True)
         self.assertEqual(mw.crawler.stats.get_stats(), {
-            'crawlera/retries/should_have_been_enabled': 1,
+            'zyte_smartproxy/retries/should_have_been_enabled': 1,
         })
 
-        # Another regular response with bad code should be done on crawlera
-        # and not be retried
+        # Another regular response with bad code should be done on Zyte Smart
+        # Proxy Manager and not be retried
         res = Response(url, status=403)
         mw.process_request(req, self.spider)
         out = mw.process_response(req, res, self.spider)
         self.assertIsInstance(out, Response)
         self.assertEqual(mw.enabled, False)
         self.assertEqual(mw.enabled_for_domain["scrapy.org"], True)
-        self.assertEqual(mw.crawler.stats.get_value("crawlera/request"), 1)
+        self.assertEqual(mw.crawler.stats.get_value("zyte_smartproxy/request"), 1)
 
-        # A crawlera response with bad code should not be retried as well
+        # A Zyte Smart Proxy Manager response with bad code should not be
+        # retried as well
         mw.process_request(req, self.spider)
-        res = self._mock_crawlera_response(url, status=403)
+        res = self._mock_zyte_smartproxy_response(url, status=403)
         out = mw.process_response(req, res, self.spider)
         self.assertIsInstance(out, Response)
         self.assertEqual(mw.enabled, False)
         self.assertEqual(mw.enabled_for_domain["scrapy.org"], True)
-        self.assertEqual(mw.crawler.stats.get_value("crawlera/request"), 2)
+        self.assertEqual(mw.crawler.stats.get_value("zyte_smartproxy/request"), 2)
 
     def test_process_response_from_file_scheme(self):
         url = "file:///tmp/foobar.txt"
 
-        self.spider.crawlera_enabled = False
-        self.settings['CRAWLERA_FORCE_ENABLE_ON_HTTP_CODES'] = [403]
+        self.spider.zyte_smartproxy_enabled = False
+        self.settings['ZYTE_SMARTPROXY_FORCE_ENABLE_ON_HTTP_CODES'] = [403]
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.enabled_for_domain = {}
@@ -765,9 +767,9 @@ def test_process_response_from_file_scheme(self):
         self.assertEqual(mw.crawler.stats.get_stats(), {})
         self.assertEqual(out.status, 200)
 
-    @patch('scrapy_crawlera.middleware.logging')
-    def test_apikey_warning_crawlera_disabled(self, mock_logger):
-        self.spider.crawlera_enabled = False
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
+    def test_apikey_warning_zyte_smartproxy_disabled(self, mock_logger):
+        self.spider.zyte_smartproxy_enabled = False
         settings = {}
         crawler = self._mock_crawler(self.spider, settings)
         mw = self.mwcls.from_crawler(crawler)
@@ -775,38 +777,38 @@ def test_apikey_warning_crawlera_disabled(self, mock_logger):
         self.assertFalse(mw.enabled)
         mock_logger.warning.assert_not_called()
 
-    @patch('scrapy_crawlera.middleware.logging')
-    def test_no_apikey_warning_crawlera_enabled(self, mock_logger):
-        self.spider.crawlera_enabled = True
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
+    def test_no_apikey_warning_zyte_smartproxy_enabled(self, mock_logger):
+        self.spider.zyte_smartproxy_enabled = True
         settings = {}
         crawler = self._mock_crawler(self.spider, settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
         self.assertTrue(mw.enabled)
         mock_logger.warning.assert_called_with(
-            "Crawlera can't be used without a APIKEY",
+            "Zyte Smart Proxy Manager cannot be used without an API key",
             extra={'spider': self.spider}
         )
 
-    @patch('scrapy_crawlera.middleware.logging')
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
     def test_no_apikey_warning_force_enable(self, mock_logger):
-        self.spider.crawlera_enabled = False
-        settings = {'CRAWLERA_FORCE_ENABLE_ON_HTTP_CODES': [403]}
+        self.spider.zyte_smartproxy_enabled = False
+        settings = {'ZYTE_SMARTPROXY_FORCE_ENABLE_ON_HTTP_CODES': [403]}
         crawler = self._mock_crawler(self.spider, settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
         self.assertFalse(mw.enabled)
         mock_logger.warning.assert_called_with(
-            "Crawlera can't be used without a APIKEY",
+            "Zyte Smart Proxy Manager cannot be used without an API key",
             extra={'spider': self.spider}
         )
 
-    @patch('scrapy_crawlera.middleware.logging')
+    @patch('scrapy_zyte_smartproxy.middleware.logging')
     def test_apikey_warning_force_enable(self, mock_logger):
-        self.spider.crawlera_enabled = False
+        self.spider.zyte_smartproxy_enabled = False
         settings = {
-            'CRAWLERA_FORCE_ENABLE_ON_HTTP_CODES': [403],
-            'CRAWLERA_APIKEY': 'apikey'
+            'ZYTE_SMARTPROXY_FORCE_ENABLE_ON_HTTP_CODES': [403],
+            'ZYTE_SMARTPROXY_APIKEY': 'apikey'
         }
         crawler = self._mock_crawler(self.spider, settings)
         mw = self.mwcls.from_crawler(crawler)
@@ -858,7 +860,7 @@ def test_no_slot(self):
         url = 'http://www.scrapytest.org'
         ban_url = 'http://ban.me'
 
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -868,7 +870,7 @@ def test_no_slot(self):
                                meta={'download_slot': 'www.scrapytest.org'})
 
         headers = {'X-Crawlera-Error': 'noslaves'}
-        noslaves_res = self._mock_crawlera_response(
+        noslaves_res = self._mock_zyte_smartproxy_response(
             ban_url,
             status=self.bancode,
             headers=headers,
@@ -879,8 +881,8 @@ def test_no_slot(self):
 
 
     def test_settings_dict(self):
-        self.spider.crawlera_enabled = True
-        self.settings['CRAWLERA_DEFAULT_HEADERS'] = {
+        self.spider.zyte_smartproxy_enabled = True
+        self.settings['ZYTE_SMARTPROXY_DEFAULT_HEADERS'] = {
             'X-Crawlera-Profile': 'desktop',
         }
         crawler = self._mock_crawler(self.spider, self.settings)
@@ -897,7 +899,7 @@ def test_settings_dict(self):
         self.assertEqual(req.headers['X-Crawlera-Profile'], b'desktop')
 
     def test_client_header(self):
-        self.spider.crawlera_enabled = True
+        self.spider.zyte_smartproxy_enabled = True
         crawler = self._mock_crawler(self.spider, self.settings)
         mw = self.mwcls.from_crawler(crawler)
         mw.open_spider(self.spider)
@@ -905,5 +907,5 @@ def test_client_header(self):
         self.assertEqual(mw.process_request(req, self.spider), None)
         self.assertEqual(
             req.headers.get('X-Crawlera-Client').decode('utf-8'),
-            'scrapy-crawlera/%s' % __version__
+            'scrapy-zyte-smartproxy/%s' % __version__
         )