83% woo-verotelcardbilling-flexpay

Code Review | Verotel/CardBilling/Bill/GayCharge/BitsafePay FlexPay for WooCommerce

WordPress plugin Verotel/CardBilling/Bill/GayCharge/BitsafePay FlexPay for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-verotelcardbi...
  • Plugin version: 1.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2.1-5.9.1
  • WordPress version: 6.3.1
  • First release: Jun 19, 2017
  • Latest release: Apr 28, 2023
  • Number of updates: 75
  • Update frequency: every 28.6 days
  • Top authors: verotel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,427 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.07MB] [CPU: ▼17.31ms] Passed 4 tests

Analyzing server-side resources used by Verotel/CardBilling/Bill/GayCharge/BitsafePay FlexPay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.63 ▼1.59
Dashboard /wp-admin3.30 ▼0.0137.89 ▼12.76
Posts /wp-admin/edit.php3.36 ▲0.0040.30 ▼14.45
Add New Post /wp-admin/post-new.php5.54 ▼0.3577.90 ▼35.87
Media Library /wp-admin/upload.php3.30 ▲0.0732.53 ▼6.14

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Verotel/CardBilling/Bill/GayCharge/BitsafePay FlexPay for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.78 ▲0.412.01 ▲0.3343.20 ▲2.71
Dashboard /wp-admin2,209 ▲214.85 ▼1.0596.65 ▼13.8539.63 ▼6.19
Posts /wp-admin/edit.php2,092 ▼02.02 ▲0.0336.01 ▼7.9732.92 ▼2.94
Add New Post /wp-admin/post-new.php1,514 ▼1917.60 ▼5.48695.36 ▲58.2962.81 ▲9.89
Media Library /wp-admin/upload.php1,391 ▲34.17 ▲0.0495.10 ▼9.8043.65 ▼4.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/tests/FlexPayTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/classes/WC_Gateway_FlexPay.php:4
    • > PHP Fatal error
      Uncaught Verotel\\FlexPay\\Exception: Invalid merchant ID in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/src/Verotel/FlexPay/Brand.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/tests/VerotelFlexPayClientTest.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FlexPayWoo\\add_action() in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/classes/Initializer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/tests/VerotelFlexPayBrandTest.php:7
    • > PHP Fatal error
      Uncaught Verotel\\FlexPay\\Exception: Invalid merchant ID in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/src/Verotel/FlexPay/Brand.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/settings.php:6
    • > PHP Fatal error
      Uncaught Verotel\\FlexPay\\Exception: Invalid merchant ID in wp-content/plugins/woo-verotelcardbilling-flexpay/includes/vendor/verotel/flexpay-php-client/src/Verotel/FlexPay/Brand.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === woo-verotelcardbilling-flexpay === )
You can take inspiration from this readme.txt

woo-verotelcardbilling-flexpay/index.php 85% from 13 tests

"Verotel/CardBilling/Bill/GayCharge/BitsafePay FlexPay for WooCommerce" version 1.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-verotelcardbilling-flexpay.php" instead of "index.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.9.1" instead of "6.2.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,432 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP385272992,286
JSON20075
Markdown124051
HTML10014
YAML1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.36
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes14.00%
Methods153
▷ Static methods2315.03%
▷ Public methods14494.12%
▷ Protected methods10.65%
▷ Private methods85.23%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/logos.png19.65KB8.23KB▼ 58.12%