78% woo-cart-customizer

Code Review | Simple Customization of Add to Cart Button

WordPress plugin Simple Customization of Add to Cart Button scored78%from 54 tests.

About plugin

  • Plugin page: woo-cart-customizer
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2016
  • Latest release: Nov 27, 2023
  • Number of updates: 34
  • Update frequency: every 77.1 days
  • Top authors: AddWeb Solution Pvt. Ltd. (94.12%)snehalb890 (8.82%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /7,276 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼13.43ms] Passed 4 tests

Server-side resources used by Simple Customization of Add to Cart Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0535.62 ▼10.34
Dashboard /wp-admin3.36 ▲0.0143.56 ▼38.08
Posts /wp-admin/edit.php3.41 ▲0.0547.12 ▲0.67
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.53 ▼5.98
Media Library /wp-admin/upload.php3.28 ▲0.0536.39 ▲3.81
Woo Cart Customizer /wp-admin/admin.php?page=woo-cart-customizer3.2429.18

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Customization of Add to Cart Button
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4614.24 ▼0.091.72 ▲0.1338.50 ▼5.69
Dashboard /wp-admin2,201 ▲245.62 ▼0.0492.53 ▼10.3441.28 ▼0.85
Posts /wp-admin/edit.php2,103 ▲32.01 ▼0.0139.86 ▲2.1636.61 ▲0.90
Add New Post /wp-admin/post-new.php1,529 ▼623.19 ▼2.31608.71 ▼40.0142.90 ▼24.83
Media Library /wp-admin/upload.php1,403 ▲64.15 ▼0.0395.72 ▼2.2542.70 ▼0.24
Woo Cart Customizer /wp-admin/admin.php?page=woo-cart-customizer1,7511.9825.1927.44

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-cart-customizer/includes/plugin-setting-page.php
    • > /wp-content/plugins/woo-cart-customizer/includes/admin.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/woo-cart-customizer/woo_cart_customizer_class.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: custom button, custom button text, custom message and notices, custom shop, cart...

woo-cart-customizer/woo_cart_customizer.php 77% from 13 tests

"Simple Customization of Add to Cart Button" version 2.3.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-cart-customizer.php" instead of "woo_cart_customizer.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: Keep the plugin description shorter than 140 characters (currently 157 characters long)

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 plugin1,038 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
SVG714687
PHP44198284
CSS3201767

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wewp-ad-plugin-400.png15.32KB8.89KB▼ 42.00%
assets/images/wewp-logo.png39.91KB20.18KB▼ 49.44%
assets/images/stickybelt.png19.91KB8.01KB▼ 59.75%
assets/images/popupbox.png17.85KB7.15KB▼ 59.92%
assets/images/icon.png0.31KB0.23KB▼ 23.32%