Not sure there are so many variables for any given site. Maybe the first thing to check is that the required SAC JavaScript is included on the page, and that there are no JavaScript errors happening.
Thank you for answering.
Do I need to add SAC Javascript manually?
The steps I followed are:
1. I installed the SAC plugin
2. Added the php script in the front page:
<?php if (function_exists(‘simple_ajax_chat’)) simple_ajax_chat(); ?>
Then the chat appeared in the front page but the username is not auto-generated and every time I send a message I got the error.
I checked the js console and I am not getting any errors, neither before or after sending the message.
“Do I need to add SAC Javascript manually?”
Nope, the plugin adds it for you. But in order for that to happen, there must not be any errors, etc.
You might want to check to make sure the JavaScript file is getting included on the page. The path is:
/wp-content/plugins/simple-ajax-chat/resources/sac.php?ver=20210210
Thank you, I added the script tag manually in the header.php and it is working now.
<script type="text/javascript" src="./wp-content/plugins/simple-ajax-chat/resources/sac.php?ver=20210210"></script>
Will this solution work with future updates? Perhaps there is something wrong with the functions.php?
It should be included automatically, based on the setting “Chat URL”. So that would be one thing to check.
Sorry, I don’t understand, how can I check that setting?
Log in to WP. Go to Settings. Click Simple Ajax Chat in the menu. Click on Plugin Settings to toggle open the settings. Scroll down to the setting “Chat URL”. Look at it. If there are any URLs listed, compare them with the URL of your current chat page.
That field is empty. There is no URLs listed.
Okay then it might be a bug. I will investigate and try to resolve for the next plugin update.
I realized that now the chat is only working in the front-page. The other pages I have are located in the “page-templates” directory, so I guess the SAC’s js file URL is not the same for all the pages.
The URL of the SAC JavaScript file indeed is the same regardless of where it is included.
Hi @abellon, just wanted to follow up with this. It’s been awhile with no reply, so I hope the issue is resolved? Or if there is anything I can do to help, please let me know. Thank you.
Hey @abellon, I hope you got this sorted. It’s been awhile with no reply so gonna go ahead and mark this thread as resolved to help keep the forum organized. Feel free to post again with any further questions or feedback, Thank you.
Sorry, I didn’t see the last messages.
Yes, You can mark it as resolved. It worked adding the script manually in the pages.
Thank you so much!