74% woo-gateway-fedapay

Code Review | FedaPay Gateway for WooCommerce

WordPress plugin FedaPay Gateway for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: woo-gateway-fedapay
  • Plugin version: 0.3.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 6.3.1
  • First release: Oct 3, 2018
  • Latest release: Oct 4, 2022
  • Number of updates: 47
  • Update frequency: every 31.1 days
  • Top authors: fedapay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /8,931 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.01MB] [CPU: ▼5.73ms] Passed 4 tests

Server-side resources used by FedaPay Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.04 ▼5.68
Dashboard /wp-admin3.31 ▲0.0145.83 ▼3.44
Posts /wp-admin/edit.php3.37 ▲0.0146.51 ▲1.03
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.62 ▼14.84
Media Library /wp-admin/upload.php3.24 ▲0.0137.21 ▲5.06

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 47 new files
Database: 1 new table, 8 new options
New tables
wp_wc_fedapay_orders_transactions
New WordPress options
wc_fedapay_gateway_bootstrap_warning_message
widget_theysaidso_widget
widget_recent-comments
wc_fedapay_db_version
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for FedaPay Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7413.23 ▼1.431.69 ▼0.2443.18 ▼1.43
Dashboard /wp-admin2,229 ▲385.90 ▲1.0798.51 ▼8.1739.17 ▼5.49
Posts /wp-admin/edit.php2,112 ▲232.02 ▼0.0342.20 ▲4.6235.53 ▼3.40
Add New Post /wp-admin/post-new.php1,548 ▲3423.63 ▲6.12667.99 ▼20.4950.37 ▼7.98
Media Library /wp-admin/upload.php1,405 ▲174.15 ▼0.0499.87 ▼1.5243.55 ▼1.79

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 did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • wc_fedapay_gateway_bootstrap_warning_message
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Resource' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/ApiKey.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Error\\Base' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Error/SignatureVerification.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'FedaPay\\HttpClient\\ClientInterface' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/HttpClient/CurlClient.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\FedaPayObject' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Resource.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Resource' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Event.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Error\\Base' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Error/ApiConnection.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Resource' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Account.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Error\\Base' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Error/InvalidRequest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Resource' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Customer.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FedaPay\\Resource' not found in wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/lib/Log.php:24

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please a description for screenshot #4 in woo-gateway-fedapay/assets to your readme.txt
  • Screenshots: Please add an image for screenshot #5 (Choose payment mode.)
You can look at the official readme.txt

woo-gateway-fedapay/woo-gateway-fedapay.php Passed 13 tests

The primary PHP file in "FedaPay Gateway for WooCommerce" version 0.3.4 is used by WordPress to initiate all plugin functionality
71 characters long description:
Take credit card and mobile money payments on your store using Fedapay.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/woo-gateway-fedapay/vendor/fedapay-php/data/ca-certificates.crt
2,372 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP374669512,021
PO File15361180
JavaScript23110112
SVG10143
XML10016

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.45
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces5
Interfaces1
Traits7
Classes25
▷ Abstract classes520.00%
▷ Concrete classes2080.00%
▷ Final classes00.00%
Methods147
▷ Static methods5336.05%
▷ Public methods11779.59%
▷ Protected methods128.16%
▷ Private methods1812.24%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants11
▷ Global constants436.36%
▷ Class constants763.64%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin