function likebtn_db_update_10()
{
    if (get_option('likebtn_acc_data_correct') != '1') {
        require_once dirname(__FILE__) . '/likebtn_like_button.class.php';
        $likebtn = new LikeBtnLikeButton();
        $test_response = $likebtn->checkAccount(get_option('likebtn_account_email'), get_option('likebtn_account_api_key'), get_option('likebtn_site_id'));
        if ($test_response['connect_result'] == 'success') {
            if ($test_response['result'] == 'success') {
                update_option('likebtn_acc_data_correct', '1');
            }
        }
    }
}
Ejemplo n.º 2
0
function likebtn_check_account_callback()
{
    $likebtn_account_email = '';
    if (isset($_POST['likebtn_account_email'])) {
        $likebtn_account_email = $_POST['likebtn_account_email'];
    }
    $likebtn_account_api_key = '';
    if (isset($_POST['likebtn_account_api_key'])) {
        $likebtn_account_api_key = $_POST['likebtn_account_api_key'];
    }
    $likebtn_site_id = '';
    if (isset($_POST['likebtn_site_id'])) {
        $likebtn_site_id = trim($_POST['likebtn_site_id']);
    }
    require_once dirname(__FILE__) . '/likebtn_like_button.class.php';
    $likebtn = new LikeBtnLikeButton();
    $test_response = $likebtn->checkAccount($likebtn_account_email, $likebtn_account_api_key, $likebtn_site_id);
    if ($test_response['result'] == 'success') {
        $result_text = __('OK', LIKEBTN_I18N_DOMAIN);
    } else {
        $result_text = __('Error', LIKEBTN_I18N_DOMAIN);
    }
    $response = array('result' => $test_response['result'], 'result_text' => $result_text, 'message' => $test_response['message']);
    if (!DOING_AJAX) {
        define('DOING_AJAX', true);
    }
    if (ob_get_contents()) {
        ob_clean();
    }
    _likebtn_send_json($response);
}