WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. flynsarmy
    Member
    Posted 9 months 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 9 months 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 9 months 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 9 months ago #

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

  5. Ajay
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.