• Resolved abellon

    (@abellon)


    Hello,

    I installed the chat in my website and added the php script in the front page but everytime I write a message and press send I am redirected to an error page that displays: “WP Plugin SAC: Mandatory name and comment. Please complete all required fields and try again.”

    I installed it in another page successfully and I noticed that one of the differences between them is that in the first one the user names are automatically generated but in this last one are not.

    What could cause that problem? Is there anything I can try?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Jeff Starr

    (@specialk)

    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.

    Thread Starter abellon

    (@abellon)

    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.

    Plugin Author Jeff Starr

    (@specialk)

    “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

    Thread Starter abellon

    (@abellon)

    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?

    Plugin Author Jeff Starr

    (@specialk)

    It should be included automatically, based on the setting “Chat URL”. So that would be one thing to check.

    Thread Starter abellon

    (@abellon)

    Sorry, I don’t understand, how can I check that setting?

    Plugin Author Jeff Starr

    (@specialk)

    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.

    Thread Starter abellon

    (@abellon)

    That field is empty. There is no URLs listed.

    Plugin Author Jeff Starr

    (@specialk)

    Okay then it might be a bug. I will investigate and try to resolve for the next plugin update.

    Thread Starter abellon

    (@abellon)

    Thank you so much.

    Thread Starter abellon

    (@abellon)

    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.

    Plugin Author Jeff Starr

    (@specialk)

    The URL of the SAC JavaScript file indeed is the same regardless of where it is included.

    Plugin Author Jeff Starr

    (@specialk)

    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.

    Plugin Author Jeff Starr

    (@specialk)

    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.

    Thread Starter abellon

    (@abellon)

    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!

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Chat not working on custom template’ is closed to new replies.