89% tt-add-to-cart-buy-now-for-woocommerce

Code Review | TT Add to Cart Buy Now for WooCommerce

WordPress plugin TT Add to Cart Buy Now for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: tt-add-to-cart-bu...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2022
  • Latest release: Dec 2, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: terrytsang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.20ms] Passed 4 tests

Analyzing server-side resources used by TT Add to Cart Buy Now for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0745.17 ▲7.05
Dashboard /wp-admin3.38 ▲0.0855.34 ▲4.44
Posts /wp-admin/edit.php3.43 ▲0.0750.95 ▲1.83
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.44 ▼8.10
Media Library /wp-admin/upload.php3.31 ▲0.0735.92 ▲2.62

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by TT Add to Cart Buy Now for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.62 ▲0.102.11 ▲0.3246.42 ▲0.28
Dashboard /wp-admin2,195 ▲215.61 ▼0.06100.20 ▲2.3647.36 ▲6.32
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0637.28 ▼0.1336.46 ▲0.86
Add New Post /wp-admin/post-new.php1,526 ▼223.40 ▲0.44691.67 ▲17.5654.31 ▲4.24
Media Library /wp-admin/upload.php1,397 ▼34.23 ▲0.12101.59 ▼32.7244.31 ▼4.35

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === tt-add-to-cart-buy-now-for-woocommerce === )
  • Screenshots: These screenshots require images: #1 ([screenhot-1.png] Screenshot Admin WooCommerce - Add to Cart Buy Now options), #2 ([screenhot-2.png] Screenshot Frontend WooCommerce - Shop page with customized "Add to cart" and "Buy Now" buttons), #3 ([screenhot-3.png] Screenshot Frontend WooCommerce - Product page with a new "Buy Now" button (with Icons enabled)), #4 ([screenhot-4.png] Screenshot Frontend WooCommerce - Product page with a new "Buy Now" button)
The official readme.txt is a good inspiration

tt-add-to-cart-buy-now-for-woocommerce/wc-add-to-cart-buy-now.php 92% from 13 tests

"TT Add to Cart Buy Now for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("tt-add-to-cart-buy-now-for-woocommerce.php" instead of "wc-add-to-cart-buy-now.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,297 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS46274681
PHP112845442
PO File25052132
JavaScript120042

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.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 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
27 PNG files occupy 0.55MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png42.28KB17.30KB▼ 59.07%
screenshot-2.png82.63KB30.06KB▼ 63.62%
assets/images/icon-woocommerce-product-badge.png8.45KB4.08KB▼ 51.70%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
screenshot-4.png144.77KB66.90KB▼ 53.79%