84% acf-media

Code Review | Advanced Custom Fields: Media Field

WordPress plugin Advanced Custom Fields: Media Field scored84%from 54 tests.

About plugin

  • Plugin page: acf-media
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.2.0
  • WordPress version: 6.3.1
  • First release: Dec 14, 2018
  • Latest release: May 10, 2019
  • Number of updates: 4
  • Update frequency: every 56.3 days
  • Top authors: Jorenm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /740 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by Advanced Custom Fields: Media Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.24 ▼2.13
Dashboard /wp-admin3.32 ▲0.0144.67 ▼6.53
Posts /wp-admin/edit.php3.37 ▲0.0148.05 ▼0.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.24 ▼12.17
Media Library /wp-admin/upload.php3.24 ▲0.0136.80 ▲0.64

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Media Field
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.69 ▼0.624.90 ▲3.1544.42 ▲0.17
Dashboard /wp-admin2,209 ▲215.90 ▲1.03109.86 ▼2.0942.77 ▼0.34
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0238.59 ▼8.9236.17 ▼1.03
Add New Post /wp-admin/post-new.php1,533 ▲523.07 ▲4.93676.42 ▲10.8149.99 ▼6.05
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0394.70 ▼7.0039.93 ▼1.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/acf-media/fields/render_field.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_esc_attr_e() in wp-content/plugins/acf-media/fields/render_field.php:52
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-media/fields/render_field.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: acf

acf-media/acf-media.php Passed 13 tests

"Advanced Custom Fields: Media Field" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
25 characters long description:
Creates Media field type.

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 detected376 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3211370236
JavaScript13959107
SVG10132
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin