77% donation-thermometer

Code Review | Donation Thermometer

WordPress plugin Donation Thermometer scored 77% from 54 tests.

About plugin

  • Plugin page: donation-thermometer
  • Plugin version: 2.2.4
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 5, 2012
  • Latest release: Sep 16, 2023
  • Number of updates: 110
  • Update frequency: every 38.0 days
  • Top authors: henryp (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active / 78,609 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼1.23ms] Passed 4 tests

This is a short check of server-side resources used by Donation Thermometer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2643.47 ▲0.37
Dashboard /wp-admin3.64 ▲0.3353.19 ▲3.07
Posts /wp-admin/edit.php3.73 ▲0.3754.30 ▼12.42
Add New Post /wp-admin/post-new.php6.19 ▲0.30103.13 ▲4.06
Media Library /wp-admin/upload.php3.54 ▲0.3045.71 ▲9.92
Thermometer /wp-admin/options-general.php?page=thermometer-settings3.8039.09

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
thermometer_options
widget_recent-posts
thermometer_style
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Donation Thermometer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲9813.20 ▼1.412.12 ▲0.2842.41 ▼1.29
Dashboard /wp-admin2,279 ▲795.88 ▼0.0399.37 ▼1.3746.63 ▲3.71
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0439.35 ▼0.9535.87 ▼0.36
Add New Post /wp-admin/post-new.php1,537 ▲2023.43 ▲5.91678.52 ▲61.7061.95 ▲6.66
Media Library /wp-admin/upload.php1,392 ▲74.17 ▼0.0493.83 ▼5.2638.59 ▼3.11
Thermometer /wp-admin/options-general.php?page=thermometer-settings1,2742.3839.7642.33

Uninstaller [IO: ✅] [DB: ▲0.00MB] 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/donation-thermometer/donation_therm.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/donation-thermometer/includes/therm_widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/donation-thermometer/includes/therm_shortcode.php:299
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/donation-thermometer/includes/therm_widget-config.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots do not have images: #1 (The Thermometer settings page.), #2 (Multiple thermometers displayed on a page/sidebar. Unique values and colours can be assigned for each.), #3 (Customisable CSS rules for thermometers.), #4 (The help page describing the various shortcode options and functionality.)
You can look at the official readme.txt

donation-thermometer/donation_therm.php 85% from 13 tests

The main file in "Donation Thermometer" v. 2.2.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 300 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("donation-thermometer.php" instead of "donation_therm.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 plugin1,544 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP82241911,515
JavaScript12029

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin