Support » Plugin: Disable All WordPress Updates » Possible Performance Improvement

  • Resolved Dominic

    (@dominicp)


    First, thanks for a great plugin.

    I noticed that there is code to get a list of all installed plugins and themes in the main class constructor. It looks like those lists are only used in two methods though.

    Since the class is loaded (and the constructor is called) on every request to the site, it seems like it might be beneficial to move that code to the methods where it is used. Or, am I missing some reason why those lists are needed on every request?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wpseek

    (@alphawolf)

    Hi Dominic,

    good catch, just released a little update that addesses this.

    Thank you!
    Oliver

    • This reply was modified 2 years, 8 months ago by wpseek.

    Hello,

    do we need to use the get_plugins function ?
    I have more than 150 plugins and the get_plugins function take more than 150ms each request. Can we just use a empty plugins list instead, to improve performance ?

    I’m using this plugin but it doesn’t solve all my problems.

    I my case, i had to add this code

    
        add_action('schedule_event', array($this, 'filter_cron_events'));
    
        function filter_cron_events($event) {
    
            $ignore = array(
                'wp_version_check',
                'wp_update_plugins',
                'wp_update_themes',
                'wp_maybe_auto_update',
            );
    
            if ( in_array($event->hook, $ignore) ){
                return false;
            }
            return $event;
        }
    
    

    to avoid adding the events to the cron, in the database.

    The wp_clear_scheduled_hook just delete the events, but with my code i don’t need to delete the events, because they aren’t added to the cron. With this i reduce 8 queries for each request.
    Updates in wp_options / cron are heavy.

    Hello,

    thanks for the plugin update with filter_cron_events.

    I must ask again, do we need to use get_plugins function ?
    Like a said before, i have a lot plugins, and the get_plugins function is heavy for me.

    Plugin Author wpseek

    (@alphawolf)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Possible Performance Improvement’ is closed to new replies.