80% paypro-gateways-woocommerce

Code Review | PayPro Gateways - WooCommerce

WordPress plugin PayPro Gateways - WooCommerce scored80%from 54 tests.

About plugin

  • Plugin page: paypro-gateways-w...
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8
  • WordPress version: 6.3.1
  • First release: Jan 15, 2016
  • Latest release: Nov 3, 2021
  • Number of updates: 33
  • Update frequency: every 64.2 days
  • Top authors: paypro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /7,591 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.00MB] [CPU: ▼7.86ms] Passed 4 tests

This is a short check of server-side resources used by PayPro Gateways - WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.59 ▼2.88
Dashboard /wp-admin3.31 ▲0.0047.81 ▼12.01
Posts /wp-admin/edit.php3.36 ▲0.0049.22 ▼5.60
Add New Post /wp-admin/post-new.php5.89 ▲0.00105.03 ▼10.96
Media Library /wp-admin/upload.php3.23 ▲0.0033.55 ▼2.32

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for PayPro Gateways - WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.30 ▼0.282.00 ▼0.1946.13 ▼0.70
Dashboard /wp-admin2,198 ▲245.65 ▼0.0391.91 ▼7.2440.92 ▼5.71
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0040.82 ▲2.8634.82 ▼2.37
Add New Post /wp-admin/post-new.php1,554 ▲2318.22 ▼4.93610.73 ▼32.2361.72 ▲8.62
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0597.75 ▼10.4045.92 ▼0.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
The official readme.txt might help

paypro-gateways-woocommerce/paypro-gateways-woocommerce.php Passed 13 tests

The entry point to "PayPro Gateways - WooCommerce" version 1.3.3 is a PHP file that has certain tags in its header comment area
88 characters long description:
With this plugin you easily add all PayPro payment gateways to your WooCommerce webshop.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/paypro-gateways-woocommerce/vendor/paypro/paypro-php-v1/data/ca-bundle.crt
      • wp-content/plugins/paypro-gateways-woocommerce/includes/paypro/api/ca-bundle.crt
1,674 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP303404401,453
PO File14649121
JSON20073
Markdown115027

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.22
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods123
▷ Static methods1512.20%
▷ Public methods11190.24%
▷ Protected methods75.69%
▷ Private methods54.07%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/paypro_wc_gateway_mistercash.png4.66KB1.58KB▼ 66.01%
assets/images/paypro_wc_gateway_mastercard.png3.68KB2.24KB▼ 39.23%
assets/images/paypro_wc_gateway_idealqr.png1.10KB1.04KB▼ 5.16%
assets/images/paypro_wc_gateway_banktransfer.png2.94KB1.82KB▼ 38.17%
assets/images/paypro_wc_gateway_visa.png1.28KB1.31KB0.00%