84% wp-allow-hosts

Code Review | WP Allowed Hosts

WordPress plugin WP Allowed Hosts scored84%from 54 tests.

About plugin

  • Plugin page: wp-allow-hosts
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-5.7.0
  • WordPress version: 6.3.1
  • First release: Dec 3, 2013
  • Latest release: Mar 3, 2021
  • Number of updates: 10
  • Update frequency: every 265.6 days
  • Top authors: ucfwebcom (80%)DFieldFL (30%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,167 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.97ms] Passed 4 tests

A check of server-side resources used by WP Allowed Hosts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.52 ▼11.08
Dashboard /wp-admin3.34 ▲0.0444.06 ▼8.33
Posts /wp-admin/edit.php3.39 ▲0.0445.63 ▼1.32
Add New Post /wp-admin/post-new.php5.92 ▲0.0492.27 ▼7.16
Media Library /wp-admin/upload.php3.27 ▲0.0434.15 ▼0.79
Allowed Hosts /wp-admin/options-general.php?page=ah-settings-page3.2329.77

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 8 new options
New WordPress options
allowed-hosts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
allowed-hosts-regex

Browser metrics Passed 4 tests

A check of browser resources used by WP Allowed Hosts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.28 ▼1.371.99 ▲0.2243.31 ▲5.29
Dashboard /wp-admin2,210 ▲195.88 ▲1.0098.00 ▼17.7640.51 ▼3.24
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0637.11 ▼0.0931.69 ▼3.34
Add New Post /wp-admin/post-new.php1,517 ▼2517.72 ▼0.65610.77 ▼42.7746.20 ▼17.14
Media Library /wp-admin/upload.php1,395 ▲74.14 ▼0.1095.65 ▼9.5241.10 ▼4.17
Allowed Hosts /wp-admin/options-general.php?page=ah-settings-page7992.0523.5126.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-allow-hosts/allowed-hosts.php on line 18
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-allow-hosts/allowed-hosts.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-allow-hosts/allowed-hosts.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: allow, multisite, filter, hosts, host

wp-allow-hosts/allowed-hosts.php 92% from 13 tests

This is the main PHP file of "WP Allowed Hosts" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-allow-hosts.php" instead of "allowed-hosts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin165 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12314162
Markdown1103

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity17.00
▷ Minimum class complexity16.00
▷ Maximum class complexity18.00
Average method complexity5.14
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin