83% buy-now-for-woocommerce

Code Review | Buy Now Button - Woocommerce

WordPress plugin Buy Now Button - Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: buy-now-for-wooco...
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 30, 2021
  • Latest release: Nov 30, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: nazmulhasan103 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.99ms] Passed 4 tests

An overview of server-side resources used by Buy Now Button - Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1035.68 ▼3.17
Dashboard /wp-admin3.42 ▲0.1247.38 ▼1.98
Posts /wp-admin/edit.php3.53 ▲0.1849.31 ▲3.37
Add New Post /wp-admin/post-new.php6.00 ▲0.1188.47 ▼10.12
Media Library /wp-admin/upload.php3.34 ▲0.1137.19 ▲3.31

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Buy Now Button - Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,476 ▼28514.15 ▼0.200.77 ▼1.0113.23 ▼40.89
Dashboard /wp-admin2,195 ▲185.65 ▲0.0395.57 ▼0.7342.02 ▼2.52
Posts /wp-admin/edit.php2,100 ▲32.00 ▼0.0140.37 ▲3.1136.64 ▼3.88
Add New Post /wp-admin/post-new.php1,526 ▼221.49 ▼1.52710.20 ▲76.0063.48 ▲11.94
Media Library /wp-admin/upload.php1,394 ▼64.19 ▼0.0198.61 ▼2.3744.71 ▼0.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/buy-now-for-woocommerce/includes/customize-settings.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% 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: skip to checkout, buy now button, buy now

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

The main PHP script in "Buy Now Button - Woocommerce" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("buy-now-for-woocommerce.php" instead of "buy-now-button.php")
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("5.3" instead of "7.2")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "5.2")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin522 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP525787514
CSS1156
JavaScript1012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity22.75
▷ Minimum class complexity5.00
▷ Maximum class complexity38.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods24
▷ Static methods416.67%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.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
PNG images were not found in this plugin