84% rest-api-enabler

Code Review | REST API Enabler

WordPress plugin REST API Enabler scored84%from 54 tests.

About plugin

  • Plugin page: rest-api-enabler
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Oct 9, 2015
  • Latest release: Jul 4, 2016
  • Number of updates: 13
  • Update frequency: every 20.9 days
  • Top authors: McGuive7 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /8,877 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼2.11ms] Passed 4 tests

Server-side resources used by REST API Enabler
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.08 ▼3.74
Dashboard /wp-admin3.44 ▲0.1350.40 ▲1.44
Posts /wp-admin/edit.php3.55 ▲0.1950.77 ▲1.46
Add New Post /wp-admin/post-new.php6.04 ▲0.1591.29 ▼5.66
Media Library /wp-admin/upload.php3.36 ▲0.1335.89 ▼0.48
REST API Enabler /wp-admin/options-general.php?page=rest-api-enabler3.3334.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for REST API Enabler
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.24 ▼0.111.85 ▲0.0340.88 ▼5.50
Dashboard /wp-admin2,194 ▲145.55 ▼0.1393.01 ▼6.8240.87 ▼1.59
Posts /wp-admin/edit.php2,108 ▲52.03 ▲0.0636.14 ▼5.1634.20 ▼3.82
Add New Post /wp-admin/post-new.php1,535 ▲922.83 ▼0.76634.34 ▼58.6444.87 ▼15.16
Media Library /wp-admin/upload.php1,408 ▲174.30 ▲0.0995.43 ▼6.7646.05 ▼2.96
REST API Enabler /wp-admin/options-general.php?page=rest-api-enabler1,1082.1225.5532.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rest-api-enabler/public/partials/rest-api-enabler-public-display.php
    • > /wp-content/plugins/rest-api-enabler/admin/partials/rest-api-enabler-admin-display.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: type, rest, taxonomy, category, custom...

rest-api-enabler/rest-api-enabler.php Passed 13 tests

The principal PHP file in "REST API Enabler" v. 1.1.0 is loaded by WordPress automatically on each request
91 characters long description:
Enable the WP REST API to work with custom post types, custom fields, and custom endpoints.

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
There were no executable files found in this plugin654 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12274829534
CSS2161171
JavaScript2253449

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.86
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods59.62%
▷ Public methods4280.77%
▷ Protected methods00.00%
▷ Private methods1019.23%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected