WordPress HTTPS (SSL)
Patch to avoid DB writes because of ssl_host_diff (1 post)

  1. epirker
    Posted 3 years ago #


    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?

    > protected $sslHostDiff = 0;
    < }
    \ 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



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress HTTPS (SSL)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic