I don’t have the same phenomenon than @ant0nell0, but I can confirm there’s a problem with WPBakery. Here’s what’s going wrong:
WPBakery basically enters admin mode, but on the front-end. It loads wp-admin/post.php
and display the contents using javascript.
In your admin/class-simple-event-planner-admin.php
, you’re correctly enqueuing and then localizing '-admin-scripts'
, but the problem is that you’re overriding a core WordPress variable: ajaxurl
.
The result is this:
<script src='https://www.4motion.lu/wp-content/plugins/simple-event-planner/admin/js/jquery.geocomplete.min.js?ver=1.7.0'></script>
<script src='https://www.4motion.lu/wp-content/plugins/simple-event-planner/admin/js/jquery.datetimepicker.js?ver=2.5.4'></script>
<script>
var ajaxurl = {"url":"https:\/\/www.mysite.com\/wp-admin\/admin-ajax.php"};
</script>
<script src='https://www.4motion.lu/wp-content/plugins/simple-event-planner/admin/js/simple-event-planner-admin.js?ver=1.5.1'></script>
<script src='https://www.4motion.lu/wp-content/plugins/simple-event-planner/admin/js/jquery-ui.min.js?ver=1.10.3'></script>
Now every ajax request will go to URIs like this:
https://www.mysite.com/wp-admin/[object%20Object]?action=wp-compression-test&test=no&_ajax_nonce=f8b7d6026b&1586201927574
You should definitely, if you actually need to do this (?!), rename that variable to something unique to your plug-in. (Why do it, you have that same URL on window.ajaxurl
already on every WordPress page (front-end and back-end as far as I’ve seen).