84% rest-api-filter-fields

Code Review | REST API - Filter Fields

WordPress plugin REST API - Filter Fields scored84%from 54 tests.

About plugin

  • Plugin page: rest-api-filter-f...
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.4.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2015
  • Latest release: Jun 29, 2020
  • Number of updates: 21
  • Update frequency: every 81.2 days
  • Top authors: svrooij (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /32,407 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.01MB] [CPU: ▼9.48ms] Passed 4 tests

Server-side resources used by REST API - Filter Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.75 ▼1.45
Dashboard /wp-admin3.33 ▼0.0245.95 ▼18.44
Posts /wp-admin/edit.php3.38 ▲0.0248.77 ▼2.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.61 ▼15.78
Media Library /wp-admin/upload.php3.26 ▲0.0237.26 ▲0.82

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by REST API - Filter Fields
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.34 ▼0.381.99 ▲0.3342.27 ▼1.55
Dashboard /wp-admin2,210 ▲335.62 ▲0.0289.23 ▼18.9346.84 ▼5.40
Posts /wp-admin/edit.php2,115 ▲122.00 ▲0.0238.30 ▼3.3034.26 ▼0.37
Add New Post /wp-admin/post-new.php1,543 ▲1720.86 ▼2.23665.02 ▼51.4552.02 ▼4.61
Media Library /wp-admin/upload.php1,412 ▲94.22 ▲0.0499.42 ▼4.8245.96 ▼0.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rest-api-filter-fields/includes/class-rest-api-filter-fields.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

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

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

Analyzing the main PHP file in "REST API - Filter Fields" version 1.0.8
53 characters long description:
Enables you to filter the fields returned by the api.

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 plugin128 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25281128

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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
There are no PNG files in this plugin