87% latitude-pay-genoa-pay-integrations

Code Review | LatitudePay & Genoapay Integrations for WooCommerce

WordPress plugin LatitudePay & Genoapay Integrations for WooCommerce scored 87% from 54 tests.

About plugin

  • Plugin page: latitude-pay-geno...
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 5.9.2
  • First release: Jul 15, 2020
  • Latest release: Jan 31, 2022
  • Number of updates: 43
  • Update frequency: every 13.2 days
  • Top authors: chandansharma (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active / 3,570 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼295.86ms] Passed 4 tests

Server-side resources used by LatitudePay & Genoapay Integrations for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0357.67 ▲4.27
Dashboard /wp-admin3.43 ▲0.0333.97 ▼1.89
Posts /wp-admin/edit.php3.66 ▲0.0340.95 ▲3.96
Add New Post /wp-admin/post-new.php6.91 ▼0.0698.06 ▼1,166.03
Media Library /wp-admin/upload.php3.32 ▲0.0227.98 ▼19.46

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 53 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

LatitudePay & Genoapay Integrations for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,775 ▲2115.88 ▲0.245.70 ▲0.132.18 ▼0.67
Dashboard /wp-admin2,907 ▲466.11 ▼0.02125.09 ▼10.49161.94 ▼10.38
Posts /wp-admin/edit.php2,704 ▲133.24 ▲0.0164.66 ▼0.08140.26 ▼1.63
Add New Post /wp-admin/post-new.php1,727 ▲3122.46 ▲0.63525.86 ▲81.64220.83 ▲12.58
Media Library /wp-admin/upload.php1,710 ▲125.52 ▼0.01138.06 ▼29.94189.56 ▼4.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/latitude-pay-genoa-pay-integrations/templates/checkout/genoapay/modal.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BinaryPay' not found in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/Gateways/Genoapay.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WC_LatitudeFinance_Base' not found in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/class-latitudefinance.php:27
    • > PHP Warning
      Use of undefined constant WC_LATITUDEPAY_ASSETS - assumed 'WC_LATITUDEPAY_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/latitude-pay-genoa-pay-integrations/templates/checkout/genoapay/modal.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/wc-latitudefinance-hooks.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Genoapay' not found in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/Gateways/Latitudepay.php:28
    • > PHP Fatal error
      Uncaught Error: Call to a member function output_checkout_fields() on null in wp-content/plugins/latitude-pay-genoa-pay-integrations/templates/checkout/genoapay/info.php:27
    • > PHP Notice
      Undefined variable: gateway in wp-content/plugins/latitude-pay-genoa-pay-integrations/templates/checkout/genoapay/info.php on line 27
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Genoapay_Blocks_Support' not found in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/Blocks/LatitudePay.php:5
    • > PHP Warning
      Use of undefined constant WC_LATITUDEPAY_ASSETS - assumed 'WC_LATITUDEPAY_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/latitude-pay-genoa-pay-integrations/templates/checkout/genoapay/modal.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/latitude-pay-genoa-pay-integrations/includes/Blocks/Genoapay.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed: Please take inspiration from this readme.txt

latitude-pay-genoa-pay-integrations/LatitudeFinance.php 77% from 13 tests

Analyzing the main PHP file in "LatitudePay & Genoapay Integrations for WooCommerce" version 2.2.1
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("latitude-pay-genoa-pay-integrations.php" instead of "LatitudeFinance.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 160 characters long)

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
Good job! No executable or dangerous file extensions detected2,821 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP265051,4692,336
CSS220209
SVG1102171
JavaScript372105

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity16.53
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes19.09%
Methods148
▷ Static methods106.76%
▷ Public methods12886.49%
▷ Protected methods1711.49%
▷ Private methods32.03%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants119
▷ Global constants65.04%
▷ Class constants11394.96%
▷ Public constants113100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/latitudepay/lp_phone.png3.34KB3.41KB0.00%
assets/genoapay/gen_background_slim_modal.png7.15KB6.85KB▼ 4.26%
assets/latitudepay/lp_tick.png0.35KB0.29KB▼ 18.84%
assets/latitudepay/lp_calender.png5.13KB5.27KB0.00%
assets/latitudepay/lpay_modal_logo.png4.85KB2.95KB▼ 39.32%