84% validated-field-for-acf

Code Review | Advanced Custom Fields: Validated Field

WordPress plugin Advanced Custom Fields: Validated Field scored84%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: 6.3.1
  • 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

400+ active /17,500 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.58ms] Passed 4 tests

Analyzing server-side resources used by Advanced Custom Fields: Validated Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.21 ▼1.15
Dashboard /wp-admin3.31 ▼0.0350.48 ▼15.40
Posts /wp-admin/edit.php3.36 ▲0.0153.29 ▼0.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.01 ▼13.45
Media Library /wp-admin/upload.php3.23 ▲0.0141.10 ▲2.60

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Validated Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.22 ▼1.064.65 ▲2.6644.66 ▲3.19
Dashboard /wp-admin2,221 ▲155.84 ▲0.9798.68 ▼3.4236.67 ▼7.18
Posts /wp-admin/edit.php2,103 ▲32.01 ▼0.0438.09 ▲0.4536.74 ▲6.03
Add New Post /wp-admin/post-new.php1,545 ▲1423.17 ▼0.10619.33 ▼43.3672.11 ▲23.08
Media Library /wp-admin/upload.php1,394 ▼94.14 ▼0.07100.89 ▼1.9246.21 ▲0.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings 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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

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

This is the main PHP file of "Advanced Custom Fields: Validated Field" version 1.7.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected7,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 short overview 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.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin