84% dynamic-hostname

Code Review | Dynamic Hostname

WordPress plugin Dynamic Hostname scored84%from 54 tests.

About plugin

  • Plugin page: dynamic-hostname
  • Plugin version: 0.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2
  • WordPress version: 6.3.1
  • First release: Mar 18, 2014
  • Latest release: Apr 26, 2015
  • Number of updates: 11
  • Update frequency: every 36.7 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /25,092 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.67ms] Passed 4 tests

An overview of server-side resources used by Dynamic Hostname
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.91 ▲3.27
Dashboard /wp-admin3.33 ▲0.0346.82 ▲2.31
Posts /wp-admin/edit.php3.38 ▲0.0346.65 ▲2.10
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.44 ▼9.40
Media Library /wp-admin/upload.php3.25 ▲0.0230.92 ▼1.67

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Hostname
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.27 ▼1.041.83 ▲0.1341.52 ▼3.46
Dashboard /wp-admin2,210 ▲225.79 ▼0.07106.44 ▲8.1036.00 ▼7.51
Posts /wp-admin/edit.php2,095 ▲62.05 ▲0.0539.24 ▲4.7037.03 ▲0.09
Add New Post /wp-admin/post-new.php1,537 ▲1822.97 ▼0.13637.71 ▼27.6256.65 ▲6.60
Media Library /wp-admin/upload.php1,389 ▲14.21 ▲0.0094.97 ▼4.7942.20 ▼4.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/dynamic-hostname/dynamic-hostname.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: site_url, hostname, vagrant cloud, wp_home

dynamic-hostname/dynamic-hostname.php Passed 13 tests

Analyzing the main PHP file in "Dynamic Hostname" version 0.4.2
45 characters long description:
Set hostname dynamically for the development.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin70 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1181170

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected