89% checkout-for-paypal

Code Review | Checkout for PayPal

WordPress plugin Checkout for PayPal scored89%from 54 tests.

About plugin

  • Plugin page: checkout-for-paypal
  • Plugin version: 1.0.26
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Nov 10, 2020
  • Latest release: Nov 17, 2023
  • Number of updates: 42
  • Update frequency: every 26.2 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /30,327 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▲4.26ms] Passed 4 tests

A check of server-side resources used by Checkout for PayPal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2837.95 ▼1.16
Dashboard /wp-admin3.59 ▲0.2954.58 ▲7.05
Posts /wp-admin/edit.php3.70 ▲0.3551.67 ▲7.37
Add New Post /wp-admin/post-new.php6.17 ▲0.2894.11 ▲7.79
Media Library /wp-admin/upload.php3.51 ▲0.2834.95 ▲3.76
Add-ons /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-addons3.4830.84
Add New /wp-admin/post-new.php?post_type=coforpaypal_order3.6249.06
Settings /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-settings3.4831.89
Debug /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-debug3.4832.35
All Orders /wp-admin/edit.php?post_type=coforpaypal_order3.5635.91

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 9 new options
New WordPress options
checkout_for_paypal_db_version
checkoutforpaypal_logfile_suffix
db_upgraded
widget_theysaidso_widget
checkout_for_paypal_email_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Checkout for PayPal
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲9514.21 ▲0.021.84 ▲0.1640.55 ▼4.22
Dashboard /wp-admin2,237 ▲575.64 ▼0.0189.45 ▼11.7740.21 ▼1.73
Posts /wp-admin/edit.php2,142 ▲421.97 ▼0.0540.05 ▲2.4334.55 ▼4.24
Add New Post /wp-admin/post-new.php1,567 ▲4118.61 ▼5.04601.62 ▲5.2169.26 ▲18.83
Media Library /wp-admin/upload.php1,439 ▲454.21 ▼0.0597.25 ▼1.9743.82 ▼0.55
Add-ons /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-addons8981.9927.9036.09
Add New /wp-admin/post-new.php?post_type=coforpaypal_order2,1367.66184.7861.00
Settings /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-settings1,0582.0124.5632.35
Debug /wp-admin/edit.php?post_type=coforpaypal_order&page=checkout-for-paypal-debug8772.0025.5727.61
All Orders /wp-admin/edit.php?post_type=coforpaypal_order1,1511.9132.1631.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • checkout_for_paypal_db_version
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • checkoutforpaypal_logfile_suffix
    • checkout_for_paypal_email_options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% 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: ecommerce, e-commerce, paypal, payments, checkout

checkout-for-paypal/main.php 85% from 13 tests

The main PHP script in "Checkout for PayPal" version 1.0.26 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("checkout-for-paypal.php" instead of "main.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
Everything looks great! No dangerous files found in this plugin1,431 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP494361,397
CSS10034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity106.00
▷ Minimum class complexity106.00
▷ Maximum class complexity106.00
Average method complexity5.77
▷ 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%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/images/checkout-for-paypal-dynamic-buttons.png3.64KB2.78KB▼ 23.47%
addons/images/checkout-for-paypal-variable-price.png5.90KB2.78KB▼ 52.87%
addons/images/checkout-for-paypal-contact-form-7-integration.png2.93KB2.04KB▼ 30.42%