84% cocoon-scenery-color

Code Review | Cocoon Scenery Color

WordPress plugin Cocoon Scenery Color scored84%from 54 tests.

About plugin

  • Plugin page: cocoon-scenery-color
  • Plugin version: 1.3.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Aug 14, 2021
  • Latest release: Aug 11, 2023
  • Number of updates: 35
  • Update frequency: every 21.3 days
  • Top authors: nshuuo36 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,663 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.43MB] [CPU: ▼0.40ms] Passed 4 tests

Analyzing server-side resources used by Cocoon Scenery Color
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4643.62 ▲2.77
Dashboard /wp-admin3.77 ▲0.4645.79 ▲1.01
Posts /wp-admin/edit.php3.82 ▲0.4647.00 ▼5.83
Add New Post /wp-admin/post-new.php6.29 ▲0.4093.27 ▲1.98
Media Library /wp-admin/upload.php3.63 ▲0.4034.50 ▲1.25

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 77 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Cocoon Scenery Color
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.131.74 ▼0.6143.63 ▼4.02
Dashboard /wp-admin2,209 ▲244.83 ▼0.26100.39 ▼4.4839.78 ▼6.27
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0737.34 ▼4.3830.92 ▼6.30
Add New Post /wp-admin/post-new.php1,542 ▲1318.45 ▲0.10606.90 ▼19.6553.65 ▼3.87
Media Library /wp-admin/upload.php1,382 ▼94.19 ▼0.1194.89 ▼12.0941.44 ▼3.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/themes/twentytwentyone/lib/_defins.php' (include_path='.:/usr/share/php') in wp-content/plugins/cocoon-scenery-color/modules/backup-download.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: color, setting, cocoon, scenery

cocoon-scenery-color/cocoon-scenery-color.php 92% from 13 tests

The main PHP script in "Cocoon Scenery Color" version 1.3.6 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 450 characters long)

Code Analysis 97% from 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
No dangerous file extensions were detected5,519 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP41647962,142
PO File2599501,237
JSON44501,007
JavaScript19526640
CSS2145158493

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 120)
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity93.67
▷ Minimum class complexity9.00
▷ Maximum class complexity238.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity120.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods95
▷ Static methods1010.53%
▷ Public methods2425.26%
▷ Protected methods00.00%
▷ Private methods7174.74%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants168
▷ Global constants00.00%
▷ Class constants168100.00%
▷ Public constants168100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 compressed PNG files occupy 3.52MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
options/summer-green.png361.67KB390.43KB0.00%
options/dark-blue.png207.77KB231.23KB0.00%
options/vermilion-black.png228.83KB252.98KB0.00%
options/pastel-pink.png217.10KB239.99KB0.00%
images/sample-color-inside.png79.07KB25.83KB▼ 67.33%