78% culqi-checkout

Code Review | Culqi

WordPress plugin Culqi scored78%from 54 tests.

About plugin

  • Plugin page: culqi-checkout
  • Plugin version: 3.0.11
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 21, 2022
  • Latest release: Nov 27, 2023
  • Number of updates: 24
  • Update frequency: every 17.0 days
  • Top authors: culqionline (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /6,592 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.82MB] [CPU: ▲1.06ms] Passed 4 tests

This is a short check of server-side resources used by Culqi
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5946.09 ▲3.47
Dashboard /wp-admin4.23 ▲0.8859.94 ▲1.33
Posts /wp-admin/edit.php4.26 ▲0.9057.12 ▲8.51
Add New Post /wp-admin/post-new.php6.83 ▲0.9494.70 ▼9.07
Media Library /wp-admin/upload.php4.15 ▲0.9245.76 ▲11.52
Orders /wp-admin/edit.php?post_type=culqi_orders4.1747.49
Webhooks /wp-admin/admin.php?page=fullculqi_webhooks4.1241.29
Culqi /wp-admin/admin.php?page=fullculqi_settings4.2144.60
Charges /wp-admin/edit.php?post_type=culqi_charges4.1746.96
FullCulqi Integration /wp-admin/index.php?page=fullculqi-welcome4.1341.67
Customers /wp-admin/edit.php?post_type=culqi_customers4.1751.23

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 314 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
fullculqi_2_0_0_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Culqi
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4514.67 ▲0.331.61 ▼0.1643.83 ▼0.25
Dashboard /wp-admin2,200 ▲205.64 ▼0.0593.39 ▼4.1641.15 ▼6.58
Posts /wp-admin/edit.php2,102 ▲21.99 ▲0.0240.21 ▲2.5736.66 ▼1.06
Add New Post /wp-admin/post-new.php1,528 ▲223.66 ▲0.37658.91 ▼63.1153.74 ▼5.26
Media Library /wp-admin/upload.php1,405 ▲84.25 ▲0.1599.25 ▲2.0543.98 ▲2.85
Orders /wp-admin/edit.php?post_type=culqi_orders1,1252.0138.2128.58
Webhooks /wp-admin/admin.php?page=fullculqi_webhooks8242.0425.6926.47
Culqi /wp-admin/admin.php?page=fullculqi_settings2,4631.9532.9170.76
Charges /wp-admin/edit.php?post_type=culqi_charges1,1122.0240.9432.87
FullCulqi Integration /wp-admin/index.php?page=fullculqi-welcome1,0232.2229.2752.16
Customers /wp-admin/edit.php?post_type=culqi_customers1,1072.0736.6631.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • fullculqi_2_0_0_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 18× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/culqi-checkout/vendor/rmccue/requests/examples/cookie.php
    • > /wp-content/plugins/culqi-checkout/resources/layouts/admin/settings/input_password.php
    • > /wp-content/plugins/culqi-checkout/includes/class-fullculqi-wc.php
    • > /wp-content/plugins/culqi-checkout/vendor/rmccue/requests/bin/create_pear_package.php
    • > /wp-content/plugins/culqi-checkout/vendor/rmccue/requests/examples/post.php
    • > /wp-content/plugins/culqi-checkout/admin/layouts/modal_merchants.php
    • > /wp-content/plugins/culqi-checkout/resources/layouts/admin/metaboxes/order_source.php
    • > /wp-content/plugins/culqi-checkout/vendor/rmccue/requests/examples/multiple.php
    • > /wp-content/plugins/culqi-checkout/vendor/rmccue/requests/examples/get.php
    • > /wp-content/plugins/culqi-checkout/resources/layouts/admin/metaboxes/charge_source.php
  • 176× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/culqi-checkout/vendor/rmccue/requests/library/Requests/Exception/HTTP/409.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/culqi-checkout/vendor/rmccue/requests/library/Requests/Exception/HTTP/412.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/culqi-checkout/vendor/rmccue/requests/bin/create_pear_package.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/culqi-checkout/includes/3rd-party/plugins/woocommerce/class-fullculqi-wc-admin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/culqi-checkout/resources/layouts/admin/settings/input_commerce.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/culqi-checkout/resources/layouts/admin/addons_page.php:3
    • > PHP Warning
      Use of undefined constant MPCULQI_URLAPI_MERCHANT_INTEG - assumed 'MPCULQI_URLAPI_MERCHANT_INTEG' (this will throw an Error in a future version of PHP) in wp-content/plugins/culqi-checkout/resources/layouts/admin/settings/input_enviroment.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/culqi-checkout/includes/class-fullculqi-endpoints.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/culqi-checkout/vendor/rmccue/requests/library/Requests/Exception/HTTP/505.php:13
    • > PHP Warning
      Use of undefined constant MPCULQI_URLAPI_ORDERCHARGES_INTEG - assumed 'MPCULQI_URLAPI_ORDERCHARGES_INTEG' (this will throw an Error in a future version of PHP) in wp-content/plugins/culqi-checkout/resources/layouts/admin/settings/input_enviroment.php on line 1

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: checkout, payment method, culqi, per, woocommerce

culqi-checkout/index.php 77% from 13 tests

The main file in "Culqi" v. 3.0.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("culqi-checkout.php" instead of "index.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "5.0")

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 plugin20,866 lines of code in 270 files:
LanguageFilesBlank linesComment linesLines of code
PHP1983,1325,61413,236
CSS11306793,282
JavaScript142313201,617
Markdown1546301,123
PO File2433598973
SVG1840341
JSON410171
YAML310558
XML22049
Bourne Shell24012
Python1104

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.93
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces4
Interfaces4
Traits0
Classes133
▷ Abstract classes32.26%
▷ Concrete classes13097.74%
▷ Final classes00.00%
Methods699
▷ Static methods11716.74%
▷ Public methods64091.56%
▷ Protected methods527.44%
▷ Private methods71.00%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants62
▷ Global constants2641.94%
▷ Class constants3658.06%
▷ Public constants36100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.41MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/assets/images/letsgo_1.png15.32KB6.30KB▼ 58.87%
resources/assets/images/letsgo_2.png21.49KB7.98KB▼ 62.85%
includes/3rd-party/plugins/woocommerce/assets/images/cards.png22.59KB6.96KB▼ 69.19%
admin/assets/images/letsgo_1.png15.32KB6.30KB▼ 58.87%
resources/assets/images/letsgo_3.png17.72KB7.52KB▼ 57.58%