83% my-coolpay-payment-gateway-for-woocommerce

Code Review | My-CoolPay - Payment gateway for WooCommerce

WordPress plugin My-CoolPay - Payment gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: my-coolpay-paymen...
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-5.8
  • WordPress version: 6.3.1
  • First release: Oct 14, 2020
  • Latest release: Apr 15, 2022
  • Number of updates: 64
  • Update frequency: every 8.6 days
  • Top authors: laetitiadhi (78.13%)mathermann (23.44%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,443 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by My-CoolPay - Payment gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.28 ▲0.22
Dashboard /wp-admin3.35 ▲0.0149.09 ▼15.38
Posts /wp-admin/edit.php3.40 ▲0.0452.51 ▲3.38
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.15 ▼9.76
Media Library /wp-admin/upload.php3.27 ▲0.0436.23 ▼0.16

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for My-CoolPay - Payment gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.21 ▼0.071.70 ▼0.2048.21 ▲1.22
Dashboard /wp-admin2,192 ▲155.59 ▲0.0290.96 ▼1.2542.54 ▲4.31
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0540.39 ▼2.7135.21 ▲0.38
Add New Post /wp-admin/post-new.php1,535 ▲718.19 ▼4.88627.48 ▲7.1971.55 ▲20.73
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.0298.03 ▼4.0242.03 ▼3.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/my-coolpay-payment-gateway-for-woocommerce/include/mycoolpay_hooks.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-coolpay-payment-gateway-for-woocommerce/include/mycoolpay_callback.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/my-coolpay-payment-gateway-for-woocommerce/include/mycoolpay_update_wc_admin_order_list.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

my-coolpay-payment-gateway-for-woocommerce/my-coolpay-woocommerce-gateway.php 77% from 13 tests

The main PHP file in "My-CoolPay - Payment gateway for WooCommerce" ver. 1.5.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 275 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("my-coolpay-payment-gateway-for-woocommerce.php" instead of "my-coolpay-woocommerce-gateway.php")

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 detected380 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4110126380

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods758.33%
▷ Protected methods00.00%
▷ Private methods541.67%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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
6 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/my_coolpay_operators.png8.97KB3.80KB▼ 57.59%
images/visa_master_card.png4.38KB2.10KB▼ 52.15%
images/mcp.png2.72KB1.36KB▼ 49.86%
images/mcp_visa_master.png5.99KB2.62KB▼ 56.36%
images/mcp_momo_om.png6.60KB2.78KB▼ 57.89%