Title: Per Wiklander's Replies | WordPress.org

---

# Per Wiklander

  [  ](https://wordpress.org/support/users/perwiklander/)

 *   [Profile](https://wordpress.org/support/users/perwiklander/)
 *   [Topics Started](https://wordpress.org/support/users/perwiklander/topics/)
 *   [Replies Created](https://wordpress.org/support/users/perwiklander/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/perwiklander/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/perwiklander/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/perwiklander/engagements/)
 *   [Favorites](https://wordpress.org/support/users/perwiklander/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Posts 2 Posts] P2P incompatibility problem with Relevanssi, proposing 'solution'](https://wordpress.org/support/topic/p2p-incompatibility-problem-with-relevanssi-proposing-solution/)
 *  [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/p2p-incompatibility-problem-with-relevanssi-proposing-solution/#post-3424906)
 * [@ruud](https://wordpress.org/support/users/ruud/)@joyo Have you got it working
   now? Which versions of Relevanssi and Posts2Posts are you running?
 * I can run Relevanssi 2.9.14 and P2P 1.5.2 with no problems. I guess the problems
   in Relevanssi were introduced somewhere in the 3.0 branch.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PostTypeBuilder] i18n with posttypebuilder](https://wordpress.org/support/topic/i18n-with-posttypebuilder/)
 *  Thread Starter [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/i18n-with-posttypebuilder/#post-2598655)
 * I didn’t have to do any more translated sites, so I forgot about it. I think 
   the best thing to do is to file an issue here: [https://github.com/bornemix/PostTypeBuilder/issues](https://github.com/bornemix/PostTypeBuilder/issues)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wpMandrill] Unnecessary ping requests to mandrillapp.com, makes site slow](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/)
 *  Thread Starter [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/#post-2848970)
 * Ok, we’re getting there.
 * Now you don’t ping twice for every page load. That is good. That was the “WTF
   is happening here?!?” issue.
 * Now you just ping twice for almost every thing you do through the API. The first
   ping still happens in the constructor of the Mandrill class at line 20:
 *     ```
       $response = $this->request('users/ping2', array( 'key' => $api ) );
       if ( !isset($response['PING']) || $response['PING'] != 'PONG!' ) throw new Mandrill_Exception('Invalid API key');
       ```
   
 * The second ping is done in `isConnected()` on line 451 in wpmandrill.php.
 * What I was trying to explain earlier was that there is only one time we ever 
   need to do the whole ping thing, that is directly after the user has changed 
   his API key through the settings page. That is a good time to verify that the
   key works. After that single time we must be able to trust the fact that the 
   key is still valid and the Mandrill server is still online. When any of these
   two facts are no longer true, we will get to know that since a call to any of
   the API methods that actually do something of value (like sending mail) will 
   fail.
 * Consider this scenario (events are written in the order they happen in time):
 * 1. I call wpMandrill::mail()
    2. self::isConnected() does the ping and everything
   is still OK 3. The Mandrill service goes down or the API key is revoked 4. self::
   $mandrill->messages_send($message); fails
 * Now what was the reason to do (2)?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wpMandrill] Unnecessary ping requests to mandrillapp.com, makes site slow](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/)
 *  Thread Starter [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/#post-2848774)
 * And then:
    wpmandrill.php line 75 :: isReady() one more call to ping, but this
   time through Mandrill::users_ping()
 * So that is TWO blocking http calls to a web service on every page load of a busy
   WordPress site. Removing these two ping calls dropped my page load time to a 
   reasonable 0.2 seconds again.
 * I’m suggesting you only load Mandrill in the admin_init action on the admin pages
   that actually use it. And then load it on demand when sending mail from front
   end pages.
 * The pings should only be needed after changing the API key in admin, to verify
   that it works. Other than that I think we can trust that the service is still
   up until a real request, like sending mail, actually fails.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wpMandrill] Unnecessary ping requests to mandrillapp.com, makes site slow](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/)
 *  Thread Starter [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/#post-2848768)
 * Ok, it looks like the constructor of the Mandrill class does a ping request to
   the web service. And the Mandrill class is instanced by wpmandrill.php on every
   page request regardless of if it is needed at all.
 * That would explain it.
 * Now my question is not “why does this happen?” but more of “why, oh why, did 
   you code it like this?”.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wpMandrill] Unnecessary ping requests to mandrillapp.com, makes site slow](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/)
 *  Thread Starter [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/wpmandrill-makes-my-site-slow/#post-2848767)
 * I hope I have given as much details as needed. This is on a fresh WP 3.4, no 
   other plugins. How long the call to mandrillapp.com actually takes is of course
   dependent on network connection speeds and latency. I guess there’s a bit of 
   latency between Sweden and the US (if Mandrill doesn’t have EU sites) but my 
   question is really about WHY the call is made at all.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] [Plugin: WP Super Cache] Expired files problem](https://wordpress.org/support/topic/plugin-wp-super-cache-expired-files-problem/)
 *  [Per Wiklander](https://wordpress.org/support/users/perwiklander/)
 * (@perwiklander)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-super-cache-expired-files-problem/#post-2642118)
 * I had this problem. I turned on email notfications and got this:
 * >  The WP Super Cache Garbage Collector has now run, deleting 0 files and directories.
   > …
   > The following warnings were generated by the WP Super Cache Garbage Collector:
   > Cache expiry cron job failed. Job will run again in 10 seconds.
 * Then I saw that I had preload mode set to “on” but “custom_preload_interval” 
   was set to 0 (as in zero seconds, or turned off). I turned preload mode off (
   unchecked the box) and files stated to get deleted again. Now the notification
   mails look like this:
 * >  The WP Super Cache Garbage Collector has now run, deleting 174 files and directories.
 * A better handling of this would be nice. Like the first mail telling me it did
   not delete anything because of the preload settings.

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