83% cryptapi-payment-gateway-for-woocommerce

Code Review | CryptAPI Payment Gateway for WooCommerce

WordPress plugin CryptAPI Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: cryptapi-payment-...
  • Plugin version: 4.7.10
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5-6.3
  • WordPress version: 6.3.1
  • First release: Oct 18, 2019
  • Latest release: Aug 28, 2023
  • Number of updates: 72
  • Update frequency: every 19.6 days
  • Top authors: cryptapi (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

400+ active /15,827 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
Install script ran successfully

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

An overview of server-side resources used by CryptAPI Payment Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.08 ▼0.78
Dashboard /wp-admin3.33 ▲0.0249.57 ▲1.46
Posts /wp-admin/edit.php3.38 ▲0.0251.62 ▲1.83
Add New Post /wp-admin/post-new.php5.91 ▲0.0298.67 ▲0.09
Media Library /wp-admin/upload.php3.26 ▲0.0234.99 ▼0.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CryptAPI Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.24 ▲0.082.46 ▲0.4646.69 ▲2.40
Dashboard /wp-admin2,202 ▲355.60 ▼0.1095.93 ▼9.2342.79 ▲1.57
Posts /wp-admin/edit.php2,110 ▲131.98 ▼0.0542.76 ▲4.6937.58 ▲1.62
Add New Post /wp-admin/post-new.php1,537 ▲923.13 ▲0.07664.10 ▼3.1558.43 ▲5.04
Media Library /wp-admin/upload.php1,407 ▲74.28 ▲0.07110.25 ▼0.2948.05 ▲3.36

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
You still need to fix the following
  • The uninstall procedure has failed, 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 shallow check for server-side errors
Good news, no errors were detected

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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/cryptapi-payment-gateway-for-woocommerce/controllers/CryptAPI.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cryptapi-payment-gateway-for-woocommerce/define.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cryptapi-payment-gateway-for-woocommerce/define.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Requires at least: Version format is invalid
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can take inspiration from this readme.txt

cryptapi-payment-gateway-for-woocommerce/CryptAPI.php 85% from 13 tests

"CryptAPI Payment Gateway for WooCommerce" version 4.7.10'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: It is recommended to name the main PHP file as the plugin slug ("cryptapi-payment-gateway-for-woocommerce.php" instead of "CryptAPI.php")
  • Requires at least: Periods and digits should be used for the required version number (ex. "7.0" instead of "5")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin4,289 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP5312391,694
PO File44645431,576
CSS1920509
Markdown11000263
JavaScript1470185
SVG30062

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity97.00
▷ Minimum class complexity50.00
▷ Maximum class complexity144.00
Average method complexity5.80
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods40
▷ Static methods922.50%
▷ Public methods3792.50%
▷ Protected methods00.00%
▷ Private methods37.50%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/files/logo_ca.png67.00KB27.26KB▼ 59.31%
static/files/200_logo_ca.png4.03KB2.50KB▼ 37.85%