Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Teguh

    (@teguhpratama)

    Add this code to /wp-content/plugins/yakadandada-instagram/admin/functions.php (after line-377, or last line)

    function yi_get_access_token($code) {
      $data = yinstagram_get_options('settings');
    
      // Get cURL resource
      $curl = curl_init();
      // Set some options - we are passing in a useragent too here
      curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_URL => 'https://api.instagram.com/oauth/access_token',
        CURLOPT_USERAGENT => 'Access Token Request',
        CURLOPT_POST => 1,
        CURLOPT_POSTFIELDS => array(
          'client_id' => $data['client_id'],
          'client_secret' => $data['client_secret'],
          'grant_type' => 'authorization_code',
          'redirect_uri' => admin_url('admin.php?page=yinstagram/settings.php'),
          'code' => $code
        )
      ));
      // Send the request & save response to $resp
      $resp = curl_exec($curl);
      // Close request to clear up some resources
      curl_close($curl);
      return $resp;
    }
    

    still on /wp-content/plugins/yakadandada-instagram/admin/functions.php add this code (on line-149)

    $message = maybe_serialize(array('cookie' => 1, 'class' => 'error', 'msg' => 'Connection to Instagram failed.'));
    $response = json_decode( yi_get_access_token($_GET['code']) );
    if ( isset($response->access_token) ) {
      update_option('yinstagram_access_token', $response);
      $message = maybe_serialize(array('cookie' => 1, 'class' => 'updated', 'msg' => 'Connection to Instagram succeeded.'));
    }
    

    so it will look like

    ...
    } else {
      $message = maybe_serialize(array('cookie' => 1, 'class' => 'error', 'msg' => $response['errors']['http_request_failed'][0]));
    }
    
    $message = maybe_serialize(array('cookie' => 1, 'class' => 'error', 'msg' => 'Connection to Instagram failed.'));
    $response = json_decode( yi_get_access_token($_GET['code']) );
    if ( isset($response->access_token) ) {
      update_option('yinstagram_access_token', $response);
      $message = maybe_serialize(array('cookie' => 1, 'class' => 'updated', 'msg' => 'Connection to Instagram succeeded.'));
    }
    
    setcookie('yinstagram_response', $message, time()+1, '/');
    wp_redirect(admin_url('admin.php?page=yinstagram/settings.php')); exit;
    }
    /* end of authentication */
    ...
    
    Teguh

    (@teguhpratama)

    hmmm… let’s try this, I’m just curious

    on /wp-content/plugins/yakadandada-instagram/admin/page-settings.php

    add this code (after line-3)

    <?php if (!function_exists('curl_version')): ?>
      <div class="error">
        <p>Please enable cURL.</p>
      </div>
    <?php endif; ?>
    

    So it will look like

    <div class="wrap">
      <div id="icon-edit" class="icon32 icon32-posts-quote"></div>
      <h2>Settings</h2>
      <?php if (!function_exists('curl_version')): ?>
        <div class="error">
          <p>Please enable cURL.</p>
        </div>
      <?php endif; ?>
      <?php if ($message): ?>
        <div class="<?php echo $message['class']; ?>">
      ...
    

    then open your settings page -> https://your-site.am/wp-admin/admin.php?page=yinstagram/settings.php

    if no red message go to next step below

    Teguh

    (@teguhpratama)

    Strange ?? , I have no problem at all. Try to reset and connect again. And make sure OAuth redirect_uri is https://your-site.am/wp-admin/admin.php?page=yinstagram/settings.php

    Teguh

    (@teguhpratama)

    I changed /wp-content/plugins/features-by-woothemes/woothemes-features-template.php line 92

    from
    $image_size = apply_filters( 'woothemes_features_image_size', 'thumbnail', $post );

    to
    $image_size = apply_filters( 'woothemes_features_image_size', array($args['size'],$args['size']), $post );

    it worked for me.

    Teguh

    (@teguhpratama)

    Maybe, email verification existed since 0.1.5 to prevent wrong connection to google api
    To pass the email verification edit /wp-content/plugins/yakadanda-google-hangout-events/oauth2callback.php line 34

    from
    $is_calendar_id = in_array($data['calendar_id'], $calendar_ids);

    to
    $is_calendar_id = true;

    Teguh

    (@teguhpratama)

    I used another computer to setup this plugin, because I don’t want to clear everything (cache, cookie, etc) on my browser in my laptop. It worked for me.

Viewing 6 replies - 1 through 6 (of 6 total)