• hello and thank your for this GREAT addition to WordPress editor. I use your latest version.
    The plugin still works in the frontend since emojis I inserted in posts are visible.
    It used to work fine with TinyMCE and I made some theme changes over time.

    Now for some reason the editor window is broken. I can see the content is loaded but the editor window is blank.
    There is an error from native_emoji_tinymce-plugin.js in the console and that’s the cause:

    ReferenceError: nep_plugin_vars is not defined (native_emoji_tinymce-plugin.js:15:13)

    I would love to debug it myself but how can I do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter audioscavenger

    (@audioscavenger)

    OK I got mad and debugged it myself.
    I enabled error_reporting in wp-tinymce.php and got his error:
    SyntaxError: missing } after property list

    The javascript var = nep_plugin_vars is not formatted correctly.

    So I found the culprit!!
    You have an error in native-emoji.php:316

    $fu_emojis_codes[] = '{"id":"'.$emoji->btn_id.'", "class":"'.$emoji->class.'", "code":"'.html_entity_decode($emoji->code).'"}';

    When you implode $fu_emojis_codes into $inlineScript at line 341 this produces a broken inline javascript variable nep_plugin_vars

    Because nep_frequently_codes contains classes escaped with double quotes, and your js list items are already escaped with double quotes in line 316 => SyntaxError: missing } after property list

    Solution in native-emoji.php:316

    $fu_emojis_codes[] = "{'id':'".$emoji->btn_id."', 'class':'".$emoji->class."', 'code':'".html_entity_decode($emoji->code)."'}";

    Just invert the quotes with double quotes and voila.
    I hope to see an updated version soon ??

    Confirm. Have same issue with editor.
    This fix helped ??
    Thank!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘post editor broken: nep_plugin_vars is not defined’ is closed to new replies.