10% payex-woocommerce-payments

Code Review | PayEx WooCommerce Payments

WordPress plugin PayEx WooCommerce Payments scored10%from 54 tests.

About plugin

  • Plugin page: payex-woocommerce...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2019
  • Latest release: Jul 21, 2019
  • Number of updates: 10
  • Update frequency: every 2.2 days
  • Top authors: payex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /839 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/payex-woocommerce-payments/vendors/php-name-parser/vendor/aait/php-name-parser/parser.php+437
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.65MB] [CPU: ▼54.52ms] Passed 4 tests

Analyzing server-side resources used by PayEx WooCommerce Payments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼1.127.02 ▼33.59
Dashboard /wp-admin2.36 ▼0.956.86 ▼45.93
Posts /wp-admin/edit.php2.36 ▼1.007.27 ▼44.02
Add New Post /wp-admin/post-new.php2.36 ▼3.538.32 ▼94.53
Media Library /wp-admin/upload.php2.36 ▼0.876.75 ▼25.50

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 170 new files
Database: 1 new table, 8 new options
New tables
wp_payex_transactions
New WordPress options
woocommerce_payex_psp_version
widget_theysaidso_widget
widget_recent-posts
recovery_mode_email_last_sent
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by PayEx WooCommerce Payments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9913.56 ▼0.822.00 ▲0.2037.39 ▼8.83
Dashboard /wp-admin2,215 ▲274.87 ▼1.03110.28 ▲5.0643.63 ▲0.52
Posts /wp-admin/edit.php2,101 ▲92.01 ▲0.0040.40 ▼2.8738.21 ▲4.39
Add New Post /wp-admin/post-new.php45 ▼1,4880.44 ▼22.560.08 ▼572.589.84 ▼40.29
Media Library /wp-admin/upload.php1,394 ▲64.20 ▼0.04103.98 ▲3.0567.90 ▲25.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/payex-woocommerce-payments/vendors/php-name-parser/vendor/aait/php-name-parser/parser.php+437
    Array and string offset access syntax with curly braces is deprecated
  • Zombie tables detected upon uninstall: 1 table
    • wp_payex_transactions
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • woocommerce_payex_psp_version
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/payex-woocommerce-payments/vendors/php-name-parser/vendor/aait/php-name-parser/examples.php
    • > /wp-content/plugins/payex-woocommerce-payments/tests/bootstrap.php
  • 41× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/payex-woocommerce-payments/vendors/php-name-parser/vendor/aait/php-name-parser/tests/FullNameParserTest.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\umberConverterInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\TimeGeneratorInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Provider\odeProviderInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php:23
    • > PHP Warning
      require_once(other/ide_stubs/libsodium.php): failed to open stream: No such file or directory in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/paragonie/random_compat/psalm-autoload.php on line 6
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Builder\\UuidBuilderInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/payex-woocommerce-payments/vendors/ramsey-uuid/vendor/ramsey/uuid/src/Generator/SodiumRandomGenerator.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/payex-woocommerce-payments/vendors/payex-ecom-php/vendor/payex/payex-ecom-php/tests/TestCase.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'TestCase' not found in wp-content/plugins/payex-woocommerce-payments/vendors/payex-ecom-php/vendor/payex/payex-ecom-php/tests/PurchaseTest.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: You can look at the official readme.txt

payex-woocommerce-payments/payex-woocommerce-payments.php 92% from 13 tests

The entry point to "PayEx WooCommerce Payments" version 1.3.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "3.0.0")

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
No dangerous file extensions were detected8,921 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,6044,7377,418
Markdown82870524
JSON1100389
PO File2183375376
YAML29067
XML44061
JavaScript15060
CSS10021
Bourne Shell1203
INI1012

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.42
▷ Minimum class complexity1.00
▷ Maximum class complexity143.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces13
Interfaces11
Traits0
Classes68
▷ Abstract classes11.47%
▷ Concrete classes6798.53%
▷ Final classes00.00%
Methods481
▷ Static methods377.69%
▷ Public methods43189.60%
▷ Protected methods387.90%
▷ Private methods122.49%
Functions33
▷ Named functions2884.85%
▷ Anonymous functions515.15%
Constants28
▷ Global constants725.00%
▷ Class constants2175.00%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.18MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/swish.png5.10KB2.48KB▼ 51.33%
assets/images/creditcards.png41.36KB7.23KB▼ 82.53%
assets/images/vipps.png4.07KB2.18KB▼ 46.40%
docs/image3.png10.81KB5.04KB▼ 53.42%
assets/images/invoice.png5.82KB2.67KB▼ 54.20%