67% altapay-for-woocommerce

Code Review | AltaPay for WooCommerce

WordPress plugin AltaPay for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: altapay-for-wooco...
  • Plugin version: 3.5.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Nov 16, 2016
  • Latest release: Nov 8, 2023
  • Number of updates: 186
  • Update frequency: every 13.7 days
  • Top authors: altapayint (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,367 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▲0.21ms] Passed 4 tests

An overview of server-side resources used by AltaPay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2943.00 ▲6.66
Dashboard /wp-admin3.59 ▲0.2847.82 ▲0.66
Posts /wp-admin/edit.php3.70 ▲0.3451.16 ▲2.86
Add New Post /wp-admin/post-new.php6.17 ▲0.2893.96 ▼6.61
Media Library /wp-admin/upload.php3.51 ▲0.2836.00 ▲3.92

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 557 new files
Database: 1 new table, 7 new options
New tables
wp_altapayCreditCardDetails
New WordPress options
altapay_cc_form_styling
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AltaPay for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.261.74 ▼0.0043.10 ▼3.08
Dashboard /wp-admin2,192 ▲155.63 ▲0.0691.18 ▼2.9141.47 ▲1.41
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.1239.63 ▲3.1434.66 ▼0.69
Add New Post /wp-admin/post-new.php1,526 ▼023.18 ▼0.40642.85 ▲5.0658.89 ▲10.80
Media Library /wp-admin/upload.php1,394 ▼94.23 ▲0.0998.90 ▼6.8942.70 ▼0.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_altapayCreditCardDetails
  • The uninstall procedure has failed, leaving 7 options in the database
    • altapay_cc_form_styling
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/altapay-for-woocommerce/views/tables/capture.blade.php
    • > /wp-content/plugins/altapay-for-woocommerce/views/tables/index.blade.php
    • > /wp-content/plugins/altapay-for-woocommerce/views/tables/refund.blade.php
    • > /wp-content/plugins/altapay-for-woocommerce/views/tables/creditCard.blade.php
  • 181× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\Response\\ReservationOfFixedAmountResponse' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Response/ChargeSubscriptionResponse.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\Response\\AbstractResponse' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Response/Embeds/CustomerInfo.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\AbstractApi' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Api/Others/QueryGiftcard.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/altapay-for-woocommerce/vendor/symfony/options-resolver/Exception/AccessException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/altapay-for-woocommerce/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/altapay-for-woocommerce/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\AbstractApi' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Api/Test/TestConnection.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\Exceptions\\Exception' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Exceptions/AuthenticationRequiredException.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Altapay\\Response\\AbstractResponse' not found in wp-content/plugins/altapay-for-woocommerce/vendor/altapay/api-php/src/Response/InvoiceTextResponse.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/altapay-for-woocommerce/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: gateway, payments, woocommerce, payment card industry, altapay

altapay-for-woocommerce/altapay.php 85% from 13 tests

The entry point to "AltaPay for WooCommerce" version 3.5.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("altapay-for-woocommerce.php" instead of "altapay.php")
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "3.9.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin58,919 lines of code in 471 files:
LanguageFilesBlank linesComment linesLines of code
PHP3526,44518,73047,697
Markdown742,44807,257
JSON26002,231
Smarty19987593
Blade5434578
JavaScript42448382
XML413187
YAML322475
Dockerfile18010
make1409

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.81
▷ Minimum class complexity1.00
▷ Maximum class complexity354.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces50
Interfaces38
Traits26
Classes250
▷ Abstract classes41.60%
▷ Concrete classes24698.40%
▷ Final classes4618.70%
Methods2,289
▷ Static methods24310.62%
▷ Public methods1,64972.04%
▷ Protected methods47020.53%
▷ Private methods1707.43%
Functions385
▷ Named functions11730.39%
▷ Anonymous functions26869.61%
Constants227
▷ Global constants5122.47%
▷ Class constants17677.53%
▷ Public constants16493.18%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
33 PNG files occupy 0.74MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/payment_icons/elv_giropay.png6.90KB2.97KB▼ 57.00%
assets/images/payment_icons/giftcard.png7.77KB3.38KB▼ 56.47%
assets/images/screenshot-4.png133.30KB35.42KB▼ 73.42%
assets/images/payment_icons/ideal.png22.48KB8.26KB▼ 63.26%
assets/images/payment_icons/creditcard.png6.60KB2.92KB▼ 55.75%