78% rest-api-custom-fields

Code Review | REST API Custom Fields

WordPress plugin REST API Custom Fields scored 78% from 54 tests.

About plugin

  • Plugin page: rest-api-custom-f...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Jul 19, 2019
  • Latest release: Aug 14, 2020
  • Number of updates: 13
  • Update frequency: every 30.4 days
  • Top authors: integromat (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 10,282 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.77ms] Passed 4 tests

A check of server-side resources used by REST API Custom Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0247.27 ▲2.85
Dashboard /wp-admin3.37 ▲0.0657.39 ▼4.27
Posts /wp-admin/edit.php3.48 ▲0.1354.48 ▲1.77
Add New Post /wp-admin/post-new.php5.95 ▲0.06112.05 ▲9.34
Media Library /wp-admin/upload.php3.29 ▲0.0643.32 ▲6.74
Rest API Custom Fields /wp-admin/options-general.php?page=integromat_api_mi3.2640.72

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for REST API Custom Fields
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲1813.28 ▲0.062.14 ▲0.2145.66 ▲3.11
Dashboard /wp-admin2,210 ▲14.89 ▲0.04105.49 ▲7.0439.40 ▼0.90
Posts /wp-admin/edit.php2,096 ▲101.99 ▼0.0037.90 ▲1.5333.81 ▼1.21
Add New Post /wp-admin/post-new.php1,545 ▲318.34 ▼4.82610.09 ▼135.1464.27 ▼4.20
Media Library /wp-admin/upload.php1,392 ▲44.19 ▲0.0799.08 ▼3.9044.26 ▼0.02
Rest API Custom Fields /wp-admin/options-general.php?page=integromat_api_mi1,1272.0937.5032.05

Uninstaller [IO: ✅] [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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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 0% 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
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rest-api-custom-fields/settings/render.php
    • > /wp-content/plugins/rest-api-custom-fields/index.php
    • > /wp-content/plugins/rest-api-custom-fields/response/response.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'IntegromatAPI\\MetaObject' not found in wp-content/plugins/rest-api-custom-fields/settings/ObjectTypes/UserMeta.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'IntegromatAPI\\MetaObject' not found in wp-content/plugins/rest-api-custom-fields/settings/ObjectTypes/PostMeta.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'IntegromatAPI\\MetaObject' not found in wp-content/plugins/rest-api-custom-fields/settings/ObjectTypes/CommentsMeta.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'IntegromatAPI\\MetaObject' not found in wp-content/plugins/rest-api-custom-fields/settings/ObjectTypes/TermMeta.php:5

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: meta_data, integromat, api, meta, endpoints...

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

This is the main PHP file of "REST API Custom Fields" version 1.3, 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: Name the main plugin file the same as the plugin slug ("rest-api-custom-fields.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected575 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP911039435
CSS1104106
JavaScript112034

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions210.53%
▷ Anonymous functions1789.47%
Constants2
▷ Global constants2100.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
No PNG files were detected