78% alma-gateway-for-woocommerce

Code Review | Alma - Pay in installments or later for WooCommerce

WordPress plugin Alma - Pay in installments or later for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: alma-gateway-for-...
  • Plugin version: 5.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jun 1, 2022
  • Latest release: Oct 18, 2023
  • Number of updates: 45
  • Update frequency: every 11.6 days
  • Top authors: almapayments (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /17,912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.31ms] Passed 4 tests

Server-side resources used by Alma - Pay in installments or later for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.95 ▼0.91
Dashboard /wp-admin3.31 ▼0.0443.02 ▼18.56
Posts /wp-admin/edit.php3.36 ▲0.0042.71 ▼10.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.56 ▼15.57
Media Library /wp-admin/upload.php3.23 ▲0.0034.92 ▲0.25

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Alma - Pay in installments or later for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.35 ▼0.131.82 ▲0.2638.22 ▲2.82
Dashboard /wp-admin2,195 ▲175.54 ▼0.0983.67 ▼35.0039.67 ▼7.65
Posts /wp-admin/edit.php2,100 ▲31.98 ▲0.0035.41 ▼1.3636.62 ▲1.81
Add New Post /wp-admin/post-new.php1,526 ▼023.53 ▲0.39682.38 ▲14.6155.38 ▲3.58
Media Library /wp-admin/upload.php1,394 ▼64.14 ▼0.0399.08 ▼14.9545.71 ▼1.64

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

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

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 | 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
  • 28× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-payment-upon-trigger.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/helpers/class-alma-cart-helper.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-checkout.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-refund.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-cart-handler.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/admin/helpers/class-alma-form-fields-helper.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-product-handler.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/admin/helpers/class-alma-form-helper.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/includes/class-alma-logger.php
    • > /wp-content/plugins/alma-gateway-for-woocommerce/tests/bootstrap.php
  • 49× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/alma-gateway-for-woocommerce/public/templates/alma-checkout-no-plans.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Unit/PHP8_1/ClientOptionsValidatorTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Integration/PHP8_1/Endpoints/PaymentsTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Alma\\API\\Entities\\Base' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/src/Entities/Refund.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Unit/PHP7_2/ClientOptionsValidatorTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Integration/PHP7_0/Endpoints/PaymentsTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Unit/PHP8_1/RequestErrorTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/tests/Unit/Legacy/Endpoints/PaymentsTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Alma\\API\\Entities\\Base' not found in wp-content/plugins/alma-gateway-for-woocommerce/vendor/alma/alma-php-client/src/Entities/Webhook.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/alma-gateway-for-woocommerce/public/templates/alma-checkout-plans-in-page.php:12

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Please add descriptions for these screenshots #0, #0, #0, #0 in alma-gateway-for-woocommerce/assets to your readme.txt
The official readme.txt is a good inspiration

alma-gateway-for-woocommerce/alma-gateway-for-woocommerce.php Passed 13 tests

"Alma - Pay in installments or later for WooCommerce" version 5.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
Install Alma and boost your sales! It's simple and guaranteed, your cash flow is secured. 0 commitment, 0 subscription, 0 risk.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin31,779 lines of code in 209 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63,6731,40916,556
PHP1552,4916,67710,400
PO File71,1971,6802,905
CSS410210701
Markdown51580502
JSON400225
INI13631,495172
XML53242114
SVG1600102
YAML311251
make110322
Dockerfile17917
Bourne Shell16012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.94
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces31
Interfaces3
Traits3
Classes133
▷ Abstract classes21.50%
▷ Concrete classes13198.50%
▷ Final classes43.05%
Methods725
▷ Static methods9312.83%
▷ Public methods62686.34%
▷ Protected methods547.45%
▷ Private methods456.21%
Functions18
▷ Named functions422.22%
▷ Anonymous functions1477.78%
Constants98
▷ Global constants88.16%
▷ Class constants9091.84%
▷ Public constants90100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected