Title: Time to optimize BP Docs code?
Last modified: August 31, 2016

---

# Time to optimize BP Docs code?

 *  [mln83](https://wordpress.org/support/users/mln83/)
 * (@mln83)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/)
 * First off I would like to say that the concept of collaborative docs is really
   a great idea. This can be used in many circumstances especially in e-learning,
   schools or in an office environment.
 * Second I have noticed some people reporting that version 1.8.8 leads to fatal
   errors.
 * So I performed a test of this plugin using **P3 Plugin Performance Profiler**(
   [https://www.wordpress.org/plugins/p3-profiler/](https://www.wordpress.org/plugins/p3-profiler/))
   to see how it stacks up. I ran the tests several times to see if the results 
   were reproducable.
 * Here are the results from one of the tests: [http://imgur.com/a/kPZ2p](http://imgur.com/a/kPZ2p)
 * The results are staggering: This plugin doubles the total plugin load time. This
   indicates that there may be some problems in the code. So I was wondering if 
   the next version (1.8.9) or (1.9) will be better optimized?
 * Thanks again and sorry if I have offended the developers. I only try to ask questions
   and point out some concerns here 🙂
 * Best regards,
    Michael
 * [https://wordpress.org/plugins/buddypress-docs/](https://wordpress.org/plugins/buddypress-docs/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [David Cavins](https://wordpress.org/support/users/dcavins/)
 * (@dcavins)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003693)
 * Hi Michael-
 * Yep, we’re aware of the effect BP Docs has on load times. The bottleneck is that
   we have to modify every call to `WP_Query` that might possibly return `bp_docs`
   so that private docs are protected at all times.
 * You can greatly speed up non-doc-related queries by specifying the `post_type`
   in each query. For instance, if you’re querying by a taxonomy term that only 
   applies to posts, but not specifying `post_type` => `post` in your query (because
   you’re thinking that that taxonomy term will only return posts, so why bother?),
   our protection has to run. Specify the `post_type` and the BP Docs query will
   not run.
 * If you have access to your server, you can optimize your MySQL instance, too,
   for the added load that the protection queries cause. Try [http://mysqltuner.com](http://mysqltuner.com)
 *  [Georgio](https://wordpress.org/support/users/georgio-1/)
 * (@georgio-1)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003845)
 * > The bottleneck is that we have to modify every call to WP_Query that might 
   > possibly return bp_docs so that private docs are protected at all times.
 * Ok, but are you going to fix this problem in the future?
 * Greetings
 *  Plugin Author [Boone Gorges](https://wordpress.org/support/users/boonebgorges/)
 * (@boonebgorges)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003846)
 * > Ok, but are you going to fix this problem in the future?
 * What exactly is the problem? This is simply how the plugin works. WordPress’s
   architecture means that there is no other way to enforce fine-grained privacy
   settings.
 * FWIW, there’s not much that one can reliably say about the pie charts posted 
   by [@mln83](https://wordpress.org/support/users/mln83/). For one thing, I don’t
   have a ton of faith in profiling tools that are themselves WP plugins, without
   knowing more about how they work. More importantly, there are dozens of variables
   that may cause apparent performance issues like this, and without knowing exactly
   why the profiler is blaming things on BuddyPress Docs, it’s impossible to say
   whether it’s valid or whether it can be “fixed”.
 *  Thread Starter [mln83](https://wordpress.org/support/users/mln83/)
 * (@mln83)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003850)
 * Hi [@boonebgorges](https://wordpress.org/support/users/boonebgorges/),
 * Thanks for responding to this. While I only provided one pie chart I did some
   further tests using browser developer tools to check frontend site load time 
   with BP docs activated and deactivated, respectively. It showed a difference 
   of about +1 second load time in my case. Unfortunately, I don’t have access to
   the server so I can’t perform MySQL optimization as suggested by David. Thus,
   I have decided to go for another collaborative plugin for the time being. I still
   think you did an awesome job when you decided to create this plugin but until
   I get a dedicated server it’s not something I can use.
 * Georg.io: Another way to reduce site load time is to use Plugin Organizer ([https://wordpress.org/plugins/plugin-organizer/](https://wordpress.org/plugins/plugin-organizer/))
   and switch off BP Docs (and other plugins) on pages where they are not needed.
 * FYI: You may also want to check out this critical review of P3 Profiler
    [https://managewp.com/plugin-performance-profiler](https://managewp.com/plugin-performance-profiler)
 * In any case, I always recommend people to do their own tests since user requirements
   may differ.
 * Best regards,
    Michael
 *  [Georgio](https://wordpress.org/support/users/georgio-1/)
 * (@georgio-1)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003852)
 * > > Ok, but are you going to fix this problem in the future?
   > What exactly is the problem? This is simply how the plugin works. WordPress’s
   > architecture means that there is no other way to enforce fine-grained privacy
   > settings.
 * Hi [@boonebgorges](https://wordpress.org/support/users/boonebgorges/)
    I think
   that I misunderstood David Cavins’ explanation. Thank you for your response.
 * > Thus, I have decided to go for another collaborative plugin for the time being.
   > I still think you did an awesome job when you decided to create this plugin
   > but until I get a dedicated server it’s not something I can use.
 * Hi [@mln83](https://wordpress.org/support/users/mln83/)
    I think also that BP
   Docs is an excellent plugin but I can’t use it either with my shared server. 
   Did you find a lighter plugin? In case I don’t find something in the repository,
   can I contact you through your site’s contact form?
 * >  Another way to reduce site load time is to use Plugin Organizer ([https://wordpress.org/plugins/plugin-organizer/](https://wordpress.org/plugins/plugin-organizer/))
   > and switch off BP Docs (and other plugins) on pages where they are not needed.
   > FYI: You may also want to check out this critical review of P3 Profiler
   >  [https://managewp.com/plugin-performance-profiler](https://managewp.com/plugin-performance-profiler)
 *  Thank you for the info about Plugin Organizer. As for the P3 Profiler, I have
   already tested it and have the same opinion as the reviewer.
 * Regards

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Time to optimize BP Docs code?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-docs.svg)
 * [BuddyPress Docs](https://wordpress.org/plugins/buddypress-docs/)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-docs/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-docs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-docs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-docs/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Georgio](https://wordpress.org/support/users/georgio-1/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/time-to-optimize-bp-docs-code/#post-7003852)
 * Status: not resolved