WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. epirker
    Member
    Posted 2 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic