84% wp-rest-api-custom-fields

Code Review | WP REST API Custom Fields

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

About plugin

  • Plugin page: wp-rest-api-custo...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-4.2.1
  • WordPress version: 6.3.1
  • First release: Apr 29, 2015
  • Latest release: May 4, 2015
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: andrex84 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /5,819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by WP REST API Custom Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.45 ▼2.26
Dashboard /wp-admin3.31 ▲0.0151.42 ▼0.59
Posts /wp-admin/edit.php3.36 ▲0.0146.93 ▼12.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.41 ▼15.32
Media Library /wp-admin/upload.php3.24 ▲0.0135.05 ▼3.24

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP REST API Custom Fields
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.021.65 ▼0.0443.99 ▲3.07
Dashboard /wp-admin2,192 ▲125.62 ▼0.0586.48 ▼1.1139.96 ▲0.70
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0842.87 ▲7.5735.54 ▲2.55
Add New Post /wp-admin/post-new.php1,526 ▼023.42 ▲0.27588.07 ▼38.3951.18 ▼5.04
Media Library /wp-admin/upload.php1,391 ▼64.20 ▼0.04100.22 ▼3.3243.07 ▼2.09

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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 | 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
  • 1× 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-custom-fields/plugin.php:14

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-rest-api-custom-fields === )
The official readme.txt is a good inspiration

wp-rest-api-custom-fields/plugin.php 92% from 13 tests

This is the main PHP file of "WP REST API Custom Fields" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-rest-api-custom-fields.php" instead of "plugin.php")

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 plugin35 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1261135

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.23MB with 0.14MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png67.05KB25.13KB▼ 62.53%
banner-1544x500.png168.15KB61.65KB▼ 63.34%