User getting 500 error on CoursePress Pro

One single user was not seeing the links to the units of one course under the Curriculum tab. After deactivating some plugins, now this user is getting PHP error 500 (both issues are not happening to admin user).

Also, an option saying ‘Continue learning’ (that was seen on the right side after logging in) is not showing up.

  • Predrag Dubajic

    Hi youmeare,

    I was doing some tests on your installation and it seems like there's a memory issue there and it was pointing to Defender scan but when I disabled scan and increased the memory limit I was still unable to access the course, but this time it's showing only notices in debug log which shouldn't be causing white screen.

    This is probably causing backup to fail as well but unfortunately I was unable to find the cause of this.

    I have gathered all the information I got during the test and forwarded it to our developers so they can investigate this further.

    Best regards,
    Predrag

  • Panos

    Hey youmeare ,

    I noticed here that this specific course has 11 units (10 published).
    Each unit contains from 15-22 (or more) Sections (pages).
    CoursePress needs to go though all of these Sections Modules and check the completion status and various other calculations/condition checks.
    So having to do this for all these modules adds a lot of overhead to the server to handle.

    I did some more digging to verify this. So if I try to print the unit_ids that are being checked for completion data in
    CoursePress_Data_Student::get_calculated_completion_data()
    it doesn't complete the loop for all units. If I remove some condition checks, it continues printing more units, but it doesn't go through all of the Sections of the last unit.

    This points that the server doesn't have the resources to handle all of this information.

    To avoid this, I would suggest to split the Courses to smaller ones, containing less modules that need to be evaluated.

    I have asked from developer to confirm this and will update you once I have news.

    Thanks!

  • Adam Czajczyk

    Hello youmeare,

    According to what Panos found when testing your site, it seems like switching to a more powerful server should indeed help but I'm not able to tell you whether it will solve the issue entirely or only "improve" user experience.

    I know that Panos have asked one of the CoursePress developers form some advice on this and his waiting for his response. He will update this thread once he only gets hears from him.

    Best regards,
    Adam

  • Panos

    Hi youmeare ,

    Today it seems to be loading that page. Probably the server is not that busy currently.

    However the dev replied to me and he suggested to try removing the recalculation of student progress so it is lighter. I have created a mu-plugin which contains the following:

    add_filter( 'coursepress_update_student_progress', '__return_false' );

    You can find that file in wp-content/mu-plugins/cp-remove-recalculate-progress.php

    Hopefully this would help viewing that page when server is more loaded too :slight_smile:

    Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.