77% buy-now-button-direct-checkout-quick-checkoutpurchase-button-for-woocommerce

Code Review | Buy Now Button, Direct Checkout, Quick Checkout / Purchase Button For WooCommerce

WordPress plugin Buy Now Button, Direct Checkout, Quick Checkout / Purchase Button For WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: buy-now-button-di...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Nov 9, 2022
  • Latest release: Nov 9, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: mrjz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /354 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Buy Now Button, Direct Checkout, Quick Checkout / Purchase Button For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.60 ▼2.16
Dashboard /wp-admin3.31 ▲0.0042.77 ▼7.57
Posts /wp-admin/edit.php3.36 ▲0.0044.30 ▼1.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.34 ▼10.10
Media Library /wp-admin/upload.php3.23 ▲0.0034.26 ▼2.94
Buy Now Button /wp-admin/admin.php?page=buy-now-direct-checkout-for-woocommerce3.0022.34

Server storage [IO: ▲0.20MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
bndcfw-buy-now-button-classes
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
bndcfw-buy-now-empty-cart
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Buy Now Button, Direct Checkout, Quick Checkout / Purchase Button For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.36 ▼0.271.65 ▼0.1343.45 ▼0.28
Dashboard /wp-admin2,198 ▲215.65 ▲0.0483.93 ▼15.8137.86 ▼4.38
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0834.91 ▼2.4831.30 ▼2.31
Add New Post /wp-admin/post-new.php1,526 ▼223.32 ▲0.22657.52 ▼2.7464.12 ▲4.00
Media Library /wp-admin/upload.php1,394 ▼64.21 ▲0.0597.88 ▼9.5242.20 ▼4.57
Buy Now Button /wp-admin/admin.php?page=buy-now-direct-checkout-for-woocommerce280.420.114.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • bndcfw-buy-now-button-classes
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • bndcfw-buy-now-empty-cart
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/buy-now-button-direct-checkout-quick-checkoutpurchase-button-for-woocommerce/public/partials/buy-now-direct-checkout-for-woocommerce-public-display.php
    • > /wp-content/plugins/buy-now-button-direct-checkout-quick-checkoutpurchase-button-for-woocommerce/admin/partials/buy-now-direct-checkout-for-woocommerce-admin-display.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=buy-now-direct-checkout-for-woocommerce
    • > Network (severe)
    wp-admin/admin.php?page=buy-now-direct-checkout-for-woocommerce - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (This screen shot shows that "Buy now" button has been added to simple product.), #2 (This screen shot shows that "Buy now" button has been added to variable product.), #3 (This screen shot shows options of settings provided by plugin.)
The official readme.txt might help

buy-now-button-direct-checkout-quick-checkoutpurchase-button-for-woocommerce/buy-now-direct-checkout-for-woocommerce.php 69% from 13 tests

The main file in "Buy Now Button, Direct Checkout, Quick Checkout / Purchase Button For WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 479 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("buy-now-button-direct-checkout-quick-checkoutpurchase-button-for-woocommerce.php" instead of "buy-now-direct-checkout-for-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Plugin Name: A shorter plugin name is better (currently 81 characters long instead of max. 70)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,397 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PO File11198231948
PHP12107548327
JavaScript245592
CSS22830

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.57
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin