10% rest-filter-response-fields

Code Review | REST Filter Response Fields

WordPress plugin REST Filter Response Fields scored10%from 54 tests.

About plugin

  • Plugin page: rest-filter-respo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: May 9, 2017
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: adamsilverstein (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,648 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Compile error in wp-content/plugins/rest-filter-response-fields/rest-filter-response-fields.php+24
    Cannot redeclare rest_filter_response_fields() (previously declared in wp-includes/rest-api.php:882)

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.68ms] Passed 4 tests

Server-side resources used by REST Filter Response Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.13 ▼2.62
Dashboard /wp-admin3.31 ▼0.0445.59 ▼17.09
Posts /wp-admin/edit.php3.36 ▲0.0042.91 ▼3.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.02 ▼3.70
Media Library /wp-admin/upload.php3.23 ▲0.0034.17 ▼0.13

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by REST Filter Response Fields
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.11 ▼0.161.71 ▼0.0339.29 ▼3.65
Dashboard /wp-admin2,198 ▲185.67 ▲0.0485.18 ▲0.0439.52 ▲0.14
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0136.09 ▲0.7231.78 ▼1.44
Add New Post /wp-admin/post-new.php1,540 ▲1418.11 ▼4.87630.49 ▲9.6663.18 ▲11.68
Media Library /wp-admin/upload.php1,397 ▼04.20 ▼0.0997.10 ▼2.7743.93 ▼0.30

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/rest-filter-response-fields/rest-filter-response-fields.php:56

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
No plugin tags provided

rest-filter-response-fields/rest-filter-response-fields.php Passed 13 tests

The principal PHP file in "REST Filter Response Fields" v. 1.0.0 is loaded by WordPress automatically on each request
87 characters long description:
Specify fields for the response JSON. See https://core.trac.wordpress.org/ticket/38131.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin27 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1122024
Markdown1203

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
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 2 tests

Image compression Passed 2 tests

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