Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-19T05:02:48-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16281 2011-12-19T05:02:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56892#p56892 <![CDATA[Re: Security Badge Link Issue]]>

Cristián: I still don't understand how the JS conflicts work... If the library is the same in both plugins, why is there a conflict? Same var names?

Jason Caldwell: Well, I call it a conflict. Sometimes it's a conflict in jQuery because of a bad plugin, which attempts to load jQuery on it's own, instead of doing it the WP way. Or sometimes, it just a bad plugin that causes a JavaScript error, which may result in all JavaScript failing ( the nature of JavaScript ). Not really a "conflict" in that case, really an error due to a bad plugin/theme.

Jason Caldwell: I've also see some conflicts between frameworks. That's rare, but there are some plugins that use the ProtoType framework, and combined with another framework like MooTools, there is a possibility for a conflict to arise. Rare though, and it's usually attributed to the way their loaded ( i.e. by a bad plugin/theme ).

Cristián: Does WP load JQuery already? If so, why do plugins load it too?

Jason Caldwell: Yea, WP already loads it. But some plugin authors don't know that, or they just hard code it into their plugin not realizing that. Other times they'll try to include a dependency on jQuery, but they name it wrong, and WordPress gets confused.

Cristián: Does s2Member load it again or uses WP's?

Jason Caldwell: Hmm, not really, because in the Dashboard, it's already loaded by WordPress. s2Member enques scripts that is uses, which rely on jQuery being present. In the call to wp_enqueue_script(), s2Member will list jQuery as a dependency, which forces WP to load it, though it's already loaded in the Dashboard anyway. That's the proper way to handle it.

On the front-end of a site, s2Member will load jQuery if it's not already loaded, but again, using the same technique. A call to wp_enqueue_script() with a dependency on jQuery forces WP to load jQuery. If 10 plugins all do it this way ( i.e. the right way ), WordPress loads jQuery in the proper order and only one time.

Cristián: Ah, got it. I understand WP has a QC team, don't they check this?

Jason Caldwell: Not in my experience. They look mostly for security issues and really bad code. They usually don't catch minute details like this.

Cristián: I see. Well, they do look at how the db is used, iirc.

Cristián: I see, but these details do cause trouble for the users. Maybe it'd be good to write an article about JS conflicts as you explained above and post it in the forums, and then show it to the QC guys for consideration to include in their quality checklist.

Jason Caldwell: Yea, that's a good idea. On the WP side though, they're aware of this problem, and that's why they created the wp_enqueue_script() wp_enqueue_style() functions. Although, I wish this were more prominent in this article: http://codex.wordpress.org/Writing_a_Pl ... uggestions

It is mentioned, but it's all the way at the bottom:

Try not to echo <script> and <style> tags directly - instead use the recommended wp_enqueue_style() and wp_enqueue_script() functions. They help eliminate including duplicate scripts and styles as well as introduce dependency support. See posts by the following people for more info: Ozh Richard, Artem Russakovskii, and Vladimir Prelovac.


I hope it helps!

Statistics: Posted by Cristián Lávaque — December 19th, 2011, 5:02 am


]]>
2011-12-17T15:38:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56776#p56776 <![CDATA[Re: Security Badge Link Issue]]>
Do you have any solutions for fixing? I alerted the owners of the plugin.

Statistics: Posted by fcp2011 — December 17th, 2011, 3:38 pm


]]>
2011-12-15T04:53:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56574#p56574 <![CDATA[Re: Security Badge Link Issue]]>
Code:
<div class="ws-plugin--s2member-s-badge">
<a href="http://www.s2member.com/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://www.s2member.com']);window.open(" http:="" www.s2member.com="" s-badges="" s-details.php?v="1&amp;site_url=http%3A%2F%2Fwww.paylaterproducts.com'," _popup="" ,="" width="752,height=702,left='+((screen.width/2)-(752/2))+',screenX='+((screen.width/2)-(752/2))+',top='+((screen.height/2)-(702/2))+',screenY='+((screen.height/2)-(702/2))+',location=0,menubar=0,toolbar=0,scrollbars=0,resizable=1');" return="" false;="" title="s2Member®"><img src="//www.s2member.com/s-badges/s-badge.php?v=1&amp;site_url=http%3A%2F%2Fwww.paylaterproducts.com" style="border: 0pt none;" alt="s2Member®" title="s2Member® ( Security for WordPress® )"></a>
</div></div>


It may be a parsing problem or a JavaScript conflict caused by another plugin or the theme. To find which, please test changing to the default theme and check if the badge now works. If that doesn't do it, deactivate other plugins one by one and check if the problem goes with one of them.

Statistics: Posted by Cristián Lávaque — December 15th, 2011, 4:53 am


]]>
2011-12-13T12:58:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56424#p56424 <![CDATA[Re: Security Badge Link Issue]]> Statistics: Posted by fcp2011 — December 13th, 2011, 12:58 pm


]]>
2011-12-11T21:45:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56339#p56339 <![CDATA[Re: Security Badge Link Issue]]>
</div></div><div class="layout-fourth layout-last"><img class="alignright" title="Positive SSL By Comodo" src="http://www.paylaterproducts.com/wp-content/uploads/2011/06/positivessl_tl_white.gif" alt="" width="98" height="98" /></div><div class="clear"></div>

Statistics: Posted by fcp2011 — December 11th, 2011, 9:45 pm


]]>
2011-12-11T13:28:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56301#p56301 <![CDATA[Re: Security Badge Link Issue]]>
Thanks

Statistics: Posted by fcp2011 — December 11th, 2011, 1:28 pm


]]>
2011-12-11T01:04:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56264#p56264 <![CDATA[Re: Security Badge Link Issue]]>
Since when did you start having that issue? What version s2Member are you running? Are you using the shortcode for it?

Statistics: Posted by Cristián Lávaque — December 11th, 2011, 1:04 am


]]>
2011-12-09T23:47:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16281&p=56176#p56176 <![CDATA[Security Badge Link Issue]]>
Can you confirm this and correct the issue? The site is www.paylaterproducts.com.

Regards,

Daniel

Statistics: Posted by fcp2011 — December 9th, 2011, 11:47 pm


]]>