90% sar-disable-rest-api

Code Review | Disable REST API for Real

WordPress plugin Disable REST API for Real scored90%from 54 tests.

About plugin

  • Plugin page: sar-disable-rest-api
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.3
  • WordPress version: 6.3.1
  • First release: Dec 17, 2015
  • Latest release: Nov 15, 2019
  • Number of updates: 11
  • Update frequency: every 129.9 days
  • Top authors: samuelaguilera (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /5,012 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.33MB] [CPU: ▼14.75ms] Passed 4 tests

A check of server-side resources used by Disable REST API for Real
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.94 ▲2.50
Dashboard /wp-admin3.31 ▼0.0343.35 ▼15.68
Posts /wp-admin/edit.php3.37 ▲0.0144.93 ▼2.67
Add New Post /wp-admin/post-new.php4.59 ▼1.3062.36 ▼39.84
Media Library /wp-admin/upload.php3.24 ▲0.0134.36 ▼0.81

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

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

Browser metrics Passed 4 tests

Disable REST API for Real: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,788 ▲2714.28 ▼0.091.69 ▼0.2344.08 ▲1.35
Dashboard /wp-admin2,195 ▲215.64 ▼0.0290.33 ▼6.9739.04 ▼5.64
Posts /wp-admin/edit.php2,097 ▼31.95 ▼0.0240.47 ▼2.0536.44 ▼0.95
Add New Post /wp-admin/post-new.php1,268 ▼26315.33 ▼7.75318.90 ▼340.0133.81 ▼26.33
Media Library /wp-admin/upload.php1,397 ▼34.23 ▲0.0799.55 ▼8.7046.11 ▼1.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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
Good news, no errors were detected

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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: rest, rest api, api, wp-json, json

sar-disable-rest-api/sar-disable-rest-api.php Passed 13 tests

"Disable REST API for Real" version 2.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
94 characters long description:
Really prevents the REST API from handling requests (default) or require user to be logged in.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected65 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1254365

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
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