PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 4.1.1
WP Popular Posts v4.1.1
4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 5.0.0 5.0.1 5.0.2 5.1.0 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.2 5.5.0 5.5.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.2.0 6.2.1 6.3.0 6.3.1 6.3.2 6.3.3 6.3.4 6.4.0 6.4.1 6.4.2 7.0.0 7.0.1 7.1.0 7.2.0 7.3.0 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4.0 trunk 2.3.7 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.2 4.0.3 4.0.5 4.0.6
wordpress-popular-posts / admin / partials / admin.php
wordpress-popular-posts / admin / partials Last commit date
admin.php 8 years ago index.php 8 years ago
admin.php
985 lines
1 <?php
2 if ( basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__) )
3 exit( 'Please do not load this page directly' );
4
5 $tabs = array(
6 'stats' => __( 'Stats', 'wordpress-popular-posts' ),
7 'tools' => __( 'Tools', 'wordpress-popular-posts' ),
8 'params' => __( 'Parameters', 'wordpress-popular-posts' ),
9 'debug' => 'Debug'
10 );
11
12 // Set active tab
13 if ( isset( $_GET['tab'] ) && isset( $tabs[$_GET['tab']] ) )
14 $current = $_GET['tab'];
15 else
16 $current = 'stats';
17
18 // Update options on form submission
19 if ( isset($_POST['section']) ) {
20
21 if ( "stats" == $_POST['section'] ) {
22
23 $current = 'stats';
24
25 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-stats-options' ) ) {
26
27 //$this->options['stats']['order_by'] = $_POST['stats_order'];
28 $this->options['stats']['limit'] = ( WPP_Helper::is_number( $_POST['stats_limit'] ) && $_POST['stats_limit'] > 0 ) ? $_POST['stats_limit'] : 10;
29 $this->options['stats']['post_type'] = empty( $_POST['stats_type'] ) ? "post,page" : $_POST['stats_type'];
30 $this->options['stats']['freshness'] = empty( $_POST['stats_freshness'] ) ? false : $_POST['stats_freshness'];
31
32 update_option( 'wpp_settings_config', $this->options );
33 echo "<div class=\"notice notice-success is-dismissible\"><p><strong>" . __( 'Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
34
35 }
36
37 }
38 elseif ( "misc" == $_POST['section'] ) {
39
40 $current = 'tools';
41
42 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-misc-options' ) ) {
43
44 $this->options['tools']['link']['target'] = $_POST['link_target'];
45 $this->options['tools']['css'] = $_POST['css'];
46
47 update_option( 'wpp_settings_config', $this->options );
48 echo "<div class=\"notice notice-success is-dismissible\"><p><strong>" . __( 'Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
49
50 }
51 }
52 elseif ( "thumb" == $_POST['section'] ) {
53
54 $current = 'tools';
55
56 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-thumbnail-options' ) ) {
57
58 if (
59 $_POST['thumb_source'] == "custom_field"
60 && ( !isset( $_POST['thumb_field'] ) || empty( $_POST['thumb_field'] ) )
61 ) {
62 echo '<div id="wpp-message" class="error fade"><p>'.__( 'Please provide the name of your custom field.', 'wordpress-popular-posts' ).'</p></div>';
63 } else {
64
65 $this->options['tools']['thumbnail']['source'] = $_POST['thumb_source'];
66 $this->options['tools']['thumbnail']['field'] = ( !empty( $_POST['thumb_field']) ) ? $_POST['thumb_field'] : "wpp_thumbnail";
67 $this->options['tools']['thumbnail']['default'] = ( !empty( $_POST['upload_thumb_src']) ) ? $_POST['upload_thumb_src'] : "";
68 $this->options['tools']['thumbnail']['resize'] = $_POST['thumb_field_resize'];
69
70 update_option( 'wpp_settings_config', $this->options );
71 echo "<div class=\"notice notice-success is-dismissible\"><p><strong>" . __( 'Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
72
73 }
74
75 }
76
77 }
78 elseif ( "data" == $_POST['section'] ) {
79
80 $current = 'tools';
81
82 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-data-options' ) ) {
83
84 $this->options['tools']['log']['level'] = $_POST['log_option'];
85 $this->options['tools']['log']['limit'] = $_POST['log_limit'];
86 $this->options['tools']['log']['expires_after'] = ( WPP_Helper::is_number( $_POST['log_expire_time'] ) && $_POST['log_expire_time'] > 0 )
87 ? $_POST['log_expire_time']
88 : $this->default_user_settings['tools']['log']['expires_after'];
89 $this->options['tools']['ajax'] = $_POST['ajax'];
90
91 // if any of the caching settings was updated, destroy all transients created by the plugin
92 if (
93 $this->options['tools']['cache']['active'] != $_POST['cache']
94 || $this->options['tools']['cache']['interval']['time'] != $_POST['cache_interval_time']
95 || $this->options['tools']['cache']['interval']['value'] != $_POST['cache_interval_value']
96 ) {
97 $this->flush_transients();
98 }
99
100 $this->options['tools']['cache']['active'] = $_POST['cache'];
101 $this->options['tools']['cache']['interval']['time'] = $_POST['cache_interval_time'];
102 $this->options['tools']['cache']['interval']['value'] = ( isset( $_POST['cache_interval_value'] ) && WPP_Helper::is_number( $_POST['cache_interval_value'] ) && $_POST['cache_interval_value'] > 0 )
103 ? $_POST['cache_interval_value']
104 : 1;
105
106 $this->options['tools']['sampling']['active'] = $_POST['sampling'];
107 $this->options['tools']['sampling']['rate'] = ( isset( $_POST['sample_rate'] ) && WPP_Helper::is_number( $_POST['sample_rate'] ) && $_POST['sample_rate'] > 0 )
108 ? $_POST['sample_rate']
109 : 100;
110
111 update_option( 'wpp_settings_config', $this->options );
112 echo "<div class=\"notice notice-success is-dismissible\"><p><strong>" . __( 'Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
113
114 }
115 }
116
117 }
118
119 if ( $this->options['tools']['css'] && !file_exists( get_stylesheet_directory() . '/wpp.css' ) ) {
120 echo '<div id="wpp-message" class="update-nag">'. __( 'Any changes made to WPP\'s default stylesheet will be lost after every plugin update. In order to prevent this from happening, please copy the wpp.css file (located at wp-content/plugins/wordpress-popular-posts/style) into your theme\'s directory', 'wordpress-popular-posts' ) .'.</div>';
121 }
122
123 $rand = md5( uniqid(rand(), true) );
124
125 if ( !$wpp_rand = get_option("wpp_rand") ) {
126 add_option( "wpp_rand", $rand );
127 } else {
128 update_option( "wpp_rand", $rand );
129 }
130
131 ?>
132 <script type="text/javascript">
133 // TOOLS
134 function confirm_reset_cache() {
135 if ( confirm("<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( "This operation will delete all entries from WordPress Popular Posts' cache table and cannot be undone.", 'wordpress-popular-posts'); ?> \n\n" + "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( "Do you want to continue?", 'wordpress-popular-posts' ); ?>") ) {
136 jQuery.post(
137 ajaxurl,
138 {
139 action: 'wpp_clear_data',
140 token: '<?php echo get_option("wpp_rand"); ?>',
141 clear: 'cache'
142 }, function(data){
143 var response = "";
144
145 switch( data ) {
146 case "1":
147 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Success! The cache table has been cleared!', 'wordpress-popular-posts' ); ?>";
148 break;
149
150 case "2":
151 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Error: cache table does not exist.', 'wordpress-popular-posts' ); ?>";
152 break;
153
154 case "3":
155 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
156 break;
157
158 case "4":
159 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Sorry, you do not have enough permissions to do this. Please contact the site administrator for support.', 'wordpress-popular-posts' ); ?>";
160 break;
161
162 default:
163 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
164 break;
165 }
166
167 alert( response );
168 }
169 );
170 }
171 }
172
173 function confirm_reset_all() {
174 if ( confirm("<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( "This operation will delete all stored info from WordPress Popular Posts' data tables and cannot be undone.", 'wordpress-popular-posts'); ?> \n\n" + "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e("Do you want to continue?", 'wordpress-popular-posts'); ?>")) {
175 jQuery.post(
176 ajaxurl,
177 {
178 action: 'wpp_clear_data',
179 token: '<?php echo get_option("wpp_rand"); ?>',
180 clear: 'all'
181 }, function(data){
182 var response = "";
183
184 switch( data ) {
185 case "1":
186 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Success! All data have been cleared!', 'wordpress-popular-posts' ); ?>";
187 break;
188
189 case "2":
190 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Error: one or both data tables are missing.', 'wordpress-popular-posts' ); ?>";
191 break;
192
193 case "3":
194 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
195 break;
196
197 case "4":
198 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Sorry, you do not have enough permissions to do this. Please contact the site administrator for support.', 'wordpress-popular-posts' ); ?>";
199 break;
200
201 default:
202 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
203 break;
204 }
205
206 alert( response );
207 }
208 );
209 }
210 }
211
212 function confirm_clear_image_cache() {
213 if ( confirm("<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e("This operation will delete all cached thumbnails and cannot be undone.", 'wordpress-popular-posts'); ?> \n\n" + "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( "Do you want to continue?", 'wordpress-popular-posts' ); ?>") ) {
214 jQuery.post(
215 ajaxurl,
216 {
217 action: 'wpp_clear_thumbnail',
218 token: '<?php echo get_option("wpp_rand"); ?>'
219 }, function(data){
220 var response = "";
221
222 switch( data ) {
223 case "1":
224 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Success! All files have been deleted!', 'wordpress-popular-posts' ); ?>";
225 break;
226
227 case "2":
228 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'The thumbnail cache is already empty!', 'wordpress-popular-posts' ); ?>";
229 break;
230
231 case "3":
232 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
233 break;
234
235 case "4":
236 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Sorry, you do not have enough permissions to do this. Please contact the site administrator for support.', 'wordpress-popular-posts' ); ?>";
237 break;
238
239 default:
240 response = "<?php /*translators: Special characters (such as accents) must be replaced with Javascript Octal codes (eg. \341 is the Octal code for small a with acute accent) */ _e( 'Invalid action.', 'wordpress-popular-posts' ); ?>";
241 break;
242 }
243
244 alert( response );
245 }
246 );
247 }
248 }
249 </script>
250
251 <nav id="wpp-menu">
252 <ul>
253 <li><a href="#" title="<?php esc_attr_e( 'Menu' ); ?>"><span><?php _e( 'Menu' ); ?></span></a></li>
254 <li<?php echo ( 'stats' == $current ) ? ' class="current"' : ''; ?>><a href="<?php echo admin_url( 'options-general.php?page=wordpress-popular-posts&tab=stats' ); ?>" title="<?php esc_attr_e( 'Stats', 'wordpress-popular-posts' ); ?>"><span><?php _e( 'Stats', 'wordpress-popular-posts' ); ?></span></a></li>
255 <li<?php echo ( 'tools' == $current ) ? ' class="current"' : ''; ?>><a href="<?php echo admin_url( 'options-general.php?page=wordpress-popular-posts&tab=tools' ); ?>" title="<?php esc_attr_e( 'Tools', 'wordpress-popular-posts' ); ?>"><span><?php _e( 'Tools', 'wordpress-popular-posts' ); ?></span></a></li>
256 <li<?php echo ( 'params' == $current ) ? ' class="current"' : ''; ?>><a href="<?php echo admin_url( 'options-general.php?page=wordpress-popular-posts&tab=params' ); ?>" title="<?php esc_attr_e( 'Parameters', 'wordpress-popular-posts' ); ?>"><span><?php _e( 'Parameters', 'wordpress-popular-posts' ); ?></span></a></li>
257 </ul>
258 </nav>
259
260 <div class="wpp-wrapper wpp-section-<?php echo $current; ?>">
261
262 <div class="wpp-header">
263 <h2>WordPress Popular Posts</h2>
264 <h3><?php echo $tabs[$current]; ?></h3>
265 </div>
266
267 <?php
268 // Stats chart
269 if ( 'stats' == $current ) {
270
271 $chart_data = $this->get_chart_data( $this->options['stats']['range'] );
272
273 ?>
274
275 <a href="#" id="wpp-stats-config-btn" class="dashicons dashicons-admin-generic"></a>
276
277 <div id="wpp-stats-config" class="wpp-lightbox">
278
279 <form action="" method="post" id="wpp_stats_options" name="wpp_stats_options">
280
281 <label for="stats_type"><?php _e("Post type", 'wordpress-popular-posts'); ?>:</label>
282 <input type="text" name="stats_type" value="<?php echo esc_attr( $this->options['stats']['post_type'] ); ?>" size="15" />
283
284 <label for="stats_limits"><?php _e("Limit", 'wordpress-popular-posts'); ?>:</label>
285 <input type="text" name="stats_limit" value="<?php echo $this->options['stats']['limit']; ?>" size="5" />
286
287 <label for="stats_freshness"><input type="checkbox" class="checkbox" <?php echo ($this->options['stats']['freshness']) ? 'checked="checked"' : ''; ?> id="stats_freshness" name="stats_freshness" /> <small><?php _e('Display only posts published within the selected Time Range', 'wordpress-popular-posts'); ?></small></label>
288
289 <div class="clear"></div>
290 <br /><br />
291
292 <input type="hidden" name="section" value="stats" />
293 <button type="submit" class="button-primary action"><?php _e("Apply", 'wordpress-popular-posts'); ?></button>
294 <button class="button-secondary action right"><?php _e("Cancel"); ?></button>
295
296 <?php wp_nonce_field( 'wpp-update-stats-options', 'wpp-admin-token' ); ?>
297
298 </form>
299
300 </div>
301
302 <div id="wpp-stats-range" class="wpp-lightbox">
303
304 <form action="" method="post">
305
306 <ul class="wpp-lightbox-tabs">
307 <li class="active"><a href="#"><?php _e('Custom Time Range', 'wordpress-popular-posts'); ?></a></li>
308 <li><a href="#"><?php _e('Date Range', 'wordpress-popular-posts'); ?></a></li>
309 </ul>
310
311 <div class="wpp-lightbox-tab-content wpp-lightbox-tab-content-active" id="custom-time-range">
312
313 <input type="text" id="stats_range_time_quantity" name="stats_range_time_quantity" value="<?php echo $this->options['stats']['time_quantity']; ?>">
314
315 <select id="stats_range_time_unit" name="stats_range_time_unit">
316 <option <?php if ($this->options['stats']['time_unit'] == "minute") {?>selected="selected"<?php } ?> value="minute"><?php _e("Minute(s)", 'wordpress-popular-posts'); ?></option>
317 <option <?php if ($this->options['stats']['time_unit'] == "hour") {?>selected="selected"<?php } ?> value="hour"><?php _e("Hour(s)", 'wordpress-popular-posts'); ?></option>
318 <option <?php if ($this->options['stats']['time_unit'] == "day") {?>selected="selected"<?php } ?> value="day"><?php _e("Day(s)", 'wordpress-popular-posts'); ?></option>
319 </select>
320
321 </div>
322
323 <div class="wpp-lightbox-tab-content" id="custom-date-range">
324 <input type="text" id="stats_range_date" name="stats_range_date" value="" placeholder="<?php esc_attr_e('Select a date...', 'wordpress-popular-posts'); ?>" readonly>
325 </div>
326
327 <div class="clear"></div>
328 <br />
329
330 <button type="submit" class="button-primary action">
331 <?php _e("Apply", 'wordpress-popular-posts'); ?>
332 </button>
333 <button class="button-secondary action right">
334 <?php _e("Cancel"); ?>
335 </button>
336
337 </form>
338
339 </div>
340
341 <div id="wpp-chart-wrapper">
342 <h4><?php echo $chart_data['totals']['label_summary']; ?></h4>
343 <h5><?php echo $chart_data['totals']['label_date_range']; ?></h5>
344
345 <ul class="wpp-header-nav" id="wpp-time-ranges">
346 <li <?php echo ( 'daily' == $this->options['stats']['range'] || 'today' == $this->options['stats']['range'] ) ? ' class="current"' : ''; ?>><a href="#" data-range="today" title="<?php esc_attr_e( 'Today', 'wordpress-popular-posts' ); ?>"><?php _e( 'Today', 'wordpress-popular-posts' ); ?></a></li>
347 <li <?php echo ( 'daily' == $this->options['stats']['range'] || 'last24hours' == $this->options['stats']['range'] ) ? ' class="current"' : ''; ?>><a href="#" data-range="last24hours" title="<?php esc_attr_e( 'Last 24 hours', 'wordpress-popular-posts' ); ?>">24h</a></li>
348 <li <?php echo ( 'weekly' == $this->options['stats']['range'] || 'last7days' == $this->options['stats']['range'] ) ? ' class="current"' : ''; ?>><a href="#" data-range="last7days" title="<?php esc_attr_e( 'Last 7 days', 'wordpress-popular-posts' ); ?>">7d</a></li>
349 <li <?php echo ( 'monthly' == $this->options['stats']['range'] || 'last30days' == $this->options['stats']['range'] ) ? ' class="current"' : ''; ?>><a href="#" data-range="last30days" title="<?php esc_attr_e( 'Last 30 days', 'wordpress-popular-posts' ); ?>">30d</a></li>
350 <li <?php echo ( 'custom' == $this->options['stats']['range'] ) ? ' class="current"' : ''; ?>><a href="#" data-range="custom" title="<?php esc_attr_e( 'Custom', 'wordpress-popular-posts' ); ?>"><?php _e( 'Custom', 'wordpress-popular-posts' ); ?></a></li>
351 </ul>
352
353 <div id="wpp-chart">
354 <p><?php echo sprintf( __('Err... A nice little chart is supposed to be here, instead you are seeing this because your browser is too old. <br /> Please <a href="%s" target="_blank">get a better browser</a>.', 'wordpress-popular-posts'), 'https://browsehappy.com/'); ?></p>
355
356 <?php $this->print_chart_script( $chart_data, 'wpp-chart' ); ?>
357 </div>
358 </div>
359 <?php
360 } // End stats chart
361 ?>
362
363 <div id="wpp-listing" class="wpp-content"<?php echo ( 'stats' == $current ) ? '' : ' style="display: none;"'; ?>>
364 <ul class="wpp-tabbed-nav">
365 <li class="active"><a href="#" title="<?php esc_attr_e( 'Most viewed', 'wordpress-popular-posts' ); ?>"><span class="fa fa-eye"></span><span><?php _e( 'Most viewed', 'wordpress-popular-posts' ); ?></span></a></li>
366 <li><a href="#" title="<?php esc_attr_e( 'Most commented', 'wordpress-popular-posts' ); ?>"><span class="fa fa-comment-o"></span><span><?php _e( 'Most commented', 'wordpress-popular-posts' ); ?></span></a></li>
367 <li><a href="#" title="<?php esc_attr_e( 'Trending now', 'wordpress-popular-posts' ); ?>"><span class="fa fa-rocket"></span><span><?php _e( 'Trending now', 'wordpress-popular-posts' ); ?></span></a></li>
368 <li><a href="#" title="<?php esc_attr_e( 'Hall of Fame', 'wordpress-popular-posts' ); ?>"><span class="fa fa-trophy"></span><span><?php _e( 'Hall of Fame', 'wordpress-popular-posts' ); ?></span></a></li>
369 </ul>
370
371 <div class="wpp-tab-content wpp-tab-content-active">
372 <?php $this->get_most_viewed(); ?>
373 </div>
374
375 <div class="wpp-tab-content">
376 <?php $this->get_most_commented(); ?>
377 </div>
378
379 <div class="wpp-tab-content">
380 <?php
381 $args = array(
382 'range' => 'custom',
383 'time_unit' => 'HOUR',
384 'time_quantity'=> 1,
385 'post_type' => $this->options['stats']['post_type'],
386 'order_by' => 'views',
387 'limit' => $this->options['stats']['limit'],
388 'stats_tag' => array(
389 'comment_count' => 1,
390 'views' => 1,
391 'date' => array(
392 'active' => 1
393 )
394 )
395 );
396 $trending = new WPP_query( $args );
397 $posts = $trending->get_posts();
398
399 if (
400 is_array( $posts )
401 && !empty( $posts )
402 ) {
403 ?>
404 <ol class="popular-posts-list">
405 <?php
406 foreach ( $posts as $post ) { ?>
407 <li>
408 <p>
409 <a href="<?php echo get_permalink( $post->id ); ?>"><?php echo sanitize_text_field( $post->title ); ?></a>
410 <br />
411 <span><?php printf( _n( '1 view', '%s views', $post->pageviews, 'wordpress-popular-posts' ), number_format_i18n( $post->pageviews ) ); ?>, <?php printf( _n( '1 comment', '%s comments', $post->comment_count, 'wordpress-popular-posts' ), number_format_i18n( $post->comment_count ) ); ?></span>
412 <small> &mdash; <a href="<?php echo get_permalink( $post->id ); ?>"><?php _e("View"); ?></a> | <a href="<?php echo get_edit_post_link( $post->id ); ?>"><?php _e("Edit"); ?></a></small>
413 </p>
414 </li>
415 <?php
416 }
417 ?>
418 </ol>
419 <?php
420 }
421 else {
422 ?>
423 <p style="text-align: center;"><?php _e("Looks like traffic to your site is a little light right now. <br />Spread the word and come back later!", "wordpress-popular-posts"); ?></p>
424 <?php
425 }
426 ?>
427 </div>
428 <div class="wpp-tab-content">
429 <?php
430 $args = array(
431 'range' => 'all',
432 'post_type' => $this->options['stats']['post_type'],
433 'order_by' => 'views',
434 'limit' => $this->options['stats']['limit'],
435 'stats_tag' => array(
436 'comment_count' => 1,
437 'views' => 1,
438 'date' => array(
439 'active' => 1
440 )
441 )
442 );
443 $hof = new WPP_query( $args );
444 $posts = $hof->get_posts();
445
446 if (
447 is_array( $posts )
448 && !empty( $posts )
449 ) {
450 ?>
451 <ol class="popular-posts-list">
452 <?php
453 foreach ( $posts as $post ) { ?>
454 <li>
455 <p>
456 <a href="<?php echo get_permalink( $post->id ); ?>"><?php echo sanitize_text_field( $post->title ); ?></a>
457 <br />
458 <span><?php printf( _n( '1 view', '%s views', $post->pageviews, 'wordpress-popular-posts' ), number_format_i18n( $post->pageviews ) ); ?>, <?php printf( _n( '1 comment', '%s comments', $post->comment_count, 'wordpress-popular-posts' ), number_format_i18n( $post->comment_count ) ); ?></span>
459 <small> &mdash; <a href="<?php echo get_permalink( $post->id ); ?>"><?php _e("View"); ?></a> | <a href="<?php echo get_edit_post_link( $post->id ); ?>"><?php _e("Edit"); ?></a></small>
460 </p>
461 </li>
462 <?php
463 }
464 ?>
465 </ol>
466 <?php
467 }
468 else {
469 ?>
470 <p style="text-align: center;"><?php _e("Looks like traffic to your site is a little light right now. <br />Spread the word and come back later!", "wordpress-popular-posts"); ?></p>
471 <?php
472 }
473 ?>
474 </div>
475 </div>
476
477 <!-- Start tools -->
478 <div id="wpp_tools" <?php echo ( "tools" == $current ) ? '' : ' style="display: none;"'; ?>>
479
480 <h3 class="wmpp-subtitle"><?php _e("Thumbnails", 'wordpress-popular-posts'); ?></h3>
481 <form action="" method="post" id="wpp_thumbnail_options" name="wpp_thumbnail_options">
482 <table class="form-table">
483 <tbody>
484 <tr valign="top">
485 <th scope="row"><label for="thumb_default"><?php _e("Default thumbnail", 'wordpress-popular-posts'); ?>:</label></th>
486 <td>
487 <div id="thumb-review">
488 <img src="<?php echo ( $this->options['tools']['thumbnail']['default'] ) ? str_replace( parse_url( $this->options['tools']['thumbnail']['default'], PHP_URL_SCHEME ) . ':', '', $this->options['tools']['thumbnail']['default'] ) : plugins_url() . '/wordpress-popular-posts/public/images/no_thumb.jpg'; ?>" alt="" border="0" />
489 </div>
490 <input id="upload_thumb_button" type="button" class="button" value="<?php _e( "Change thumbnail", 'wordpress-popular-posts' ); ?>" />
491 <input type="hidden" id="upload_thumb_src" name="upload_thumb_src" value="" />
492 <p class="description"><?php _e("This image will be displayed when no thumbnail is available", 'wordpress-popular-posts'); ?>.</p>
493 </td>
494 </tr>
495 <tr valign="top">
496 <th scope="row"><label for="thumb_source"><?php _e("Pick image from", 'wordpress-popular-posts'); ?>:</label></th>
497 <td>
498 <select name="thumb_source" id="thumb_source">
499 <option <?php if ($this->options['tools']['thumbnail']['source'] == "featured") {?>selected="selected"<?php } ?> value="featured"><?php _e("Featured image", 'wordpress-popular-posts'); ?></option>
500 <option <?php if ($this->options['tools']['thumbnail']['source'] == "first_image") {?>selected="selected"<?php } ?> value="first_image"><?php _e("First image on post", 'wordpress-popular-posts'); ?></option>
501 <option <?php if ($this->options['tools']['thumbnail']['source'] == "first_attachment") {?>selected="selected"<?php } ?> value="first_attachment"><?php _e("First attachment", 'wordpress-popular-posts'); ?></option>
502 <option <?php if ($this->options['tools']['thumbnail']['source'] == "custom_field") {?>selected="selected"<?php } ?> value="custom_field"><?php _e("Custom field", 'wordpress-popular-posts'); ?></option>
503 </select>
504 <br />
505 <p class="description"><?php _e("Tell WordPress Popular Posts where it should get thumbnails from", 'wordpress-popular-posts'); ?>.</p>
506 </td>
507 </tr>
508 <tr valign="top" <?php if ($this->options['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field">
509 <th scope="row"><label for="thumb_field"><?php _e("Custom field name", 'wordpress-popular-posts'); ?>:</label></th>
510 <td>
511 <input type="text" id="thumb_field" name="thumb_field" value="<?php echo esc_attr( $this->options['tools']['thumbnail']['field'] ); ?>" size="10" <?php if ($this->options['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> />
512 </td>
513 </tr>
514 <tr valign="top" <?php if ($this->options['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field_resize">
515 <th scope="row"><label for="thumb_field_resize"><?php _e("Resize image from Custom field?", 'wordpress-popular-posts'); ?>:</label></th>
516 <td>
517 <select name="thumb_field_resize" id="thumb_field_resize">
518 <option <?php if ( !$this->options['tools']['thumbnail']['resize'] ) {?>selected="selected"<?php } ?> value="0"><?php _e("No, I will upload my own thumbnail", 'wordpress-popular-posts'); ?></option>
519 <option <?php if ( $this->options['tools']['thumbnail']['resize'] == 1 ) {?>selected="selected"<?php } ?> value="1"><?php _e("Yes", 'wordpress-popular-posts'); ?></option>
520 </select>
521 </td>
522 </tr>
523 <?php
524 $wp_upload_dir = wp_get_upload_dir();
525 if ( is_dir( $wp_upload_dir['basedir'] . "/" . 'wordpress-popular-posts' ) ) :
526 ?>
527 <tr valign="top">
528 <th scope="row"></th>
529 <td>
530 <input type="button" name="wpp-reset-cache" id="wpp-reset-cache" class="button-secondary" value="<?php _e("Empty image cache", 'wordpress-popular-posts'); ?>" onclick="confirm_clear_image_cache()" />
531 <p class="description"><?php _e("Use this button to clear WPP's thumbnails cache", 'wordpress-popular-posts'); ?>.</p>
532 </td>
533 </tr>
534 <?php
535 endif;
536 ?>
537 <tr valign="top">
538 <td colspan="2">
539 <input type="hidden" name="section" value="thumb" />
540 <input type="submit" class="button-primary action" id="btn_th_ops" value="<?php _e("Apply", 'wordpress-popular-posts'); ?>" name="" />
541 </td>
542 </tr>
543 </tbody>
544 </table>
545
546 <?php wp_nonce_field( 'wpp-update-thumbnail-options', 'wpp-admin-token' ); ?>
547 </form>
548 <br />
549 <p style="display:block; float:none; clear:both">&nbsp;</p>
550
551 <h3 class="wmpp-subtitle"><?php _e("Data", 'wordpress-popular-posts'); ?></h3>
552 <form action="" method="post" id="wpp_ajax_options" name="wpp_ajax_options">
553 <table class="form-table">
554 <tbody>
555 <tr valign="top">
556 <th scope="row"><label for="log_option"><?php _e("Log views from", 'wordpress-popular-posts'); ?>:</label></th>
557 <td>
558 <select name="log_option" id="log_option">
559 <option <?php if ($this->options['tools']['log']['level'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Visitors only", 'wordpress-popular-posts'); ?></option>
560 <option <?php if ($this->options['tools']['log']['level'] == 2) {?>selected="selected"<?php } ?> value="2"><?php _e("Logged-in users only", 'wordpress-popular-posts'); ?></option>
561 <option <?php if ($this->options['tools']['log']['level'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Everyone", 'wordpress-popular-posts'); ?></option>
562 </select>
563 <br />
564 </td>
565 </tr>
566 <tr valign="top">
567 <th scope="row"><label for="log_limit"><?php _e("Log limit", 'wordpress-popular-posts'); ?>:</label></th>
568 <td>
569 <select name="log_limit" id="log_limit">
570 <option <?php if ($this->options['tools']['log']['limit'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", 'wordpress-popular-posts'); ?></option>
571 <option <?php if ($this->options['tools']['log']['limit'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Keep data for", 'wordpress-popular-posts'); ?></option>
572 </select>
573
574 <label for="log_expire_time"<?php echo ($this->options['tools']['log']['limit'] == 0) ? ' style="display:none;"' : ''; ?>><input type="text" id="log_expire_time" name="log_expire_time" value="<?php echo esc_attr( $this->options['tools']['log']['expires_after'] ); ?>" size="3" /> <?php _e("day(s)", 'wordpress-popular-posts'); ?></label>
575
576 <p class="description"<?php echo ($this->options['tools']['log']['limit'] == 0) ? ' style="display:none;"' : ''; ?>><?php _e("Data older than the specified time frame will be automatically discarded", 'wordpress-popular-posts'); ?>.</p>
577
578 <br<?php echo ($this->options['tools']['log']['limit'] == 1) ? ' style="display:none;"' : ''; ?> />
579 </td>
580 </tr>
581 <tr valign="top">
582 <th scope="row"><label for="ajax"><?php _e("Ajaxify widget", 'wordpress-popular-posts'); ?>:</label></th>
583 <td>
584 <select name="ajax" id="ajax">
585 <option <?php if (!$this->options['tools']['ajax']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", 'wordpress-popular-posts'); ?></option>
586 <option <?php if ($this->options['tools']['ajax']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", 'wordpress-popular-posts'); ?></option>
587 </select>
588
589 <br />
590 <p class="description"><?php _e("If you are using a caching plugin such as WP Super Cache, enabling this feature will keep the popular list from being cached by it", 'wordpress-popular-posts'); ?>.</p>
591 </td>
592 </tr>
593 <tr valign="top">
594 <th scope="row"><label for="cache"><?php _e("Data Caching", 'wordpress-popular-posts'); ?>:</label> <small>[<a href="https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#caching" target="_blank" title="<?php _e('What is this?', 'wordpress-popular-posts'); ?>">?</a>]</small></th>
595 <td>
596 <select name="cache" id="cache">
597 <option <?php if ( !$this->options['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Never cache", 'wordpress-popular-posts'); ?></option>
598 <option <?php if ( $this->options['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enable caching", 'wordpress-popular-posts'); ?></option>
599 </select>
600
601 <br />
602 <p class="description"><?php _e("WPP can cache the popular list for a specified amount of time. Recommended for large / high traffic sites", 'wordpress-popular-posts'); ?>.</p>
603 </td>
604 </tr>
605 <tr valign="top" <?php if ( !$this->options['tools']['cache']['active'] ) { ?>style="display:none;"<?php } ?> id="cache_refresh_interval">
606 <th scope="row"><label for="cache_interval_value"><?php _e("Refresh cache every", 'wordpress-popular-posts'); ?>:</label></th>
607 <td>
608 <input name="cache_interval_value" type="text" id="cache_interval_value" value="<?php echo ( isset($this->options['tools']['cache']['interval']['value']) ) ? (int) $this->options['tools']['cache']['interval']['value'] : 1; ?>" class="small-text">
609 <select name="cache_interval_time" id="cache_interval_time">
610 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "minute") {?>selected="selected"<?php } ?> value="minute"><?php _e("Minute(s)", 'wordpress-popular-posts'); ?></option>
611 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "hour") {?>selected="selected"<?php } ?> value="hour"><?php _e("Hour(s)", 'wordpress-popular-posts'); ?></option>
612 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "day") {?>selected="selected"<?php } ?> value="day"><?php _e("Day(s)", 'wordpress-popular-posts'); ?></option>
613 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "week") {?>selected="selected"<?php } ?> value="week"><?php _e("Week(s)", 'wordpress-popular-posts'); ?></option>
614 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "month") {?>selected="selected"<?php } ?> value="month"><?php _e("Month(s)", 'wordpress-popular-posts'); ?></option>
615 <option <?php if ($this->options['tools']['cache']['interval']['time'] == "year") {?>selected="selected"<?php } ?> value="month"><?php _e("Year(s)", 'wordpress-popular-posts'); ?></option>
616 </select>
617 <br />
618 <p class="description" style="display:none;" id="cache_too_long"><?php _e("Really? That long?", 'wordpress-popular-posts'); ?></p>
619 </td>
620 </tr>
621 <tr valign="top">
622 <th scope="row"><label for="sampling"><?php _e("Data Sampling", 'wordpress-popular-posts'); ?>:</label> <small>[<a href="https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#data-sampling" target="_blank" title="<?php _e('What is this?', 'wordpress-popular-posts'); ?>">?</a>]</small></th>
623 <td>
624 <select name="sampling" id="sampling">
625 <option <?php if ( !$this->options['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", 'wordpress-popular-posts'); ?></option>
626 <option <?php if ( $this->options['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", 'wordpress-popular-posts'); ?></option>
627 </select>
628
629 <br />
630 <p class="description"><?php echo sprintf( __('By default, WordPress Popular Posts stores in database every single visit your site receives. For small / medium sites this is generally OK, but on large / high traffic sites the constant writing to the database may have an impact on performance. With <a href="%1$s" target="_blank">data sampling</a>, WordPress Popular Posts will store only a subset of your traffic and report on the tendencies detected in that sample set (for more, <a href="%2$s" target="_blank">please read here</a>)', 'wordpress-popular-posts'), 'http://en.wikipedia.org/wiki/Sample_%28statistics%29', 'https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#data-sampling' ); ?>.</p>
631 </td>
632 </tr>
633 <tr valign="top" <?php if ( !$this->options['tools']['sampling']['active'] ) { ?>style="display:none;"<?php } ?>>
634 <th scope="row"><label for="sample_rate"><?php _e("Sample Rate", 'wordpress-popular-posts'); ?>:</label></th>
635 <td>
636 <input name="sample_rate" type="text" id="sample_rate" value="<?php echo ( isset($this->options['tools']['sampling']['rate']) ) ? (int) $this->options['tools']['sampling']['rate'] : 100; ?>" class="small-text">
637 <br />
638 <p class="description"><?php echo sprintf( __("A sampling rate of %d is recommended for large / high traffic sites. For lower traffic sites, you should lower the value", 'wordpress-popular-posts'), WPP_Settings::$defaults['admin_options']['tools']['sampling']['rate'] ); ?>.</p>
639 </td>
640 </tr>
641 <tr valign="top">
642 <td colspan="2">
643 <input type="hidden" name="section" value="data" />
644 <input type="submit" class="button-primary action" id="btn_ajax_ops" value="<?php _e("Apply", 'wordpress-popular-posts'); ?>" name="" />
645 </td>
646 </tr>
647 </tbody>
648 </table>
649
650 <?php wp_nonce_field( 'wpp-update-data-options', 'wpp-admin-token' ); ?>
651 </form>
652 <br />
653 <p style="display:block; float:none; clear:both">&nbsp;</p>
654
655 <h3 class="wmpp-subtitle"><?php _e("Miscellaneous", 'wordpress-popular-posts'); ?></h3>
656 <form action="" method="post" id="wpp_link_options" name="wpp_link_options">
657 <table class="form-table">
658 <tbody>
659 <tr valign="top">
660 <th scope="row"><label for="link_target"><?php _e("Open links in", 'wordpress-popular-posts'); ?>:</label></th>
661 <td>
662 <select name="link_target" id="link_target">
663 <option <?php if ( $this->options['tools']['link']['target'] == '_self' ) {?>selected="selected"<?php } ?> value="_self"><?php _e("Current window", 'wordpress-popular-posts'); ?></option>
664 <option <?php if ( $this->options['tools']['link']['target'] == '_blank' ) {?>selected="selected"<?php } ?> value="_blank"><?php _e("New tab/window", 'wordpress-popular-posts'); ?></option>
665 </select>
666 <br />
667 </td>
668 </tr>
669 <tr valign="top">
670 <th scope="row"><label for="css"><?php _e("Use plugin's stylesheet", 'wordpress-popular-posts'); ?>:</label></th>
671 <td>
672 <select name="css" id="css">
673 <option <?php if ($this->options['tools']['css']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", 'wordpress-popular-posts'); ?></option>
674 <option <?php if (!$this->options['tools']['css']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", 'wordpress-popular-posts'); ?></option>
675 </select>
676 <br />
677 <p class="description"><?php _e("By default, the plugin includes a stylesheet called wpp.css which you can use to style your popular posts listing. If you wish to use your own stylesheet or do not want it to have it included in the header section of your site, use this.", 'wordpress-popular-posts'); ?></p>
678 </td>
679 </tr>
680 <tr valign="top">
681 <td colspan="2">
682 <input type="hidden" name="section" value="misc" />
683 <input type="submit" class="button-primary action" value="<?php _e("Apply", 'wordpress-popular-posts'); ?>" name="" />
684 </td>
685 </tr>
686 </tbody>
687 </table>
688
689 <?php wp_nonce_field( 'wpp-update-misc-options', 'wpp-admin-token' ); ?>
690 </form>
691 <br />
692 <p style="display:block; float:none; clear:both">&nbsp;</p>
693
694 <br /><br />
695
696 <p><?php _e('WordPress Popular Posts maintains data in two separate tables: one for storing the most popular entries on a daily basis (from now on, "cache"), and another one to keep the All-time data (from now on, "historical data" or just "data"). If for some reason you need to clear the cache table, or even both historical and cache tables, please use the buttons below to do so.', 'wordpress-popular-posts') ?></p>
697 <p><input type="button" name="wpp-reset-cache" id="wpp-reset-cache" class="button-secondary" value="<?php _e("Empty cache", 'wordpress-popular-posts'); ?>" onclick="confirm_reset_cache()" /> <label for="wpp-reset-cache"><small><?php _e('Use this button to manually clear entries from WPP cache only', 'wordpress-popular-posts'); ?></small></label></p>
698 <p><input type="button" name="wpp-reset-all" id="wpp-reset-all" class="button-secondary" value="<?php _e("Clear all data", 'wordpress-popular-posts'); ?>" onclick="confirm_reset_all()" /> <label for="wpp-reset-all"><small><?php _e('Use this button to manually clear entries from all WPP data tables', 'wordpress-popular-posts'); ?></small></label></p>
699 </div>
700 <!-- End tools -->
701
702 <!-- Start params -->
703 <div id="wpp_params" <?php echo ( "params" == $current ) ? '' : ' style="display: none;"'; ?>>
704 <div>
705 <p><?php printf( __('With the following parameters you can customize the popular posts list when using either the <a href="%1$s">wpp_get_mostpopular() template tag</a> or the <a href="%2$s">[wpp] shortcode</a>.', 'wordpress-popular-posts'),
706 'https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#wpp_get_mostpopular',
707 'https://github.com/cabrerahector/wordpress-popular-posts/wiki/1.-Using-WPP-on-posts-&-pages'
708 ); ?></p>
709 <br />
710 <table cellspacing="0" class="wp-list-table widefat fixed posts">
711 <thead>
712 <tr>
713 <th class="manage-column column-title"><?php _e('Parameter', 'wordpress-popular-posts'); ?></th>
714 <th class="manage-column column-title"><?php _e('What it does ', 'wordpress-popular-posts'); ?></th>
715 <th class="manage-column column-title"><?php _e('Possible values', 'wordpress-popular-posts'); ?></th>
716 <th class="manage-column column-title"><?php _e('Defaults to', 'wordpress-popular-posts'); ?></th>
717 <th class="manage-column column-title"><?php _e('Example', 'wordpress-popular-posts'); ?></th>
718 </tr>
719 </thead>
720 <tbody>
721 <tr>
722 <td><strong>header</strong></td>
723 <td><?php _e('Sets a heading for the list', 'wordpress-popular-posts'); ?></td>
724 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
725 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
726 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'header' => 'Popular Posts'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp header='Popular Posts']<br /><br /></td>
727 </tr>
728 <tr class="alternate">
729 <td><strong>header_start</strong></td>
730 <td><?php _e('Set the opening tag for the heading of the list', 'wordpress-popular-posts'); ?></td>
731 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
732 <td>&lt;h2&gt;</td>
733 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'header' => 'Popular Posts', <br />&nbsp;&nbsp;&nbsp;&nbsp;'header_start' => '&lt;h3 class="title"&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;'header_end' => '&lt;/h3&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp header='Popular Posts' header_start='&lt;h3 class="title"&gt;' header_end='&lt;/h3&gt;']<br /><br /></td>
734 </tr>
735 <tr>
736 <td><strong>header_end</strong></td>
737 <td><?php _e('Set the closing tag for the heading of the list', 'wordpress-popular-posts'); ?></td>
738 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
739 <td>&lt;/h2&gt;</td>
740 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'header' => 'Popular Posts', <br />&nbsp;&nbsp;&nbsp;&nbsp;'header_start' => '&lt;h3 class="title"&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;'header_end' => '&lt;/h3&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp header='Popular Posts' header_start='&lt;h3 class="title"&gt;' header_end='&lt;/h3&gt;']<br /><br /></td>
741 </tr>
742 <tr class="alternate">
743 <td><strong>limit</strong></td>
744 <td><?php _e('Sets the maximum number of popular posts to be shown on the listing', 'wordpress-popular-posts'); ?></td>
745 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
746 <td>10</td>
747 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'limit' => 5<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp limit=5]<br /><br /></td>
748 </tr>
749 <tr>
750 <td><strong>range</strong></td>
751 <td><?php _e('Tells WordPress Popular Posts to retrieve the most popular entries within the time range specified by you', 'wordpress-popular-posts'); ?></td>
752 <td>"last24hours", "last7days", "last30days", "all", "custom"</td>
753 <td>last24hours</td>
754 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'range' => 'last7days'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp range='last7days']<br /><br /></td>
755 </tr>
756 <tr class="alternate">
757 <td><strong>time_quantity</strong></td>
758 <td><?php _e('Especifies the number of time units of the custom time range', 'wordpress-popular-posts'); ?></td>
759 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
760 <td>24</td>
761 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'range' => 'custom',<br />&nbsp;&nbsp;&nbsp;&nbsp;'time_quantity' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'time_unit' => 'hour'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp range='custom' time_quantity=1 time_unit='hour']<br /><br /></td>
762 </tr>
763 <tr>
764 <td><strong>time_unit</strong></td>
765 <td><?php _e('Especifies the time unit of the custom time range', 'wordpress-popular-posts'); ?></td>
766 <td>minute, hour, day, week, month</td>
767 <td>hour</td>
768 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'range' => 'custom',<br />&nbsp;&nbsp;&nbsp;&nbsp;'time_quantity' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'time_unit' => 'hour'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp range='custom' time_quantity=1 time_unit='hour']<br /><br /></td>
769 </tr>
770 <tr class="alternate">
771 <td><strong>freshness</strong></td>
772 <td><?php _e('Tells WordPress Popular Posts to retrieve the most popular entries published within the time range specified by you', 'wordpress-popular-posts'); ?></td>
773 <td>1 (true), 0 (false)</td>
774 <td>0</td>
775 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'range' => 'weekly',<br />&nbsp;&nbsp;&nbsp;&nbsp;'freshness' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp range='last7days' freshness=1]<br /><br /></td>
776 </tr>
777 <tr>
778 <td><strong>order_by</strong></td>
779 <td><?php _e('Sets the sorting option of the popular posts', 'wordpress-popular-posts'); ?></td>
780 <td>"comments", "views", "avg" <?php _e('(for average views per day)', 'wordpress-popular-posts'); ?></td>
781 <td>views</td>
782 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'order_by' => 'comments'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp order_by='comments']<br /><br /></td>
783 </tr>
784 <tr class="alternate">
785 <td><strong>post_type</strong></td>
786 <td><?php _e('Defines the type of posts to show on the listing', 'wordpress-popular-posts'); ?></td>
787 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
788 <td>post,page</td>
789 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_type' => 'post,page,your-custom-post-type'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp post_type='post,page,your-custom-post-type']<br /><br /></td>
790 </tr>
791 <tr>
792 <td><strong>pid</strong></td>
793 <td><?php _e('If set, WordPress Popular Posts will exclude the specified post(s) ID(s) form the listing.', 'wordpress-popular-posts'); ?></td>
794 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
795 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
796 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'pid' => '60,25,31'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp pid='60,25,31']<br /><br /></td>
797 </tr>
798 <tr class="alternate">
799 <td><strong>cat</strong></td>
800 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries that belong to the specified category ID(s). If a minus sign is used, entries associated to the category will be excluded instead.', 'wordpress-popular-posts'); ?></td>
801 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
802 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
803 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'cat' => '1,55,-74'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp cat='1,55,-74']<br /><br /></td>
804 </tr>
805 <tr>
806 <td><strong>taxonomy</strong></td>
807 <td><?php _e('If set, WordPress Popular Posts will filter posts by a given taxonomy.', 'wordpress-popular-posts'); ?></td>
808 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
809 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
810 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'taxonomy' => 'post_tag',<br />&nbsp;&nbsp;&nbsp;&nbsp;'term_id' => '118,75,15'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp taxonomy='post_tag' term_id='118,75,15']<br /><br /></td>
811 </tr>
812 <tr class="alternate">
813 <td><strong>term_id</strong></td>
814 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries that belong to the specified term ID(s). If a minus sign is used, entries associated to the term(s) will be excluded instead.', 'wordpress-popular-posts'); ?></td>
815 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
816 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
817 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'taxonomy' => 'post_tag',<br />&nbsp;&nbsp;&nbsp;&nbsp;'term_id' => '118,75,15'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp taxonomy='post_tag' term_id='118,75,15']<br /><br /></td>
818 </tr>
819 <tr>
820 <td><strong>author</strong></td>
821 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries created by specified author(s) ID(s).', 'wordpress-popular-posts'); ?></td>
822 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
823 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
824 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'author' => '75,8,120'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp author='75,8,120']<br /><br /></td>
825 </tr>
826 <tr class="alternate">
827 <td><strong>title_length</strong></td>
828 <td><?php _e('If set, WordPress Popular Posts will shorten each post title to "n" characters whenever possible', 'wordpress-popular-posts'); ?></td>
829 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
830 <td>25</td>
831 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'title_length' => 25<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp title_length=25]<br /><br /></td>
832 </tr>
833 <tr>
834 <td><strong>title_by_words</strong></td>
835 <td><?php _e('If set to 1, WordPress Popular Posts will shorten each post title to "n" words instead of characters', 'wordpress-popular-posts'); ?></td>
836 <td>1 (true), (0) false</td>
837 <td>0</td>
838 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'title_by_words' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'title_length' => 25<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp title_by_words=1 title_length=25]<br /><br /></td>
839 </tr>
840 <tr class="alternate">
841 <td><strong>excerpt_length</strong></td>
842 <td><?php _e('If set, WordPress Popular Posts will build and include an excerpt of "n" characters long from the content of each post listed as popular', 'wordpress-popular-posts'); ?></td>
843 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
844 <td>0</td>
845 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'excerpt_length' => 55,<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp excerpt_length=25 post_html='&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;']<br /><br /></td>
846 </tr>
847 <tr>
848 <td><strong>excerpt_format</strong></td>
849 <td><?php _e('If set, WordPress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt', 'wordpress-popular-posts'); ?></td>
850 <td>1 (true), (0) false</td>
851 <td>0</td>
852 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'excerpt_format' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'excerpt_length' => 55,<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp excerpt_format=1 excerpt_length=25 post_html='&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;']<br /><br /></td>
853 </tr>
854 <tr class="alternate">
855 <td><strong>excerpt_by_words</strong></td>
856 <td><?php _e('If set to 1, WordPress Popular Posts will shorten the excerpt to "n" words instead of characters', 'wordpress-popular-posts'); ?></td>
857 <td>1 (true), (0) false</td>
858 <td>0</td>
859 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'excerpt_by_words' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'excerpt_length' => 55,<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp excerpt_by_words=1 excerpt_length=55 post_html='&lt;li&gt;{thumb} {title} &lt;span class="wpp-excerpt"&gt;{summary}&lt;/span&gt;&lt;/li&gt;']<br /><br /></td>
860 </tr>
861 <tr>
862 <td><strong>thumbnail_width</strong></td>
863 <td><?php _e('If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the width for thumbnails', 'wordpress-popular-posts'); ?></td>
864 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
865 <td>0</td>
866 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'thumbnail_width' => 30,<br />&nbsp;&nbsp;&nbsp;&nbsp;'thumbnail_height' => 30<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp thumbnail_width=30 thumbnail_height=30]<br /><br /></td>
867 </tr>
868 <tr class="alternate">
869 <td><strong>thumbnail_height</strong></td>
870 <td><?php _e('If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the height for thumbnails', 'wordpress-popular-posts'); ?></td>
871 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
872 <td>0</td>
873 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'thumbnail_width' => 30,<br />&nbsp;&nbsp;&nbsp;&nbsp;'thumbnail_height' => 30<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp thumbnail_width=30 thumbnail_height=30]<br /><br /></td>
874 </tr>
875 <tr>
876 <td><strong>rating</strong></td>
877 <td><?php _e('If set, and if the WP-PostRatings plugin is installed and enabled on your blog, WordPress Popular Posts will show how your visitors are rating your entries', 'wordpress-popular-posts'); ?></td>
878 <td>1 (true), (0) false</td>
879 <td>0</td>
880 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'rating' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} {title} {rating}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp rating=1 post_html='&lt;li&gt;{thumb} {title} {rating}&lt;/li&gt;']<br /><br /></td>
881 </tr>
882 <tr class="alternate">
883 <td><strong>stats_comments</strong></td>
884 <td><?php _e('If set, WordPress Popular Posts will show how many comments each popular post has got during the specified time range', 'wordpress-popular-posts'); ?></td>
885 <td>1 (true), 0 (false)</td>
886 <td>0</td>
887 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_comments' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_comments=1]<br /><br /></td>
888 </tr>
889 <tr>
890 <td><strong>stats_views</strong></td>
891 <td><?php _e('If set, WordPress Popular Posts will show how many views each popular post has got during the specified time range', 'wordpress-popular-posts'); ?></td>
892 <td>1 (true), (0) false</td>
893 <td>1</td>
894 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_views' => 0<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_views=0]<br /><br /></td>
895 </tr>
896 <tr class="alternate">
897 <td><strong>stats_author</strong></td>
898 <td><?php _e('If set, WordPress Popular Posts will show who published each popular post on the list', 'wordpress-popular-posts'); ?></td>
899 <td>1 (true), (0) false</td>
900 <td>0</td>
901 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_author' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_author=1]<br /><br /></td>
902 </tr>
903 <tr>
904 <td><strong>stats_date</strong></td>
905 <td><?php _e('If set, WordPress Popular Posts will display the date when each popular post on the list was published', 'wordpress-popular-posts'); ?></td>
906 <td>1 (true), (0) false</td>
907 <td>0</td>
908 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_date' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_date=1]<br /><br /></td>
909 </tr>
910 <tr class="alternate">
911 <td><strong>stats_date_format</strong></td>
912 <td><?php _e('Sets the date format', 'wordpress-popular-posts'); ?></td>
913 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
914 <td>0</td>
915 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_date' => 1,<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_date_format' => 'F j, Y'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_date=1 stats_date_format='F j, Y']<br /><br /></td>
916 </tr>
917 <tr>
918 <td><strong>stats_category</strong></td>
919 <td><?php _e('If set, WordPress Popular Posts will display the categories associated to each entry', 'wordpress-popular-posts'); ?></td>
920 <td>1 (true), (0) false</td>
921 <td>0</td>
922 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_category' => 1, <br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt; {category}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_taxonomy=1 post_html='&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt; {category}&lt;/li&gt;']<br /><br /></td>
923 </tr>
924 <tr class="alternate">
925 <td><strong>stats_taxonomy</strong></td>
926 <td><?php _e('If set, WordPress Popular Posts will display the taxonomies associated to each entry', 'wordpress-popular-posts'); ?></td>
927 <td>1 (true), (0) false</td>
928 <td>0</td>
929 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_taxonomy' => 1, <br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt; {taxonomy}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp stats_taxonomy=1 post_html='&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt; {taxonomy}&lt;/li&gt;']<br /><br /></td>
930 </tr>
931 <tr>
932 <td><strong>wpp_start</strong></td>
933 <td><?php _e('Sets the opening tag for the listing', 'wordpress-popular-posts'); ?></td>
934 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
935 <td>&lt;ul&gt;</td>
936 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'wpp_start' => '&lt;ol&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;'wpp_end' => '&lt;/ol&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp wpp_start='&lt;ol&gt;' wpp_end='&lt;/ol&gt;']<br /><br /></td>
937 </tr>
938 <tr class="alternate">
939 <td><strong>wpp_end</strong></td>
940 <td><?php _e('Sets the closing tag for the listing', 'wordpress-popular-posts'); ?></td>
941 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
942 <td>&lt;/ul&gt;</td>
943 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'wpp_start' => '&lt;ol&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;'wpp_end' => '&lt;/ol&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp wpp_start='&lt;ol&gt;' wpp_end='&lt;/ol&gt;']<br /><br /></td>
944 </tr>
945 <tr>
946 <td><strong>post_html</strong></td>
947 <td><?php _e('Sets the HTML structure of each post', 'wordpress-popular-posts'); ?></td>
948 <td><?php _e('Text string, custom HTML', 'wordpress-popular-posts'); ?>.<br /><br /><strong><?php _e('Available Content Tags', 'wordpress-popular-posts'); ?>:</strong> <br /><br /><em>{thumb}</em> (<?php _e('returns thumbnail linked to post/page, requires thumbnail_width & thumbnail_height', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{thumb_img}</em> (<?php _e('returns thumbnail image without linking to post/page, requires thumbnail_width & thumbnail_height', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{thumb_url}</em> (<?php _e('returns thumbnail url, requires thumbnail_width & thumbnail_height', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{title}</em> (<?php _e('returns linked post/page title', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{pid}</em> (<?php _e('returns the post/page ID', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{summary}</em> (<?php _e('returns post/page excerpt, and requires excerpt_length to be greater than 0', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{stats}</em> (<?php _e('returns the default stats tags', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{rating}</em> (<?php _e('returns post/page current rating, requires WP-PostRatings installed and enabled', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{score}</em> (<?php _e('returns post/page current rating as an integer, requires WP-PostRatings installed and enabled', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{url}</em> (<?php _e('returns the URL of the post/page', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{text_title}</em> (<?php _e('returns post/page title, no link', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{author}</em> (<?php _e('returns linked author name, requires stats_author=1', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{category}</em> (<?php _e('returns linked category name, requires stats_category=1', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{taxonomy}</em> (<?php _e('returns linked taxonomy names, requires stats_taxonomy=1', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{views}</em> (<?php _e('returns views count only, no text', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{comments}</em> (<?php _e('returns comments count only, no text, requires stats_comments=1', 'wordpress-popular-posts'); ?>)<br /><br /> <em>{date}</em> (<?php _e('returns post/page date, requires stats_date=1', 'wordpress-popular-posts'); ?>)</td>
949 <td>&lt;li&gt;{thumb} {title} &lt;span class="wpp-meta post-stats"&gt;{stats}&lt;/span&gt;&lt;/li&gt;</td>
950 <td><strong><?php _e('With wpp_get_mostpopular():', 'wordpress-popular-posts'); ?></strong><br /><br />&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'post_html' => '&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt;&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;<br /><br /><hr /><br /><strong><?php _e('With the [wpp] shortcode:', 'wordpress-popular-posts'); ?></strong><br /><br />[wpp post_html='&lt;li&gt;{thumb} &lt;a href="{url}"&gt;{text_title}&lt;/a&gt;&lt;/li&gt;']<br /><br /></td>
951 </tr>
952 </tbody>
953 </table>
954 </div>
955 </div>
956 <!-- End params -->
957
958 <!-- Start debug -->
959 <?php
960 global $wpdb, $wp_version;
961
962 $my_theme = wp_get_theme();
963
964 $site_plugins = get_plugins();
965 $plugin_names = array();
966
967 foreach( $site_plugins as $main_file => $plugin_meta ) :
968 if ( !is_plugin_active( $main_file ) )
969 continue;
970 $plugin_names[] = sanitize_text_field( $plugin_meta['Name'] . ' ' . $plugin_meta['Version'] );
971 endforeach;
972 ?>
973 <div id="wpp_debug" <?php echo ( "debug" == $current ) ? '' : ' style="display: none;"'; ?>>
974 <p><strong>PHP version:</strong> <?php echo phpversion(); ?></p>
975 <p><strong>PHP extensions:</strong> <?php echo implode( ', ', get_loaded_extensions() ); ?></p>
976 <p><strong>Database version:</strong> <?php echo $wpdb->get_var( "SELECT VERSION();" ); ?></p>
977 <p><strong>InnoDB availability:</strong> <?php echo $wpdb->get_var( "SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'InnoDB';" ); ?></p>
978 <p><strong>WordPress version:</strong> <?php echo $wp_version; ?></p>
979 <p><strong>Multisite:</strong> <?php echo ( function_exists( 'is_multisite' ) && is_multisite() ) ? 'Yes' : 'No'; ?></p>
980 <p><strong>Active plugins:</strong> <?php echo implode( ', ', $plugin_names ); ?></p>
981 <p><strong>Theme:</strong> <?php echo $my_theme->get( 'Name' ) . ' (' . $my_theme->get( 'Version' ) . ') by ' . $my_theme->get( 'Author' ); ?></p>
982 </div>
983 <!-- End debug -->
984
985 </div>