84% buy-now-woo

Code Review | Buy Now for WooCommerce - WooCommerce Buy Now Button free addon

WordPress plugin Buy Now for WooCommerce - WooCommerce Buy Now Button free addon scored84%from 54 tests.

About plugin

  • Plugin page: buy-now-woo
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: Jul 11, 2020
  • Number of updates: 11
  • Update frequency: every 6.8 days
  • Top authors: wpismylife (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

9,000+ active /60,047 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼10.20ms] Passed 4 tests

An overview of server-side resources used by Buy Now for WooCommerce - WooCommerce Buy Now Button free addon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1036.24 ▼10.25
Dashboard /wp-admin3.45 ▲0.0648.73 ▼18.70
Posts /wp-admin/edit.php3.56 ▲0.1648.03 ▼3.16
Add New Post /wp-admin/post-new.php6.03 ▲0.1088.13 ▼8.69
Media Library /wp-admin/upload.php3.37 ▲0.1037.88 ▲1.97

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Buy Now for WooCommerce - WooCommerce Buy Now Button free addon
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.73 ▲0.381.70 ▼0.0839.56 ▼7.80
Dashboard /wp-admin2,199 ▲225.56 ▼0.0386.41 ▼14.8342.19 ▼2.33
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0336.09 ▼2.8635.11 ▼2.39
Add New Post /wp-admin/post-new.php1,533 ▲523.44 ▲0.32653.37 ▲4.2345.99 ▼15.76
Media Library /wp-admin/upload.php1,410 ▲104.20 ▼0.01100.93 ▲6.3343.73 ▼0.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/buy-now-woo/loader.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/buy-now-woo/includes/Admin/Settings.php:8

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Donate link: Invalid URI ("paypal.me/wpismylife")
You can look at the official readme.txt

buy-now-woo/buy-now-woo.php 92% from 13 tests

The main PHP file in "Buy Now for WooCommerce - WooCommerce Buy Now Button free addon" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "3.0.0")

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
Everything looks great! No dangerous files found in this plugin2,149 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP152825921,165
JavaScript116859801
CSS1297182
JSON1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.38
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods92
▷ Static methods44.35%
▷ Public methods8895.65%
▷ Protected methods33.26%
▷ Private methods11.09%
Functions8
▷ Named functions562.50%
▷ Anonymous functions337.50%
Constants3
▷ Global constants3100.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 files were detected