-
Notifications
You must be signed in to change notification settings - Fork 20
/
wangguard-about.php
executable file
·355 lines (355 loc) · 16.6 KB
/
wangguard-about.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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?php
/*
Some code taked from WooCommerce
Copyright 2010 WangGuard (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, version 2, as
published by the Free Software Foundation.
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
*/
function wangguard_about() {
global $wpdb,$wangguard_nonce, $wangguard_api_key;
$wangguard_plugin_url = plugins_url() . '/';
if ( defined('WANGGUARD_API_HOST') ) {$wangguard_api_host = WANGGUARD_API_HOST;}
if ( defined('WANGGUARD_REST_PATH') ) {$wangguard_rest_path = WANGGUARD_REST_PATH;}
if ( !current_user_can('level_10') )die(__('Cheatin’ uh?', 'wangguard'));
if ( defined('WANGGUARD_VERSION') ) {
$wangguard_version = WANGGUARD_VERSION;
}
?>
<div class="wrap about-wrap">
<h1><?php printf( __( 'Welcome to WangGuard %s' ), $wangguard_version ); ?></h1>
<div class="about-text"><?php printf( __( 'Thank you for install WangGuard %s!', 'wangguard' ), $wangguard_version ); ?></div>
<div class="wangguard-badge"><?php printf( __( 'Version %s' ), $wangguard_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a class="nav-tab nav-tab-active" href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
}
?>">
<?php _e( 'What’s New', 'wangguard' ); ?>
</a><a class="nav-tab" href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
}
?>">
<?php _e( 'Credits', 'wangguard' ); ?>
</a><a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
}
?>" class="nav-tab">
<?php _e( 'Development', 'wangguard' ); ?>
</a>
</h2>
<div class="changelog">
<h3><?php _e( 'Welcome to WangGuard, Welcome to the revolution', 'wangguard' ); ?></h3>
<div class="feature-section col two-col">
<img class="image-100" src="<?php echo $wangguard_plugin_url . 'wangguard/img/wangguard-about.png'; ?>" width=100% />
<div>
<h4><?php _e( 'WangGuard 1.7 is here', 'wangguard' ); ?></h4>
<p><?php _e( 'After many month, WanGuard 1.7 is here. It comes with new features and many fixed bugs.', 'wangguard' ); ?></p>
</div>
<div class="last-feature">
<h4><?php _e( '30 Days Trial', 'wangguard' ); ?></h4>
<p><?php _e( 'After 5 years, we are ready for start with the Premium accounts, so every one has 30 Days trial from this release.', 'wangguard' ); ?></p>
<p><?php _e( 'After the 30 Days Trial, people who has to pay for WangGuard, will pay only 12€/year for 1,500,000 queries month and unlimited site.', 'wangguard' ); ?></p>
<p><?php _e( 'The best service, with the best price and the best features.', 'wangguard' ); ?></p>
<p><?php _e( 'And the best one, you can pay from your WordPress admin. Go to WangGurd > Settings > My Account.', 'wangguard' ); ?></p>
</div>
</div>
</div>
<div class="changelog">
<h3><?php _e( 'Survey', 'wangguard' ); ?></h3>
<div class="feature-section images-stagger-right">
<iframe frameborder="0" width="70%" height="1500" scrolling="auto" style="float:right" allowtransparency="true" src="//darkeorc.polldaddy.com/s/wangguard-1-6?iframe=1"><a href="//darkeorc.polldaddy.com/s/wangguard-1-6">Ver Encuesta</a></iframe>
<h4><?php _e( 'Signup Moderation', 'wangguard' ); ?></h4>
<p><?php _e( 'We know that this was your dream, now you can moderate signups with this new feature. Moderate all users or only Detected Sploggers. By default, this feature is disabled.', 'wangguard' ); ?></p>
</div>
</div>
<div class="return-to-dashboard">
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Go to WangGuard Settings', 'wangguard' ); ?></a>
</div>
</div>
<?php
}
/*****************************************************************************************************/
/*****************************************************************************************************/
/**
* Render Contributors List
*
* @access public
* @return string $contributor_list HTML formatted list of contributors.
*/
function wangguard_contributors() {
$contributors = get_contributors_wangguard();
if ( empty( $contributors ) )return '';
$contributor_list = '<ul class="wp-people-group">';
foreach ( $contributors as $contributor ) {
if ( $contributor->login != 'joseconti') {
$contributor_list .= '<li class="wp-person">';
$contributor_list .= sprintf( '<a href="%s" title="%s">',esc_url( 'https://github.com/' . $contributor->login ),esc_html( sprintf( __( 'View %s', 'wangguard' ), $contributor->login ) ));
$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
$contributor_list .= '</a>';
$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
$contributor_list .= '</a>';
$contributor_list .= '</li>';
} else {
continue;
}
}
$contributor_list .= '</ul>';
return $contributor_list;
}
/*****************************************************************************************************/
/*****************************************************************************************************/
/**
* Render Commits List
*
* @access public
* @return string $contributor_list HTML formatted list of contributors.
*/
function wangguard_commits() {
$commits = get_commits_wangguard();
if ( empty( $commits ) )return '';
$commit_list = '';
foreach ( $commits as $commit ) {
$commit_list .= '<div class="changelog">';
$commit_list .= '<div class="feature-section col two-col">';
$commit_list .= '<div>';
$commit_list .= '<ul class="wp-people-group">';
$commit_list .= '<li class="wp-person">';
$commit_list .= sprintf( '<a href="%s" title="%s">',esc_url( $commit->author->html_url ),esc_html( sprintf( __( 'View %s', 'wangguard' ), $commit->commit->author->name ) ));
$commit_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $commit->author->avatar_url ), esc_html( $commit->author->login ) );
$commit_list .= '</a>';
$commit_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $commit->commit->author->name ), esc_html( $commit->commit->author->name ) );
$commit_list .= '</a>';
$wangguardcommitdate = new DateTime($commit->commit->author->date);
$commit_list .= '<span class="title">Made on ' . $wangguardcommitdate->format("l, d F Y H:i:s") . '</span>';
$commit_list .= '</li>';
$commit_list .= '</ul>';
$commit_list .= '</div>';
$commit_list .= '<div class="last-feature">';
$commit_list .= '<h4>Commit:</h4>';
$commit_list .= '<p>';
$commit_list .= $commit->commit->message;
$commit_list .= '</p>';
$commit_list .= '<p>';
$commit_list .= sprintf( 'See this Commit in <a href="%s">Github</a>', esc_url( 'https://github.com/joseconti/WangGuard/commit/' . $commit->sha));
$commit_list .= '</p>';
$commit_list .= '</div>';
$commit_list .= '</div>';
$commit_list .= '</div>';
$commit_list .= '<br />';
}
//$commit_list .= '</ul>';
return $commit_list;
}
/**
* Retreive list of contributors from GitHub.
*
* @access public
* @return void
*/ //TODO filter Jose and Maxi
function get_contributors_wangguard() {
$contributors = get_transient( 'wangguard_contributors' );
if ( false !== $contributors )return $contributors;
$response = wp_remote_get( 'https://api.github.com/repos/joseconti/wangguard/contributors', array( 'sslverify' => false ) );
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )return array();
$contributors = json_decode( wp_remote_retrieve_body( $response ) );
if ( ! is_array( $contributors ) )return array();
set_transient( 'wangguard_contributors', $contributors, 3600 );
return $contributors;
}
/**
* Retreive list of commits from GitHub.
*
* @access public
* @return void
*/
function get_commits_wangguard() {
$commits = get_transient( 'wangguard_commits' );
if ( false !== $commits )return $commits;
$response = wp_remote_get( 'https://api.github.com/repos/joseconti/wangguard/commits', array( 'sslverify' => false ) );
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )return array();
$commits = json_decode( wp_remote_retrieve_body( $response ) );
if ( ! is_array( $commits ) )return array();
set_transient( 'wangguard_commits', $commits, 3600 );
return $commits;
}
function wangguard_credits() {
if ( defined('WANGGUARD_VERSION') ) {
$wangguard_version = WANGGUARD_VERSION;
}
?>
<div class="wrap about-wrap">
<h1><?php printf( __( 'WangGuard %s Credits', 'wangguard' ), $wangguard_version ); ?></h1>
<div class="about-text"><?php _e( 'These are the people that actually makes WangGuard possible', 'wangguard' ); ?></div>
<div class="wangguard-badge"><?php printf( __( 'Version %s' ), $wangguard_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
}
?>" class="nav-tab">
<?php _e( 'What’s New' ); ?>
</a><a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
}
?>" class="nav-tab nav-tab-active">
<?php _e( 'Credits' ); ?>
</a><a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
}
?>" class="nav-tab">
<?php _e( 'Development' ); ?>
</a>
</h2>
<p class="about-description"><?php _e( 'WangGuard is created by a worldwide splog haters.', 'wangguard' ); ?></p>
<p>
Want to contribute to <strong>WangGuard</strong>? You can do it in many ways.
You can see all the ways in
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Help Us' ); ?></a>
.
</p>
<h4 class="wp-people-group"><?php _e( 'Project Leader and Core Developer', 'wangguard' ); ?></h4>
<ul class="wp-people-group">
<li class="wp-person">
<a title="View joseconti" href="https://github.com/joseconti">
<img class="gravatar" height="64" width="64" alt="joseconti" src="https://secure.gravatar.com/avatar/58739a905a719e6f1591333917b3118b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png">
</a>
<a class="web" href="https://github.com/joseconti">Jose Conti</a>
<span class="title"><?php _e( 'Founder and the greater splog hater in the world', 'wangguard'); ?></span>
</li>
</ul>
<h4 class="wp-people-group"><?php _e( 'Contributing Developers', 'wangguard' ); ?></h4>
<?php echo wangguard_contributors(); ?>
<p>
<?php _e( 'Want to be here? more info in ', 'wangguard' ); ?>
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Help Us', 'wangguard' ); ?></a>
.
</p>
<div class="return-to-dashboard">
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Go to WangGuard Settings', 'wangguard' ); ?></a>
</div>
</div>
<?php
}
function wangguard_development() {
if ( defined('WANGGUARD_VERSION') ) {
$wangguard_version = WANGGUARD_VERSION;
}
?>
<div class="wrap about-wrap">
<h1><?php _e( 'WangGuard Development', 'wangguard'); ?></h1>
<div class="about-text"><?php _e( 'Follow WangGuard Development', 'wangguard' ); ?></div>
<div class="wangguard-badge"><?php printf( __( 'Version %s' ), $wangguard_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_about' ), 'admin.php' ) ) );
}
?>" class="nav-tab">
<?php _e( 'What’s New' ); ?>
</a><a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_credits' ), 'admin.php' ) ) );
}
?>" class="nav-tab">
<?php _e( 'Credits' ); ?>
</a><a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_development' ), 'admin.php' ) ) );
}
?>" class="nav-tab nav-tab-active">
<?php _e( 'Development' ); ?>
</a>
</h2>
<p class="about-description"><?php _e( 'WangGuard is created by a worldwide splog haters.', 'wangguard' ); ?></p>
<p>
<?php _e('Want to contribute to <strong>WangGuard</strong>? You can do it in many ways.
You can see all ways in ', 'wangguard'); ?>
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Help Us' ); ?></a>
.
</p>
<h4 class="wp-people-group"><?php _e( 'WangGuard Commits', 'wangguard' ); ?></h4>
<?php echo wangguard_commits(); ?>
<p>
<?php _e( 'Want to be here? more info in ', 'wangguard' ); ?>
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_help_us' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Help Us', 'wangguard' ); ?></a>
.
</p>
<div class="return-to-dashboard">
<a href="<?php
if ( !is_multisite() ) {
echo esc_url( admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
} else {
echo esc_url( network_admin_url( add_query_arg( array( 'page' => 'wangguard_conf' ), 'admin.php' ) ) );
}
?>"><?php _e( 'Go to WangGuard Settings', 'wangguard' ); ?></a>
</div>
</div>
<?php
} ?>