See: https://github.com/bozoh/moodle-mod_simplecertificate/blob/c65cd5ea12005d6c221df54ebedb69bc4262256e/lib.php#L250 The above code still uses the _cron() function that was deprecated in Moodle 3.7. This code should be rewritten to implement a local task. See https://tracker.moodle.org/browse/MDL-65051