-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwarning.php
More file actions
175 lines (168 loc) · 4.96 KB
/
Copy pathwarning.php
File metadata and controls
175 lines (168 loc) · 4.96 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
/**
* Warning page template file.
*
* @since 1.0.0
* @package AskBugPro
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define the required variables.
$askbugpro_anspress_installed = defined( 'AP_VERSION' );
$askbugpro_required_anspress_version = ( defined( 'AP_VERSION' ) && version_compare( AP_VERSION, '4.4.0' ) < 0 );
// For displaying the required page title.
$askbugpro_warning_page_title = '';
if ( ! $askbugpro_anspress_installed ) :
$askbugpro_warning_page_title = esc_html__( 'Warning! Please install the AnsPress plugin', 'askbugpro' );
endif;
if ( $askbugpro_required_anspress_version ) :
$askbugpro_warning_page_title = esc_html__( 'Warning! Please update the AnsPress plugin', 'askbugpro' );
endif;
// For displaying the required title.
$askbugpro_warning_title = '';
if ( ! $askbugpro_anspress_installed ) :
$askbugpro_warning_title = esc_html__( 'AnsPress plugin not installed', 'askbugpro' );
endif;
if ( $askbugpro_required_anspress_version ) :
$askbugpro_warning_title = esc_html__( 'AnsPress plugin version 4.4.0 or later not found', 'askbugpro' );
endif;
// For displaying the required warning description.
$askbugpro_warning_description = '';
if ( $askbugpro_anspress_installed ) :
$askbugpro_warning_description = sprintf(
/* translators: 1: AnsPress plugin link, 2: AskBugPro theme link */
esc_html__( 'Ensure that you have installed and activated the %1$s plugin in order to use the %2$s theme.', 'askbugpro' ),
'<a href="' . esc_url( 'https://anspress.net/' ) . '" target="_blank">' . esc_html__( 'AnsPress', 'askbugpro' ) . '</a>',
'<a href="' . esc_url( 'https://anspress.net/themes/askbugpro/' ) . '" target="_blank">' . esc_html__( 'AskBugPro', 'askbugpro' ) . '</a>'
);
endif;
if ( $askbugpro_required_anspress_version ) :
$askbugpro_warning_description = sprintf(
/* translators: 1: AnsPress plugin link, 2: AskBugPro theme link */
esc_html__( 'Ensure that you have installed the %1$s plugin with version 4.4.0 or later in order to use the %2$s theme.', 'askbugpro' ),
'<a href="' . esc_url( 'https://anspress.net/' ) . '" target="_blank">' . esc_html__( 'AnsPress', 'askbugpro' ) . '</a>',
'<a href="' . esc_url( 'https://anspress.net/themes/askbugpro/' ) . '" target="_blank">' . esc_html__( 'AskBugPro', 'askbugpro' ) . '</a>'
);
endif;
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<?php // phpcs:ignore WPThemeReview.CoreFunctionality.NoTitleTag.TagFound ?>
<title><?php echo esc_html( $askbugpro_warning_page_title ); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
html, body, div, h1, p, form, label {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;;
}
* {
box-sizing: border-box;
}
.zp-container {
height: 100vh;
max-width: 1160px;
margin: auto;
padding-left: 20px;
padding-right: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.zp-warning {
width: 100%;
text-align: center;
background: #fff3ae;
padding: 50px;
border-radius: 5px;
border: 3px solid #ffcc30;
}
h1 {
font-size: 24px;
font-weight: bold;
margin-top: 0;
margin-bottom: 20px;
}
p {
font-size: 16px;
margin-top: 0;
margin-bottom: 20px;
}
a {
text-decoration: none;
color: #f00;
font-weight: bold;
}
a:hover {
color: #000;
}
form {
text-align: left;
max-width: 300px;
margin: 30px auto;
}
label {
font-size: 14px;
color: #333;
display: block;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
border-radius: 3px;
border: 2px solid #ddd;
}
input[type="submit"] {
cursor: pointer;
color: #fff;
font-weight: bold;
display: block;
margin: 0 auto;
padding: 10px;
border-radius: 3px;
width: 100%;
border: 2px solid #ff9900;
background-color: #ff9900;
}
input[type="submit"]:hover {
border-color: #ff8800;
background-color: #ff8800;
}
@media (max-width: 480px) {
.zp-warning {
padding: 20px;
}
form {
max-width: 100%;
}
}
</style>
</head>
<body>
<div class="zp-container">
<div class="zp-warning">
<h1><?php echo esc_html( $askbugpro_warning_title ); ?></h1>
<p><?php echo wp_kses_post( $askbugpro_warning_description ); ?></p>
<?php
// Display the login form if the user is not logged in.
if ( ! is_user_logged_in() ) :
$askbugpro_login_form_args = array(
'redirect' => admin_url( '/' ),
'label_username' => esc_html__( 'Username', 'askbugpro' ),
);
// Display the login form.
wp_login_form( $askbugpro_login_form_args );
endif;
?>
</div>
</div>
</body>
</html>