-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplugin.php
89 lines (85 loc) · 3.46 KB
/
plugin.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* StaticPress2019
*
* @package static_press
* @author Yukihiko Shinoda <[email protected]>
* @author wokamoto
* @author megumitheme
* @author amimotoami
* @author cat
* @author kazuaki.matsuhashi
* @author Olav Schettler
* @author mecrazy
* @author Caglar Akpinar
* @author Pete Schuster
* @author yukku0423
* @author k1LoW
* @author Your mother
* @author hideokamoto
* @author arobindorath
* @author chrome-cgi
* @copyright 2013 wokamoto
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: StaticPress2019
* Plugin URI: https://wordpress.org/plugins/staticpress2019/
* Description: Transforms your WordPress into static websites and blogs.
* Version: 0.8.1
* Author: yshinoda, wokamoto, amimotoami, pas5027, hideokamoto
* Author URI: https://github.com/yukihiko-shinoda
* Text Domain: static-press
* Domain Path: /languages
*
* License:
* Released under the GPL license
* http://www.gnu.org/copyleft/gpl.html
*
* Copyright 2013 (email : [email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
if ( ! defined( 'STATIC_PRESS_PLUGIN_DIR' ) ) {
/**
* Plugin Directory.
*
* @var string $STATIC_PRESS_PLUGIN_DIR Plugin folder directory path. Eg. `/var/www/html/web/app/plugins/staticpress2019/`
*/
define( 'STATIC_PRESS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
require_once STATIC_PRESS_PLUGIN_DIR . 'includes/class-static-press-admin.php';
require_once STATIC_PRESS_PLUGIN_DIR . 'includes/class-static-press.php';
use static_press\includes\Static_Press_Admin;
use static_press\includes\Static_Press;
load_plugin_textdomain( Static_Press_Admin::TEXT_DOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
// Reason: StaticPress-S3 refers this global variable not $static_press but $staticpress.
// phpcs:ignore
$staticpress = new Static_Press(
Static_Press_Admin::static_url(),
Static_Press_Admin::static_dir(),
Static_Press_Admin::remote_get_option()
);
add_filter( 'StaticPress::get_url', array( $staticpress, 'replace_url' ) );
add_filter( 'StaticPress::put_content', array( $staticpress, 'rewrite_generator_tag' ), 10, 2 );
add_filter( 'StaticPress::put_content', array( $staticpress, 'add_last_modified' ), 10, 2 );
add_filter( 'StaticPress::put_content', array( $staticpress, 'remove_link_tag' ), 10, 2 );
add_filter( 'StaticPress::put_content', array( $staticpress, 'replace_relative_uri' ), 10, 2 );
add_filter( 'https_local_ssl_verify', '__return_false' );
register_activation_hook( __FILE__, array( $staticpress, 'activate' ) );
register_deactivation_hook( __FILE__, array( $staticpress, 'deactivate' ) );
if ( is_admin() ) {
new Static_Press_Admin( plugin_basename( __FILE__ ) );
}