place_types = array( 'unknown' => __( 'Unknown', 'keyring' ), 'home' => __( 'Home', 'keyring' ), 'work' => __( 'Work', 'keyring' ), 'school' => __( 'School', 'keyring' ), 'user' => __( 'Manually Named', 'keyring' ), 'foursquare' => __( 'Selected from foursquare', 'keyring' ), ); $this->activity_types = array( 'wlk' => __( 'Walking', 'keyring' ), 'cyc' => __( 'Cycling', 'keyring' ), 'run' => __( 'Running', 'keyring' ), 'trp' => __( 'Transport', 'keyring' ), ); // Enable "basic" UI for entering key/secret if ( ! KEYRING__HEADLESS_MODE ) { add_action( 'keyring_moves_manage_ui', array( $this, 'basic_ui' ) ); add_filter( 'keyring_moves_basic_ui_intro', array( $this, 'basic_ui_intro' ) ); } $this->set_endpoint( 'authorize', 'https://api.moves-app.com/oauth/v1/authorize', 'GET' ); $this->set_endpoint( 'access_token', 'https://api.moves-app.com/oauth/v1/access_token', 'POST' ); $this->set_endpoint( 'verify_token', 'https://api.moves-app.com/oauth/v1/tokeninfo', 'GET' ); $this->set_endpoint( 'profile', 'https://api.moves-app.com/api/v1/user/profile', 'GET' ); $creds = $this->get_credentials(); $this->app_id = $creds['app_id']; $this->key = $creds['key']; $this->secret = $creds['secret']; $this->consumer = new OAuthConsumer( $this->key, $this->secret, $this->callback_url ); $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1; $this->authorization_header = 'Bearer'; $this->authorization_parameter = false; add_filter( 'keyring_moves_request_token_params', array( $this, 'request_token_params' ) ); } function basic_ui_intro() { echo '
' . __( "Head over and create a new application on Moves-app which you'll use to connect.", 'keyring' ) . '
'; echo '' . sprintf( __( "Once it's created, click the Development tab. Your App ID and API Key are both shown on that page as Client ID. Enter your Client secret in the API Secret box. On that tab there is also a Redirect URI box, which you should set to %s
.", 'keyring' ), Keyring_Util::admin_url( self::NAME, array( 'action' => 'verify' ) ) ) . '