Snippets Manager - Fatal Error on Saving a snippet

Hey Joy,

There may be an issue with the Snippets Manager; in my case, saving the CSS snippets triggers a Fatal Error with a missing “CM_Snippet” class.

Screen recording here: CM-Bug-Snippets · CleanShot Cloud

Error details below:

Fatal error: Uncaught Error: Class "CM_Snippet" not found in /sites/demo.com/files/wp-content/plugins/classic-monks/functions/core/code-manager/code-manager-ajax.php:246

Stack Trace

cm_code_manager_ajax_save_snippet()/sites/demo.com/files/wp-includes/class-wp-hook.php:341

WP_Hook->apply_filters()/sites/demo.com/files/wp-includes/class-wp-hook.php:365

WP_Hook->do_action()/sites/demo.com/files/wp-includes/plugin.php:522

do_action()/sites/demo.com/files/wp-admin/admin-ajax.php:192

{main}

thrown in /sites/demo.com/files/wp-content/plugins/classic-monks/functions/core/code-manager/code-manager-ajax.php on line 246

Hi @yanno,
Thanks for reporting and sharing the screen recording
We are working on an immediate fix, a Patch update will be released today with few other bug fixes as well.

Found the bug, looks like an initialisation issue.
Moved class-cm-snippet.php to load before admin components to ensure the class is available for both AJAX operations and snippet execution.

Thanks @joy , I really appreciate that.

1 Like