84% donations-for-woocommerce

Code Review | Potent Donations for WooCommerce

WordPress plugin Potent Donations for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: donations-for-woo...
  • Plugin version: 1.1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 9, 2016
  • Latest release: Oct 25, 2023
  • Number of updates: 52
  • Update frequency: every 54.7 days
  • Top authors: hearken (71.15%)aspengrovestudios (17.31%)annaqq (15.38%)

Code review

54 tests

User reviews

38 reviews

Install metrics

3,000+ active /48,411 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.25ms] Passed 4 tests

This is a short check of server-side resources used by Potent Donations for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0734.75 ▼5.12
Dashboard /wp-admin3.45 ▲0.1068.19 ▲10.31
Posts /wp-admin/edit.php3.49 ▲0.1345.37 ▼2.28
Add New Post /wp-admin/post-new.php5.95 ▲0.0783.24 ▼11.36
Media Library /wp-admin/upload.php3.29 ▲0.0735.56 ▲1.77

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
hm_wcdon_first_activate
can_compress_scripts

Browser metrics Passed 4 tests

Potent Donations for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.28 ▼0.041.94 ▲0.3938.70 ▼0.69
Dashboard /wp-admin2,195 ▲215.55 ▼0.0279.90 ▼5.7439.26 ▼3.79
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0433.90 ▼3.8133.07 ▼5.25
Add New Post /wp-admin/post-new.php1,526 ▼023.15 ▲0.19657.11 ▲1.3155.54 ▼5.81
Media Library /wp-admin/upload.php1,400 ▲94.39 ▲0.1793.27 ▼0.9940.76 ▼4.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • hm_wcdon_first_activate
    • widget_theysaidso_widget

Smoke tests 75% 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 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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/donations-for-woocommerce/admin.php:4
    • > PHP Notice
      Undefined variable: potent_slug in wp-content/plugins/donations-for-woocommerce/plugin-credit.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/donations-for-woocommerce/donations-for-woocommerce.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/donations-for-woocommerce/plugin-credit.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt might help

donations-for-woocommerce/donations-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Potent Donations for WooCommerce" version 1.1.11
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected312 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34267296
YAML12010
CSS1006

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions2496.00%
▷ Anonymous functions14.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/wp_zone_logo.png2.01KB2.14KB0.00%