84% wp-rest-api-v2-menus

Code Review | WP-REST-API V2 Menus

WordPress plugin WP-REST-API V2 Menus scored84%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-v2-menus
  • Plugin version: 0.12.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Nov 9, 2022
  • Number of updates: 46
  • Update frequency: every 54.0 days
  • Top authors: ClaudioLaBarbera (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

5,000+ active /125,438 total downloads

Benchmarks

Plugin footprint 83% from 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.02MB] [CPU: ▼8.51ms] Passed 4 tests

A check of server-side resources used by WP-REST-API V2 Menus
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0339.27 ▼3.30
Dashboard /wp-admin3.34 ▼0.0150.78 ▼14.05
Posts /wp-admin/edit.php3.39 ▲0.0352.05 ▲0.86
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.27 ▼14.57
Media Library /wp-admin/upload.php3.26 ▲0.0337.22 ▼2.11

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

WP-REST-API V2 Menus: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.41 ▲0.022.29 ▲0.4944.13 ▲3.52
Dashboard /wp-admin2,195 ▲245.64 ▼0.0292.48 ▼1.0941.97 ▼1.67
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0442.77 ▲2.6136.66 ▼0.88
Add New Post /wp-admin/post-new.php1,540 ▲818.14 ▼4.85633.59 ▼66.9855.72 ▼5.74
Media Library /wp-admin/upload.php1,403 ▲34.21 ▲0.01103.05 ▼7.0445.53 ▼2.73

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-api-v2-menus/wp-rest-api-v2-menus.php:264

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-rest-api-v2-menus === )
You can take inspiration from this readme.txt

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

The principal PHP file in "WP-REST-API V2 Menus" v. 0.12.1 is loaded by WordPress automatically on each request
40 characters long description:
Adding menus endpoints on WP REST API v2

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin194 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14267179
Markdown111015

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
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
PNG images were not found in this plugin