84% kill-json-rest-api

Code Review | Kill JSON REST API

WordPress plugin Kill JSON REST API scored84%from 54 tests.

About plugin

  • Plugin page: kill-json-rest-api
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7
  • WordPress version: 6.3.1
  • First release: Feb 15, 2017
  • Latest release: Feb 15, 2017
  • Number of updates: 10
  • Update frequency: N/A
  • Top authors: arminmeth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,392 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼120.93ms] Passed 4 tests

Analyzing server-side resources used by Kill JSON REST API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.20 ▼4.26
Dashboard /wp-admin3.31 ▼0.1143.97 ▼464.07
Posts /wp-admin/edit.php3.36 ▲0.0146.14 ▼14.67
Add New Post /wp-admin/post-new.php5.90 ▲0.0081.88 ▲0.74
Media Library /wp-admin/upload.php3.24 ▲0.0035.28 ▼0.72

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Kill JSON REST API
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲6414.48 ▼0.172.07 ▲0.2245.06 ▼6.17
Dashboard /wp-admin2,209 ▲214.83 ▼0.04102.47 ▼13.9541.22 ▼3.88
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0634.96 ▼7.2634.16 ▼4.26
Add New Post /wp-admin/post-new.php1,538 ▲421.97 ▼0.95675.68 ▲51.9368.95 ▲9.85
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.04102.94 ▲0.5045.11 ▲0.47

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 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 following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kill-json-rest-api/kill-json-rest-api.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

kill-json-rest-api/kill-json-rest-api.php Passed 13 tests

The principal PHP file in "Kill JSON REST API" v. 1.1.0 is loaded by WordPress automatically on each request
124 characters long description:
Completely disables JSON REST API for both registered and anonymous users in WordPress 4.7.* and removes API links and tags.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17839

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods133.33%
▷ Public methods266.67%
▷ Protected methods00.00%
▷ Private methods133.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin