Title: lukelol's Replies | WordPress.org

---

# lukelol

  [  ](https://wordpress.org/support/users/lukelol/)

 *   [Profile](https://wordpress.org/support/users/lukelol/)
 *   [Topics Started](https://wordpress.org/support/users/lukelol/topics/)
 *   [Replies Created](https://wordpress.org/support/users/lukelol/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/lukelol/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/lukelol/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/lukelol/engagements/)
 *   [Favorites](https://wordpress.org/support/users/lukelol/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[XML Sitemap Generator for Google] empty sitemap](https://wordpress.org/support/topic/empty-sitemap-6/)
 *  Thread Starter [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/empty-sitemap-6/#post-16249643)
 * I’ve been able to confirm the last working version is 4.1.5
 * After some further digging, I think the issue lies in **class-googlesitemapgeneratorstandardbuilder.
   php**
 * I suspect this line is used for some pagination feature?
 * `$posts = array_slice( $posts, ( $limit - $links_per_page) );`
 * I think the limit or links_per_page may not be properly set and thus the $posts
   array is empty after the array_slice operation.
 * Commenting out this line (175) as well as adjusting line 94 (increasing the limit
   to 50000 in the case it is set to 0) fixed the issue for me, though I suppose
   this may cause links_per_page or limits to not be properly set.
 * line 94: `$limit = (( (int) $limits ) * $links_per_page)?:50000;`
 * Thanks for following up [@saurabhdhariwal01](https://wordpress.org/support/users/saurabhdhariwal01/)
   Hope you can get this resolved in the next release.
    -  This reply was modified 3 years, 8 months ago by [lukelol](https://wordpress.org/support/users/lukelol/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Related Posts for WordPress] Caching “stuck” (premium user)](https://wordpress.org/support/topic/caching-stuck-premium-user/)
 *  [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/caching-stuck-premium-user/#post-15168254)
 * I had the same issue, I believe it is a bug with the javascript reaching the 
   completion of all posts, but not forwarding you to the next step.
 * I solved it by forcing the next step in the url, but this also required that 
   i bypass the ‘nonce’ check in the php code.
 * You might be able to append &step=2 to the url to get to the next page.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Related Posts for WordPress] Slow Query while Caching Posts](https://wordpress.org/support/topic/slow-query-while-caching-posts/)
 *  Thread Starter [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/slow-query-while-caching-posts/#post-15079498)
 * Adding “orderby” + “order” to the function get_not_auto_linked_posts_ids in _./
   classes/class-related-post-manager.php_ appears to reduce the time it takes to
   execute the 2nd query.
 *     ```
       public function get_not_auto_linked_posts_ids( $limit ) {
                       return get_posts( array(
                               'fields'         => 'ids',
                               'post_type'      => RP4WP_Related_Post_Manager::get_supported_post_types(),
                               'posts_per_page' => $limit,
                               'post_status'    => 'publish',
                               'meta_query'     => array(
                                       array(
                                               'key'     => RP4WP_Constants::PM_POST_AUTO_LINKED,
                                               'compare' => 'NOT EXISTS',
                                               'value'   => ''
                                       ),
                               ),
                               'orderby' => 'ID',
                               'order' => 'DESC',
                       ) );
               }
       ```
   
 * In this case, we are now ordering by an indexed column (ID) which has a similar
   result as ordering by post_date
    -  This reply was modified 4 years, 8 months ago by [lukelol](https://wordpress.org/support/users/lukelol/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Related Posts for WordPress] Slow Query while Caching Posts](https://wordpress.org/support/topic/slow-query-while-caching-posts/)
 *  Thread Starter [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/slow-query-while-caching-posts/#post-15079467)
 * Similarly, these two unoptimized queries delay the “Linking” process:
 * `SELECT COUNT(P.ID) FROM wp_posts P LEFT JOIN wp_postmeta PM ON (P.ID = PM.post_id
   AND PM.meta_key = 'rp4wp_auto_linked') WHERE 1=1 AND P.post_type IN ('post') 
   AND P.post_status = 'publish' AND PM.post_id IS NULL GROUP BY P.post_status;`
 * `SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.
   post_id AND wp_postmeta.meta_key = 'rp4wp_auto_linked' ) WHERE 1=1 AND (wp_postmeta.
   post_id IS NULL) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status ='
   publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 5;`
 * The previously added wp_posts indexes (ID,post_type,post_status) and (post_type,
   post_status,ID) are being used, but don’t seem to be enough to prevent mysql 
   from creating temporary tables and using filesort (on the wp_posts table) in 
   order to execute these two queries.
 * I’ve found adjusting the ppr (post per request?) value in ./classes/hooks/class-
   hook-ajax-install-link-posts.php up to 50 increases the number of posts linked
   per query execution and thus speeds up the process by reducing the number of 
   times these two queries run. By increasing this value, each request will take
   a longer time so you need to take care to avoid timeouts on the requests.
 * I suspect “ORDER BY wp_posts.post_date” could be removed from the 2nd query as
   it is not necessary to sort the posts when we will be linking them all anyways.
   
   I also don’t think “GROUP BY P.post_status” is required as part of the first 
   query as the count should remain the same with or without group by.
 * I hope this perspective can contribute to the improved linking speed of the plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Related Posts for WordPress] Slow Query while Caching Posts](https://wordpress.org/support/topic/slow-query-while-caching-posts/)
 *  Thread Starter [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/slow-query-while-caching-posts/#post-15079307)
 * I’ve been able to substantially speed up this query and therefore the indexing
   process by adding a BTREE index on the post_id column of wp_rp4wp_cache. A hash
   index probably would have worked as well. It seems mysql needs this separate 
   index on the post_id column only to properly use indexes for the previously slow
   query.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Freesoul Deactivate Plugins - Disable plugins on individual WordPress pages] Feature Request: Disable on User Agent](https://wordpress.org/support/topic/feature-request-disable-on-user-agent/)
 *  Thread Starter [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/feature-request-disable-on-user-agent/#post-14324684)
 * Good to hear! Looking forward to subscribing to the pro version.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cloudflare] Plugin Will Not Activate](https://wordpress.org/support/topic/plugin-will-not-activate-22/)
 *  [lukelol](https://wordpress.org/support/users/lukelol/)
 * (@lukelol)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/plugin-will-not-activate-22/#post-13674824)
 * Also facing an activation issue.
    Unable to interact with the settings for CloudFlare.
 * requests to:
    `/wp-admin/admin-ajax.php?action=cloudflare_proxy&proxyURL=zones&
   proxyURLType=CLIENT` result in this response: `{"result":null,"success":false,"
   errors":[{"code":"","message":"Forbidden"}],"messages":[]}`

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