89% add-to-cart-button-customizations

Code Review | Add To Cart Button Customizations

WordPress plugin Add To Cart Button Customizations scored 89% from 54 tests.

About plugin

  • Plugin page: add-to-cart-butto...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Mar 20, 2021
  • Latest release: Apr 7, 2023
  • Number of updates: 8
  • Update frequency: every 93.6 days
  • Top authors: ruhel241 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active / 4,398 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.65ms] Passed 4 tests

Analyzing server-side resources used by Add To Cart Button Customizations
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.94 ▼3.42
Dashboard /wp-admin3.32 ▲0.0249.25 ▼0.26
Posts /wp-admin/edit.php3.37 ▲0.0248.35 ▲0.22
Add New Post /wp-admin/post-new.php5.90 ▲0.0293.34 ▼3.12
Media Library /wp-admin/upload.php3.24 ▲0.0237.47 ▲3.56

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Add To Cart Button Customizations: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11613.58 ▼0.702.06 ▲0.3438.53 ▼9.72
Dashboard /wp-admin2,224 ▲334.85 ▼1.04103.34 ▼1.1439.65 ▼4.86
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0539.26 ▲3.4035.74 ▲1.85
Add New Post /wp-admin/post-new.php1,528 ▼523.30 ▼0.08666.30 ▲53.0353.73 ▲4.42
Media Library /wp-admin/upload.php1,385 ▼64.22 ▼0.0298.78 ▼5.0943.80 ▼0.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

add-to-cart-button-customizations/wooaddtocart.php 85% from 13 tests

The primary PHP file in "Add To Cart Button Customizations" version 1.3.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("add-to-cart-button-customizations.php" instead of "wooaddtocart.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
Success! There were no dangerous files found in this plugin509 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP710185480
CSS15029

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.40
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods1150.00%
▷ Public methods2195.45%
▷ Protected methods00.00%
▷ Private methods14.55%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected