- The WordPress Staging test environment set up manually for the administrator or developer is accessible by consulting the address domainetype.fr/test-stage/wp-admin.
You can alsoent decide if a subdomain like "test-stage.domainetype.fr" is needed. In this case, the subdomain must refer to the new directory created .
Set up a WordPress test environment using a plugin
As we mentioned before, there are thousands of plugins for WordPress , some allowing the duplication or cloning of a website. The " WP Staging - DB & File Duplicator & Migration " plugin is particularly popular and allows the process to be largely automated. The free version of the plugin already offers a perfect duplication of the existing WordPress installation in an etest environment. However, if you want more functionality, for example to efficiently transpose changes into the published website, clone them to other domains or to other databases, you will need to purchase the paid pro version. At the time of publication of this guide, the plugin has been tested up to version 5.5.1. of WordPress. It is available in German, English and Spanish.
Once the copy process is complete, you will find in the plugin window located in the WordPress back-end a link to the staging page which will allow you to log in.
About two minutes1.5 s are required to clone an entire full test site (no store). After this process, a link is displayed to the user. This allows him to log in with his usual administrator data . In the free version of the plugin used here, all existing database tables are recreated with another table prefix in the same database . When working in WordPress Staging, only these new tables are changed , the actual WordPress installation database tables are not affected. This method has the advantage of only requesting a single database and therefore does not require a upgrade of the web tariffs.
Protect the WordPress test environment
To protect the WordPress test environment against unauthorized access , you can protect directories in the administrator area of your provider, such as the directory for WordPress Staging. At HFrance, you will find this space under "Hosting" in the "Web space" section. Here you will find the menu entry " Protection of directories " by clicking on the gear. The configuration is easy to do. Write down the password there in a safe place!
The .htaccess file located in the root directory of the WordPress test environment offers another possible protection. There, open the locally saved .htaccess file with an editor and add the following lines:
AuthType Basic AuthName " Pagedetest"# Saving the password file with an absolute path to the server # AuthUserFile / homepages / 99 / d1234567890 / htdocs / test-stage /.htpasswd Require valid-user
Different online generators are available to create the .htpasswd file . an encryption process, they generate character sequences such as:
Pagedetest: $ 1 $ xyUaMnyQ $ AbkfDta7T876ObPNYaoj1.
This line is also saved as .htpasswd with a text editor. If the editor oftext assigns a file extension, it will need to be changed manually after uploading to the root directory of the WordPress test environment. When viewing the WordPress test environment , you are now asked to enter your username and password .
Local WordPress test environment
To develop / improve a WordPress site, it is also possible to use a local staging . In this way, the development process remains protected against possible attacks by third parties since there is no connection to the Internet . To be able to work in this way, the corresponding computer must work as a server and needs specific server software for this purpose. Powhy? The language of PHP, for example, cannot be interpreted by a browser. For that, it needs the services of a server.
Among the software allowing to create such a local environment, we find MAMP or XAMPP , the latter being open source and running on Linux, Windows and MacOS. This software was developed by “Apache Friends”, a non-profit project that supports the Apache web server and hosts the XAMPP project. This type of WordPress staging is mainly used by professional developer teams.
Advantages and disadvantages both variantes: local vs online WordPress staging
To conclude, here is a comparison of the pros and cons of the two variants of WordPress staging.
| || Local WordPress test environment || Online WordPress test environment |
| - no need for internet access - development and error checking without endangering the published website - secure protection against access attempts || - automated and fast creation with the plugin - modifications transposable on the Inte siternet published with the corresponding plugin |
| - requires server software to be installed locally - requires manual changes to published website || - vulnerability of test environment and real website - paid plugin needed to work comfortably - may incur additional hosting costs for additional database |
WordPress staging is an elegant and secure way to develop and find errors a Word websitePress. There are obvious convenience benefits to using a plugin. If you personally develop plugins or WordPress themes , a WordPress test environment is essential.