88% custom-swatches-for-iris-color-picker

Code Review | Custom Swatches for Iris Color Picker

WordPress plugin Custom Swatches for Iris Color Picker scored 88% from 54 tests.

About plugin

  • Plugin page: custom-swatches-f...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.32+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9
  • WordPress version: 5.8.1
  • First release: Jan 4, 2018
  • Latest release: Jan 8, 2018
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: CriscoNinja (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 1,091 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
Install script ran successfully

Server metrics [RAM: ▼0.17MB] [CPU: ▼155.91ms] Passed 4 tests

This is a short check of server-side resources used by Custom Swatches for Iris Color Picker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1640.35 ▲19.45
Dashboard /wp-admin2.89 ▼0.1740.24 ▼12.14
Posts /wp-admin/edit.php3.02 ▼0.0939.99 ▼14.59
Add New Post /wp-admin/post-new.php5.02 ▼0.4283.45 ▼586.88
Media Library /wp-admin/upload.php2.98 ▼0.0227.31 ▼10.04
Color Swatches /wp-admin/options-general.php?page=iceberg_iris_color2.8828.01

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Swatches for Iris Color Picker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲9515.77 ▲0.1612.61 ▼0.5151.95 ▲7.18
Dashboard /wp-admin2,985 ▲545.92 ▼0.09149.17 ▼3.69123.08 ▲9.66
Posts /wp-admin/edit.php2,751 ▲122.72 ▼0.0075.14 ▼2.3293.17 ▼3.43
Add New Post /wp-admin/post-new.php1,625 ▼5820.98 ▲4.72309.29 ▼93.14114.69 ▲2.05
Media Library /wp-admin/upload.php1,819 ▲125.05 ▲0.05166.21 ▼30.68124.03 ▲3.39
Color Swatches /wp-admin/options-general.php?page=iceberg_iris_color1,1282.3662.0979.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=iceberg_iris_color
    • > Notice in wp-content/plugins/custom-swatches-for-iris-color-picker/custom-iris-swatches.php+283
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-swatches-for-iris-color-picker/custom-iris-swatches.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: iris color picker, color swatches, iris, iris color

custom-swatches-for-iris-color-picker/custom-iris-swatches.php 92% from 13 tests

The entry point to "Custom Swatches for Iris Color Picker" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-swatches-for-iris-color-picker.php" instead of "custom-iris-swatches.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin225 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP25056197
JavaScript10018
CSS11010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin