78% color-palette-generator

Code Review | Color Palette Generator

WordPress plugin Color Palette Generator scored78%from 54 tests.

About plugin

  • Plugin page: color-palette-gen...
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Feb 6, 2017
  • Latest release: Dec 24, 2018
  • Number of updates: 19
  • Update frequency: every 36.0 days
  • Top authors: houkedekwant (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,007 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼8.27ms] Passed 4 tests

Server-side resources used by Color Palette Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.04 ▲2.31
Dashboard /wp-admin3.40 ▲0.0652.03 ▼17.98
Posts /wp-admin/edit.php3.46 ▲0.1052.59 ▲2.89
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.00 ▼20.28
Media Library /wp-admin/upload.php3.32 ▲0.1040.36 ▲3.17
Color Palette Generator /wp-admin/upload.php?page=color-palette-generator3.3146.43

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
cpg_options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
cpg_dominant_color_children
widget_recent-posts
widget_cpg_search_widget
db_upgraded

Browser metrics Passed 4 tests

Color Palette Generator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.35 ▼0.001.89 ▲0.3342.89 ▲0.59
Dashboard /wp-admin2,206 ▲325.58 ▲0.0682.01 ▼6.1238.25 ▼7.00
Posts /wp-admin/edit.php2,114 ▲111.98 ▼0.0439.44 ▼8.0034.68 ▼1.16
Add New Post /wp-admin/post-new.php1,536 ▲123.35 ▲5.34659.89 ▲18.3051.92 ▼14.64
Media Library /wp-admin/upload.php1,423 ▲234.19 ▲0.0199.58 ▼3.9446.12 ▲0.72
Color Palette Generator /wp-admin/upload.php?page=color-palette-generator9842.0738.5330.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_cpg_search_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/color-palette-generator/inc/cpg-admin-shared-functions.php
    • > /wp-content/plugins/color-palette-generator/color-palette-generator.php
    • > /wp-content/plugins/color-palette-generator/inc/cpg-uninstall.php
    • > /wp-content/plugins/color-palette-generator/inc/cpg-admin-settings.php
    • > /wp-content/plugins/color-palette-generator/inc/cpg-frontend-show-palette-on-attachment.php
    • > /wp-content/plugins/color-palette-generator/inc/cpg-admin-layout.php
    • > /wp-content/plugins/color-palette-generator/inc/cpg-admin-ajax.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/color-palette-generator/templates/search.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/color-palette-generator/inc/cpg-admin-search-rewrites.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/color-palette-generator/inc/cpg-admin-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: image, colour palette, color, palette, images...

color-palette-generator/color-palette-generator.php 92% from 13 tests

This is the main PHP file of "Color Palette Generator" version 1.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected3,513 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP12196521,834
JavaScript6911481,037
CSS6980607
Markdown116035

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity5.50
▷ Minimum class complexity4.00
▷ Maximum class complexity7.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions53
▷ Named functions5298.11%
▷ Anonymous functions11.89%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin