10% yd-culqi-gateway-for-alidropship

Code Review | YD Culqi gateway for AliDropship

WordPress plugin YD Culqi gateway for AliDropship scored10%from 54 tests.

About plugin

  • Plugin page: yd-culqi-gateway-...
  • Plugin version: 2.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.9.3-5.9.2
  • WordPress version: 6.3.1
  • First release: Feb 17, 2021
  • Latest release: Apr 4, 2022
  • Number of updates: 8
  • Update frequency: every 52.4 days
  • Top authors: axeleus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,013 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'cg_install' not found or invalid function name

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

A check of server-side resources used by YD Culqi gateway for AliDropship
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.58 ▼8.23
Dashboard /wp-admin3.32 ▲0.0139.95 ▼12.48
Posts /wp-admin/edit.php3.37 ▲0.0145.24 ▼1.63
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.33 ▼9.82
Media Library /wp-admin/upload.php3.24 ▲0.0132.77 ▼1.01

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by YD Culqi gateway for AliDropship
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.241.55 ▼0.4842.82 ▲1.70
Dashboard /wp-admin2,206 ▲154.84 ▼0.08115.26 ▲10.6241.69 ▼3.20
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0239.65 ▲1.7139.00 ▲3.98
Add New Post /wp-admin/post-new.php1,542 ▲918.41 ▼4.66607.40 ▼43.3355.58 ▲9.33
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.0398.81 ▼5.1340.58 ▼5.30

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • 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 smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/yd-culqi-gateway-for-alidropship/yd-culqi-gateway-for-alidropship.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Gate\\Common\\Gateway' not found in wp-content/plugins/yd-culqi-gateway-for-alidropship/includes/Culqi/Checkout.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Gate\\Common\\Request' not found in wp-content/plugins/yd-culqi-gateway-for-alidropship/includes/Culqi/Message/PurchaseRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/yd-culqi-gateway-for-alidropship/core/init.php:53

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 93% 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 need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Settings), #2 (Enable Culqi), #3 (Public Key and App Key), #4 (Shop name and Shop description), #5 (Currency select)
You can take inspiration from this readme.txt

yd-culqi-gateway-for-alidropship/yd-culqi-gateway-for-alidropship.php 92% from 13 tests

This is the main PHP file of "YD Culqi gateway for AliDropship" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin387 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP412583387

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.50
▷ Minimum class complexity2.00
▷ Maximum class complexity13.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods777.78%
▷ Protected methods00.00%
▷ Private methods222.22%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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 were not PNG files found in your plugin