sensei icon indicating copy to clipboard operation
sensei copied to clipboard

User meta "sensei_enrolment_providers_state" filling the database with empty information

Open sefod opened this issue 6 months ago • 0 comments

After reviewing a database of one of our client's sites, I've noticed that most of a 2GB user meta table was due to Sensei storing a lot of unnecessary, basically empty, data, under the meta key sensei_enrolment_providers_state

What I Expected

For Sensei to only store information about the courses that the user has acted upon (e.g. enrolled)

What Happened Instead

It is storing information about every course that the user is NOT enrolled into (together with those that they are), which in a big site is quite a scaling problem, and it's saving, for every course, this info:

"100048328": {
        "manual": {
            "enrolment_status": false
        },
        "student-groups": {
            "enrolment_groups_status": []
        }
    },

PHP / WordPress / Sensei LMS version

All up to date

Context / Source

Big-ish site, with a few thousand users and 800+ courses.

sefod avatar May 29 '25 15:05 sefod