83% chocolate-rain

Code Review | Chocolate Rain

WordPress plugin Chocolate Rain scored83%from 54 tests.

About plugin

  • Plugin page: chocolate-rain
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Mar 16, 2021
  • Latest release: Aug 4, 2021
  • Number of updates: 5
  • Update frequency: every 29.0 days
  • Top authors: csomorelwood (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /332 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▲11.74ms] Passed 4 tests

This is a short check of server-side resources used by Chocolate Rain
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0149.70 ▲7.74
Dashboard /wp-admin3.31 ▲0.0169.26 ▲19.42
Posts /wp-admin/edit.php3.36 ▲0.0156.31 ▲10.49
Add New Post /wp-admin/post-new.php5.89 ▲0.01111.47 ▲20.78
Media Library /wp-admin/upload.php3.23 ▲0.0045.39 ▲9.32

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Chocolate Rain
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,939 ▲3,20447.30 ▲33.03332.54 ▲330.5558.03 ▲10.52
Dashboard /wp-admin3,285 ▲1,09718.61 ▲13.68378.27 ▲267.8362.29 ▲18.43
Posts /wp-admin/edit.php3,186 ▲1,09414.83 ▲12.78345.67 ▲304.8256.07 ▲19.69
Add New Post /wp-admin/post-new.php7,431 ▲5,89833.86 ▲10.611,188.88 ▲508.0885.64 ▲27.24
Media Library /wp-admin/upload.php2,466 ▲1,07515.64 ▲11.43390.22 ▲285.6063.49 ▲21.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 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/chocolate-rain/chocolate_rain_by_csomorelwood.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Screenshot #1 (Chocolate Raiiin) image not found
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

chocolate-rain/chocolate_rain_by_csomorelwood.php 92% from 13 tests

"Chocolate Rain" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("chocolate-rain.php" instead of "chocolate_rain_by_csomorelwood.php")

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
Success! There were no dangerous files found in this plugin2,108 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS110412,025
Sass16052
JavaScript14020
PHP14811

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.00MB with 0.60MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/donate.png12.45KB5.15KB▼ 58.60%
assets/images/csoki.png1,012.66KB382.44KB▼ 62.23%