84% cloudpayments-gateway-for-woocommerce

Code Review | CloudPayments Gateway for WooCommerce

WordPress plugin CloudPayments Gateway for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: cloudpayments-gat...
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.7-6.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2019
  • Latest release: Sep 11, 2023
  • Number of updates: 63
  • Update frequency: every 22.6 days
  • Top authors: cpsupport (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active / 5,558 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.12ms] Passed 4 tests

This is a short check of server-side resources used by CloudPayments Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0325.11 ▼19.60
Dashboard /wp-admin3.36 ▲0.0545.93 ▲0.46
Posts /wp-admin/edit.php3.41 ▲0.0549.43 ▼1.37
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.61 ▼3.98
Media Library /wp-admin/upload.php3.28 ▲0.0535.73 ▲3.95

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

CloudPayments Gateway for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,469 ▼27713.15 ▼1.290.49 ▼1.2218.52 ▼22.76
Dashboard /wp-admin2,210 ▲254.90 ▼0.00106.63 ▲1.5738.67 ▼8.22
Posts /wp-admin/edit.php2,095 ▲32.18 ▲0.1940.36 ▼0.4433.02 ▼6.45
Add New Post /wp-admin/post-new.php1,532 ▼523.28 ▲0.13663.46 ▲33.7567.91 ▲17.66
Media Library /wp-admin/upload.php1,392 ▲14.23 ▲0.0096.60 ▼5.3045.61 ▼0.98

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 were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/cloudpayments-gateway-for-woocommerce/templates/payment-fields-checkout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/cloudpayments-gateway-for-woocommerce/templates/cloudpayments-widget.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Настройки модуля settings.png), #2 (Адреса уведомлений Webhook.png)
The official readme.txt is a good inspiration

cloudpayments-gateway-for-woocommerce/cloudpayments_gateway_for_wc.php 92% from 13 tests

"CloudPayments Gateway for WooCommerce" version 3.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cloudpayments-gateway-for-woocommerce.php" instead of "cloudpayments_gateway_for_wc.php")

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
There were no executable files found in this plugin1,483 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity50.67
▷ Minimum class complexity29.00
▷ Maximum class complexity87.00
Average method complexity5.11
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
▷ Static methods1027.03%
▷ Public methods2567.57%
▷ Protected methods00.00%
▷ Private methods1232.43%
▷ Named functions00.00%
▷ Anonymous functions2100.00%
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
visa-mastercard-uz.png3.16KB2.16KB▼ 31.82%
visa-mastercard.png2.63KB2.09KB▼ 20.54%