73% conekta-payment-gateway

Code Review | Conekta Payment Gateway

WordPress plugin Conekta Payment Gateway scored73%from 54 tests.

About plugin

  • Plugin page: conekta-payment-g...
  • Plugin version: 3.7.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Jun 7, 2017
  • Latest release: Nov 22, 2023
  • Number of updates: 91
  • Update frequency: every 26.1 days
  • Top authors: eduardoconekta (53.85%)interfacesconekta (25.27%)conekta01 (23.08%)

Code review

54 tests

User reviews

5 reviews

Install metrics

4,000+ active /52,801 total downloads

Benchmarks

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.00MB] [CPU: ▼1.05ms] Passed 4 tests

Server-side resources used by Conekta Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.02 ▼6.39
Dashboard /wp-admin3.32 ▲0.0148.30 ▼0.96
Posts /wp-admin/edit.php3.37 ▲0.0048.84 ▲2.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0094.93 ▲1.75
Media Library /wp-admin/upload.php3.24 ▲0.0032.97 ▲1.40

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 72 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Conekta Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1814.69 ▲0.291.58 ▼0.3535.70 ▼10.27
Dashboard /wp-admin2,195 ▲215.55 ▼0.0289.61 ▼16.2043.31 ▼6.25
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0539.55 ▼3.7337.00 ▼1.10
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.12601.85 ▼56.3753.02 ▲2.99
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0095.74 ▲1.3540.38 ▼1.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 43× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaObject' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/ConektaResource.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conekta-payment-gateway/conekta_checkout.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\Handler' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/Exceptions/NoConnectionError.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/ShippingContact.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/ShippingLine.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/TaxLine.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/Method.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/Address.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\ConektaResource' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/Event.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Conekta\\Handler' not found in wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/Conekta/Exceptions/AuthenticationError.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Requires php: Version not formatted correctly
  • Screenshots: Please add an image for screenshot #4 (You will need to configure SSL since the user will be entering their credit card information directly in the checkout. They will not be redirected to another page.)
You can take inspiration from this readme.txt

conekta-payment-gateway/conekta_checkout.php 85% from 13 tests

This is the main PHP file of "Conekta Payment Gateway" version 3.7.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("conekta-payment-gateway.php" instead of "conekta_checkout.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 166 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/conekta-payment-gateway/lib/conekta-php/lib/ssl_data/ca_bundle.crt
4,506 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP546192583,215
JavaScript2219591,061
Markdown2760230

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.38
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes42
▷ Abstract classes37.14%
▷ Concrete classes3992.86%
▷ Final classes00.00%
Methods209
▷ Static methods5526.32%
▷ Public methods18387.56%
▷ Protected methods2210.53%
▷ Private methods41.91%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.32MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/banorte.png0.53KB0.54KB0.00%
images/credit.png0.30KB0.31KB0.00%
readme_files/webhook.png66.00KB18.82KB▼ 71.49%
readme_files/admin_card.png53.82KB14.38KB▼ 73.28%
images/credits.png3.53KB2.01KB▼ 43.13%