84% wp-rest-api-controller

Code Review | WP REST API Controller

WordPress plugin WP REST API Controller scored84%from 54 tests.

About plugin

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active /156,744 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▲1.15ms] Passed 4 tests

An overview of server-side resources used by WP REST API Controller
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1747.84 ▲4.53
Dashboard /wp-admin3.49 ▲0.1849.86 ▼2.26
Posts /wp-admin/edit.php3.60 ▲0.2455.73 ▲8.92
Add New Post /wp-admin/post-new.php6.07 ▲0.1884.42 ▼5.45
Media Library /wp-admin/upload.php3.41 ▲0.1740.10 ▲7.79
REST API Controller /wp-admin/tools.php?page=wp-rest-api-controller-settings3.5484.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
wp_rest_api_controller_post_types
widget_recent-posts
widget_recent-comments
db_upgraded
wp_rest_api_controller_taxonomies
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP REST API Controller
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.39 ▼1.191.80 ▼0.0537.47 ▼10.41
Dashboard /wp-admin2,210 ▲255.85 ▲0.95102.62 ▼12.7843.25 ▼0.14
Posts /wp-admin/edit.php2,090 ▲12.02 ▼0.0336.24 ▼2.9934.17 ▼2.04
Add New Post /wp-admin/post-new.php1,538 ▲1223.20 ▼0.01672.31 ▲9.1955.39 ▲2.50
Media Library /wp-admin/upload.php1,395 ▲134.31 ▲0.1198.66 ▼8.4441.91 ▼1.65
REST API Controller /wp-admin/tools.php?page=wp-rest-api-controller-settings2,2241.9733.0343.17

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include(WP_REST_API_CONTROLLER_PATHadmin/partials/settings-functions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-rest-api-controller/admin/class-wp-rest-api-controller-admin.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-api-controller/admin/class-wp-rest-api-controller-admin.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-api-controller/admin/partials/settings-functions.php:34
    • > PHP Warning
      Use of undefined constant WP_REST_API_CONTROLLER_PATH - assumed 'WP_REST_API_CONTROLLER_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-rest-api-controller/admin/class-wp-rest-api-controller-admin.php on line 32
    • > PHP Warning
      include(): Failed opening 'WP_REST_API_CONTROLLER_PATHadmin/partials/settings-functions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-rest-api-controller/admin/class-wp-rest-api-controller-admin.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-rest-api-controller/admin/partials/settings-page.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Requires at least: Invalid plugin version format
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can look at the official readme.txt

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

"WP REST API Controller" version 2.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
96 characters long description:
WP REST API Controller enables a UI to toggle REST API endpoints on/off and customize key names.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,933 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript47089969
PHP5297289679
CSS44011285

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity36.67
▷ Minimum class complexity12.00
▷ Maximum class complexity52.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin