77% accept-donations-with-custom-amount

Code Review | Accept Donations with custom amount

WordPress plugin Accept Donations with custom amount scored77%from 54 tests.

About plugin

  • Plugin page: accept-donations-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9
  • WordPress version: 6.3.1
  • First release: Jun 2, 2021
  • Latest release: Feb 8, 2022
  • Number of updates: 4
  • Update frequency: every 62.8 days
  • Top authors: sgsoftwaresolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /534 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.00MB] [CPU: ▼9.38ms] Passed 4 tests

This is a short check of server-side resources used by Accept Donations with custom amount
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.08 ▼8.99
Dashboard /wp-admin3.31 ▼0.0343.93 ▼15.54
Posts /wp-admin/edit.php3.36 ▲0.0144.19 ▲0.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.57 ▼12.90
Media Library /wp-admin/upload.php3.23 ▲0.0133.19 ▼0.09

Server storage [IO: ▲0.05MB] [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: 23 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Accept Donations with custom amount
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.28 ▼1.031.76 ▼0.4239.46 ▼4.86
Dashboard /wp-admin2,210 ▲224.83 ▼1.0299.33 ▼9.4334.90 ▼13.19
Posts /wp-admin/edit.php2,092 ▲32.03 ▼0.0136.34 ▼7.3434.93 ▼2.54
Add New Post /wp-admin/post-new.php1,537 ▲823.40 ▲5.18661.26 ▲23.7970.00 ▲12.50
Media Library /wp-admin/upload.php1,392 ▲74.19 ▲0.0296.44 ▼15.1841.04 ▼5.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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/accept-donations-with-custom-amount/public/partials/sg-donation-woocommerce-public-display.php
    • > /wp-content/plugins/accept-donations-with-custom-amount/admin/partials/sg-donation-woocommerce-admin-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/accept-donations-with-custom-amount/includes/class-sg-donation-woocommerce-methods.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === accept-donations-with-custom-amount === )
The official readme.txt might help

accept-donations-with-custom-amount/sg-donation-woocommerce.php 77% from 13 tests

The main PHP script in "Accept Donations with custom amount" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("accept-donations-with-custom-amount.php" instead of "sg-donation-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin256 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13128543250
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin