• Resolved matthewcarlin

    (@matthewcarlin)


    I like the plugin and how it works. However i’m trying to reduce my page size on my site and if the button isn’t displayed then it reduces by around 800-900kb . This seems to be all javascript from Facebook that is being downloaded and is account for nearly a third of the total size of the page.

    Is it at all possible to reduce the amount of js loaded? or only load it what’s neccassary?

    https://www.ads-software.com/plugins/wp-fb-autoconnect/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author justin_k

    (@justin_k)

    All the JS is coming from FB, so I don’t have any control over its size.

    If you want, you can try to remove the “jfb_output_facebook_init” filter when a user is logged in, but this is unsupported behavior & you’re on your own to test & make sure everything still works properly. If you’re just using the free version of the plugin, it *should* be fine – but the premium addon relies on the JS being there for some of its additional features, & I definitely had issues removing it at some point in the past, which is why it now remains there.

    Note that it always needs to be there for non-logged-in users anyway, which is the more relevant scenario (i.e. undoubtedly the vast majority of your page hits).

    Thread Starter matthewcarlin

    (@matthewcarlin)

    Hi Justin,

    Thanks for answering, i had a suspicion that it was beyond your control, but at least i know for sure now. It’s a shame that Facebook loads so much and doesn’t allow more granularity about what you can request. Ah well!

    Plugin Author justin_k

    (@justin_k)

    Oh, I should correct that: I mean there *might* be other clever ways to try to minimize it – I’m just using the default method as per FB’s docs. But it’s not something I’ve looked deeply into, and since I’m using the more-or-less globally accepted method, I can’t imagine getting to a point where trying sidestep the official js would take precedence over implementing actual plugin functionality ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reducing the amount of javascript the plugin loads’ is closed to new replies.