52% donations-block

Code Review | Donation Block For PayPal

WordPress plugin Donation Block For PayPal scored52%from 54 tests.

About plugin

  • Plugin page: donations-block
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 19, 2019
  • Latest release: Jan 31, 2023
  • Number of updates: 27
  • Update frequency: every 51.2 days
  • Top authors: BharatKambariya (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

700+ active /26,597 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.79MB] [CPU: ▼33.26ms] Passed 4 tests

An overview of server-side resources used by Donation Block For PayPal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1446.01 ▼0.20
Dashboard /wp-admin3.16 ▼0.1828.13 ▼40.15
Posts /wp-admin/edit.php3.17 ▼0.2039.37 ▼9.18
Add New Post /wp-admin/post-new.php3.16 ▼2.7325.89 ▼75.70
Media Library /wp-admin/upload.php3.16 ▼0.0722.83 ▼8.01
Donatione Record /wp-admin/admin.php?page=pdb_list3.1725.59
Setting /wp-admin/admin.php?page=pdb_setting3.1725.10

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 43 new files
Database: 1 new table, 6 new options
New tables
wp_pdb_paypal_doantion_block
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Donation Block For PayPal: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,238 ▲47721.75 ▲7.8012.79 ▲10.9942.17 ▼0.22
Dashboard /wp-admin2,434 ▲26011.23 ▲5.70266.87 ▲174.0244.84 ▲3.36
Posts /wp-admin/edit.php2,356 ▲25611.09 ▲9.1592.19 ▲54.3532.52 ▼6.52
Add New Post /wp-admin/post-new.php6,506 ▲4,98028.66 ▲5.52816.70 ▲173.8539.74 ▼17.48
Media Library /wp-admin/upload.php1,660 ▲26011.67 ▲7.50157.02 ▲62.3375.21 ▲28.46
Donatione Record /wp-admin/admin.php?page=pdb_list1,20511.29102.9760.47
Setting /wp-admin/admin.php?page=pdb_setting1,36010.7488.3234.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • Zombie tables detected upon uninstall: 1 table
    • wp_pdb_paypal_doantion_block
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pdb_setting
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

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 fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/donations-block/public/partials/donations-block-public-display.php
    • > /wp-content/plugins/donations-block/public/ajax-submit.php
    • > /wp-content/plugins/donations-block/admin/partials/donations-block-admin-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/donations-block/admin/class-donations-block-admin.php:635

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can look at the official readme.txt

donations-block/donations-block.php Passed 13 tests

This is the main PHP file of "Donation Block For PayPal" version 2.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
80 characters long description:
Create your own PayPal block as many as you want as per your need in simple way.

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
Everything looks great! No dangerous files found in this plugin1,379 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP13156533694
JavaScript53363550
CSS351096
SVG110039

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/total-donation.png2.19KB1.22KB▼ 44.50%
public/images/Group 72.png28.27KB9.15KB▼ 67.64%