94% acf-media

Code Review | Advanced Custom Fields: Media Field

WordPress plugin Advanced Custom Fields: Media Field scored 94% 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: 5.9.2
  • 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 / 519 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Advanced Custom Fields: Media Field
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0255.09 ▲3.01
Dashboard /wp-admin3.42 ▲0.0133.57 ▼3.26
Posts /wp-admin/edit.php3.65 ▲0.0138.32 ▲2.04
Add New Post /wp-admin/post-new.php6.89 ▼0.0891.54 ▼1,194.05
Media Library /wp-admin/upload.php3.30 ▲0.0124.92 ▼0.58

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, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Media Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲6115.98 ▲0.365.80 ▲0.212.30 ▼0.14
Dashboard /wp-admin2,895 ▲376.15 ▼0.07116.21 ▼17.15154.85 ▼8.43
Posts /wp-admin/edit.php2,691 ▲33.23 ▼0.0162.67 ▼0.21140.75 ▼3.80
Add New Post /wp-admin/post-new.php1,716 ▼4421.09 ▲4.17442.47 ▲21.65169.70 ▲12.63
Media Library /wp-admin/upload.php1,701 ▲35.54 ▲0.08146.12 ▲2.91187.03 ▼5.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: acf

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

This is the main PHP file of "Advanced Custom Fields: Media Field" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
25 characters long description:
Creates Media field type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin376 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3211370236
JavaScript13959107
SVG10132
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
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

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin