89% button-customizer-for-woocommerce

Code Review | Custom Buttons for WooCommerce - Add To Cart Button for Product Types

WordPress plugin Custom Buttons for WooCommerce - Add To Cart Button for Product Types scored89%from 54 tests.

About plugin

  • Plugin page: button-customizer...
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2018
  • Latest release: Aug 15, 2023
  • Number of updates: 20
  • Update frequency: every 84.6 days
  • Top authors: morganhvidt (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

3,000+ active /33,679 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.73ms] Passed 4 tests

Server-side resources used by Custom Buttons for WooCommerce - Add To Cart Button for Product Types
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.25 ▼0.91
Dashboard /wp-admin3.32 ▲0.0147.74 ▼3.50
Posts /wp-admin/edit.php3.37 ▲0.0147.12 ▼2.72
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.50 ▲0.22
Media Library /wp-admin/upload.php3.24 ▲0.0135.44 ▲0.85

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Custom Buttons for WooCommerce - Add To Cart Button for Product Types
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7114.40 ▲0.011.64 ▼0.2441.98 ▼3.92
Dashboard /wp-admin2,212 ▲235.83 ▲0.88100.55 ▼25.1438.32 ▼5.62
Posts /wp-admin/edit.php2,095 ▲62.01 ▼0.0439.58 ▼4.4438.70 ▲3.26
Add New Post /wp-admin/post-new.php1,539 ▲1923.44 ▲0.34644.84 ▼57.5552.91 ▼4.93
Media Library /wp-admin/upload.php1,388 ▼34.32 ▲0.0996.93 ▼9.1741.87 ▼2.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: add to cart, product buttons, change add to cart, buttons, custom buttons...

button-customizer-for-woocommerce/button-customizer.php 85% from 13 tests

The main PHP script in "Custom Buttons for WooCommerce - Add To Cart Button for Product Types" version 1.2.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("5.4" instead of "3.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("button-customizer-for-woocommerce.php" instead of "button-customizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin736 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5211268736

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity38.50
▷ Minimum class complexity3.00
▷ Maximum class complexity74.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin