PluginProbe ʕ •ᴥ•ʔ
Custom Twitter Feeds – A Tweets Widget or X Feed Widget / 2.7.0
Custom Twitter Feeds – A Tweets Widget or X Feed Widget v2.7.0
2.8.0 2.7.0 2.6.1 2.6.0 1.0 1.0.1 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.2 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.4 1.4.1 1.5 1.5.1 1.6 1.6.1 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1 2.1.1 2.1.2 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.5.4 2.5.5 trunk
custom-twitter-feeds / inc / SmashTwitter / AuthRoutine.php
custom-twitter-feeds / inc / SmashTwitter Last commit date
Services 1 month ago AuthRoutine.php 1 month ago CronUpdaterManager.php 1 month ago ErrorReport.php 1 month ago Request.php 1 month ago SettingsFilter.php 1 month ago SinglePostCache.php 1 month ago TweetAggregator.php 1 month ago TweetFilterer.php 1 month ago TweetRepository.php 1 month ago TweetSetModifier.php 1 month ago
AuthRoutine.php
71 lines
1 <?php
2 /**
3 * Class Request
4 *
5 * Performs a request to the Smash Balloon Twitter API.
6 *
7 * @since 2.1
8 */
9 namespace TwitterFeed\SmashTwitter;
10
11 class AuthRoutine
12 {
13
14 public function __construct()
15 {
16 }
17
18 public function run_register()
19 {
20 $auth_required = false;
21 $data = array(
22 'url' => get_home_url()
23 );
24
25 $args = array(
26 'body' => json_encode($data),
27 'timeout' => 60
28 );
29
30 $request = new Request( 'register', '', $args, $auth_required );
31
32 $return = $request->fetch();
33
34 $ctf_options = get_option( 'ctf_options', array() );
35
36 $ctf_options[ CTF_SITE_ACCESS_TOKEN_KEY ] = false;
37
38 if ( ! empty( $return['token'] ) ) {
39 $ctf_options[ CTF_SITE_ACCESS_TOKEN_KEY ] = $return['token'];
40 }
41
42 // Failsafe if user is already registered.
43 if ( ! empty( $return['data']['token'] ) ) {
44 $ctf_options[ CTF_SITE_ACCESS_TOKEN_KEY ] = $return['data']['token'];
45 }
46 update_option( 'ctf_options', $ctf_options );
47
48 return $ctf_options[ CTF_SITE_ACCESS_TOKEN_KEY ];
49 }
50
51 public function run_license_activation( $auth_token )
52 {
53 $ctf_license_key = get_option( 'ctf_license_key', '' );
54
55 $data = array(
56 'url' => get_home_url(),
57 'license_key' => $ctf_license_key,
58 'action' => 'activate'
59 );
60
61 $args = array(
62 'body' => json_encode($data),
63 'timeout' => 60
64 );
65
66 $request = new Request( 'license', '', $args, $auth_token );
67
68 $return = $request->fetch();
69 return $return;
70 }
71 }