again: broken class http due to whmcs plugin

So after months of not knowing what happend and why my site got broken many times, disabling the plugin had effect.

I dont know what happens and yes it could be my setup but i have tried to solve it again and again.

At least three times the editing of the files goes wrong and the site dies, be it completely or just the order/whmcs part

I now had i looked at by an external party as i trust wpmudev, they decided to remove the plugin due to the way it deals with the http class.

So.. i can use that plugin now, the good part is that my website stays in a usable state.

I would love to solve it however, but cant have my website down all the time, i even changed server and service provider to help this, but no effect. I can give a backup for u guys to see, but i understand that hats not going to help. Until the way the patching is done has changed its a too big risk, no matter what the reason is, patching can go wrong and there is no check

  • jolanda_jansen

    Hi Vaughan

    Thanks for the response, sorry if my message seems rude, it does to me now.

    I got a lot of errors,
    PHP Fatal error: Class 'WP_Http' not found in /home/mydirhere/domains/mydomainhere.nl/public_html/wp-includes/http.php on line 26

    als o i get chmod errors as i need to set potential unsafe permissions to get the plugin to work.

    It not always happens but if it does its ater updating the url in whmcs integegration.

    Before i had the same thing, but then it was class http, i dont know what changed that, perhaps an wp new version or smth

    ill ask my tech guy to explain

  • jolanda_jansen

    Hi all

    sorry to bother u guys again but i think i have found the problem

    the plugi stops working as the cache directory gets chmod 755

    on my server it needs 777, if its 755 it wont work!!!

    This is whats creates the situation where it workes fine at first but after saving a setting or perhaps even visiting the config page of the plugin it fails:

    in the plugin code it see:

    //Setup session specific cookies for WHMCS
    if(! is_dir(WHMCS_INTEGRATION_CACHE_DIR)) mkdir(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    //if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0777);
    $this->cache = WHMCS_INTEGRATION_CACHE_DIR . "{$this->sid}.txt";

    to have it always 777 what must i change??

  • Hoang Ngo

    Hi @jolanda_jansen,

    I hope you are well today, and very sorry about your issue.

    If you server only work wih 777 permision, so please do like this

    1.Rename the old cache folder, to cache_old_date or similiar.
    2.Please modify the code to this.

    if(! is_dir(WHMCS_INTEGRATION_CACHE_DIR)) mkdir(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    //if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0777);

    So now, it will create another cache folder, and set the 777 to that folder. And this will resolve your issue now.

    If you have any issues please don't hesitate to let us know so we can assist

    Best Regards
    Hoang

  • Arnold

    Looks. like one of the lines got commented out in that sequence. Should be

    //Setup session specific cookies for WHMCS
    if(! is_dir(WHMCS_INTEGRATION_CACHE_DIR)) mkdir(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0755);
    if(! is_writable(WHMCS_INTEGRATION_CACHE_DIR) ) chmod(WHMCS_INTEGRATION_CACHE_DIR, 0777);

    It first tries to create the directory. It then checks if it writable and if not changes it to 0755. If it's still not writeable it changes it to 0777. It's trying to set the minimum permissions that work.

    The last 0777 check got commented out which is why it never got set properly.