After upgrading to the latest version, ajax functionality is no longer working.
The error seems to come from an error with this:
var wpforo = {"ajax_url":"https:\/\/removed.be\/wp-admin\/admin-ajax.php","template_slugs":{"paged":"paged","recent":"recent","tags":"tags","members":"members","profile":"profile","account":"account","activity":"activity","subscriptions":"subscriptions","postid":"postid"},"editor_settings":{"media_buttons":false,"textarea_name":"post[body]","textarea_rows":5,"tabindex":"","editor_height":180,"editor_css":"","editor_class":"wpeditor","teeny":false,"dfw":false,"plugins":"hr,lists,textcolor,paste,wpautoresize,fullscreen,wpforo_pre_button,wpforo_link_button,wpforo_spoiler_button,wpforo_source_code_button,emoticons","tinymce":{"toolbar1":"fontsizeselect,bold,italic,underline,strikethrough,forecolor,bullist,numlist,hr,alignleft,aligncenter,alignright,alignjustify,link,unlink,blockquote,pre,wpf_spoil,undo,redo,pastetext,source_code,emoticons,fullscreen","toolbar2":"","toolbar3":"","toolbar4":"","content_style":"blockquote{border: #cccccc 1px dotted; background: #F7F7F7; padding:10px;font-size:12px; font-style:italic; margin: 20px 10px;}","object_resizing":false,"autoresize_on_init":true,"wp_autoresize_on":true,"wp_keep_scroll_position":true,"indent":true,"add_unload_trigger":false,"wpautop":false,"setup":"wpforo_tinymce_setup","content_css":"https:\/\/removed.be\/wp-content\/plugins\/wpforo\/wpf-assets\/css\/font-awesome\/css\/fontawesome-all.min.css","extended_valid_elements":"i[class|style],span[class|style]","custom_elements":""},"quicktags":false,"default_editor":"tinymce"},"revision_options":{"is_preview_on":0,"is_draft_on":0,"auto_draft_interval":60000,"max_drafts_per_page":3},"notice":{"login_or_register":"<a href="\"https:\/\/removed.be\/fora\/?foro=signin\"" data-wpel-link="internal">Inloggen<\/a> van <a href=\"https:\/\/removed.be\/fora\/?foro=signup\">Registreer<\/a> aub"}};
Any idea what goes wrong and how to fix?
Hi @symergo,
Try to delete all caches, then purge CDN if you have. Then delete otimizer/minifier plugins cache and go to forum front-end. On front-end press Ctrl+F5 twice to reset browser cache or use a private session to check.
And please explain, when does this error happen?
Robert, thanks for your quick reaction.
I deleted all caches and disabled optimizer/caching plugins. The problem is still there.
Ajax functionality is not working on all forum pages.
Chrome gives the errors below. The first one is the one that is caused by the code included in the original post (all forum pages contain this code).
Uncaught SyntaxError: Invalid or unexpected token (index):1124
Uncaught ReferenceError: wpforo is not defined
at ajax.js?ver=1.7.2:2
jquery-3.4.1.min.js:2 Uncaught ReferenceError: wpforo is not defined
at HTMLDocument.<anonymous> (frontend.js?ver=1.7.2:427)
at e (jquery-3.4.1.min.js:2)
at t (jquery-3.4.1.min.js:2)
Hi @symergo,
The problem maker was "External Links" plugin. We've deactivated it. If you want to use it, you should contact to plugin developer and ask for a way to exclude it for some page, then exclude your forum page from this plugin. It doesn't use regular hooks for content, it makes changes in whole HTML document, this brings lots of conflicts with other plugins.