78% add-custom-fields-to-media

Code Review | Add Custom Fields to Media

WordPress plugin Add Custom Fields to Media scored78%from 54 tests.

About plugin

  • Plugin page: add-custom-fields...
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-4.1.0
  • WordPress version: 6.3.1
  • First release: Jul 19, 2012
  • Latest release: Apr 7, 2016
  • Number of updates: 16
  • Update frequency: every 86.3 days
  • Top authors: christopherross (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,967 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.64ms] Passed 4 tests

This is a short check of server-side resources used by Add Custom Fields to Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.32 ▼2.75
Dashboard /wp-admin3.34 ▼0.0045.38 ▼12.16
Posts /wp-admin/edit.php3.39 ▲0.0447.06 ▼0.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.44 ▼18.97
Media Library /wp-admin/upload.php3.26 ▲0.0431.67 ▼0.45
Add Custom Fields to Media Upload /wp-admin/options-general.php?page=thisismyurl_add_custom_media_fields3.2129.35

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Add Custom Fields to Media
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.27 ▼1.011.68 ▼0.2542.16 ▼2.11
Dashboard /wp-admin2,210 ▲224.87 ▼0.98104.82 ▲1.2539.39 ▼6.71
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0339.51 ▼1.0534.52 ▼3.72
Add New Post /wp-admin/post-new.php1,536 ▼023.22 ▼0.10609.79 ▼1.5053.74 ▼3.41
Media Library /wp-admin/upload.php1,389 ▼24.21 ▼0.0699.40 ▼2.1141.76 ▼3.44
Add Custom Fields to Media Upload /wp-admin/options-general.php?page=thisismyurl_add_custom_media_fields8482.0524.7632.07

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=thisismyurl_add_custom_media_fields
    • > Notice in wp-content/plugins/add-custom-fields-to-media/add-custom-fields-to-media.php+200
    Undefined index: delete

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/add-custom-fields-to-media/add-custom-fields-to-media.php:106

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: Please take inspiration from this readme.txt

add-custom-fields-to-media/add-custom-fields-to-media.php Passed 13 tests

"Add Custom Fields to Media" version 1.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
64 characters long description:
Allows users to add custem text fields to the media upload tool.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected151 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17093151

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions11
▷ Named functions11100.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
No PNG files were detected