94% validated-field-for-acf

Code Review | Advanced Custom Fields: Validated Field

WordPress plugin Advanced Custom Fields: Validated Field scored 94% from 54 tests.

About plugin

  • Plugin page: validated-field-f...
  • Plugin version: 1.7.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 5.9.2
  • First release: Sep 27, 2012
  • Latest release: Aug 19, 2015
  • Number of updates: 173
  • Update frequency: every 6.1 days
  • Top authors: doublesharp (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

700+ active / 16,947 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Advanced Custom Fields: Validated Field
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0159.39 ▲5.95
Dashboard /wp-admin3.41 ▲0.0132.61 ▼2.12
Posts /wp-admin/edit.php3.65 ▲0.0139.36 ▲0.60
Add New Post /wp-admin/post-new.php6.89 ▼0.0897.66 ▼1,168.88
Media Library /wp-admin/upload.php3.30 ▲0.0127.70 ▼9.62

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 60 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Custom Fields: Validated Field: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4116.17 ▲1.036.29 ▲0.482.20 ▲0.07
Dashboard /wp-admin2,895 ▲375.99 ▼0.28127.05 ▼9.45216.43 ▼27.54
Posts /wp-admin/edit.php2,691 ▲63.23 ▼0.0067.38 ▲2.68142.95 ▼10.83
Add New Post /wp-admin/post-new.php1,711 ▲5120.68 ▲0.87445.71 ▲23.68192.58 ▼24.10
Media Library /wp-admin/upload.php1,694 ▼15.55 ▲0.00161.84 ▲5.34213.65 ▼251.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/validated-field-for-acf/validated_field.php:28

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

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
The official readme.txt is a good inspiration

validated-field-for-acf/validated_field.php 92% from 13 tests

"Advanced Custom Fields: Validated Field" version 1.7.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("validated-field-for-acf.php" instead of "validated_field.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin7,277 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP32365111,762
CSS31131,668
Sass1323241,256
LESS1323331,247
SVG100520
JavaScript174790463
PO File2143178361

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity119.50
▷ Minimum class complexity100.00
▷ Maximum class complexity139.00
Average method complexity5.02
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods5796.61%
▷ Protected methods00.00%
▷ Private methods23.39%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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