84% wcmpg

Code Review | WooCommerce Multiple Payment Gateways (WCMPG)

WordPress plugin WooCommerce Multiple Payment Gateways (WCMPG) scored84%from 54 tests.

About plugin

  • Plugin page: wcmpg
  • Plugin version: 1.65
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2018
  • Latest release: Jul 17, 2023
  • Number of updates: 81
  • Update frequency: every 24.1 days
  • Top authors: ircf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /15,536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.84ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Multiple Payment Gateways (WCMPG)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.68 ▲0.75
Dashboard /wp-admin3.33 ▲0.0249.08 ▼3.61
Posts /wp-admin/edit.php3.38 ▲0.0247.56 ▼5.16
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.54 ▼7.32
Media Library /wp-admin/upload.php3.25 ▲0.0239.54 ▲5.21

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Multiple Payment Gateways (WCMPG)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼1.471.59 ▼0.1342.15 ▼4.46
Dashboard /wp-admin2,209 ▲185.90 ▲0.9997.74 ▼6.5239.14 ▲0.18
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0040.25 ▲5.3034.70 ▼0.18
Add New Post /wp-admin/post-new.php1,542 ▲1418.29 ▲0.10632.47 ▼35.7254.67 ▲5.45
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.0895.34 ▼10.5044.84 ▼1.71

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/paybox/class-wcmpg-paybox.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/mercanet/class-wcmpg-mercanet.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/sips-paypage-post/class-wcmpg-sips-paypage-post.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/admin/class-wcmpg-licence.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/sips/class-wcmpg-sips.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wcmpg/admin/settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wcmpg/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/axepta/class-wcmpg-axepta.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/systempay/class-wcmpg-systempay.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wcmpg/includes/monetico/class-wcmpg-monetico.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

wcmpg/wcmpg.php Passed 13 tests

"WooCommerce Multiple Payment Gateways (WCMPG)" version 1.65's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
42 characters long description:
Multiple Payment Gateways for WooCommerce.

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
Everything looks great! No dangerous files found in this plugin3,657 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP153465582,951
PO File1338581706

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity21.36
▷ Minimum class complexity5.00
▷ Maximum class complexity57.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods120
▷ Static methods10.83%
▷ Public methods10184.17%
▷ Protected methods10.83%
▷ Private methods1815.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.38MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/mercanet.png2.96KB1.79KB▼ 39.41%
assets/paypal.png44.63KB21.15KB▼ 52.62%
assets/paybox.png32.84KB16.91KB▼ 48.53%
assets/icons/paypal.png2.32KB1.72KB▼ 26.01%
assets/mercanet.png57.48KB19.45KB▼ 66.15%