84% wp-rest-api-menus

Code Review | WP-REST-API Menus

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

About plugin

  • Plugin page: wp-rest-api-menus
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 19, 2018
  • Latest release: Mar 27, 2018
  • Number of updates: 6
  • Update frequency: every 1.5 days
  • Top authors: jcdev518 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,512 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.67MB] [CPU: ▼16.77ms] Passed 4 tests

A check of server-side resources used by WP-REST-API Menus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.67 ▼1.84
Dashboard /wp-admin3.32 ▲0.0143.90 ▼6.85
Posts /wp-admin/edit.php3.37 ▲0.0147.92 ▲2.06
Add New Post /wp-admin/post-new.php3.20 ▼2.6932.84 ▼54.31
Media Library /wp-admin/upload.php3.24 ▲0.0131.75 ▼4.07

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-REST-API Menus
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.58 ▼0.812.05 ▲0.2944.53 ▼5.46
Dashboard /wp-admin2,200 ▲155.85 ▼0.11104.58 ▲1.1538.56 ▼6.76
Posts /wp-admin/edit.php2,089 ▲32.02 ▼0.0238.92 ▲0.5436.03 ▼0.55
Add New Post /wp-admin/post-new.php1,542 ▲2218.54 ▼4.61640.86 ▼55.9258.07 ▲1.53
Media Library /wp-admin/upload.php1,388 ▲34.16 ▼0.0694.95 ▼6.3244.42 ▼2.40

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/wp-rest-api-menus/includes/wp-rest-api-menus-controller.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The entry point to "WP-REST-API Menus" version 1.0 is a PHP file that has certain tags in its header comment area
65 characters long description:
Adds menu endpoints to WP REST API, which is now part of core WP.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected65 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2175654
Markdown16011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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