84% wc-jibit-payment-gateway

Code Review | WooCommerce Payment Gateway

WordPress plugin WooCommerce Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: wc-jibit-payment-...
  • Plugin version: 1.3.3
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.7
  • WordPress version: 6.3.1
  • First release: Sep 2, 2018
  • Latest release: Oct 29, 2018
  • Number of updates: 17
  • Update frequency: every 5.2 days
  • Top authors: myjibit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /833 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.00MB] [CPU: ▼1.68ms] Passed 4 tests

Server-side resources used by WooCommerce Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.36 ▼2.76
Dashboard /wp-admin3.31 ▲0.0049.45 ▼3.92
Posts /wp-admin/edit.php3.36 ▲0.0051.04 ▼2.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.54 ▲2.96
Media Library /wp-admin/upload.php3.23 ▲0.0035.26 ▲2.01

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.42 ▼0.331.86 ▼0.0245.89 ▲2.67
Dashboard /wp-admin2,206 ▲155.85 ▲0.93112.52 ▲3.0340.52 ▲1.35
Posts /wp-admin/edit.php2,092 ▲32.00 ▲0.0242.34 ▲3.2836.04 ▼2.86
Add New Post /wp-admin/post-new.php1,532 ▲1223.46 ▼0.20632.45 ▼17.5851.06 ▼4.51
Media Library /wp-admin/upload.php1,385 ▼34.20 ▼0.04105.16 ▼2.4745.46 ▼3.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% 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 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
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-jibit-payment-gateway/filters.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wc-jibit-payment-gateway/templates/payment-form.php:60
    • > PHP Warning
      Use of undefined constant WC_JIBIT_PAYMENT_GATEWAY_DIR - assumed 'WC_JIBIT_PAYMENT_GATEWAY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-jibit-payment-gateway/init.php on line 2
    • > PHP Warning
      require(WC_JIBIT_PAYMENT_GATEWAY_DIR/actions.php): failed to open stream: No such file or directory in wp-content/plugins/wc-jibit-payment-gateway/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-jibit-payment-gateway/actions.php:3
    • > PHP Notice
      Undefined variable: autoRedirect in wp-content/plugins/wc-jibit-payment-gateway/templates/payment-form.php on line 60
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wc-jibit-payment-gateway/class-jibit-woocommerce-payment-gateway.php:13
    • > PHP Fatal error
      require(): Failed opening required 'WC_JIBIT_PAYMENT_GATEWAY_DIR/actions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wc-jibit-payment-gateway/init.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: payment gateway, woocommerce, payment

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

The main file in "WooCommerce Payment Gateway" v. 1.3.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 detected1,038 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9144133904
PO File15456134

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity26.00
▷ Minimum class complexity22.00
▷ Maximum class complexity30.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods853.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png3.46KB1.82KB▼ 47.30%