83% takbull-gateway

Code Review | TakBull For WooCommerce

WordPress plugin TakBull For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: takbull-gateway
  • Plugin version: 4.0.5.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Apr 14, 2020
  • Latest release: Sep 3, 2023
  • Number of updates: 72
  • Update frequency: every 17.2 days
  • Top authors: supporttakbull (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,477 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.78ms] Passed 4 tests

This is a short check of server-side resources used by TakBull For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.40 ▲0.34
Dashboard /wp-admin3.33 ▼0.0151.22 ▼13.33
Posts /wp-admin/edit.php3.38 ▲0.0350.21 ▲1.18
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.43 ▼11.29
Media Library /wp-admin/upload.php3.25 ▲0.0339.56 ▲4.47

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for TakBull For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.37 ▼0.292.22 ▲0.2641.15 ▼1.31
Dashboard /wp-admin2,192 ▲155.57 ▼0.0689.71 ▼3.9138.73 ▼4.76
Posts /wp-admin/edit.php2,103 ▼01.98 ▼0.0439.23 ▲0.0536.85 ▲1.12
Add New Post /wp-admin/post-new.php1,526 ▼223.61 ▲0.61674.93 ▲28.7358.55 ▲2.13
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.05108.72 ▲4.7048.52 ▲1.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • wc_takbull_version
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Data' not found in wp-content/plugins/takbull-gateway/models/class-takbull-transaction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Data' not found in wp-content/plugins/takbull-gateway/includes/class-takbull-invoice.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/takbull-gateway/includes/class-takbull-order.php:2

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 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI ("")
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
Please take inspiration from this readme.txt

takbull-gateway/woocommerce-gateway-takbull.php 85% from 13 tests

The principal PHP file in "TakBull For WooCommerce" v. 4.0.5.10 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("takbull-gateway.php" instead of "woocommerce-gateway-takbull.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "4.4")

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
No dangerous file extensions were detected4,173 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP203665502,946
CSS2226809
JavaScript5177200
PO File1600145
SVG40473

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.88
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes16
▷ Abstract classes318.75%
▷ Concrete classes1381.25%
▷ Final classes00.00%
Methods140
▷ Static methods2014.29%
▷ Public methods13697.14%
▷ Protected methods10.71%
▷ Private methods32.14%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants27
▷ Global constants829.63%
▷ Class constants1970.37%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/cc_icons.png6.45KB2.17KB▼ 66.33%
includes/assets/images/mastercard_visa.png19.50KB2.10KB▼ 89.24%
includes/assets/images/logo_bit.png2.10KB1.89KB▼ 10.01%