74% paypal-donations

Code Review | Donations via PayPal

WordPress plugin Donations via PayPal scored74%from 54 tests.

About plugin

  • Plugin page: paypal-donations
  • Plugin version: 1.9.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: May 8, 2009
  • Latest release: Jul 25, 2023
  • Number of updates: 178
  • Update frequency: every 29.2 days
  • Top authors: artstorm (73.6%)mra13 (26.97%)

Code review

54 tests

User reviews

24 reviews

Install metrics

30,000+ active /912,602 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼1.32ms] Passed 4 tests

Analyzing server-side resources used by Donations via PayPal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1547.45 ▲0.72
Dashboard /wp-admin3.48 ▲0.1752.34 ▲2.55
Posts /wp-admin/edit.php3.59 ▲0.2455.43 ▲6.07
Add New Post /wp-admin/post-new.php6.06 ▲0.1790.87 ▼6.59
Media Library /wp-admin/upload.php3.40 ▲0.1735.71 ▼1.96
PayPal Donations /wp-admin/options-general.php?page=paypal-donations-options3.3834.09

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Donations via PayPal
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.132.25 ▲0.4642.52 ▲2.22
Dashboard /wp-admin2,202 ▲255.56 ▼0.0386.19 ▼2.9437.77 ▼0.80
Posts /wp-admin/edit.php2,104 ▲72.01 ▲0.0534.61 ▼6.3839.83 ▲1.48
Add New Post /wp-admin/post-new.php1,540 ▲1418.12 ▼4.92617.47 ▼47.9978.21 ▲20.03
Media Library /wp-admin/upload.php1,407 ▲134.21 ▲0.02104.32 ▲2.0440.44 ▼6.12
PayPal Donations /wp-admin/options-general.php?page=paypal-donations-options1,3331.7128.9837.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method PayPalDonations::uninstall() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/paypal-donations/views/paypal-button.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paypal-donations/paypal_utility.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/paypal-donations/src/PayPalDonations/Widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/paypal-donations/views/admin.php:19
    • > PHP Notice
      Undefined variable: title_id in wp-content/plugins/paypal-donations/views/widget-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paypal-donations/paypal_utility.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/paypal-donations/views/widget-form.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed: You can look at the official readme.txt

paypal-donations/paypal-donations.php 92% from 13 tests

This is the main PHP file of "Donations via PayPal" version 1.9.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 208 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,614 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PO File165968521,436
PHP91331971,153
JavaScript10013
CSS13012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity14.50
▷ Minimum class complexity3.00
▷ Maximum class complexity38.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods46
▷ Static methods48.70%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.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 were not PNG files found in your plugin