84% woo-pensopay

Code Review | WooCommerce PensoPay

WordPress plugin WooCommerce PensoPay scored84%from 54 tests.

About plugin

  • Plugin page: woo-pensopay
  • Plugin version: 6.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 26, 2018
  • Latest release: Sep 5, 2023
  • Number of updates: 47
  • Update frequency: every 38.5 days
  • Top authors: pensopay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /34,177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▼5.32ms] Passed 4 tests

An overview of server-side resources used by WooCommerce PensoPay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4448.73 ▲9.13
Dashboard /wp-admin3.78 ▲0.4457.36 ▲7.86
Posts /wp-admin/edit.php3.83 ▲0.4452.17 ▼3.05
Add New Post /wp-admin/post-new.php6.35 ▲0.4386.52 ▼29.45
Media Library /wp-admin/upload.php3.64 ▲0.3741.25 ▲3.38
PensoPay - Virtual Terminal /wp-admin/edit.php?post_type=vterminal_payment3.7553.73

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 158 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce PensoPay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.44 ▲0.011.83 ▲0.2145.83 ▲0.02
Dashboard /wp-admin2,206 ▲395.61 ▲0.0192.87 ▼12.5344.94 ▲4.95
Posts /wp-admin/edit.php2,108 ▲82.13 ▲0.1638.71 ▼3.2934.90 ▼3.41
Add New Post /wp-admin/post-new.php1,539 ▲1323.35 ▲0.32634.55 ▼77.6951.98 ▼4.36
Media Library /wp-admin/upload.php1,408 ▲84.23 ▲0.0497.98 ▼6.7847.16 ▲2.80
PensoPay - Virtual Terminal /wp-admin/edit.php?post_type=vterminal_payment1,0831.9438.6337.93

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 41× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_template_part() in wp-content/plugins/woo-pensopay/templates/checkout/iframe.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/woo-pensopay/views/checkout/payment-overlay.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_user_meta() in wp-content/plugins/woo-pensopay/templates/admin/virtualterminal/grid-notices.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_Instance' not found in wp-content/plugins/woo-pensopay/classes/instances/resurs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-pensopay/extensions/polylang.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_Instance' not found in wp-content/plugins/woo-pensopay/classes/instances/klarna.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_Instance' not found in wp-content/plugins/woo-pensopay/classes/instances/ideal.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_Instance' not found in wp-content/plugins/woo-pensopay/classes/instances/pensopay-extra.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_VirtualTerminal_Payment' not found in wp-content/plugins/woo-pensopay/templates/admin/virtualterminal/payment.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PensoPay_Instance' not found in wp-content/plugins/woo-pensopay/classes/instances/paypal.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: woocommerce pensopay, woo commerce, woocommerce, pensopay, payment...

woo-pensopay/woocommerce-pensopay.php 85% from 13 tests

"WooCommerce PensoPay" version 6.3.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-pensopay.php" instead of "woocommerce-pensopay.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected16,521 lines of code in 113 files:
LanguageFilesBlank linesComment linesLines of code
PHP671,5573,0996,561
JavaScript84385243,723
PO File41,2741,9033,021
SVG309252,924
CSS3513281
XML10011

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity16.90
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes12.08%
▷ Concrete classes4797.92%
▷ Final classes00.00%
Methods413
▷ Static methods9523.00%
▷ Public methods38793.70%
▷ Protected methods81.94%
▷ Private methods184.36%
Functions39
▷ Named functions2564.10%
▷ Anonymous functions1435.90%
Constants37
▷ Global constants38.11%
▷ Class constants3491.89%
▷ Public constants34100.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
33 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/mobilepay-checkout/white/small@1x.png4.93KB1.44KB▼ 70.77%
assets/images/mobilepay-checkout/darkblue/medium@2x.png10.23KB3.24KB▼ 68.35%
assets/images/mobilepay-checkout/white/medium@2x.png8.91KB3.16KB▼ 64.58%
assets/images/mobilepay-checkout/mpblue/small@1x.png5.29KB1.65KB▼ 68.72%
assets/images/mobilepay-checkout/whitestroke/medium@2x.png9.02KB3.22KB▼ 64.26%