89% buy-now-button-for-woocommerce

Code Review | Buy Now Button for WooCommerce

WordPress plugin Buy Now Button for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: buy-now-button-fo...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2021
  • Latest release: Oct 13, 2022
  • Number of updates: 19
  • Update frequency: every 31.5 days
  • Top authors: navarroido (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

9,000+ active /35,194 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Buy Now Button for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0143.87 ▲0.55
Dashboard /wp-admin3.32 ▼0.0352.25 ▼14.57
Posts /wp-admin/edit.php3.37 ▲0.0154.60 ▼2.82
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.03 ▼17.33
Media Library /wp-admin/upload.php3.24 ▲0.0140.44 ▲2.20

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Buy Now Button for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.34 ▼0.271.81 ▲0.0943.65 ▼0.31
Dashboard /wp-admin2,195 ▲185.63 ▲0.0492.95 ▼1.2338.83 ▼7.87
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0335.07 ▼20.4636.54 ▼2.87
Add New Post /wp-admin/post-new.php1,526 ▼1123.70 ▲5.54712.77 ▲74.1261.89 ▼9.80
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.06109.54 ▲6.5749.53 ▲3.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: buy now, skip to checkout, buy now button

buy-now-button-for-woocommerce/buy-now-button-for-woocommerce.php 77% from 13 tests

Analyzing the main PHP file in "Buy Now Button for WooCommerce" version 1.0.1
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 171 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0.0" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin58 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2305050
CSS1238

PHP code Passed 2 tests

Analyzing 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.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin