83% conotoxia-payment-gateway

Code Review | Conotoxia Pay Payment Gateway

WordPress plugin Conotoxia Pay Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: conotoxia-payment...
  • Plugin version: 1.31.18
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Jan 25, 2023
  • Latest release: Nov 27, 2023
  • Number of updates: 36
  • Update frequency: every 8.6 days
  • Top authors: conotoxia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,953 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.64ms] Passed 4 tests

An overview of server-side resources used by Conotoxia Pay Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.78 ▼6.32
Dashboard /wp-admin3.31 ▼0.0446.60 ▼14.97
Posts /wp-admin/edit.php3.36 ▲0.0048.65 ▲0.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.80 ▼9.69
Media Library /wp-admin/upload.php3.23 ▲0.0036.59 ▲2.93

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 334 new files
Database: no new tables, 11 new options
New WordPress options
conotoxia-pay-public_key_id
widget_theysaidso_widget
db_upgraded
conotoxia-pay-public_key_checksum
conotoxia-pay-payment_service_public_keys
conotoxia-pay-version
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Checking browser requirements for Conotoxia Pay Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.67 ▲0.341.66 ▼0.0337.11 ▼5.92
Dashboard /wp-admin2,198 ▲175.58 ▼0.1591.61 ▼6.4142.27 ▼1.20
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0639.15 ▲2.6335.29 ▲0.19
Add New Post /wp-admin/post-new.php1,526 ▼023.15 ▲0.10600.95 ▼12.9160.27 ▲10.96
Media Library /wp-admin/upload.php1,400 ▼34.21 ▼0.0596.81 ▲1.5341.70 ▲0.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 take a closer look at the following
  • 194× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'CKPL\\Pay\\Cryptography\\BigInteger\\Value\\ValueInterface' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Cryptography/BigInteger/Value/StringValue.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'CKPL\\Pay\\Model\\ResponseModelInterface' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Model/Response/PaymentServiceKeyResponseModel.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\Http\\HttpBadRequestException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/Api/InvalidPemException.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'CKPL\\Pay\\Model\\ResponseModelInterface' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Model/Response/RefundResponseModel.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\Http\\HttpException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/Http/HttpInternalServerErrorException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\Definition\\PaymentException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/DecodedReturnException.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\ConfigurationException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/ConfigurationResolverException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\Http\\HttpBadRequestException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/Api/ValidationErrorException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CKPL\\Pay\\Exception\\ClientException' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Exception/EndpointException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'CKPL\\Pay\\Endpoint\\EndpointInterface' not found in wp-content/plugins/conotoxia-payment-gateway/library/sdk/src/Endpoint/GetPublicKeysEndpoint.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

conotoxia-payment-gateway/woocommerce-gateway-conotoxia-pay.php 77% from 13 tests

The primary PHP file in "Conotoxia Pay Payment Gateway" version 1.31.18 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.4" instead of "4.2")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("conotoxia-payment-gateway.php" instead of "woocommerce-gateway-conotoxia-pay.php")

Code Analysis Passed 3 tests

File types Passed 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
Success! There were no dangerous files found in this plugin12,560 lines of code in 327 files:
LanguageFilesBlank linesComment linesLines of code
PHP2903,2948,85811,144
SVG2700524
PO File2194114414
Markdown2440194
CSS3260160
JavaScript3130124

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.05
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces74
Interfaces75
Traits8
Classes203
▷ Abstract classes52.46%
▷ Concrete classes19897.54%
▷ Final classes63.03%
Methods1,203
▷ Static methods514.24%
▷ Public methods1,05887.95%
▷ Protected methods947.81%
▷ Private methods514.24%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants230
▷ Global constants20.87%
▷ Class constants22899.13%
▷ Public constants19685.96%

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