83% tt-donation-checkout-for-woocommerce

Code Review | TT Donation Checkout for WooCommerce

WordPress plugin TT Donation Checkout for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: tt-donation-check...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 14, 2022
  • Latest release: Jul 14, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: terrytsang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /165 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.66ms] Passed 4 tests

Analyzing server-side resources used by TT Donation Checkout for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.33 ▼4.87
Dashboard /wp-admin3.31 ▲0.0145.85 ▼0.58
Posts /wp-admin/edit.php3.36 ▲0.0047.32 ▼4.95
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.03 ▼16.24
Media Library /wp-admin/upload.php3.23 ▲0.0037.03 ▲0.72

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by TT Donation Checkout for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.73 ▲0.361.92 ▼0.0646.89 ▼0.50
Dashboard /wp-admin2,200 ▲125.82 ▼0.08104.78 ▼18.9141.04 ▼0.88
Posts /wp-admin/edit.php2,086 ▼62.00 ▼0.0235.24 ▼9.1631.86 ▼4.88
Add New Post /wp-admin/post-new.php1,513 ▼1523.81 ▲5.58590.06 ▼20.1442.80 ▼24.19
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.07100.23 ▲0.2343.80 ▼1.84

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
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/tt-donation-checkout-for-woocommerce/wc-donation-tip-checkout.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === tt-donation-checkout-for-woocommerce === )
  • Screenshots: These screenshots do not have images: #1 ([screenhot-1.png] Screenshot Admin WooCommerce - Donation/Tip Checkout options), #2 ([screenhot-2.png] Screenshot Frontend WooCommerce - Checkout page), #3 ([screenhot-3.png] Screenshot Frontend WooCommerce - Checkout page (Removed Added Donation By Putting 0 in The Form))
You can look at the official readme.txt

tt-donation-checkout-for-woocommerce/wc-donation-tip-checkout.php 92% from 13 tests

Analyzing the main PHP file in "TT Donation Checkout for WooCommerce" version 1.0.0
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tt-donation-checkout-for-woocommerce.php" instead of "wc-donation-tip-checkout.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,284 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS36883812
PHP18752346
PO File24444126

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
26 PNG files occupy 0.36MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
chosen-sprite.png0.53KB0.88KB0.00%
assets/css/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
assets/images/icon-woocommerce-product-badge.png8.45KB4.08KB▼ 51.70%