-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_oauth.php
40 lines (33 loc) · 3.35 KB
/
demo_oauth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
*
* @wordpress-plugin
* Plugin Name: _ANDYP - Demo of Google OAUTH
* Plugin URI: http://londonparkour.com
* Description: <strong>🔌PLUGIN</strong> | Demo using google's API client https://github.com/googleapis/google-api-php-client
* Version: 1.0.0
* Author: Andy Pearson
* Author URI: https://londonparkour.com
* Domain Path: /languages
*/
define('DEMO_APPLICATION_CREDENTIALS', __DIR__.'/client_secret.json');
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Use composer autoloader │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/vendor/autoload.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Create the ANDYP_OAUTH shortcode │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/shortcode/button.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Load the Javascript into the Admin page footer. │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/js/enqueue_js.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Create the AJAX callback action for the redirectURI │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/callback/ajax_callback.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Decode the response 'state' parameter into 'action' │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/callback/decode_state.php';