Speed / Performance Issues + Optimization Guide

B2BKing is designed to have minimal impact on your WordPress site's performance. In most cases, you should not notice any significant difference in speed before and after activating the plugin. Performance issues with B2BKing are rare, and when they do occur, they're typically caused by specific bottlenecks, conflicts, or misconfigurations rather than random issues.

Before You Begin #

Confirming B2BKing as the Source #

If you're experiencing performance issues, first confirm that B2BKing is the cause:

  1. Temporarily deactivate B2BKing and test your site's performance
  2. If the speed issue disappears, reactivate B2BKing and proceed with the optimization steps below
  3. If the issue persists with B2BKing deactivated, the problem likely lies elsewhere

Note: If the snippets below don't resolve your issue, contact our support team. We can run detailed tests, including code timing analysis, to identify the exact cause of any performance bottleneck.

Quick Performance Wins #

Enable Product Visibility Cache #

If you're using B2BKing's product visibility features, this is crucial:

  1. Navigate to B2BKing → Settings → Other
  2. Enable "Product Visibility Cache"

This single setting can make a significant difference in performance when dealing with user-specific product visibility.

Performance Optimization Snippets #

1. General Backend and Overall Speed Optimization #

If you're experiencing slow WordPress backend performance or general speed issues, add this snippet to your theme's functions.php file or a custom plugin:

// Disable permalink flushing on every page load
add_filter('b2bking_flush_permalinks', '__return_false');

// Disable automatic cache flushing
add_filter('b2bking_flush_cache_wp', '__return_false');

// Disable dashboard data calculations
add_filter('b2bking_enable_dashboard_data', '__return_false');

// Extend cache time 
add_filter('b2bking_cache_time_setting', function($val){
    return 86400000;
}, 10, 1);

2. Dynamic Rules Optimization #

If you suspect performance issues are related to B2BKing's dynamic rules system, use this snippet:

// Enable simplified query system for dynamic rules
add_filter('b2bking_use_simple_query_system', '__return_true');

This switches to a simpler, generally faster query system for processing dynamic rules.

3. Bulk Order Form Optimization #

For sites experiencing slow loading times with the B2BKing bulk order form, implement these optimizations:

// Skip product sorting (can be time-intensive with large catalogs)
add_filter('b2bking_bulkorder_skip_sort', '__return_true');

// Limit search results to 25 per page (adjust as needed)
add_filter('b2bking_search_results_number_order_form_cream', function($results){
    return 25; // Lower numbers = faster loading
}, 10, 1);

// Allow all products in order form without filtering
add_filter('b2bking_allow_all_orderform', '__return_true');

// Skip individual variation checks for better performance
add_filter('b2bking_orderform_skip_individual_variation_checks', '__return_true');

You can adjust the number of results per page (25 in the example) based on your needs. Fewer results per page will load faster.

General WordPress Performance Tips #

Plugin Management #

  • Minimize active plugins: Deactivate any plugins you're not actively using
  • Audit your plugin stack: Performance issues often arise from having too many active plugins rather than any single plugin

Caching Considerations #

Recommended Approach #

We recommend WP Rocket with "User Cache" enabled. This creates unique cache entries for each user, which is essential for B2B sites where different users see different:

  • Prices
  • Products
  • Content
  • Discounts

Potential Problem Areas #

Be aware that certain caching solutions can actually decrease performance when used with B2BKing:

  • Object Caching (Memcached, Redis): Can create conflicts with user-specific content and can sometimes slow down the site overall
  • LiteSpeed Cache: May cause issues with dynamic B2B features, can sometimes slow down the site overall
  • Generic page caching: Not compatible with user-specific pricing and content

If you're experiencing performance issues, try temporarily disabling these caching methods:

  • Object caching (Memcached, Redis)
  • LiteSpeed Cache
  • Any full-page caching that doesn't account for user variations

Important: If your B2B site shows different prices, products, or content to different users (which is typical), standard caching solutions that serve the same cached content to all users are fundamentally incompatible and should not be used.

Troubleshooting Checklist #

  1. ✅ Confirm B2BKing is the source by deactivating/reactivating
  2. ✅ Enable Product Visibility Cache in B2BKing settings
  3. ✅ Apply relevant performance snippets based on your specific issue
  4. ✅ Review and minimize active plugins
  5. ✅ Check caching plugin compatibility / temporarily disable object caching and cache plugins if present
  6. ✅ Contact support if issues persist

Getting Support #

If you've tried the above optimizations and are still experiencing performance issues:

  1. Document which snippets you've tried
  2. Note any error messages or specific slow areas
  3. Contact our support team with this information. It is particularly helpful if you can also provide a backend admin access to your site or a staging site for testing.
  4. We can run detailed performance profiling to identify the exact bottleneck

B2BKing performance issues are almost always solvable once the specific cause is identified.

Powered by BetterDocs