Can't Activate

Is the WHMCS Provisioning plugin required to use WHMCS WP Integration plugin? When trying to activate the plugin, I get the following message:

Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_FUNCTION in /******/*******/******/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 811

I should point out that as per WHMCS' security recommendations, /whmcs is not my installation folder and /whmcs/admin is not my admin dashboard. Do these variables need to be changed somewhere in the code for the plugin to work?

  • Arnold
    • El Macho WP

    That areas gatta be rewoeked I see but for now could you try this.

    Replace the preg_replace_callback line with

    $text = preg_replace_callback('<code>(jQuery.post\(&quot;)([\w\d-_]+.php)</code>u', array($this, 'ajax_loop') , $text);

    and add this function just be low the close of the function the preg is in

    /**
    * Helper function for preg_replace_callback above
    *
    */
    function ajax_loop($match) {
      return $match[1] . url_to_absolute($this->whmcs_base, $match[2]);
    }

    So this whole section should look like

    $text = preg_replace_callback('<code>(jQuery.post\(&quot;)([\w\d-_]+.php)</code>u', array($this, 'ajax_loop') , $text);
    
      return $text;
    }
    
    /**
    * Helper function for preg_replace_callback above
    *
    */
    function ajax_loop($match) {
      return $match[1] . url_to_absolute($this->whmcs_base, $match[2]);
    }
    
    /**
    * have_whmcs_page - Tries to retrieve a WHMCS page based on the whmcsportal[page] query_var or root of WHMCS if whmcsportal not available

    Let me know if it works for you

  • jlloke82
    • WPMU DEV Initiate

    i also have the error
    Parse error: syntax error, unexpected T_FUNCTION in /home/gooblexc/public_html/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 811

    i add the new line

    /**
    * Helper function for preg_replace_callback above
    *
    */
    function ajax_loop($match) {
    return $match[1] . url_to_absolute($this->whmcs_base, $match[2]);
    }

    is also the same error.

  • whi
    • Design Lord, Child of Thor

    I have same error. I replace your code and added your new line. I can activate the plugin, but the shotcodes didn't work. Example: the page with [wcp_account] doesn't show anyting.
    PHP Version 5.2.17

  • NYCWW
    • Site Builder, Child of Zeus

    All of the shortcodes return errors when used. Here is a list of the errors:
    Warning: preg_replace_callback() [function.preg-replace-callback]: Unknown modifier '(' in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 813

    Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Empty string supplied as input in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 490

    Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 875

    Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 859

    Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 863

    Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 867

    Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /xxxxxxxx/xxxxxxxx/xxxxxxxx/wp-content/plugins/whmcs-wordpresss-integration/whmcs-integration.php on line 871

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.