[HOSTING] High CPU with LearnPress plugin

Hi :slight_smile:

When this plugin is active on WPMU hosting https://wordpress.org/plugins/learnpress/ it makes very high:

CPU (100%)

Object-Cache Gets

DB Queries

Web requests

We tracked this during chat session with full plugin conflict test.

Learnpress is integrated in the theme I use https://themeforest.net/item/education-wordpress-theme-education-wp/14058034?s_rank=21, so coursepress is no option for me.

I will notice also the makers of learnpress with this issue.

I think more people use WPMU DEV hosting in combination with learnpress.

I’m on WPMU Silver plan (2GB / 2x CPU).

  • Pawel Pela
    • Ex Staff

    Hello Marcel!

    Sorry to hear about the issue you are facing!

    I can confirm the same thing happening on my test WPMU DEV hosted site. This doesn’t happen on my local test site though, and I haven’t found any reason why this is.

    I will move your ticket to our Second Line Support as they may be able to find what is happening.

    Kind regards,

    Pawel

  • Kostas
    • CTO

    Hi Marcel ,

    The issue you’re facing is caused from database queries that are run by the plugin as a chain reaction from

    learnpressincbackground-processclass-lp-background-installer.php - Line 30

    public function __construct() {
    parent::__construct();

    if ( 'yes' !== get_option( 'learn_press_check_tables' ) ) {
    add_action( 'wp_loaded', array( $this, 'check' ), 100 );
    }
    }

    When the plugin is first installed it creates the “learn_press_check_tables” but it doesn’t check for cache as well. So as it tries to “read back” the option to make it’s “if” statement shown above it always finds it empty resulting on a constant loop of that add_action running throwing a lot of queries towards the database.

    If you simply go to your hosting panel under Tools and click the Object Cache Flush button, within a matter of seconds the CPU load and others should drop down to normal.

    As our information says on Object Cache as well ( just to be more precise :slight_smile: ):

    [attachments are only viewable by logged-in members]

    Tell me if you need any further help with this!

    Regards,

    Konstantinos