67% donate-button

Code Review | Donate by BestWebSoft - Donations Acception Extention for WordPress

WordPress plugin Donate by BestWebSoft - Donations Acception Extention for WordPress scored67%from 54 tests.

About plugin

  • Plugin page: donate-button
  • Plugin version: 2.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 16, 2013
  • Latest release: Aug 11, 2023
  • Number of updates: 39
  • Update frequency: every 90.5 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /24,114 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.86MB] [CPU: ▲2.94ms] Passed 4 tests

Server-side resources used by Donate by BestWebSoft - Donations Acception Extention for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8448.26 ▲8.16
Dashboard /wp-admin4.20 ▲0.8951.57 ▲4.63
Posts /wp-admin/edit.php4.25 ▲0.9056.27 ▲5.74
Add New Post /wp-admin/post-new.php6.74 ▲0.8597.74 ▼6.76
Media Library /wp-admin/upload.php4.06 ▲0.8346.87 ▲9.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 132 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_donate_widget
can_compress_scripts
widget_recent-comments
dnt_options
bstwbsftwppdtplgns_options
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Donate by BestWebSoft - Donations Acception Extention for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲21713.73 ▼1.021.56 ▼0.1039.67 ▲1.99
Dashboard /wp-admin2,364 ▲1765.89 ▲1.01109.90 ▼1.2642.75 ▼4.55
Posts /wp-admin/edit.php2,260 ▲1712.25 ▲0.1939.43 ▼0.6937.48 ▲0.92
Add New Post /wp-admin/post-new.php1,695 ▲17623.39 ▲0.36624.02 ▲26.6452.59 ▲1.02
Media Library /wp-admin/upload.php1,552 ▲1674.28 ▲0.12102.96 ▲7.1843.28 ▲0.03
Settings /wp-admin/donate.php260.440.1315.20
BWS Panel /wp-admin/donate.php?page=donate-bws-panel260.440.146.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/donate-button/donate.php+672
    rmdir(wp-content/donate-uploads/): No such file or directory
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× 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/donate-button/bws_menu/class-bws-settings.php:1452
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/donate-button/donate.php:256
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/donate-button/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/donate-button/includes/class-dnt-settings.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/donate.php
    • > Network (severe)
    wp-admin/donate.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/donate.php?page=donate-bws-panel
    • > Network (severe)
    wp-admin/donate.php?page=donate-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)

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
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Displaying Donate Widget in the Sidebar on your WordPress website.), #2 (Click on button `Donate` to see all payment systems.), #3 (Donate settings page.), #4 (Adding Donate Widget.)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

donate-button/donate.php 92% from 13 tests

The primary PHP file in "Donate by BestWebSoft - Donations Acception Extention for WordPress" version 2.1.8 is used by WordPress to initiate all plugin functionality
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 ("donate-button.php" instead of "donate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected19,242 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PO File103,4645,0777,779
CSS101892765,640
PHP94626285,132
JavaScript828112541
SVG400150

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity78.75
▷ Minimum class complexity21.00
▷ Maximum class complexity210.00
Average method complexity11.72
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2379.31%
▷ Protected methods00.00%
▷ Private methods620.69%
Functions71
▷ Named functions71100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
71 PNG files occupy 3.86MB with 2.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
bws_menu/css/jquery-ui-styles/1.12.1/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
bws_menu/css/jquery-ui-styles/1.12.1/images/ui-icons_454545_256x240.png6.92KB4.18KB▼ 39.61%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_glass_65_ffffff_1x400.png0.25KB0.11KB▼ 54.83%