Please test now.
You added code in snippets plugin. Also you loaded that code only in front-end. But this plugin send message using ajax. All admin ajax load admin code also. I changed that settings to load both in front-end and back-end. Now it is working.