title: TwitterOAuth: Uncaught exception 'This feature is temporarily unavailable'
body: <p>I am working on an application in Wordpress which allows users to login using their Twitter accounts, and then redirects the users to a form. On submitting that form, a tweet is sent to the user's Twitter handle. I'm using Abraham's <code>twitteroauth</code> to implement Twitter OAuth.</p>
  
  <p>The source code of the redirected template after successful Twitter login:</p>
  
  <pre><code>&lt;pre&gt;
  &lt;?php
  /*
   *Template Name: Callback 
  */
  
  ?&gt;  
  &lt;?php
  
      session_start();
      require "twitteroauth/autoload.php";
      use Abraham\TwitterOAuth\TwitterOAuth;
  
      define('CONSUMER_KEY', "XXXXXXXXXXXXXXX");
      define('CONSUMER_SECRET', "XXXXXXXXXXXXXX");
      define('OAUTH_CALLBACK', " http://localhost/wordpress/index.php/callback/");
  
      $request_token = [];
      $request_token['oauth_token'] = $_SESSION['oauth_token'];
      $request_token['oauth_token_secret'] = $_SESSION['oauth_token_secret'];
  
      if (isset($_REQUEST['oauth_token']) &amp;&amp; $request_token['oauth_token'] !== $_REQUEST['oauth_token'])
      {
          echo "Opps! Something went wrong!";
      }
  
      else
      {
          $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $request_token['oauth_token'], $request_token['oauth_token_secret']);
          $access_token = $connection-&gt;oauth("oauth/access_token", array("oauth_verifier" =&gt; $_REQUEST['oauth_verifier']));
  
          //print_r($access_token);
  
          $_SESSION['access_token'] = $access_token;
      }
  
      $access_token = $_SESSION['access_token'];
  
      $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
  
      //$user = $connection-&gt;get("account/verify_credentials");
  
      //$response = $connection-&gt;post("statuses/update", array('status' =&gt; 'fsociety'))
  
  
  
  
  
      //$response = $tmhOAuth-&gt;request('POST', $tmhOAuth-&gt;url('1.1/statuses/update'), array(
                                                                          //'status' =&gt; 'Conceit to fall on parasol.'
  
  
  ?&gt;
  
  
  &lt;script&gt;
  
      var count = 0
  
      function addNewMessage(count)
          {       
                  if(count &gt; 5)
                  {
                      window.alert("NO MORE THAN 5!");
                  }
                  else
                  {
                      var celeb = document.createElement("input");
                      celeb.type = "text";
                      celeb.name = "tweet" + count;
                      celeb.placeholder = "Tweet" + " " + count;
                      celebrity.appendChild(celeb);
  
                      var date = document.createElement("input");
                      date.type = "datetime-local";
                      date.name = "date" + count;
                      date.placeholder = "message-date" + " " + count;
                      celebrity.appendChild(date);
  
                      celebrity.appendChild(document.createElement("br"));
                      celebrity.appendChild(document.createElement("br"));
                  }
          }        
  
  &lt;/script&gt;
  
  &lt;form method = "POST" action = ""&gt;
  
      &lt;fieldset&gt;
          &lt;a style = "color:red" onclick = "addNewMessage(++count)"&gt;Schedule a tweet&lt;/a&gt;
          &lt;div id = "celebrity"/&gt;
      &lt;/fieldset&gt;
  
      &lt;br&gt;
      &lt;fieldset&gt;
          &lt;input type="hidden" name="submitted" id="submitted" value="true" /&gt;
          &lt;?php wp_nonce_field( 'post_nonce', 'post_nonce_field' ); ?&gt;
          &lt;button type="submit"&gt;&lt;?php _e('Add Campaign', 'framework') ?&gt;&lt;/button&gt;
      &lt;/fieldset&gt;
  
  
  &lt;/form&gt;
  
  
  &lt;?php
  
  
  
  if ( isset( $_POST['submitted'] ))
  {
      $response = $connection-&gt;post("statuses/update", array('status' =&gt; 'fsociety'));
  }
  
  ?&gt;
  
  &lt;/pre&gt;
  </code></pre>
  
  <p>On submitting the form, I use Abraham's <code>twitteroauth</code> to post a tweet on the user's Twitter timeline, which I have tried to implement as follows:</p>
  
  <pre><code>&lt;?php
  
  
  
  if ( isset( $_POST['submitted'] ))
  {
      $response = $connection-&gt;post("statuses/update", array('status' =&gt; 'fsociety'));
  }
  
  ?&gt;
  </code></pre>
  
  <p>However, this is the error I'm encountering:</p>
  
  <pre><code>Fatal error:  Uncaught exception 'Abraham\TwitterOAuth\TwitterOAuthException' with message 'This feature is temporarily unavailable' in /opt/lampp/htdocs/wordpress/wp-content/themes/twentyfifteen/tuto/twitteroauth/src/TwitterOAuth.php:137
  Stack trace:
  #0 /opt/lampp/htdocs/wordpress/wp-content/themes/twentyfifteen/tuto/callback.php(30): Abraham\TwitterOAuth\TwitterOAuth-&gt;oauth('oauth/access_to...', Array)
  #1 /opt/lampp/htdocs/wordpress/wp-includes/template-loader.php(74): include('/opt/lampp/htdo...')
  #2 /opt/lampp/htdocs/wordpress/wp-blog-header.php(16): require_once('/opt/lampp/htdo...')
  #3 /opt/lampp/htdocs/wordpress/index.php(17): require('/opt/lampp/htdo...')
  #4 {main}
    thrown in /opt/lampp/htdocs/wordpress/wp-content/themes/twentyfifteen/tuto/twitteroauth/src/TwitterOAuth.php on line 137
  </code></pre>
  
  <p>I tried debugging by printing the <code>$access_token</code>, and I'm indeed getting a unique token from the OAuth provider as expected. </p>
  
  <p>What seems to be wrong with my code, and how could I avoid raising that Exception?</p>