84% wp-paypal

Code Review | Payment Button for PayPal

WordPress plugin Payment Button for PayPal scored84%from 54 tests.

About plugin

  • Plugin page: wp-paypal
  • Plugin version: 1.2.3.26
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Feb 16, 2015
  • Latest release: Nov 16, 2023
  • Number of updates: 115
  • Update frequency: every 27.9 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

10,000+ active /430,667 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▲3.88ms] Passed 4 tests

A check of server-side resources used by Payment Button for PayPal
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4949.79 ▲6.89
Dashboard /wp-admin3.80 ▲0.5066.15 ▲15.17
Posts /wp-admin/edit.php3.92 ▲0.5657.09 ▲10.24
Add New Post /wp-admin/post-new.php6.39 ▲0.5092.31 ▼16.78
Media Library /wp-admin/upload.php3.73 ▲0.5051.79 ▲21.21
All Orders /wp-admin/edit.php?post_type=wp_paypal_order3.7743.90
Debug /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-debug3.6935.65
Add-ons /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-addons3.7035.04
Settings /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-settings3.7035.10
Add New /wp-admin/post-new.php?post_type=wp_paypal_order3.8449.90

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 13 new options
New WordPress options
wp_paypal_currency_code
wp_paypal_db_version
widget_recent-posts
wp_paypal_email
db_upgraded
wp_paypal_email_options
can_compress_scripts
wp_paypal_enable_receiver_check
wppaypal_logfile_suffix
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Button for PayPal
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7014.72 ▲0.322.06 ▲0.1752.91 ▲9.04
Dashboard /wp-admin2,222 ▲485.50 ▼0.10102.82 ▲3.6237.70 ▼11.13
Posts /wp-admin/edit.php2,142 ▲422.01 ▲0.0742.63 ▲3.4648.02 ▲13.04
Add New Post /wp-admin/post-new.php1,435 ▼9117.82 ▼5.19602.98 ▼74.8548.72 ▼11.00
Media Library /wp-admin/upload.php1,436 ▲334.13 ▼0.14153.08 ▲52.3958.70 ▲15.26
All Orders /wp-admin/edit.php?post_type=wp_paypal_order1,1591.9435.3532.91
Debug /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-debug8772.0025.5929.29
Add-ons /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-addons1,0511.9923.4937.09
Settings /wp-admin/edit.php?post_type=wp_paypal_order&page=wp-paypal-settings1,1272.1722.4531.98
Add New /wp-admin/post-new.php?post_type=wp_paypal_order2,1367.61161.9558.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_recent-comments
    • widget_recent-posts
    • wp_paypal_currency_code
    • wp_paypal_enable_ipn_validation
    • wp_paypal_email
    • wp_paypal_enable_receiver_check
    • db_upgraded
    • wppaypal_logfile_suffix
    • can_compress_scripts
    • theysaidso_admin_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 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/wp-paypal/wp-paypal-order.php:173

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: paypal, cart, e-commerce, donation, checkout

wp-paypal/main.php 92% from 13 tests

Analyzing the main PHP file in "Payment Button for PayPal" version 1.2.3.26
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-paypal.php" instead of "main.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
No dangerous file extensions were detected2,597 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5134842,563
CSS10034

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity96.00
▷ Minimum class complexity96.00
▷ Maximum class complexity96.00
Average method complexity5.32
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants11
▷ Global constants11100.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
14 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/images/wp-paypal-buy-now-discount.png7.49KB3.42KB▼ 54.28%
addons/images/wp-paypal-variable-subscription.png2.63KB1.79KB▼ 31.77%
images/buy-now.png2.55KB1.76KB▼ 31.13%
addons/images/wp-paypal-variable-quantity.png7.57KB3.29KB▼ 56.59%
addons/images/wp-paypal-product-variations.png5.09KB2.58KB▼ 49.33%