Plugin Directory

Changeset 2076899


Ignore:
Timestamp:
04/29/2019 11:34:08 AM (6 years ago)
Author:
optinmate
Message:

updating main file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • optinmate/trunk/optinmate.php

    r2075426 r2076899  
    3636    define('OPTIN_WOO_MATE_PLUGIN_PATH', plugin_dir_path(__FILE__));
    3737    define('OPTIN_WOO_MATE_PLUGIN_URL', plugin_dir_url(__FILE__));
    38     define('OPTIN_WOO_API_INSTALL_URL', 'http://optinmate.com/api/woocommerce/install');
    39     define('OPTIN_WOO_API_ACCOUNT_URL', 'http://optinmate.com/woocommerce/iframe?account=');
     38    define('OPTIN_WOO_API_INSTALL_URL', 'http://my.optinmate.com/api/woocommerce/install');
     39    define('OPTIN_WOO_API_ACCOUNT_URL', 'http://my.optinmate.com/woocommerce/iframe?account=');
    4040    define('OPTIN_FRONTEND_JS_PATH', 'https://my.optinmate.com/');
    4141    if (is_admin()) {
     
    103103     */
    104104    $response_decoded = json_decode($response['body'], true);
    105 
    106     $optin_account_id = intval($response_decoded['account_id']);
    107     if (!$optin_account_id) {
    108         $optin_account_id = '';
     105   
     106    if(isset($response_decoded['account_id']) && !empty($response_decoded['account_id'])) {
     107        $optin_account_id = intval($response_decoded['account_id']);
    109108    }
    110109
    111     $optin_user_id = intval($response_decoded['user_id']);
    112     if (!$optin_user_id) {
    113         $optin_user_id = '';
     110    if(isset($response_decoded['user_id']) && !empty($response_decoded['user_id'])) {
     111        $optin_user_id = intval($response_decoded['user_id']);
    114112    }
    115113
    116     if (!empty($optin_account_id) && !empty($optin_user_id)) {
     114    if (isset($optin_account_id) && !empty($optin_account_id) && isset($optin_user_id) && !empty($optin_user_id)) {
    117115        update_option("optin_account_id", $optin_account_id, 'no');
    118116        update_option("optin_user_id", $optin_user_id, 'no');
Note: See TracChangeset for help on using the changeset viewer.