84% disable-rest-api-wp-json-and-oembed

Code Review | Disable REST API (wp-json and oembed)

WordPress plugin Disable REST API (wp-json and oembed) scored84%from 54 tests.

About plugin

  • Plugin page: disable-rest-api-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.4
  • WordPress version: 6.3.1
  • First release: May 4, 2017
  • Latest release: May 4, 2017
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: admanager (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,017 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.03MB] [CPU: ▼10.22ms] Passed 4 tests

This is a short check of server-side resources used by Disable REST API (wp-json and oembed)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0135.47 ▼1.57
Dashboard /wp-admin3.30 ▼0.0141.30 ▼2.37
Posts /wp-admin/edit.php3.35 ▼0.0143.92 ▼4.40
Add New Post /wp-admin/post-new.php5.81 ▼0.0871.89 ▼32.55
Media Library /wp-admin/upload.php3.22 ▼0.0134.08 ▲0.43

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Disable REST API (wp-json and oembed)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲5313.28 ▼1.021.75 ▼0.0638.51 ▼2.28
Dashboard /wp-admin2,206 ▲175.88 ▲0.89107.42 ▼5.1543.03 ▲1.26
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0433.89 ▼8.6729.75 ▼7.19
Add New Post /wp-admin/post-new.php1,514 ▼517.28 ▼5.89651.50 ▼4.4866.87 ▲13.38
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0798.84 ▼2.3040.28 ▼8.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-rest-api-wp-json-and-oembed/disable-wp-json-and-oembed.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: api, wp-json, oembed, json, rest-api

disable-rest-api-wp-json-and-oembed/disable-wp-json-and-oembed.php 92% from 13 tests

The main PHP file in "Disable REST API (wp-json and oembed)" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("disable-rest-api-wp-json-and-oembed.php" instead of "disable-wp-json-and-oembed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin18 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151118

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin