78% emerchantpay-payment-page-for-woocommerce

Code Review | emerchantpay Gateway Module for WooCommerce

WordPress plugin emerchantpay Gateway Module for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: emerchantpay-paym...
  • Plugin version: 1.14.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Feb 19, 2016
  • Latest release: Oct 26, 2023
  • Number of updates: 129
  • Update frequency: every 21.8 days
  • Top authors: empproduct (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

900+ active /7,534 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼7.40ms] Passed 4 tests

An overview of server-side resources used by emerchantpay Gateway Module for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.99 ▲3.32
Dashboard /wp-admin3.31 ▲0.0043.56 ▼2.90
Posts /wp-admin/edit.php3.36 ▲0.0052.43 ▼8.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.61 ▼13.72
Media Library /wp-admin/upload.php3.23 ▲0.0031.44 ▼4.53

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for emerchantpay Gateway Module for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.16 ▼0.191.88 ▲0.0342.77 ▲0.23
Dashboard /wp-admin2,195 ▲185.64 ▲0.0390.30 ▲4.8941.64 ▼0.08
Posts /wp-admin/edit.php2,097 ▼31.99 ▼0.0038.26 ▲0.3135.12 ▼3.75
Add New Post /wp-admin/post-new.php1,528 ▲222.92 ▼0.62641.66 ▼60.0351.82 ▲1.81
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.0692.73 ▼9.5140.66 ▼6.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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/emerchantpay-payment-page-for-woocommerce/templates/admin/order/totals/common.php
  • 207× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\\Financial\\Cards\\CreditCard' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/Financial/Cards/Authorize.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\onFinancial\\Consumers\\BaseRequest' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/NonFinancial/Consumers/Enable.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\onFinancial\\KYC\\BaseRequest' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/NonFinancial/KYC/Call/Update.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\Exceptions\\Exception' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/Exceptions/EnvironmentNotSet.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\\Financial\\SouthAmericanPayment' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/Financial/CashPayments/Surtimax.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/WPF/Create.php:75
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\\Financial' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/Financial/Wallets/PayPal.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\onFinancial\\Fx\\BaseRequest' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/NonFinancial/Fx/GetRates.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\\Financial\\SouthAmericanPayment' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Webpay.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis\\API\\Request\\Base\onFinancial\\TokenizationApi\\BaseRequest' not found in wp-content/plugins/emerchantpay-payment-page-for-woocommerce/libraries/genesis/src/Genesis/API/Request/NonFinancial/TokenizationApi/GetCard.php:40

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: payments, genesis, mastercard, visa, payment processing...

emerchantpay-payment-page-for-woocommerce/index.php 85% from 13 tests

The principal PHP file in "emerchantpay Gateway Module for WooCommerce" v. 1.14.5 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("emerchantpay-payment-page-for-woocommerce.php" instead of "index.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin29,281 lines of code in 432 files:
LanguageFilesBlank linesComment linesLines of code
PHP4116,11428,15126,650
PO File250801,218
JavaScript121342881,131
Markdown1340177
CSS6512105

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.40
▷ Minimum class complexity1.00
▷ Maximum class complexity231.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces110
Interfaces2
Traits85
Classes317
▷ Abstract classes195.99%
▷ Concrete classes29894.01%
▷ Final classes113.69%
Methods1,711
▷ Static methods30117.59%
▷ Public methods94655.29%
▷ Protected methods71341.67%
▷ Private methods523.04%
Functions35
▷ Named functions617.14%
▷ Anonymous functions2982.86%
Constants1,171
▷ Global constants10.09%
▷ Class constants1,17099.91%
▷ Public constants1,170100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/emerchantpay_logo.png1.82KB0.95KB▼ 47.80%
assets/images/emerchantpay_direct.png1.00KB1.06KB0.00%
assets/images/logo.png0.25KB0.26KB0.00%
assets/images/emerchantpay_checkout.png1.07KB1.14KB0.00%