84% wp-rest-api-filter-fields

Code Review | WP REST API Filter Fields

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

About plugin

  • Plugin page: wp-rest-api-filte...
  • Plugin version: 1...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2015
  • Latest release: May 7, 2015
  • Number of updates: 6
  • Update frequency: every 2.3 days
  • Top authors: nish@ncrafts.net (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,946 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by WP REST API Filter Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0134.70 ▼5.08
Dashboard /wp-admin3.32 ▲0.0149.77 ▲0.93
Posts /wp-admin/edit.php3.37 ▲0.0154.29 ▲6.49
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.36 ▼8.94
Media Library /wp-admin/upload.php3.24 ▲0.0135.30 ▲0.51

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

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

Browser metrics Passed 4 tests

WP REST API Filter Fields: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.39 ▲0.241.79 ▼0.0041.31 ▼2.91
Dashboard /wp-admin2,198 ▲185.66 ▲0.0588.48 ▼2.2537.83 ▼6.08
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0537.07 ▼0.9734.73 ▼2.33
Add New Post /wp-admin/post-new.php1,526 ▼723.47 ▲0.44657.51 ▼6.7057.94 ▲7.65
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0698.88 ▼7.7444.60 ▲1.82

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-rest-api-filter-fields/plugin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-rest-api-filter-fields/trunk/plugin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: rest-api, json, rest, api

wp-rest-api-filter-fields/plugin.php 85% from 13 tests

Analyzing the main PHP file in "WP REST API Filter Fields" version 1...
It is important to fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "1...")
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-rest-api-filter-fields.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected44 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP10841
Markdown1103

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code1.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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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