74% palmodule-paypal-payment-for-woocoomerce

Code Review | PayPal Payment for WooCommerce

WordPress plugin PayPal Payment for WooCommerce scored 74% from 54 tests.

About plugin

  • Plugin page: palmodule-paypal-...
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2017
  • Latest release: Dec 6, 2021
  • Number of updates: 19
  • Update frequency: every 82.7 days
  • Top authors: palmoduledev (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 7,899 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.53ms] Passed 4 tests

Analyzing server-side resources used by PayPal Payment for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.28 ▼6.32
Dashboard /wp-admin3.33 ▲0.0246.44 ▲1.30
Posts /wp-admin/edit.php3.38 ▲0.0245.59 ▼2.75
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.93 ▼18.36
Media Library /wp-admin/upload.php3.25 ▲0.0244.94 ▲11.34

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 439 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for PayPal Payment for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲17713.92 ▼0.448.54 ▲6.7342.06 ▲2.97
Dashboard /wp-admin2,213 ▲254.88 ▼0.01102.00 ▲0.7743.68 ▼1.06
Posts /wp-admin/edit.php2,093 ▲42.13 ▲0.1236.57 ▼6.1932.48 ▼2.75
Add New Post /wp-admin/post-new.php1,532 ▼123.42 ▲0.62635.45 ▼42.6160.26 ▲6.19
Media Library /wp-admin/upload.php1,386 ▼24.23 ▼0.0197.00 ▼7.0841.14 ▼4.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 246× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/Descriptor.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/AchMandate.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Api\\Address' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/paypal-rest/lib/PayPal/Api/ShippingAddress.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/Transaction/CustomerDetails.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/paypal-rest/lib/PayPal/Api/WebhookEventList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/AndroidPayCard.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/ConnectedMerchantStatusTransitioned.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Api\\Payment' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/paypal-rest/lib/PayPal/Api/FuturePayment.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/Result/Error.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/Braintree/SettlementBatchSummary.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: paypal, express checkout, braintree, payment, woocommerce...

palmodule-paypal-payment-for-woocoomerce/palmodule-paypal-payment-for-woocoomerce.php 92% from 13 tests

The main file in "PayPal Payment for WooCommerce" v. 1.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("1.0.5" instead of "3.8")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/braintree/lib/ssl/api_braintreegateway_com.ca.crt
    • .bat - Batch File in Windows
      • wp-content/plugins/palmodule-paypal-payment-for-woocoomerce/includes/php-library/paypal-rest/vendor/bin/phpunit.bat
34,485 lines of code in 424 files:
LanguageFilesBlank linesComment linesLines of code
PHP3865,22720,81130,369
YAML20127893,144
JSON500609
JavaScript3827184
Markdown441099
CSS31440
XML13027
Bourne Shell1359
DOS Batch1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces29
Interfaces6
Traits2
Classes364
▷ Abstract classes51.37%
▷ Concrete classes35998.63%
▷ Final classes00.00%
Methods3,336
▷ Static methods48014.39%
▷ Public methods3,12593.68%
▷ Protected methods541.62%
▷ Private methods1574.71%
Functions19
▷ Named functions1684.21%
▷ Anonymous functions315.79%
Constants671
▷ Global constants60.89%
▷ Class constants66599.11%
▷ Public constants665100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/cards.png19.60KB2.61KB▼ 86.71%