opencredit / badgeos

BadgeOS is a plugin to WordPress that allows you to easily create badges and set up the steps and achievements users take to earn them. Badges are Mozilla OBI compatible and sharable via Credly.
http://www.badgeos.org
GNU Affero General Public License v3.0
92 stars 64 forks source link

PHP Fatal error: Allowed memory size of x bytes exhausted when using [badgeos_achievement id="n"] shortcode in quiz #625

Open fa33on opened 6 years ago

fa33on commented 6 years ago

Description

Including shortcode [badgeos_achievement id="n"] into a learndash quiz's graduation content causes the quiz to result in a PHP Fatal error: Allowed memory size of 268435456 bytes exhausted.

Steps to Reproduce

  1. Create a new achievement, with the following info: In the Required Steps section: Require: LearnDash Activity LearnDash Trigger: Passed Quiz Quiz: [Name of quiz where the achievement will be displayed]

  2. Add the [badgeos_achievement id="n"] shortcode to the learndash quiz referenced in step 1. (content or graduation content area) [Swap n in shortcode with the published badge/achievement id created in step 1]

Actual result: Quiz is not displayed due to PHP fatal error (Allowed memory size of 268435456 bytes exhausted) This only happen when using the individual achievement shortcode. example:

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 851968 bytes) in ...\learndash-demo\wp-includes\class.wp-scripts.php on line 437
/quizzes/position-dynamics/ - Allowed memory size of 268435456 bytes exhausted (tried to allocate 851968 bytes) in ..\learndash-demo\wp-includes\class.wp-scripts.php on line 437
PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 290816 bytes) in ..\learndash-demo\wp-includes\functions.php on line 3729

Expected result: Quiz should work as expected and show the appropriate badge when expected.

Product Versions

Additional Information

I increased the php memory limit upto 512MB which also resulted with the same issue. The site is a simple dev site using the learndash demo site as a base, with the badgeOS plugins replacing the WPachievements plugin, which I've deleted from the site.

Other plugins have been deactivated, other than: