Performance issue when editing books on large membership site
-
We use this plugin on a membership site and are having memory issues even though we have a large server. After running some monitoring we discovered the “Post Author” dropdown when editing a book was causing a huge issue as it loads every user on the site ( over 15k ) and WordPress runs a update_meta_cache query for each one when using the get_user command.
So I made the following edits which helped a lot and wonder if they can be incorporated into the plugin:
/public_html/wp-content/plugins/mybooktable/includes/metaboxes.php
Line 140Replace this:
<?php foreach(get_users() as $author) { ?>With this:
<?php foreach(get_users(array( ‘role__in’ => array( ‘author’, ‘editor’, ‘contributor’, ‘administrator’ )) ) as $author) { ?>Then Line 32
Add the following line to the function: mbt_add_metaboxes()add_filter( ‘update_user_metadata_cache’, ‘__return_false’ );
- The topic ‘Performance issue when editing books on large membership site’ is closed to new replies.