100% disable-wp-rest-api

Code Review | Disable WP REST API

WordPress plugin Disable WP REST API scored 100% from 54 tests.

About plugin

  • Plugin page: disable-wp-rest-api
  • Plugin version: 2.2
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 5.8.1
  • First release: Jun 6, 2018
  • Latest release: Jul 13, 2021
  • Number of updates: 16
  • Update frequency: every 71.6 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

10,000+ active / 71,829 total downloads


Plugin footprint Passed 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.01MB] [CPU: ▼142.52ms] 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 /2.84 ▲0.0137.57 ▼1.17
Dashboard /wp-admin3.07 ▲0.0152.38 ▲0.17
Posts /wp-admin/edit.php3.12 ▲0.0150.69 ▲11.56
Add New Post /wp-admin/post-new.php5.42 ▼0.0191.99 ▼570.11
Media Library /wp-admin/upload.php3.01 ▲0.0138.60 ▲1.02

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, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Disable WP REST API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲10615.86 ▲0.5311.86 ▲4.4952.23 ▲0.15
Dashboard /wp-admin2,970 ▲365.91 ▼0.25145.87 ▼17.88123.25 ▲7.43
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0070.50 ▼1.2293.18 ▲0.18
Add New Post /wp-admin/post-new.php3,577 ▲1,89415.07 ▼1.70483.85 ▲76.66115.91 ▲5.05
Media Library /wp-admin/upload.php1,807 ▼05.01 ▼0.03167.34 ▲5.17127.51 ▲3.55

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

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


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (What non-logged visitors see when requesting JSON/REST API), #2 (What logged-in users see when requesting JSON/REST API)
The official readme.txt might help

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

The main file in "Disable WP REST API" v. 2.2 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 detected44 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

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.31
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions4100.00%
▷ Anonymous functions00.00%
▷ 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