84% acf-color-swatches

Code Review | ACF Color Swatches

WordPress plugin ACF Color Swatches scored84%from 54 tests.

About plugin

  • Plugin page: acf-color-swatches
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0+
  • WordPress version: 6.3.1
  • First release: Feb 14, 2018
  • Latest release: Nov 29, 2018
  • Number of updates: 5
  • Update frequency: every 156.4 days
  • Top authors: nickforddesign (80%)deployer (40%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /15,584 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
Installer ran successfully

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

A check of server-side resources used by ACF Color Swatches
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.60 ▲1.84
Dashboard /wp-admin3.31 ▲0.0149.04 ▼4.39
Posts /wp-admin/edit.php3.36 ▲0.0147.59 ▼11.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.34 ▼14.30
Media Library /wp-admin/upload.php3.23 ▲0.0038.49 ▼2.21

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ACF Color Swatches
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.321.78 ▼0.2743.77 ▲0.61
Dashboard /wp-admin2,195 ▲215.62 ▼0.0583.74 ▼10.6138.69 ▼6.18
Posts /wp-admin/edit.php2,100 ▲31.99 ▲0.0138.52 ▼1.0333.53 ▼12.72
Add New Post /wp-admin/post-new.php1,526 ▼223.18 ▲0.20677.99 ▲6.0751.58 ▼3.04
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.02110.46 ▼0.2745.50 ▼1.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-color-swatches/acf-swatch.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-color-swatches/acf-swatch-v4.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tested up to: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

acf-color-swatches/acf-swatch.php 92% from 13 tests

The main PHP file in "ACF Color Swatches" ver. 1.0.7 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("acf-color-swatches.php" instead of "acf-swatch.php")

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
No dangerous file extensions were detected658 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP395259381
Markdown4620143
JavaScript128361
CSS110059
JSON10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity20.00
▷ Minimum class complexity16.00
▷ Maximum class complexity24.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/checkers.png0.22KB0.10KB▼ 56.58%
images/swatches.png24.82KB6.99KB▼ 71.85%
images/choices.png39.20KB11.60KB▼ 70.41%