88% add-custom-fields-to-media

Code Review | Add Custom Fields to Media

WordPress plugin Add Custom Fields to Media scored 88% 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: 5.9.2
  • 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,579 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼302.01ms] Passed 4 tests

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.55 ▲0.0454.45 ▲5.69
Dashboard /wp-admin3.45 ▲0.0532.49 ▼1.13
Posts /wp-admin/edit.php3.68 ▲0.0435.67 ▼1.81
Add New Post /wp-admin/post-new.php6.92 ▼0.0591.71 ▼1,203.51
Media Library /wp-admin/upload.php3.33 ▲0.0422.69 ▼1.59
Add Custom Fields to Media Upload /wp-admin/options-general.php?page=thisismyurl_add_custom_media_fields3.2721.71

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add Custom Fields to Media: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲6815.78 ▲0.147.03 ▲1.142.38 ▼0.61
Dashboard /wp-admin2,893 ▲356.15 ▼0.00113.90 ▼17.58152.40 ▼5.79
Posts /wp-admin/edit.php2,693 ▲23.23 ▼0.0161.42 ▼2.96139.17 ▼1.91
Add New Post /wp-admin/post-new.php1,664 ▲316.05 ▼0.15409.22 ▼10.15155.97 ▼6.67
Media Library /wp-admin/upload.php1,706 ▲85.50 ▼0.03142.99 ▲2.18180.10 ▼2.74
Add Custom Fields to Media Upload /wp-admin/options-general.php?page=thisismyurl_add_custom_media_fields1,1082.4356.81151.50

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: Please take inspiration from this readme.txt

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

The main PHP script in "Add Custom Fields to Media" version 1.2.5 is automatically included on every request by WordPress
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
Good job! No executable or dangerous file extensions detected151 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic 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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions11100.00%
▷ Anonymous functions00.00%
▷ 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
No PNG images were found in this plugin