99% token-field-for-advanced-custom-fields

Code Review | Advanced Custom Fields: Token Field

WordPress plugin Advanced Custom Fields: Token Field scored 99% from 53 tests.

About plugin

  • Plugin page: token-field-for-a...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 5.8.1
  • First release: May 2, 2017
  • Latest release: May 3, 2017
  • Number of updates: 9
  • Update frequency: every 7.6 days
  • Top authors: fotype (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 656 total downloads

Benchmarks

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.01MB] [CPU: ▼269.51ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: Token Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1336.34 ▲12.97
Dashboard /wp-admin3.07 ▲0.0250.44 ▲5.03
Posts /wp-admin/edit.php3.12 ▲0.0146.13 ▲2.11
Add New Post /wp-admin/post-new.php5.43 ▲0.0088.97 ▼1,078.11
Media Library /wp-admin/upload.php3.01 ▲0.0128.50 ▼7.08

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Token Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7215.96 ▲0.438.74 ▲0.6844.85 ▼3.72
Dashboard /wp-admin2,932 ▲796.08 ▲0.24138.41 ▲9.49105.51 ▲1.91
Posts /wp-admin/edit.php2,710 ▲72.68 ▼0.0166.27 ▲0.0283.26 ▼7.83
Add New Post /wp-admin/post-new.php1,485 ▼16818.43 ▼0.41358.42 ▼12.52103.81 ▼6.03
Media Library /wp-admin/upload.php1,779 ▲45.02 ▲0.04143.56 ▼9.00106.05 ▼4.37

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 Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
Please take inspiration from this readme.txt

token-field-for-advanced-custom-fields/acf-tokenfield.php 92% from 13 tests

The principal PHP file in "Advanced Custom Fields: Token Field" v. 1.0.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("token-field-for-advanced-custom-fields.php" instead of "acf-tokenfield.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,094 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1228105709
PHP3149181264
CSS1166118
Markdown1203

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.67
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/select2.png0.60KB0.99KB0.00%