Support » Plugin: GamiPress - LearnDash integration » Crashing when completing steps in Learndash achievement

  • Resolved alemao2k6

    (@alemao2k6)


    Hi, I am having trouble with achievements that have steps in learndash modules.

    I made a completely clean installation with the latest (today) version of WordPress 5.4 using twenty-twenty theme, Learndash and Gamipress, but still the problem remains.

    If I turn off Javascript for the frontend in Gamipress settings, everything works fine, but if I leave javascript “on” it returns a memory leak every time I complete a step or basically anything within Learndash.

    The problem with turning off the javascript is that the reports in the user´s profile become broken, and the switch to “show details” and “load more” for the achievements don´t work.

    Is there any way to use the javascript only at the profile pages? Or can you check into this issue?

    Any achievement that has learndash “complete lesson” or “complete topic” steps (2 or more steps) always crash, when the student completes the step during the course.

    It´s easy to stage the issue, and it renders my Gamification impossible for my learndash site, unless I disable Javascript on the settings which breaks part of the plugin´s functions.

    OBS: I have tried to raise wp_memory_limit and php.ini memory limit to 512M, still the problem is the same. It´s crashing with other scripts from learndash or wordpress when completing the steps.

    Thank you,

    Eduardo

    • This topic was modified 2 years, 3 months ago by alemao2k6. Reason: Added memory comment
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ruben Garcia

    (@rubengc)

    Hi @alemao2k6

    Is possible that your issue comes from an excesive use of the GamiPress awards

    For example, the LearnDash integration includes several events based on the quiz completion (if user completes it, if pass or fails, if has completed it with a minimum grade, etc)
    If you configure 20 requirements (points awards, deducts, steps and rank requirements) it could make the process slow down since GamiPress needs to check if user is able to earn all of them and also if user should earn something more (like an extra achievement, or award extra points for something, etc)

    For that, the way you can speed up or avoid issues in some process is reducing the number or requirements that are using this event (for example, if you have 20 achievements looking for complete any quiz, reduce them to 10)

    The GamiPress awards engine is developed to run as fast as possible, but is comprehensible that will run slower if is required to perform several checks on a single action

    Best regards

    Thread Starter alemao2k6

    (@alemao2k6)

    Hi, thank you for replying.

    Unfortunately, it´s just one action.

    I have a test achievement that has two requirements:

    1) Complete 1 lesson
    2) Complete 1 lesson

    When the student completes he first lesson, Gamipress knows he completed one step. And this crashes. Then, I refresh the page, complete the second lesson. Crashes again.

    Like I said, I tried with a completely clean install of wordpress, learndash and gamipress. No theme, no translation, still the problem is the same.

    What could I have wrong? I can send the system info from Gamipress if you need.

    I even bought the notifications add-on for Gamipress, but I can´t use it the way I needed for our courses.

    Can you help checking this scenario, or another way?

    Thank you,

    Eduardo

    Thread Starter alemao2k6

    (@alemao2k6)

    One comment, my Learndash is set to share lessons between courses.

    Any lesson I create can be assigned to multiple courses. I haven´t tried with an install where lessons can only be assigned to a single course.

    When we turn this option on in Learndash, it modifies the database, so maybe this has something to do with it? Have you checked this scenario with the latest versions of WP and Learndash?

    This is a native Learndash feature, but handles the courses very differently. I think.

    Thanks,

    Eduardo

    Thread Starter alemao2k6

    (@alemao2k6)

    Hi,

    after thinking for a while. I think you actually pointed me in the right direction.

    I had very few settings, but enough to cause a crash due to their requirements.

    Basically, I was using “complete a lesson” to try points, achievements and even ranks, and just 2 or 3 of these at the same time were crashing it out.

    Now I set more organized rules for each one, and it seems to be going very well.

    Now, a question:

    Shoul I avoid the more broad options, like “complete a lesson”? Do you suggest we try to always link the requirement with a specific course, or lesson inside a course, specific lesson, etc?

    Thanks,

    Eduardo

    Plugin Author Ruben Garcia

    (@rubengc)

    Hi @alemao2k6

    Awesome! Glad you get it working now

    The issue is not establishing general rules or a great number of them, the main issue if is your actual hosting plan can handle them

    I mean, depending on your server and your website activity, this decides the maximum number of rules you can setup per action

    But there are a few improvements you can apply to your hosting without upgrade your actual plan like switch all your tables engine from MyIsam to InnoDB or enable Memcached (if your hosting supports it, that for sure yes)

    The most recommended is to contact your hosting provider and check all the improvements you can perform

    Best regards

    Thread Starter alemao2k6

    (@alemao2k6)

    Great, thanks a lot. I will do that!

    Maybe a suggestion would be for the plugin to notify the user when such a heavy load is happening due to excessive checks on the same rule?

    For example, like the “Snippets” plugin that checks when a script is crashing and reverts back, telling user that their script had an error… it would help to know that there is nothing wrong with the extension, but it´s a user error or a server limitation….

    Thanks a lot for the help, it´s totally solved

    Plugin Author Ruben Garcia

    (@rubengc)

    Hi @alemao2k6

    Thank you so much for your suggestion, we will keep it in mind for future updates

    On GamiPress -> Tools -> System Info you have a section where you can see a recount of all requirements looking for the same action

    Best regards

    Thread Starter alemao2k6

    (@alemao2k6)

    Awesome!

    That makes it even easier to debug, thanks for that. I had seen that part, but didn´t notice how important it was!

    Thanks again for helping with my issue!

    Kind regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Crashing when completing steps in Learndash achievement’ is closed to new replies.