10% custom-post-donations

Code Review | WordPress PayPal Donations

WordPress plugin WordPress PayPal Donations scored 10% from 53 tests.

About plugin

  • Plugin page: custom-post-donat...
  • Plugin version: 4.2.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 5.8.1
  • First release: Aug 19, 2011
  • Latest release: Mar 10, 2021
  • Number of updates: 171
  • Update frequency: every 20.4 days
  • Top authors: hahncgdev (100%)

Code review

53 tests

User reviews

1 review

Install metrics

900+ active / 44,366 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/custom-post-donations/custom-post-donations.php+59
    Undefined variable: cpDonations_plugin_db_version

Server metrics [RAM: ▲0.09MB] [CPU: ▼264.06ms] Passed 4 tests

This is a short check of server-side resources used by WordPress PayPal Donations
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1934.77 ▲14.36
Dashboard /wp-admin3.13 ▲0.0843.63 ▼4.60
Posts /wp-admin/edit.php3.24 ▲0.1443.78 ▼1.99
Add New Post /wp-admin/post-new.php5.50 ▲0.0791.71 ▼1,042.45
Media Library /wp-admin/upload.php3.07 ▲0.0728.78 ▼7.18
Edit Donation /wp-admin/admin.php?page=edit-cpDonation3.1028.41
Add Donation /wp-admin/admin.php?page=add-cpDonation3.0630.15
WP Donations /wp-admin/admin.php?page=cpDonations-admin3.0621.75

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: 1 new table, 6 new options
New tables
wp_cp_donations
New WordPress options
cpDonations_plugin_db_version
cpDonations_returnUrl
cpDonations_Business_Name
widget_cp_donation_widget
cpDonations_buttonStyle
cpDonations_restrictToPagePost

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress PayPal Donations
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,823 ▲21716.28 ▲0.7413.11 ▲5.4644.19 ▼5.62
Dashboard /wp-admin2,968 ▲1185.98 ▲0.13135.76 ▼0.20111.12 ▲7.01
Posts /wp-admin/edit.php2,747 ▲412.69 ▼0.0068.08 ▲2.5193.08 ▲0.10
Add New Post /wp-admin/post-new.php1,884 ▲3119.17 ▼0.04374.83 ▼18.70108.38 ▲3.92
Media Library /wp-admin/upload.php1,813 ▲415.01 ▼0.01148.43 ▼21.09110.44 ▼12.75
Edit Donation /wp-admin/admin.php?page=edit-cpDonation1,1352.1062.5379.17
Add Donation /wp-admin/admin.php?page=add-cpDonation1,3762.0961.8782.37
WP Donations /wp-admin/admin.php?page=cpDonations-admin1,3662.1059.9276.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_cp_donations
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_cp_donation_widget
    • cpDonations_returnUrl
    • cpDonations_buttonStyle
    • cpDonations_Business_Name
    • cpDonations_plugin_db_version
    • cpDonations_restrictToPagePost

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/custom-post-donations/admin/edit-cpDonation.php
    • > /wp-content/plugins/custom-post-donations/admin/add-cpDonation.php
    • > /wp-content/plugins/custom-post-donations/admin/ws.php
    • > /wp-content/plugins/custom-post-donations/admin/overview.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/custom-post-donations/custom-post-donations.php:37
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/custom-post-donations/custom-post-donations.php on line 34
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-donations/lib/widget-class.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

custom-post-donations/custom-post-donations.php 92% from 13 tests

"WordPress PayPal Donations" version 4.2.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 178 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,037 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP66945800
JavaScript43252222
CSS23215

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected