78% charitydonation-thermometer

Code Review | Charity-thermometer

WordPress plugin Charity-thermometer scored78%from 54 tests.

About plugin

  • Plugin page: charitydonation-t...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 19, 2013
  • Latest release: Jun 9, 2013
  • Number of updates: 15
  • Update frequency: every 5.6 days
  • Top authors: eyouth.ace (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /4,807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼16.10ms] Passed 4 tests

A check of server-side resources used by Charity-thermometer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.92 ▼6.05
Dashboard /wp-admin3.39 ▲0.0849.25 ▼0.99
Posts /wp-admin/edit.php3.44 ▲0.0949.06 ▼7.25
Add New Post /wp-admin/post-new.php3.22 ▼2.6644.10 ▼50.10
Media Library /wp-admin/upload.php3.31 ▲0.0840.67 ▲2.71
All Thermometers /wp-admin/edit.php?post_type=wpch_thermometer3.3637.28
Add New /wp-admin/post-new.php?post_type=wpch_thermometer3.1741.04

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Charity-thermometer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲19213.44 ▼1.129.78 ▲8.0242.86 ▼3.95
Dashboard /wp-admin2,237 ▲605.62 ▲0.0084.96 ▼14.5781.29 ▲37.88
Posts /wp-admin/edit.php2,136 ▲362.01 ▲0.0235.82 ▲0.3235.16 ▲0.43
Add New Post /wp-admin/post-new.php1,582 ▲3723.33 ▼0.40749.71 ▲48.9238.21 ▼13.59
Media Library /wp-admin/upload.php1,442 ▲424.16 ▼0.07115.86 ▲8.0676.24 ▲26.67
All Thermometers /wp-admin/edit.php?post_type=wpch_thermometer1,1152.0130.9231.61
Add New /wp-admin/post-new.php?post_type=wpch_thermometer2,4687.64174.71142.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/wpcm_thermometer.php+199
    Undefined index: _wphc_wpnonce_
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php+94
    Undefined variable: dollar
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php+95
    Undefined variable: pound
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php+96
    Undefined variable: yen
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php+97
    Undefined variable: euro
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpch_thermometer
    • > Notice in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php+123
    Undefined variable: wpch_symbol

SRP 50% 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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/charitydonation-thermometer/wpcm_thermometer.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/charitydonation-thermometer/templates/wpch_metabox.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: meter, thermometer, donation, non-profit, donate...

charitydonation-thermometer/wpcm_thermometer.php 85% from 13 tests

The entry point to "Charity-thermometer" version 1.1.2 is a PHP file that has certain tags in its header comment area
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 ("charitydonation-thermometer.php" instead of "wpcm_thermometer.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 306 characters long)

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected657 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP29452382
CSS1162142
JavaScript24540133

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/icon.png1.61KB1.01KB▼ 37.35%
css/images/Thermometer.png10.90KB4.89KB▼ 55.14%
css/images/cti.png3.48KB1.91KB▼ 45.16%