78% toucan-color-palette

Code Review | Toucan - Gutenberg Color Palette

WordPress plugin Toucan - Gutenberg Color Palette scored78%from 54 tests.

About plugin

  • Plugin page: toucan-color-palette
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3
  • WordPress version: 6.3.1
  • First release: Dec 31, 2019
  • Latest release: Dec 31, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: daggerhart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /506 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.58MB] [CPU: ▼1.35ms] Passed 4 tests

A check of server-side resources used by Toucan - Gutenberg Color Palette
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3635.60 ▼0.75
Dashboard /wp-admin3.96 ▲0.6247.88 ▼11.81
Posts /wp-admin/edit.php4.05 ▲0.6948.97 ▲3.82
Add New Post /wp-admin/post-new.php6.55 ▲0.6692.48 ▲3.34
Media Library /wp-admin/upload.php3.89 ▲0.6638.43 ▲7.09
Toucan Colors /wp-admin/options-general.php?page=toucan_color_palette4.1437.16

Server storage [IO: ▲3.35MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for Toucan - Gutenberg Color Palette
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.35 ▼0.081.67 ▲0.0238.91 ▼2.89
Dashboard /wp-admin2,204 ▲275.59 ▼0.0682.73 ▼5.1238.92 ▲0.76
Posts /wp-admin/edit.php2,118 ▲182.08 ▲0.1441.59 ▲6.7636.36 ▲0.62
Add New Post /wp-admin/post-new.php1,544 ▲1818.62 ▼4.63616.48 ▼53.6865.24 ▼2.62
Media Library /wp-admin/upload.php1,415 ▲154.26 ▲0.0396.78 ▼1.3140.08 ▼1.18
Toucan Colors /wp-admin/options-general.php?page=toucan_color_palette1,0802.6144.7132.65

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/apigen/hook-docs.php
  • 42× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toucan-color-palette/vendor/cmb2/cmb2/init.php:126

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: color picker, color palette, theme support, gutenberg

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

"Toucan - Gutenberg Color Palette" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("toucan-color-palette.php" instead of "toucan.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 detected53,057 lines of code in 235 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP652,2086,2777,548
CSS141,2711,1645,098
JSON3003,562
JavaScript124696472,431
Sass16300251,379
Markdown52430716

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity18.90
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes71
▷ Abstract classes811.27%
▷ Concrete classes6388.73%
▷ Final classes00.00%
Methods551
▷ Static methods9517.24%
▷ Public methods45682.76%
▷ Protected methods8916.15%
▷ Private methods61.09%
Functions37
▷ Named functions3697.30%
▷ Anonymous functions12.70%
Constants10
▷ Global constants330.00%
▷ Class constants770.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/apigen/theme-bootstrap/src/resources/tree-last.png0.17KB0.11KB▼ 36.05%
vendor/cmb2/cmb2/apigen/theme-bootstrap/src/resources/inherit.png0.15KB0.10KB▼ 29.61%
vendor/cmb2/cmb2/apigen/theme-bootstrap/src/resources/tree-cleaner.png0.12KB0.08KB▼ 33.33%
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%