90% wp-api-menus

Code Review | WP API Menus

WordPress plugin WP API Menus scored90%from 54 tests.

About plugin

  • Plugin page: wp-api-menus
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.5.0
  • WordPress version: 6.3.1
  • First release: Jan 18, 2015
  • Latest release: Aug 18, 2020
  • Number of updates: 25
  • Update frequency: every 81.6 days
  • Top authors: nekojira (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /89,200 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.24ms] Passed 4 tests

An overview of server-side resources used by WP API Menus
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0638.25 ▼9.59
Dashboard /wp-admin3.37 ▲0.0653.31 ▲3.51
Posts /wp-admin/edit.php3.49 ▲0.1350.41 ▲4.88
Add New Post /wp-admin/post-new.php5.96 ▲0.0796.38 ▲5.30
Media Library /wp-admin/upload.php3.29 ▲0.0638.49 ▲2.14

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP API Menus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.45 ▲0.051.66 ▼0.3338.84 ▼7.36
Dashboard /wp-admin2,203 ▲125.83 ▼0.0693.62 ▼18.0437.48 ▼5.04
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0441.00 ▲4.7735.83 ▲1.96
Add New Post /wp-admin/post-new.php1,514 ▼017.58 ▼0.08654.87 ▼39.8960.17 ▲7.89
Media Library /wp-admin/upload.php1,391 ▲64.17 ▼0.0894.58 ▼3.5343.18 ▲1.10

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: api, menu-routes, wp-rest-api, json, rest...

wp-api-menus/wp-api-menus.php Passed 13 tests

The principal PHP file in "WP API Menus" v. 1.3.2 is loaded by WordPress automatically on each request
42 characters long description:
Extends WP API with WordPress menu routes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin389 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4183207389

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity24.00
▷ Minimum class complexity23.00
▷ Maximum class complexity25.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods633.33%
▷ Public methods1688.89%
▷ Protected methods00.00%
▷ Private methods211.11%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin