74% woo-paypal-express-checkout

Code Review | PayPal Express Checkout For Woo

WordPress plugin PayPal Express Checkout For Woo scored74%from 54 tests.

About plugin

  • Plugin page: woo-paypal-expres...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.2
  • WordPress version: 6.3.1
  • First release: Sep 25, 2017
  • Latest release: Dec 6, 2021
  • Number of updates: 7
  • Update frequency: every 219.2 days
  • Top authors: palmoduledev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /5,235 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.54ms] Passed 4 tests

An overview of server-side resources used by PayPal Express Checkout For Woo
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.34 ▼9.12
Dashboard /wp-admin3.38 ▲0.0448.98 ▼15.26
Posts /wp-admin/edit.php3.50 ▲0.1449.05 ▼1.96
Add New Post /wp-admin/post-new.php5.99 ▲0.1085.61 ▼7.81
Media Library /wp-admin/upload.php3.31 ▲0.0836.35 ▲0.15

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 263 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by PayPal Express Checkout For Woo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲12413.51 ▼0.857.51 ▲4.8643.06 ▼5.79
Dashboard /wp-admin2,194 ▲145.63 ▼0.0289.90 ▼1.4240.70 ▲2.44
Posts /wp-admin/edit.php2,102 ▲51.98 ▼0.1233.66 ▼4.8532.75 ▼0.99
Add New Post /wp-admin/post-new.php1,528 ▲223.55 ▲0.34688.03 ▼3.4456.29 ▲3.43
Media Library /wp-admin/upload.php1,405 ▲24.20 ▼0.02107.46 ▲4.6344.21 ▲0.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 151× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/RedirectUrls.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/vendor/symfony/yaml/Tests/YamlTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/InputFields.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/PaymentInstruction.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Api\\BaseAddress' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/Address.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/Capture.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/OpenIdTokeninfo.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/ExternalFunding.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Api/TemplateSettings.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
Please take inspiration from this readme.txt

woo-paypal-express-checkout/woo-paypal-express-checkout.php Passed 13 tests

Analyzing the main PHP file in "PayPal Express Checkout For Woo" version 1.0.2
69 characters long description:
Express Checkout for WooCommerce. Develop by Official PayPal Partner.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/vendor/bin/phpunit.bat
22,344 lines of code in 252 files:
LanguageFilesBlank linesComment linesLines of code
PHP2163,55516,48418,319
YAML20127893,144
JSON400573
JavaScript3227129
Markdown441099
CSS21040
XML13027
Bourne Shell1359
DOS Batch1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.75
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces19
Interfaces6
Traits2
Classes201
▷ Abstract classes31.49%
▷ Concrete classes19898.51%
▷ Final classes00.00%
Methods2,318
▷ Static methods964.14%
▷ Public methods2,26197.54%
▷ Protected methods80.35%
▷ Private methods492.11%
Functions17
▷ Named functions1588.24%
▷ Anonymous functions211.76%
Constants32
▷ Global constants721.88%
▷ Class constants2578.12%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin