WordPress.org

Forums

Contextual Related Posts
[resolved] [PATCH] minor performance improvement (5 posts)

  1. flynsarmy
    Member
    Posted 1 year ago #

    The following

    function init_ald_crp(){
    	if (function_exists('register_widget')) {
    		register_widget('WidgetCRP');
    	}
    }
    add_action('init', 'init_ald_crp', 1);

    should be using widgets_init not init hook as per the documentation.

    http://wordpress.org/plugins/contextual-related-posts/

  2. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you once again. I'll put this through. Didn't realise there was a change.

    Is there really a performance increase because of this?

  3. flynsarmy
    Member
    Posted 1 year ago #

    Some pages (such as AJAX) don't require widget inits. I'm sure there are other places but that was just off the top of my head.

  4. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Understood. It definitely will help not having to load all the code every single time!

  5. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    I've changed the code to use widget_init in the current version of the plugin 1.8.10.2

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contextual Related Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.