84% wizhi-submenus

Code Review | Wizhi Submenus

WordPress plugin Wizhi Submenus scored84%from 54 tests.

About plugin

  • Plugin page: wizhi-submenus
  • Plugin version: 3.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.5
  • WordPress version: 6.3.1
  • First release: Jul 26, 2014
  • Latest release: Aug 1, 2020
  • Number of updates: 30
  • Update frequency: every 73.3 days
  • Top authors: iwillhappy1314 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,552 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Wizhi Submenus
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.84 ▼5.58
Dashboard /wp-admin3.33 ▲0.0346.20 ▼5.01
Posts /wp-admin/edit.php3.38 ▲0.0342.42 ▼2.88
Add New Post /wp-admin/post-new.php5.91 ▲0.0378.17 ▼15.71
Media Library /wp-admin/upload.php3.25 ▲0.0335.10 ▼2.25

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_wizhi_submenus
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wizhi Submenus
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.391.79 ▼0.1043.64 ▲4.23
Dashboard /wp-admin2,189 ▲125.55 ▼0.0384.56 ▼2.3739.92 ▲0.41
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0238.11 ▲1.0732.12 ▼2.50
Add New Post /wp-admin/post-new.php1,537 ▲218.13 ▼0.21610.36 ▼49.1672.40 ▲2.50
Media Library /wp-admin/upload.php1,397 ▼34.22 ▼0.02101.39 ▼3.9442.66 ▼5.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_wizhi_submenus
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wizhi-submenus/trunk/wizhi-submenus.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wizhi-submenus/wizhi-submenus.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: ""
  • Plugin Name: You should set the name of your plugin on the first line ( === wizhi-submenus === )
You can look at the official readme.txt

wizhi-submenus/wizhi-submenus.php Passed 13 tests

The principal PHP file in "Wizhi Submenus" v. 3.3.5 is loaded by WordPress automatically on each request
74 characters long description:
Display page`s subpage list and taxonomy terms list belongs to a post type

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
Everything looks great! No dangerous files found in this plugin157 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP14029124
YAML20032
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected