Up to 50 percent off

Incorrect loading of scripts leads to errors on our website [wp_enqueue_script(]

This topic contains 3 reply and 3 voices, and was last updated by Mahi 11 years, 4 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
June 28, 2013 at 12:45 pm 5379
Mahi Hello again, We have some issues on our website and at first I thought it had only something to do with the wp-property plugin, but it has now been confirmed by two people that it has also something to do with your plugin. Below you see the complete reaction from them. They are saying that the issue is because of the fact that frontend user pro doesn't use the wp_enqueue_script() code to load scripts. Is it possible to solve this? Because I am very fond of your plugin. Message: Hello Miguel, First of all, sorry for the delay. Eugene is on vacation and can not take care about the current thread. I have done research of your issue. So let me try to explain what I found in details. 1. FEPS premium feature's issue. As you already was informed, WP-Property has special option which disables loading plugin's scripts on all pages by default. But, FEPS premium feature breaks this ability by loading specifc plugin's scripts, which it uses, on every page, just in case if FEPS shortcode will be used on anyone of them. So, when FEPS premium feature is enabled, "Load WP-Property scripts on all front-end pages" doesn't work correctly. It's our fault and it will be fixed in the next FEPS release. One of the suggestions ( other ones are below ) is to disable FEPS premium feature until new version is released. It will solve your problems. 2. The event list on the end of the home page ( https://www.brazilexpat.com/ ) The reason of the issue is the following script: http://www.brazilexpat.com/wp-content/plugins/wp-property/js/jquery.validate.js It's the third-party-jquery-plugin which is used only by FEPS. More details about script you can find here. I have no idea why the current script breaks 'event list' functionality. It's too weird, because I don't see any errors and bugs, and I have never faced with the similar problem before. Anyway, the issue should be solved with new FEPS release. For now, you could commented out wp_enqueue_script('wpp-jquery-validate') in feps_enqueue_scripts() ( wp-property/core/premium/class_wpp_feps.php ). It will solve 'event list' issue, but also will disable validation functionality for FEPS shortcode. [code] function feps_enqueue_scripts() { global $wp_properties, $wpp_runtime; if($wpp_runtime['feps']['scripts_loaded']) { return; } wp_enqueue_script('wpp-jquery-gmaps'); wp_enqueue_script('wp-property-global'); wp_enqueue_script('wpp-jquery-validate'); wp_enqueue_script('wpp-jquery-number-format'); wp_enqueue_script('wpp-jquery-ajaxupload'); ... } [/code] 3. The map disappears when wp-property is activated. ( https://www.brazilexpat.com/add-new-job/ ) As I said above FEPS loads specific scripts on all pages. One of them is google map: https://maps.google.com/maps/api/js?sensor=true As Eugene noticed the problem is related to double script loading. But, I pretty believe taht the reason of it is WP User Frontend Pro plugin. It doesn't use wp_enqueue_script(). The script link is added to user's form. It's incorrect way of implementation. 1. src=’https://maps.google.com/maps/api/js?sensor=true&ver=3.5.2? 2. src=’https://maps.googleapis.com/maps/api/js?sensor=false&language=en&ver=3? in example 1 you see the link when wp-property and everything else is activated. In example 2 you see when wp-property is deactivated and everything else is activated. I don’t know what this means It's related to home page. And it's the answer on described above. WP-Property uses wp_enqueue_script() and the another plugin does too. So, wordpress loads the script once and ignores the same scripts. When WP-Property is activated, its script is loaded faster than another plugin's one ( https://maps.google.com/maps/api/js?sensor=true&ver=3.5.2? ). And when WP-Property is disabled, other plugin loads own script ( https://maps.googleapis.com/maps/api/js?sensor=false&language=en&ver=3? ). So, I can only suggest you to use another plugin instead of WP User Frontend Pro or notify developers of this plugin about the current issue. Miguel, I pretty believe that we answered on all your questions. Anyway, we spent much more time on this thread than we should. If you have more questions, please, create new topic or premium request for it. Regards. View Conversation: https://usabilitydynamics.com/products/wp-property/forum/topic/three-plugins-not-working-when-wp-property-is-activated-1/
June 28, 2013 at 6:08 pm 5393
Tareq Hasan Tareq Hasan

I am not going to argue on this as I’ve loaded the google maps inline, not with enqueue-ing. But as the scripts are similar and delivered by google, I suspect there shouldn’t have any problem. Also, if one plugin enqueue’s the google maps with the handle ‘google-maps’ and another uses ‘googlemaps’, there will be two instances of google maps on page, that would be a problem too.

Anyway, I’ve removed the inline google maps from my plugin. So you’ve to download the plugin again and see if that solves your problem.

July 1, 2013 at 7:28 am 5441
MDelcour MDelcour

Is there a update coming or do I simply need to download the same version again?

July 1, 2013 at 8:22 am 5443
Mahi Mahi

please re-download from your account and check if problem still exists

Viewing 3 Posts - 1 through 3 (of 3 total)