90% disable-wp-rest-api

Code Review | Disable WP REST API

WordPress plugin Disable WP REST API scored90%from 54 tests.

About plugin

  • Plugin page: disable-wp-rest-api
  • Plugin version: 2.6.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jun 6, 2018
  • Latest release: Oct 25, 2023
  • Number of updates: 25
  • Update frequency: every 79.2 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

10,000+ active /183,040 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.84ms] Passed 4 tests

A check of server-side resources used by Disable WP REST API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0132.64 ▼2.66
Dashboard /wp-admin3.32 ▼0.0344.51 ▼14.81
Posts /wp-admin/edit.php3.37 ▲0.0143.00 ▼5.48
Add New Post /wp-admin/post-new.php5.90 ▲0.0177.12 ▼20.40
Media Library /wp-admin/upload.php3.24 ▲0.0133.96 ▲0.71

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Disable WP REST API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,788 ▲1714.33 ▼0.321.54 ▼0.2240.72 ▼0.82
Dashboard /wp-admin2,198 ▲245.63 ▲0.0781.36 ▼4.0539.03 ▼2.06
Posts /wp-admin/edit.php2,100 ▼31.99 ▲0.0535.12 ▼5.5030.57 ▼7.34
Add New Post /wp-admin/post-new.php1,526 ▼023.68 ▲0.58647.11 ▲46.1663.27 ▲1.50
Media Library /wp-admin/upload.php1,400 ▲34.21 ▲0.0595.00 ▼15.3442.84 ▼2.55

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
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: rest, head, rest-api, api, json...

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

The main file in "Disable WP REST API" v. 2.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Disables the WP REST API for visitors not logged into WordPress.

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
Good job! No executable or dangerous file extensions detected60 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1503260

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.63
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.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