89% host-changer

Code Review | WPMultiHost - 1 WordPress Site with Multiple Domains

WordPress plugin WPMultiHost - 1 WordPress Site with Multiple Domains scored 89% from 54 tests.

About plugin

  • Plugin page: host-changer
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 5.8.1
  • First release: May 7, 2021
  • Latest release: May 14, 2021
  • Number of updates: 9
  • Update frequency: every 0.9 days
  • Top authors: iqonicdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 286 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼149.49ms] Passed 4 tests

This is a short check of server-side resources used by WPMultiHost - 1 WordPress Site with Multiple Domains
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1336.59 ▲11.33
Dashboard /wp-admin3.08 ▲0.0241.83 ▼20.07
Posts /wp-admin/edit.php3.13 ▲0.0249.23 ▼11.91
Add New Post /wp-admin/post-new.php5.44 ▲0.0096.86 ▼563.08
Media Library /wp-admin/upload.php3.02 ▲0.0233.04 ▼2.88
WPMultiHost /wp-admin/tools.php?page=host-changer2.9923.69

Server storage [IO: ▲0.30MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 1 new option
New WordPress options
wphc_setting_option

Browser metrics Passed 4 tests

An overview of browser requirements for WPMultiHost - 1 WordPress Site with Multiple Domains
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,717 ▲12116.09 ▲0.2710.28 ▼0.0847.92 ▼3.57
Dashboard /wp-admin2,982 ▲636.30 ▲0.31143.32 ▼30.48122.61 ▼15.92
Posts /wp-admin/edit.php2,751 ▲122.75 ▲0.0669.99 ▼15.7695.05 ▼14.51
Add New Post /wp-admin/post-new.php1,614 ▲11418.98 ▲0.47360.78 ▼18.79110.61 ▼10.92
Media Library /wp-admin/upload.php1,822 ▲155.17 ▲0.10158.17 ▼0.82126.55 ▲3.09
WPMultiHost /wp-admin/tools.php?page=host-changer1,1542.5166.4346.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/host-changer/app/base/WPHCDeactivate.php
    • > /wp-content/plugins/host-changer/app/filters/WPHCFilterHook.php
    • > /wp-content/plugins/host-changer/app/base/WPHCBase.php
    • > /wp-content/plugins/host-changer/app/base/WPHCActivate.php
    • > /wp-content/plugins/host-changer/host-changer.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/host-changer/assets/admin/setting_fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/host-changer/assets/admin/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: changer, multihost, multiplehosts, wordpress, host switcher...

host-changer/host-changer.php Passed 13 tests

"WPMultiHost - 1 WordPress Site with Multiple Domains" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
91 characters long description:
WPMultiHost is an plugin which helps to access same WordPress site from different domains.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin996 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP18295346911
JavaScript281249
JSON20023
CSS20613

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.50
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods63
▷ Static methods1523.81%
▷ Public methods6196.83%
▷ Protected methods00.00%
▷ Private methods23.17%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected