83% cashbill-payment-method

Code Review | CashBill.pl - Płatności WooCommerce

WordPress plugin CashBill.pl - Płatności WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: cashbill-payment-...
  • Plugin version: 2.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 13, 2015
  • Latest release: Nov 29, 2022
  • Number of updates: 27
  • Update frequency: every 106.6 days
  • Top authors: lukaszfirek (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /5,854 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▲1.27ms] Passed 4 tests

Analyzing server-side resources used by CashBill.pl - Płatności WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2241.01 ▼6.23
Dashboard /wp-admin3.52 ▲0.2251.07 ▼1.24
Posts /wp-admin/edit.php3.57 ▲0.2154.63 ▲9.22
Add New Post /wp-admin/post-new.php6.04 ▲0.1596.74 ▲6.81
Media Library /wp-admin/upload.php3.38 ▲0.1538.59 ▲5.73

Server storage [IO: ▲0.17MB] [DB: ▲0.79MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for CashBill.pl - Płatności WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.24 ▼1.141.69 ▼0.0639.98 ▼3.29
Dashboard /wp-admin2,237 ▲485.88 ▲0.9698.80 ▼17.9739.06 ▼4.77
Posts /wp-admin/edit.php2,120 ▲312.06 ▲0.0740.06 ▲5.1835.29 ▲3.01
Add New Post /wp-admin/post-new.php1,542 ▲15123.40 ▲5.00612.98 ▲9.7847.66 ▲1.10
Media Library /wp-admin/upload.php1,422 ▲404.21 ▲0.0096.76 ▼1.0142.28 ▼3.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.79MB] 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
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CashBillChannelPayment' not found in wp-content/plugins/cashbill-payment-method/payment/CashBillInstallmentPayment.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cashbill-payment-method/view/admin/notice/success_save.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cashbill-payment-method/view/admin/option/basic.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'CashBill\\Payments\\Interfaces\\Data' not found in wp-content/plugins/cashbill-payment-method/lib/cashbill_sdk/Model/Options.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'CashBillChannelPayment' not found in wp-content/plugins/cashbill-payment-method/payment/CashBillGooglePayPayment.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cashbill-payment-method/view/admin/notice/error_validation.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'CashBillChannelPayment' not found in wp-content/plugins/cashbill-payment-method/payment/CashBillPaysafecardPayment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CashBillChannelPayment' not found in wp-content/plugins/cashbill-payment-method/payment/CashBillTwistoPayment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/cashbill-payment-method/payment/CashBillPaymentAbstract.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cashbill-payment-method/view/admin/notice/error_save.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4 in cashbill-payment-method/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
Please take inspiration from this readme.txt

cashbill-payment-method/woocommerce-cashbill.php 85% from 13 tests

Analyzing the main PHP file in "CashBill.pl - Płatności WooCommerce" version 2.3.1
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 244 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cashbill-payment-method.php" instead of "woocommerce-cashbill.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 detected1,514 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP322403811,372
CSS2170111
JavaScript12021
SVG20010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.24
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes28
▷ Abstract classes13.57%
▷ Concrete classes2796.43%
▷ Final classes00.00%
Methods94
▷ Static methods1819.15%
▷ Public methods9196.81%
▷ Protected methods00.00%
▷ Private methods33.19%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/payment/logo_aliorraty_200x24.png5.86KB2.44KB▼ 58.32%
img/payment/logo_blik_200x24.png3.47KB1.49KB▼ 56.96%
img/payment/logo_paymentocc_200x24.png5.05KB2.34KB▼ 53.73%
img/payment/logo_applepay_200x24.png2.84KB0.71KB▼ 75.13%
img/payment/logo_paypal_200x24.png4.43KB2.13KB▼ 51.97%