-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathanyway-feedback.php
75 lines (63 loc) · 2.13 KB
/
anyway-feedback.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
<?php
/*
Plugin Name: Anyway Feedback
Plugin URI: https://wordpress.org/extend/plugins/anyway-feedback/
Description: Help to assemble simple feedback(negative or positive) and get statics of them.
Version: nightly
Author: Takahashi_Fumiki
Author URI: https://takahashifumiki.com
Text Domain: anyway-feedback
Domain Path: /language/
License: GPL2 or Later
*/
/*
Copyright 2011 Takahashi Fumiki (email : takahashi.fumiki@hametuha.co.jp)
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
*/
defined( 'ABSPATH' ) || die( 'Do not load directly.' );
// Register Bootstrap
add_action( 'plugins_loaded', '_afb_init' );
/**
* Bootstrap
*/
function _afb_init() {
// Set Text Domain
load_plugin_textdomain( 'anyway-feedback', false, 'anyway-feedback/language' );
// Check PHP version
if ( version_compare( PHP_VERSION, '7.2.0', '<' ) ) {
// NG. Show message.
add_action( 'admin_notices', '_afb_too_old' );
} else {
// Load composer.
require __DIR__ . '/vendor/autoload.php';
// Load functions
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions.php';
// Load main instance.
AFB\Main::get_instance();
// Load Admin instance
AFB\Admin\Screen::get_instance();
}
}
/**
* Show error message.
*
* @ignore
* @internal
*/
function _afb_too_old() {
// translators: %s is PHP version.
$message = esc_html( sprintf( __( 'Oops, Anyway Feedback doesn\'t work. You PHP Version is %s but PHP 7.2 and over required.', 'anyway-feedback' ), PHP_VERSION ) );
echo <<<HTML
<div class="error"><p>{$message}</p></div>
HTML;
}