99% disable-rest-api-and-require-jwt-oauth-authentication

Code Review | Disable REST API and Require JWT / OAuth Authentication

WordPress plugin Disable REST API and Require JWT / OAuth Authentication scored 99% from 53 tests.

About plugin

  • Plugin page: disable-rest-api-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8.2
  • WordPress version: 5.8.1
  • First release: Sep 26, 2017
  • Latest release: Sep 26, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: bfintal (100%)

Code review

53 tests

User reviews

1 review

Install metrics

100+ active / 8,155 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Disable REST API and Require JWT / OAuth Authentication
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.77 ▲14.86
Dashboard /wp-admin3.06 ▲0.0143.41 ▲4.25
Posts /wp-admin/edit.php3.11 ▲0.0036.98 ▼7.90
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.14 ▼1,090.21
Media Library /wp-admin/upload.php3.00 ▼0.0033.06 ▼5.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Disable REST API and Require JWT / OAuth Authentication: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲6815.87 ▲0.039.63 ▲0.8152.06 ▲2.78
Dashboard /wp-admin2,931 ▲815.95 ▼0.05143.31 ▲8.59109.50 ▲5.84
Posts /wp-admin/edit.php2,706 ▼02.69 ▼0.0163.10 ▼7.4692.39 ▲4.02
Add New Post /wp-admin/post-new.php1,853 ▲20018.83 ▲0.20357.53 ▼8.52113.85 ▲12.00
Media Library /wp-admin/upload.php1,772 ▼05.00 ▼0.01147.54 ▼8.02107.63 ▼12.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 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
10 plugin tags: jwt, oauth, json, api, wp-api...

disable-rest-api-and-require-jwt-oauth-authentication/plugin.php 85% from 13 tests

"Disable REST API and Require JWT / OAuth Authentication" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("disable-rest-api-and-require-jwt-oauth-authentication.php" instead of "plugin.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin26 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP261526

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin