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.

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 and options 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.

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 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 code snippets 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, or if you have a large number of rules, try this snippet:

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

This switches to a simpler, often 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. Aim for 20-30 active plugins at most.

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

We have also found WP Rocket to be fairly light and effective.

Potential Problem Areas #

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

  • Object Caching (Memcached, Redis): Sometimes object caching can slow down the site overall. We recommend testing with and without it.
  • LiteSpeed Cache: Depending on configuration, some Litespeed setups may actually slow down the site, so we recommend testing with and without it.
  • Any generic speed or performance related plugin. Activating multiple different performance plugins indiscriminately is a common mistake that can actually result to decreased overall performance.

If you're experiencing performance issues, try temporarily disabling any caching solution and testing results.

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. Learn more about caching recommendations. It is essential to have either a unique cache for each user, or to disable caching for logged in users.

Troubleshooting Checklist #

  1. ✅ Confirm B2BKing is the source by deactivating/reactivating
  2. ✅ Enable Product Visibility Cache in B2BKing settings (if you do not see the setting, it means you are not using visibility)
  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. We would generally also need a backend admin access to your site or a staging clone site for testing and troubleshooting.
  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