90% only-rest-api

Code Review | Only REST API

WordPress plugin Only REST API scored90%from 54 tests.

About plugin

  • Plugin page: only-rest-api
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: Dec 7, 2015
  • Number of updates: 8
  • Update frequency: every 9.3 days
  • Top authors: Braad (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,628 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.12MB] [CPU: ▼9.55ms] Passed 4 tests

Analyzing server-side resources used by Only REST API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▼0.6025.88 ▼14.31
Dashboard /wp-admin3.34 ▲0.0449.51 ▼5.76
Posts /wp-admin/edit.php3.39 ▲0.0345.10 ▼4.99
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.87 ▼13.13
Media Library /wp-admin/upload.php3.26 ▲0.0334.61 ▼3.40
Only REST API /wp-admin/options-general.php?page=only-rest-api3.2326.48

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Only REST API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,433 ▼32814.31 ▼0.050.51 ▼1.140.34 ▼40.26
Dashboard /wp-admin2,202 ▲225.62 ▲0.0298.72 ▲3.6944.03 ▲4.52
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0635.89 ▼1.7333.59 ▼4.50
Add New Post /wp-admin/post-new.php1,529 ▲123.12 ▲0.12650.01 ▼53.8965.20 ▲7.76
Media Library /wp-admin/upload.php1,398 ▼24.23 ▲0.02100.16 ▼9.0646.20 ▲1.41
Only REST API /wp-admin/options-general.php?page=only-rest-api8161.9924.5531.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: api, rest, json, only

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

The entry point to "Only REST API" version 1.0.0 is a PHP file that has certain tags in its header comment area
64 characters long description:
Redirects all front end, non-REST API requests to a single page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected285 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP156126153
Markdown142087
JavaScript14325
JSON10020

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 images were found in this plugin