Quick Page/Post Redirect Plugin
This plugin is very slow (4 posts)

  1. rritoch
    Posted 2 years ago #

    Using the P3 (Plugin Performance Profiler) I was able to determine that this plugin was making a site that I am managing very slow. I reviewed the code and the only problem I could find was the database query in the get_main_array() method of the quick_page_post_reds class.

    I replaced this query with

    $theqsl = "SELECT * FROM $wpdb->postmeta a JOIN $wpdb->posts b ON a.post_id=b.ID WHERE b.post_status!='trash' AND a.meta_key IN ('_pprredirect_active','_pprredirect_rewritelink','_pprredirect_newwindow','_pprredirect_relnofollow','_pprredirect_type','_pprredirect_url') ";

    As far as I can tell there is no reason to sort these results by post so I removed the order by clause. I also reduced the string of OR conditions to an IN statement which has also been proven to be faster. I also changed the statement to use a join, this optimization is disputable but I have found 9 out of 10 times a join is faster.

    After these changes this plugin no longer shows up in the P3 profiler as a plugin using significant resources.

    Please use this optimized query for the next version of your plugin.


  2. Matt Zak
    Posted 2 years ago #

    Thanks for the suggestion rritoch. I've implemented it on a site I run, and have noticed a significant improvement as well. +1 to the plugin author including it in the next version.

  3. Paul Thomson
    Posted 2 years ago #

    +1, well spotted. Needs to be implemented in coming releases.

  4. Paul Thomson
    Posted 2 years ago #

    well spotted! Indeed your solution looks to be much faster. Needs to be implemented in coming releases. +1

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Quick Page/Post Redirect Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic