-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwp2static-addon-s3.php
72 lines (55 loc) · 1.92 KB
/
wp2static-addon-s3.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Plugin Name: WP2Static Add-on: GitHub
* Plugin URI: https://wp2static.com
* Description: AWS GitHub as a deployment option for WP2Static.
* Version: 0.1
* Author: Leon Stafford
* Author URI: https://leonstafford.github.io
* License: Unlicense
* License URI: http://unlicense.org
* Text Domain: wp2static-addon-github
* Domain Path: /languages
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
// @codingStandardsIgnoreStart
$ajax_action = isset( $_POST['ajax_action'] ) ? $_POST['ajax_action'] : '';
// @codingStandardsIgnoreEnd
$wp2static_core_dir =
dirname( __FILE__ ) . '/../static-html-output-plugin';
$add_on_dir = dirname( __FILE__ );
// NOTE: bypass instantiating plugin for specific AJAX requests
if ( $ajax_action == 'test_github' ) {
require_once $wp2static_core_dir .
'/plugin/WP2Static/SitePublisher.php';
require_once $add_on_dir . '/GitHubDeployer.php';
wp_die();
return null;
} elseif ( $ajax_action == 'github_prepare_export' ) {
require_once $wp2static_core_dir .
'/plugin/WP2Static/SitePublisher.php';
require_once $add_on_dir . '/GitHubDeployer.php';
wp_die();
return null;
} elseif ( $ajax_action == 'github_transfer_files' ) {
require_once $wp2static_core_dir .
'/plugin/WP2Static/SitePublisher.php';
require_once $add_on_dir . '/GitHubDeployer.php';
wp_die();
return null;
} elseif ( $ajax_action == 'cloudfront_invalidate_all_items' ) {
require_once $wp2static_core_dir .
'/plugin/WP2Static/SitePublisher.php';
require_once $add_on_dir . '/GitHubDeployer.php';
wp_die();
return null;
}
define( 'PLUGIN_NAME_VERSION', '0.1' );
require plugin_dir_path( __FILE__ ) . 'includes/class-wp2static-addon-github.php';
function run_wp2static_addon_github() {
$plugin = new Wp2static_Addon_GitHub();
$plugin->run();
}
run_wp2static_addon_github();