78% color-picker

Code Review | Color Picker

WordPress plugin Color Picker scored 78% from 53 tests.

About plugin

  • Plugin page: color-picker
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7.3
  • WordPress version: 5.8.1
  • First release: May 20, 2017
  • Latest release: May 20, 2017
  • Number of updates: 11
  • Update frequency: every 0.4 days
  • Top authors: ifourkuldeep1 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 457 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.89MB] [CPU: ▼308.05ms] Passed 4 tests

This is a short check of server-side resources used by Color Picker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼0.985.66 ▼12.89
Dashboard /wp-admin1.76 ▼1.296.17 ▼36.34
Posts /wp-admin/edit.php1.76 ▼1.345.66 ▼29.44
Add New Post /wp-admin/post-new.php1.76 ▼3.675.08 ▼1,130.10
Media Library /wp-admin/upload.php1.76 ▼1.245.02 ▼36.30
Color Options /wp-admin/options-general.php?page=color-picker/color.php1.765.38

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Color Picker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,832 ▲22716.54 ▲0.9513.55 ▲5.4072.22 ▲25.77
Dashboard /wp-admin2,989 ▲1396.61 ▲0.81147.60 ▲15.59105.95 ▲1.59
Posts /wp-admin/edit.php2,742 ▲362.99 ▲0.3063.23 ▲1.1799.43 ▲4.65
Add New Post /wp-admin/post-new.php1,501 ▼15018.53 ▲1.01356.81 ▲2.07109.55 ▼0.06
Media Library /wp-admin/upload.php1,808 ▲365.37 ▲0.38125.72 ▼21.30107.24 ▼8.28
Color Options /wp-admin/options-general.php?page=color-picker/color.php1,2332.9166.5169.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5663
    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 wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=color-picker/color.php
    • > User notice in wp-includes/functions.php+5663
    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 wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/color-picker/color.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
No plugin tags provided

color-picker/color.php 92% from 13 tests

The main PHP script in "Color Picker" version 0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("color-picker.php" instead of "color.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
Success! There were no dangerous files found in this plugin94 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1692085
JavaScript2209

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.06MB with 0.75MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png1,017.94KB317.88KB▼ 68.77%
assets/screenshot-1.png62.43KB16.09KB▼ 74.23%