62% jquery-color-picker

Code Review | jQuery Color Picker

WordPress plugin jQuery Color Picker scored62%from 54 tests.

About plugin

  • Plugin page: jquery-color-picker
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Jan 26, 2013
  • Latest release: Jan 28, 2013
  • Number of updates: 15
  • Update frequency: every 0.2 days
  • Top authors: softy.5454 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,462 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.92MB] [CPU: ▼49.84ms] Passed 4 tests

This is a short check of server-side resources used by jQuery Color Picker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.57 ▼36.45
Dashboard /wp-admin2.08 ▼1.225.25 ▼43.10
Posts /wp-admin/edit.php2.08 ▼1.276.39 ▼38.58
Add New Post /wp-admin/post-new.php2.08 ▼3.806.47 ▼81.22
Media Library /wp-admin/upload.php2.08 ▼1.145.42 ▼28.78
Color Picker /wp-admin/options-general.php?page=Color-Picker2.085.58

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 42 new files
Database: 1 new table, 6 new options
New tables
wp_colorpicker
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for jQuery Color Picker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲16113.71 ▼1.065.52 ▲3.6443.31 ▲0.81
Dashboard /wp-admin2,214 ▲265.86 ▲0.95108.91 ▼1.1338.44 ▼7.23
Posts /wp-admin/edit.php2,097 ▲82.04 ▼0.0239.74 ▲4.2135.83 ▲0.50
Add New Post /wp-admin/post-new.php1,530 ▼418.12 ▼5.34606.16 ▼77.6863.95 ▲1.86
Media Library /wp-admin/upload.php1,390 ▲24.24 ▲0.0495.67 ▼5.1244.15 ▼0.22
Color Picker /wp-admin/options-general.php?page=Color-Picker8522.0224.9131.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the layout handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the layout handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the layout handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the colorpickercss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the colorpickercss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > Notice in wp-content/plugins/jquery-color-picker/colorpicker_admin.php+124
    Undefined variable: nPickerType
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > Notice in wp-content/plugins/jquery-color-picker/colorpicker_admin.php+127
    Undefined variable: sPickername
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > Notice in wp-content/plugins/jquery-color-picker/colorpicker_admin.php+129
    Undefined variable: sDefaultColor
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > Notice in wp-content/plugins/jquery-color-picker/colorpicker_admin.php+133
    Undefined index: mode
    • > GET request to /wp-admin/options-general.php?page=Color-Picker
    • > Warning in wp-content/plugins/jquery-color-picker/jquery-color-picker.php+101
    Creating default object from empty value

SRP 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/jquery-color-picker/classes/core.php
    • > /wp-content/plugins/jquery-color-picker/colorpicker_admin.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/jquery-color-picker/jquery-color-picker.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Icon base Color Picker), #2 (Field base Color Picker), #3 (Color Picker Admin View)
The official readme.txt might help

jquery-color-picker/jquery-color-picker.php Passed 13 tests

"jQuery Color Picker" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
96 characters long description:
A simple plugin to select color in the same way you select color in Adobe Photoshop using jQuery

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
Good job! No executable or dangerous file extensions detected1,482 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3220748
CSS320502
PHP31545232

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/colorpicker_hsb_s.png1.14KB0.80KB▼ 29.97%
images/custom_hsb_b.png1.07KB0.82KB▼ 23.61%
images/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
images/custom_rgb_r.png0.99KB0.74KB▼ 25.34%
images/slider.png0.31KB1.51KB0.00%