99% hostvn-admin-optimize

Code Review | Hostvn Admin Optimize

WordPress plugin Hostvn Admin Optimize scored 99% from 54 tests.

About plugin

  • Plugin page: hostvn-admin-opti...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5.6
  • WordPress version: 5.8.1
  • First release: Nov 4, 2020
  • Latest release: Feb 8, 2021
  • Number of updates: 43
  • Update frequency: every 2.2 days
  • Top authors: hostvn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 799 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
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼146.18ms] Passed 4 tests

Analyzing server-side resources used by Hostvn Admin Optimize
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.2340.05 ▲12.17
Dashboard /wp-admin3.13 ▲0.0840.69 ▼11.94
Posts /wp-admin/edit.php3.31 ▲0.2051.29 ▼3.82
Add New Post /wp-admin/post-new.php5.56 ▲0.13108.62 ▼555.76
Media Library /wp-admin/upload.php3.20 ▲0.1938.71 ▼13.19
Hostvn AO Settings /wp-admin/options-general.php?page=hvn-admin-optimize-settings3.1736.94

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 55 new files
Database: no new tables, 1 new option
New WordPress options
hostvn_admin_optimize

Browser metrics Passed 4 tests

Hostvn Admin Optimize: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,341 ▼1,27115.44 ▼0.1111.62 ▲0.3051.09 ▼5.33
Dashboard /wp-admin1,578 ▼1,3585.55 ▼0.45126.08 ▼67.1788.03 ▼39.42
Posts /wp-admin/edit.php2,698 ▼412.71 ▲0.0070.06 ▼4.7386.16 ▼12.71
Add New Post /wp-admin/post-new.php1,649 ▼3417.75 ▼0.67393.24 ▼70.22120.31 ▼4.90
Media Library /wp-admin/upload.php1,766 ▼415.01 ▲0.00164.72 ▼11.92124.83 ▼15.66
Hostvn AO Settings /wp-admin/options-general.php?page=hvn-admin-optimize-settings1,1202.0861.2478.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: You can look at the official readme.txt

hostvn-admin-optimize/hostvn-ao.php 92% from 13 tests

The primary PHP file in "Hostvn Admin Optimize" version 1.0.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hostvn-admin-optimize.php" instead of "hostvn-ao.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected5,559 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,672
PHP232783562,273
CSS1640357
PO File2109109254
JavaScript3053

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity19.65
▷ Minimum class complexity1.00
▷ Maximum class complexity180.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods144
▷ Static methods21.39%
▷ Public methods13795.14%
▷ Protected methods00.00%
▷ Private methods74.86%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants6
▷ Global constants6100.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/zalo-min-150x150.png6.99KB3.25KB▼ 53.53%
assets/img/messenger.png20.22KB6.58KB▼ 67.47%