DGashi DGashi - 4 years ago 77
PHP Question

Why is this plugin not working on my responsive site? (Facebook TrafficPop™ for WordPress)

I am using this plugin called "Facebook TrafficPop™" for WordPress which displays a pop-up that forces the visitor to like a specified link in order to gain access to the page.

When the browser is full size, the pop-up appears as it should, however when I decrease the browser size up to the point where the styling gets changed to fit mobile screens, the pop-up doesn't show up anymore. As the majority of my visitors use mobile, it's a great loss for me.

These are the files:

fb-traffic-pop.php

fb-like-pop.js

In the .php file, you will notice that at the mobile part I have changed the

$state = false
to
true
but it did not fix the problem as it is not a user agent problem but rather a browser size (responsiveness) problem.

Answer Source

looks like that script (fb-like-pop.js) internally checks your windows width with the following code:

... fbtp_display=function(){700<b(window).width()&& ...

try setting that 700 to 0 or getting rid of the comparison completely:

... fbtp_display=function(){0<b(window).width()&& ...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download