84% tunl-payment-gateway

Code Review | Tunl Payment Gateway for WooCommerce

WordPress plugin Tunl Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: tunl-payment-gateway
  • Plugin version: 1.0.22
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.1.1
  • WordPress version: 6.3.1
  • First release: May 4, 2023
  • Latest release: Aug 14, 2023
  • Number of updates: 18
  • Update frequency: every 5.7 days
  • Top authors: tunl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /213 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
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.24ms] Passed 4 tests

Analyzing server-side resources used by Tunl Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1141.38 ▼1.51
Dashboard /wp-admin3.42 ▲0.1145.84 ▼7.85
Posts /wp-admin/edit.php3.53 ▲0.1745.16 ▼4.15
Add New Post /wp-admin/post-new.php6.00 ▲0.1190.66 ▼7.45
Media Library /wp-admin/upload.php3.34 ▲0.1137.18 ▲0.49

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Tunl Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3813.18 ▼1.091.77 ▼0.3341.81 ▼2.54
Dashboard /wp-admin2,215 ▲305.85 ▲0.79103.42 ▼19.2537.39 ▼9.30
Posts /wp-admin/edit.php2,097 ▲82.00 ▲0.0033.58 ▼0.2534.15 ▼2.70
Add New Post /wp-admin/post-new.php1,544 ▲3023.09 ▲5.49619.38 ▼19.7049.86 ▼5.53
Media Library /wp-admin/upload.php1,400 ▲124.18 ▼0.11102.14 ▼6.7344.46 ▼1.60

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tunl-payment-gateway/class-wc-tunl-gateway.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

tunl-payment-gateway/class-wc-tunl-gateway.php 92% from 13 tests

"Tunl Payment Gateway for WooCommerce" version 1.0.22's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("tunl-payment-gateway.php" instead of "class-wc-tunl-gateway.php")

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
No dangerous file extensions were detected911 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP115780628
JavaScript4278159
CSS312069
SVG40055

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.20
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity4.78
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions19
▷ Named functions1894.74%
▷ Anonymous functions15.26%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin