10% woobag-cart-popup-lite

Code Review | WooBag Cart Popup Lite for WooCommerce

WordPress plugin WooBag Cart Popup Lite for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: woobag-cart-popup...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 6.3.1
  • First release: Oct 27, 2015
  • Latest release: Jun 8, 2016
  • Number of updates: 15
  • Update frequency: every 15.1 days
  • Top authors: Gatelogix (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 4,838 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/woobag-cart-popup-lite/includes/settings/wb-product-settings.php+34
    Uncaught Error: [] operator not supported for strings in wp-content/plugins/woobag-cart-popup-lite/includes/settings/wb-product-settings.php:34
    Stack trace:
    #0 wp-content/plugins/woobag-cart-popup-lite/woo-bag.php(339): wb_plugin_setting()
    #1 wp-content/plugins/woobag-cart-popup-lite/includes/wb-core-functions.php(1733): Woo_Bag->wb_default_settings()
    #2 wp-content/plugins/woobag-cart-popup-lite/includes/wb-template-functions.php(48): wb_default_options()
    #3 wp-content/plugins/woobag-cart-popup-lite/includes/class-woo-bag-activator.php(88): wb_activate_plugin()
    #4 wp-content/plugins/woobag-cart-popup-lite/includes/class-woo-bag-activator.php(64): Woo_Bag_Activator::wb_default_create_options()
    #5 wp-includes/class-wp-hook.php(310): Woo_Bag_Activator::wb_install()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/p

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

An overview of server-side resources used by WooBag Cart Popup Lite for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.32 ▼2.39
Dashboard /wp-admin3.31 ▲0.0045.92 ▼9.52
Posts /wp-admin/edit.php3.36 ▲0.0046.59 ▼2.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.64 ▼7.91
Media Library /wp-admin/upload.php3.23 ▲0.0047.73 ▲13.52

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
wb_setting_install
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WooBag Cart Popup Lite for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.71 ▼0.701.84 ▼0.1642.82 ▼10.00
Dashboard /wp-admin2,206 ▲185.85 ▲0.9696.53 ▼19.1137.75 ▼9.97
Posts /wp-admin/edit.php2,092 ▲242.05 ▲0.0436.86 ▼0.7133.54 ▲0.34
Add New Post /wp-admin/post-new.php1,539 ▲323.18 ▼0.17673.70 ▲70.2951.76 ▼9.90
Media Library /wp-admin/upload.php1,382 ▼94.23 ▲0.0094.31 ▼4.6441.37 ▼2.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WB() in wp-content/plugins/woobag-cart-popup-lite/admin/templates/woo-bag-premium-features.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WB() in wp-content/plugins/woobag-cart-popup-lite/admin/templates/woo-bag-template.php:1

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 83% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Requires at least: The plugin version is formatted incorrectly
You can look at the official readme.txt

woobag-cart-popup-lite/woo-bag.php 77% from 13 tests

The primary PHP file in "WooBag Cart Popup Lite for WooCommerce" version 1.1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woobag-cart-popup-lite.php" instead of "woo-bag.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)
  • 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 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin21,292 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
CSS761959,898
PHP234268758,434
JavaScript121842682,178
SVG504782

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.75
▷ Minimum class complexity1.00
▷ Maximum class complexity133.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods55
▷ Static methods712.73%
▷ Public methods4581.82%
▷ Protected methods00.00%
▷ Private methods1018.18%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.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
7 PNG files occupy 0.18MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/wb_menu_icon.png1.75KB0.81KB▼ 53.87%
public/images/cart-empty.png2.85KB1.63KB▼ 42.62%
admin/images/wb_logo.png4.64KB2.79KB▼ 39.83%
admin/images/dummy-product-image.png38.15KB14.02KB▼ 63.24%
public/images/bag-icon.png0.67KB0.49KB▼ 27.35%