73% wc-mobilpayments-card

Code Review | LivePayments - mobilPay Card WooCommerce Payment Gateway

WordPress plugin LivePayments - mobilPay Card WooCommerce Payment Gateway scored 73% from 54 tests.

About plugin

  • Plugin page: wc-mobilpayments-...
  • Plugin version: 0.1.6
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Aug 27, 2021
  • Number of updates: 10
  • Update frequency: every 49.4 days
  • Top authors: alexandruboia (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

20+ active / 1,143 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.98ms] Passed 4 tests

An overview of server-side resources used by LivePayments - mobilPay Card WooCommerce Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1436.59 ▼2.17
Dashboard /wp-admin3.42 ▲0.1244.81 ▼4.19
Posts /wp-admin/edit.php3.47 ▲0.1148.52 ▼0.84
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.82 ▼8.71
Media Library /wp-admin/upload.php3.34 ▲0.1137.16 ▲3.61

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 125 new files
Database: 1 new table, 7 new options
New tables
wp_lvdwcmc_mobilpay_transactions
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
lvd_wc_mc_plugin_version
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by LivePayments - mobilPay Card WooCommerce Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7914.47 ▲0.181.80 ▲0.0531.18 ▼7.83
Dashboard /wp-admin2,223 ▲384.85 ▼1.00111.65 ▲2.0743.62 ▼1.87
Posts /wp-admin/edit.php2,103 ▲142.00 ▲0.0140.61 ▼2.2839.61 ▲0.57
Add New Post /wp-admin/post-new.php1,545 ▲2523.03 ▼0.32649.77 ▼17.1154.16 ▼2.45
Media Library /wp-admin/upload.php1,402 ▲144.25 ▲0.0394.10 ▼24.9346.02 ▼2.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wc-mobilpayments-card/lib/Installer.php+350
    rmdir(wp-content/uploads/livepayments-mp-wc): Directory not empty
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 17× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/WooCommerceAdminDashboardReportingWidgetsModule.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Mobilpay_Payment_Request_Abstract' not found in wp-content/plugins/wc-mobilpayments-card/lib/3rdParty/mobilpay/payment/request/Sms.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/WordPressDashboardReportingWidgetsModule.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/wc-mobilpayments-card/lib/MobilpayCreditCardGatewayDiagnosticsEmail.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/GatewayDiagnosticsModule.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/OrderTransactionSupportModule.php:37
    • > PHP Fatal error
      Trait 'LvdWcMc\\LoggingExtensions' not found in wp-content/plugins/wc-mobilpayments-card/lib/ApiServer.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/AdminTransactionDetailsModule.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'LvdWcMc\\PluginModules\\PluginModule' not found in wp-content/plugins/wc-mobilpayments-card/lib/pluginModules/WebPageAssetsExtensionPointsProviderModule.php:6
    • > AH00126
      Invalid URI in request '' 'GET /wp-content/plugins/wc-mobilpayments-card/media/../../../../../ HTTP/1.0'

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: woocommerce, card, payment, mobilpay, creditcard

wc-mobilpayments-card/lvdwcmc-plugin-main.php 77% from 13 tests

The entry point to "LivePayments - mobilPay Card WooCommerce Payment Gateway" version 0.1.6 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 be the same as the one declared in readme.txt ("5.0" instead of "3.2.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-mobilpayments-card.php" instead of "lvdwcmc-plugin-main.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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected16,134 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
PHP731,9724,5099,673
JavaScript219011,0255,321
CSS776151574
PO File1210262565
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.76
▷ Minimum class complexity1.00
▷ Maximum class complexity221.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces2
Interfaces1
Traits2
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods712
▷ Static methods273.79%
▷ Public methods43260.67%
▷ Protected methods588.15%
▷ Private methods22231.18%
Functions18
▷ Named functions1372.22%
▷ Anonymous functions527.78%
Constants145
▷ Global constants2013.79%
▷ Class constants12586.21%
▷ Public constants125100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
media/img/mobilpay.png4.89KB2.72KB▼ 44.41%