Session Shredder for WooCommerce
Session Shredder is a production-grade, rule-based session cleanup plugin for WooCommerce 10.3+. WooCommerce 10.3 introduces experimental guest session storage and auto-pruning. Session Shredder builds directly on this already available foundation and adds behavior-based heuristics that predict which sessions are zombies (safe to prune) versus keepers (should be retained). Highlights – Heuristic pruning – Uses anonymized features (session age, pageviews, cart value, etc.) and conservative rules to identify low-value sessions. – Configurable rules & thresholds – Tune base age, hard timeout, bounce detection, and cart-protection rules from a dedicated WooCommerce settings screen. – Safe thresholds – Only considers sessions past a base age window and is biased towards keeping anything that shows meaningful activity or cart value. – Robust behavior – Even if tracking data is sparse, a conservative rule-based strategy kicks in (e.g. hard 72h timeout, bounces with no cart value). – Privacy-first – No PII is stored. Session IDs and countries are hashed; only coarse behavioral data is used. – Native Woo 10.3 integration – Reads from the WooCommerce session table (supports both legacy and new tables) and plays nicely with the core experimental pruning. – HPOS compatible – Declares compatibility with WooCommerce High-Performance Order Storage (custom order tables) and never touches orders, only session data. – Admin dashboard – Under WooCommerce → Session Shredder you get active sessions, pruned counts, a Chart.js visualization of active & pruned sessions per run, and a compact “Recent runs” summary. – Logging & observability – Uses wc_get_logger() for info/error logging; integrates cleanly with existing WooCommerce logs. Session Shredder is structured for real-world stores and designed as a companion to WooCommerce’s experimental guest session engine. It stays fully rule-based out of the box, but developers can extend it via hooks if they ever want to plug in external scoring services or AI endpoints. Why not rely only on the WooCommerce experimental pruning? – Core experimental pruning is largely age-based and opaque. – Session Shredder adds behavior-aware rules (pageviews, cart value, bounce flag) on top of age. – You get a dry-run mode to analyze impact before deleting anything. – The dashboard gives you visibility into how many sessions were pruned per run and how many sessions remained active. – WP-CLI commands let you script and automate analyze/prune runs. – It works alongside WooCommerce experimental guest sessions and HPOS rather than replacing them: Woo can still prune based on its own rules, while Session Shredder adds a tunable, rule-based layer with better reporting. How It Works Feature collection – On each page load, Session Shredder tracks session activity: – Session age (hours since first seen) – Pageviews count – Cart value (numeric) – Whether anything was added to cart – Geolocation hash (hashed billing/shipping country) – Simple bounce indicator (single pageview, no cart) – Features are stored per-session in non-autoloaded options and never include raw session IDs or user identifiers. Rule-based pruning – An hourly cron (session_shredder_cron) scans the WooCommerce session table for candidates based on age. – For each candidate, the plugin: – Loads stored features – Applies conservative rules like: – Session older than a hard timeout window (e.g. 72 hours) – Single pageview and no cart value – If the rules deem the session a low-value “zombie”, it is pruned. Stats & visualization – After each real run, Session Shredder records: – Total pruned sessions (lifetime and today) – A short history of recent runs, including how many sessions were pruned and how many remained active before/after each run – The admin dashboard renders a Chart.js line graph of active & pruned sessions per run via a secure AJAX endpoint, plus a compact “Recent runs” table. For developers Session Shredder exposes a small set of hooks and CLI commands so you can integrate it into more advanced workflows without forking the plugin. Hooks – session_shredder_features( array $features, string $session_hash ) – Filter the behavior feature array before it is stored and later used for pruning decisions. – $session_hash is a hashed identifier of the session (no raw IDs or PII). – session_shredder_base_age_hours( float $base_age_hours ) – Adjust the base age window (in hours) before sessions are considered as prune candidates. – session_shredder_should_prune( bool $should_prune, array $features ) – Override or refine the core rule-based decision for a given session. – session_shredder_feature_options_soft_limit( int $soft_limit ) – Adjust the soft cap for how many per-session feature options (session_shredder_features_*) are kept in wp_options before garbage collection trims the oldest entries. – session_shredder_feature_options_gc_batch( int $batch_size ) – Adjust how many feature options are removed per garbage-collection pass when the soft limit is exceeded. Larger values clean up faster; smaller values spread work over more runs. – session_shredder_before_run( float $base_age_hours, bool $dry_run ) – Fires before a prune run (cron, manual, or CLI) starts. – session_shredder_after_run( int $pruned_count, bool $dry_run ) – Fires after a prune run completes (dry-run or real). – session_shredder_pruned( int $pruned_count ) – Fires after a real prune run that actually deletes sessions; useful for logging or additional cleanup. WP-CLI commands If WP-CLI is available, Session Shredder registers the following commands: – wp session-shredder analyze – Performs a dry run using the current rules and settings. – Outputs the total number of sessions and how many would be pruned, without deleting anything. – wp session-shredder prune – Runs a real prune using the current rules and settings. – Deletes matching sessions, updates stats, and logs a summary.
Top keywords
- session37×4.23%
- session shredder20×2.29%
- shredder20×2.29%
- sessions15×1.72%
- run13×1.49%
- prune11×1.26%
- pruned11×1.26%
- woocommerce11×1.26%
- age10×1.14%
- rules9×1.03%
- cart8×0.92%
- many7×0.80%
DietPress
DietPress puts your WordPress on a diet and speeds it up. It pairs a complete set of performance optimizations (the ones that used to ship in “Zero Config Performance Optimization”) with a clean, risk-based interface to disable the WordPress features you do not use. Everything is configurable, and the performance optimizations are already on by default, so you can simply activate and enjoy a faster site, or fine-tune every detail. Coming from “Zero Config Performance Optimization”? This is the same plugin, now called DietPress and fully configurable. All your previous optimizations stay active by default; you just gained a settings page and a whole new set of WordPress-diet options. By default WordPress loads functions, services and scripts that most sites do not need. They slow down loading times and consume hosting resources. DietPress lets you trim that fat and apply battle-tested performance tweaks, with a clear description of what each option does and what might break, organized by risk level so you always know what is safe. TWO THINGS IN ONE PLUGIN 1. Performance optimizations (on by default) Automatic Critical CSS inlined in the head (optional experimental deferral of non-critical CSS) JavaScript defer parsing with smart dependency handling Image loading attributes safety net: lazy loading, decoding=async and fetchpriority for images that bypass core Automatic image dimensions for better CLS scores (including picture elements) Resource hints: preconnect and DNS prefetch for common third-party origins Theme stylesheet, critical fonts and logo preloading for a faster LCP Google Fonts display=swap RSS feed optimization (cache headers and item limit) Server rules in .htaccess: browser caching, GZIP and Brotli compression, immutable cache headers, CORS for fonts and keep-alive (master switch plus per-feature toggles) Database maintenance: daily expired-transient cleanup and safe query optimizations 2. Put WordPress on a diet (risk-based, opt-in) Light (safe for any site): emojis, RSD/WLW tags, shortlinks, self-pingbacks, comment pagination, and more Moderate (evaluate first): oEmbed, jQuery Migrate, Dashicons on the frontend, Global Styles and Duotone, remote block patterns, avatars and Gravatar, comment threading, and more Strict (site-specific): granular RSS feed control, Heartbeat API mode, post revisions and autosave, disable comments, XML sitemap, native lazy loading/fetchpriority, content types, and more Widgets: dashboard widgets (including third-party ones from Yoast, WooCommerce, Elementor, Jetpack, Wordfence, Rank Math, Gravity Forms), classic sidebar widgets, block-editor widgets and the Customizer Emails: silence the automatic emails WordPress sends on its own, grouped by area: auto-update results for core, plugins and themes (plus the new-version notice), comment moderation and new-comment notices, and new user, password and email-change notices, plus toggles for the admin email verification prompt and post-by-email. Every option is off by default, and critical notices such as a failed core update are always kept SCALE, PROFILES AND ANALYZER Savings indicator: HTTP requests removed, CSS/JS saved and active optimizations at a glance Quick profiles: Personal Blog, WooCommerce Store, Landing Page and Maximum Cleanup Site analyzer: personalized recommendations based on your active plugins and content Import and export your whole configuration as a JSON file COMPATIBILITY AND EXTENSIBILITY The plugin includes filters for developers: dietpress_critical_css – Customize the inline critical CSS dietpress_critical_css_handles – Define which CSS handles are critical dietpress_skip_defer_script_handles – Opt scripts out of the JavaScript defer dietpress_skip_defer_style_handles – Opt stylesheets out of the CSS deferral dietpress_preconnect_hints – Customize preconnect origins dietpress_dns_prefetch_domains – Customize DNS prefetch domains dietpress_critical_fonts – Define critical fonts to preload Compatible with: Well-coded themes and page builders (Divi, Elementor, Beaver Builder, Gutenberg) Cache plugins (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, etc.) Security plugins (DietPress focuses on performance and deliberately leaves security to them; we recommend our free Vigilant) CDNs (Cloudflare, StackPath, KeyCDN, etc.) thanks to CORS and Vary headers WordPress Multisite HOW TO VERIFY THE OPTIMIZATIONS Cache rules: check your .htaccess for a block marked # BEGIN DietPress with immutable Cache-Control headers Logo preload: view page source and look for pointing to your logo Critical CSS: view source and look for in the head Compression: test at giftofspeed.com/gzip-test Always measure with tools like Google PageSpeed, GTMetrix or WebPageTest, and run each test at least twice to account for caching. Support Need private support or custom development? Do you need one-on-one help, priority troubleshooting, or a custom feature, integration, or tweak built specifically for your site? I offer private support and custom development. Just contact me and tell me what you need. Need help or have suggestions? Official website WordPress support forum YouTube channel Documentation and tutorials Love the plugin? Please leave us a 5-star review and help spread the word! About AyudaWP We are specialists in WordPress security, SEO, AI and performance optimization plugins. We create tools that solve real problems for WordPress site owners while maintaining the highest coding standards and accessibility requirements.