Title: Create conditional bit.ly api requests
Last modified: August 22, 2016

---

# Create conditional bit.ly api requests

 *  Resolved [jlooooo](https://wordpress.org/support/users/jlooooo/)
 * (@jlooooo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/)
 * Hi,
 * Just some feedback about performance. I noticed my website slowed down with 3,5
   s when I enabled Super Socializer. With the Query Monitor plugin I discovered
   it had to do with the bit.ly url shortener. I use a custom post type to render‘
   custom blocks’ where needed. Unfortunately, the bit.ly feature makes a http request
   to the bit.ly api for every post on the page. With 10 custom posts this took 
   2.6s…
 * Could you please only make a bit.ly api call when a user shares something? Would
   be great.
 * For now I just disabled the bit.ly api again, but I would love to enable it again
   for my users.
 * Cheers!
 * [https://wordpress.org/plugins/super-socializer/](https://wordpress.org/plugins/super-socializer/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Rajat Varlani](https://wordpress.org/support/users/the_champ/)
 * (@the_champ)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895115)
 * Hi there,
    Thanks for reporting this. I will definitely try to improve this in
   future releases.
 *  Thread Starter [jlooooo](https://wordpress.org/support/users/jlooooo/)
 * (@jlooooo)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895271)
 * Thanks
 *  Plugin Author [Rajat Varlani](https://wordpress.org/support/users/the_champ/)
 * (@the_champ)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895347)
 * Hi,
    I have included the functionality to cache short urls in the latest version
   of the plugin so that request will not be sent to bitly server on each page load.
   Kindly update your plugin.
 *  Thread Starter [jlooooo](https://wordpress.org/support/users/jlooooo/)
 * (@jlooooo)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895349)
 * Hi,
    Doesn’t sound as the best solution. Wouldn’t it be better to only make the
   api call if a user clicks a button to share somehting?
 *  Plugin Author [Rajat Varlani](https://wordpress.org/support/users/the_champ/)
 * (@the_champ)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895352)
 * In the solution you are suggesting, API call will be made each time the share
   button is clicked. Say your website has 100 visitors per day. If 75 of them share
   the content, bitly API would be called 75 times a day. Furthermore, this will
   introduce some delay between the ‘click on icon’ and ‘appearance of sharing window’.
   
   What I have done – Plugin will call the bit.ly API on first page load and will
   cache the short urls for the subsequent page loads. So in above scenario, API
   call will be made only once for these 75 shares a day and even subsequent shares
   for that webpage. Isn’t it better? 🙂
 *  Thread Starter [jlooooo](https://wordpress.org/support/users/jlooooo/)
 * (@jlooooo)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895353)
 * Sound better indeed 🙂
 * Would it be possible to enable/disable by post_type? I use custom post_types 
   to create banners, boxes etc. No need to share this stuff, hence no need to make
   an bit.ly api call at all.
 *  Plugin Author [Rajat Varlani](https://wordpress.org/support/users/the_champ/)
 * (@the_champ)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895354)
 * Sorry, it cannot be enabled based on post/page type for now. I will try to do
   something about it in future releases.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Create conditional bit.ly api requests’ is closed to new replies.

 * ![](https://ps.w.org/super-socializer/assets/icon-128x128.png?rev=1866723)
 * [Social Share, Social Login and Social Comments Plugin - Super Socializer](https://wordpress.org/plugins/super-socializer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/super-socializer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/super-socializer/)
 * [Active Topics](https://wordpress.org/support/plugin/super-socializer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/super-socializer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/super-socializer/reviews/)

## Tags

 * [bit.ly](https://wordpress.org/support/topic-tag/bit-ly/)

 * 7 replies
 * 2 participants
 * Last reply from: [Rajat Varlani](https://wordpress.org/support/users/the_champ/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/create-conditional-bitly-api-requests/#post-5895354)
 * Status: resolved