Title: [Plugin: WordPress HTTPS (SSL)] Patch to avoid DB writes because of ssl_host_diff
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] Patch to avoid DB writes because of ssl_host_diff

 *  [epirker](https://wordpress.org/support/users/epirker/)
 * (@epirker)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-patch-to-avoid-db-writes-because-of-ssl_host_diff/)
 * Folks,
 * I don’t understand why WordPressHTTPS is always doing a setSetting (i.e. an unconditional
   SQL UPDATE) on the value ssl_host_diff. Since it is done every time, per connection(!),
   then I’d suggest storing it as an object variable, because one should avoid pointless
   database writes and these are especially painful in a replicated setup.
 * I created the following patch for lib/WordpressHTTPS.php that makes the change
   transparent to the existing code and as far as I see doesn’t have side effects
   and works well, however I don’t know the plugin code well enough to make a good
   statement. So I’m asking for other opinions on this matter, is there some important
   point I’m missing?
 * 48a49,50
    > protected $sslHostDiff = 0; > 409c411,426 < } \ No newline at end
   of file — > > public function getSetting( $setting, $blog_id = 0 ) { > if ($setting
   ==’ssl_host_diff’) return $this->sslHostDiff; > return parent::getSetting( $setting,
   $blog_id ); > } > > public function setSetting( $setting, $value ) { > if ($setting
   ==’ssl_host_diff’) { > $this->sslHostDiff=$value; > return $this; > } > return
   parent::setSetting( $setting, $value ); > } > > > }
 * Kind Regards
 * Emanuel
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

The topic ‘[Plugin: WordPress HTTPS (SSL)] Patch to avoid DB writes because of ssl_host_diff’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [performance](https://wordpress.org/support/topic-tag/performance/)
 * [queries](https://wordpress.org/support/topic-tag/queries/)
 * [setting](https://wordpress.org/support/topic-tag/setting/)

 * 0 replies
 * 1 participant
 * Last reply from: [epirker](https://wordpress.org/support/users/epirker/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-patch-to-avoid-db-writes-because-of-ssl_host_diff/)
 * Status: not resolved