PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 3.3.3
WP Popular Posts v3.3.3
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 / views / admin.php
wordpress-popular-posts / views Last commit date
admin.php 10 years ago form.php 10 years ago index.php 10 years ago
admin.php
765 lines
1 <?php
2 if (basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__))
3 exit('Please do not load this page directly');
4
5 define('WPP_ADMIN', true);
6
7 // Set active tab
8 if ( isset($_GET['tab']) )
9 $current = $_GET['tab'];
10 else
11 $current = 'stats';
12
13 // Update options on form submission
14 if ( isset($_POST['section']) ) {
15
16 if ( "stats" == $_POST['section'] ) {
17
18 $current = 'stats';
19
20 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-stats-options' ) ) {
21
22 $this->user_settings['stats']['order_by'] = $_POST['stats_order'];
23 $this->user_settings['stats']['limit'] = (is_numeric($_POST['stats_limit']) && $_POST['stats_limit'] > 0) ? $_POST['stats_limit'] : 10;
24 $this->user_settings['stats']['post_type'] = empty($_POST['stats_type']) ? "post,page" : $_POST['stats_type'];
25 $this->user_settings['stats']['freshness'] = empty($_POST['stats_freshness']) ? false : $_POST['stats_freshness'];
26
27 update_site_option('wpp_settings_config', $this->user_settings);
28 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', $this->plugin_slug ) . "</strong></p></div>";
29
30 }
31
32 }
33 elseif ( "misc" == $_POST['section'] ) {
34
35 $current = 'tools';
36
37 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-misc-options' ) ) {
38
39 $this->user_settings['tools']['link']['target'] = $_POST['link_target'];
40 $this->user_settings['tools']['css'] = $_POST['css'];
41
42 update_site_option('wpp_settings_config', $this->user_settings);
43 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', $this->plugin_slug ) . "</strong></p></div>";
44
45 }
46 }
47 elseif ( "thumb" == $_POST['section'] ) {
48
49 $current = 'tools';
50
51 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-thumbnail-options' ) ) {
52
53 if ($_POST['thumb_source'] == "custom_field" && (!isset($_POST['thumb_field']) || empty($_POST['thumb_field']))) {
54 echo '<div id="wpp-message" class="error fade"><p>'.__('Please provide the name of your custom field.', $this->plugin_slug).'</p></div>';
55 } else {
56 $this->user_settings['tools']['thumbnail']['source'] = $_POST['thumb_source'];
57 $this->user_settings['tools']['thumbnail']['field'] = ( !empty( $_POST['thumb_field']) ) ? $_POST['thumb_field'] : "wpp_thumbnail";
58 $this->user_settings['tools']['thumbnail']['default'] = ( !empty( $_POST['upload_thumb_src']) ) ? $_POST['upload_thumb_src'] : "";
59 $this->user_settings['tools']['thumbnail']['resize'] = $_POST['thumb_field_resize'];
60 $this->user_settings['tools']['thumbnail']['responsive'] = $_POST['thumb_responsive'];
61
62 update_site_option('wpp_settings_config', $this->user_settings);
63 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', $this->plugin_slug ) . "</strong></p></div>";
64 }
65
66 }
67
68 }
69 elseif ( "data" == $_POST['section'] ) {
70
71 $current = 'tools';
72
73 if ( isset( $_POST['wpp-admin-token'] ) && wp_verify_nonce( $_POST['wpp-admin-token'], 'wpp-update-data-options' ) ) {
74
75 $this->user_settings['tools']['log']['level'] = $_POST['log_option'];
76 $this->user_settings['tools']['log']['limit'] = $_POST['log_limit'];
77 $this->user_settings['tools']['log']['expires_after'] = ( $this->__is_numeric($_POST['log_expire_time']) && $_POST['log_expire_time'] > 0 )
78 ? $_POST['log_expire_time']
79 : $this->default_user_settings['tools']['log']['expires_after'];
80 $this->user_settings['tools']['ajax'] = $_POST['ajax'];
81
82 // if any of the caching settings was updated, destroy all transients created by the plugin
83 if ( $this->user_settings['tools']['cache']['active'] != $_POST['cache'] || $this->user_settings['tools']['cache']['interval']['time'] != $_POST['cache_interval_time'] || $this->user_settings['tools']['cache']['interval']['value'] != $_POST['cache_interval_value'] ) {
84 $this->__flush_transients();
85 }
86
87 $this->user_settings['tools']['cache']['active'] = $_POST['cache'];
88 $this->user_settings['tools']['cache']['interval']['time'] = $_POST['cache_interval_time'];
89 $this->user_settings['tools']['cache']['interval']['value'] = ( isset($_POST['cache_interval_value']) && is_numeric($_POST['cache_interval_value']) && $_POST['cache_interval_value'] > 0 )
90 ? $_POST['cache_interval_value']
91 : 1;
92
93 $this->user_settings['tools']['sampling']['active'] = $_POST['sampling'];
94 $this->user_settings['tools']['sampling']['rate'] = ( isset($_POST['sample_rate']) && is_numeric($_POST['sample_rate']) && $_POST['sample_rate'] > 0 )
95 ? $_POST['sample_rate']
96 : 100;
97
98 update_site_option('wpp_settings_config', $this->user_settings);
99 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', $this->plugin_slug ) . "</strong></p></div>";
100
101 }
102 }
103
104 }
105
106 if ( $this->user_settings['tools']['css'] && !file_exists( get_stylesheet_directory() . '/wpp.css' ) ) {
107 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', $this->plugin_slug) .'.</div>';
108 }
109
110 $rand = md5(uniqid(rand(), true));
111 $wpp_rand = get_site_option("wpp_rand");
112 if (empty($wpp_rand)) {
113 add_site_option("wpp_rand", $rand);
114 } else {
115 update_site_option("wpp_rand", $rand);
116 }
117
118 ?>
119 <script type="text/javascript">
120 // TOOLS
121 function confirm_reset_cache() {
122 if (confirm("<?php _e("This operation will delete all entries from WordPress Popular Posts' cache table and cannot be undone.", $this->plugin_slug); ?> \n\n" + "<?php _e("Do you want to continue?", $this->plugin_slug); ?>")) {
123 jQuery.post(ajaxurl, {action: 'wpp_clear_data', token: '<?php echo get_site_option("wpp_rand"); ?>', clear: 'cache'}, function(data){
124 alert(data);
125 });
126 }
127 }
128
129 function confirm_reset_all() {
130 if (confirm("<?php _e("This operation will delete all stored info from WordPress Popular Posts' data tables and cannot be undone.", $this->plugin_slug); ?> \n\n" + "<?php _e("Do you want to continue?", $this->plugin_slug); ?>")) {
131 jQuery.post(ajaxurl, {action: 'wpp_clear_data', token: '<?php echo get_site_option("wpp_rand"); ?>', clear: 'all'}, function(data){
132 alert(data);
133 });
134 }
135 }
136
137 function confirm_clear_image_cache() {
138 if (confirm("<?php _e("This operation will delete all cached thumbnails and cannot be undone.", $this->plugin_slug); ?> \n\n" + "<?php _e("Do you want to continue?", $this->plugin_slug); ?>")) {
139 jQuery.post(ajaxurl, {action: 'wpp_clear_thumbnail', token: '<?php echo get_site_option("wpp_rand"); ?>'}, function(data){
140 alert(data);
141 });
142 }
143 }
144
145 jQuery(document).ready(function($){
146 <?php if ( "params" != $current ) : ?>
147 $('.wpp_boxes:visible').css({
148 display: 'inline',
149 float: 'left'
150 }).width( $('.wpp_boxes:visible').parent().width() - $('.wpp_box').outerWidth() - 15 );
151
152 $(window).on('resize', function(){
153 $('.wpp_boxes:visible').css({
154 display: 'inline',
155 float: 'left'
156 }).width( $('.wpp_boxes:visible').parent().width() - $('.wpp_box').outerWidth() - 15 );
157 });
158 <?php else: ?>
159 $('.wpp_box').hide();
160 <?php endif; ?>
161 });
162 </script>
163
164 <div class="wrap">
165 <div id="icon-options-general" class="icon32"><br /></div>
166 <h2>WordPress Popular Posts</h2>
167
168 <h2 class="nav-tab-wrapper">
169 <?php
170 // build tabs
171 $tabs = array(
172 'stats' => __('Stats', $this->plugin_slug),
173 'tools' => __('Tools', $this->plugin_slug),
174 'params' => __('Parameters', $this->plugin_slug),
175 'faq' => __('FAQ', $this->plugin_slug),
176 'about' => __('About', $this->plugin_slug)
177 );
178 foreach( $tabs as $tab => $name ){
179 $class = ( $tab == $current ) ? ' nav-tab-active' : '';
180 echo "<a class='nav-tab$class' href='?page=wordpress-popular-posts&tab=$tab'>$name</a>";
181 }
182 ?>
183 </h2>
184
185 <!-- Start stats -->
186 <div id="wpp_stats" class="wpp_boxes"<?php if ( "stats" == $current ) {?> style="display:block;"<?php } ?>>
187 <p><?php _e("Click on each tab to see what are the most popular entries on your blog in the last 24 hours, this week, last 30 days or all time since WordPress Popular Posts was installed.", $this->plugin_slug); ?></p>
188
189 <div class="tablenav top">
190 <div class="alignleft actions">
191 <form action="" method="post" id="wpp_stats_options" name="wpp_stats_options">
192 <select name="stats_order">
193 <option <?php if ($this->user_settings['stats']['order_by'] == "comments") {?>selected="selected"<?php } ?> value="comments"><?php _e("Order by comments", $this->plugin_slug); ?></option>
194 <option <?php if ($this->user_settings['stats']['order_by'] == "views") {?>selected="selected"<?php } ?> value="views"><?php _e("Order by views", $this->plugin_slug); ?></option>
195 <option <?php if ($this->user_settings['stats']['order_by'] == "avg") {?>selected="selected"<?php } ?> value="avg"><?php _e("Order by avg. daily views", $this->plugin_slug); ?></option>
196 </select>
197 <label for="stats_type"><?php _e("Post type", $this->plugin_slug); ?>:</label> <input type="text" name="stats_type" value="<?php echo esc_attr( $this->user_settings['stats']['post_type'] ); ?>" size="15" />
198 <label for="stats_limits"><?php _e("Limit", $this->plugin_slug); ?>:</label> <input type="text" name="stats_limit" value="<?php echo $this->user_settings['stats']['limit']; ?>" size="5" />
199 <input type="hidden" name="section" value="stats" />
200 <input type="submit" class="button-secondary action" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
201
202 <div class="clear"></div>
203 <label for="stats_freshness"><input type="checkbox" class="checkbox" <?php echo ($this->user_settings['stats']['freshness']) ? 'checked="checked"' : ''; ?> id="stats_freshness" name="stats_freshness" /> <?php _e('Display only posts published within the selected Time Range', $this->plugin_slug); ?></label>
204
205 <?php wp_nonce_field( 'wpp-update-stats-options', 'wpp-admin-token' ); ?>
206 </form>
207 </div>
208 </div>
209 <div class="clear"></div>
210 <br />
211 <div id="wpp-stats-tabs">
212 <a href="#" class="button-primary" rel="wpp-daily"><?php _e("Last 24 hours", $this->plugin_slug); ?></a>
213 <a href="#" class="button-secondary" rel="wpp-weekly"><?php _e("Last 7 days", $this->plugin_slug); ?></a>
214 <a href="#" class="button-secondary" rel="wpp-monthly"><?php _e("Last 30 days", $this->plugin_slug); ?></a>
215 <a href="#" class="button-secondary" rel="wpp-all"><?php _e("All-time", $this->plugin_slug); ?></a>
216 </div>
217 <div id="wpp-stats-canvas">
218 <div class="wpp-stats wpp-stats-active" id="wpp-daily">
219 <?php echo do_shortcode("[wpp range='daily' post_type='".$this->user_settings['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$this->user_settings['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li><a href=\"{url}\" target=\"_blank\" class=\"wpp-post-title\">{text_title}</a> <span class=\"post-stats\">{stats}</span></li>' limit=".$this->user_settings['stats']['limit']." freshness=" . $this->user_settings['stats']['freshness'] . "]"); ?>
220 </div>
221 <div class="wpp-stats" id="wpp-weekly">
222 <?php echo do_shortcode("[wpp range='weekly' post_type='".$this->user_settings['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$this->user_settings['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li><a href=\"{url}\" target=\"_blank\" class=\"wpp-post-title\">{text_title}</a> <span class=\"post-stats\">{stats}</span></li>' limit=".$this->user_settings['stats']['limit']." freshness=" . $this->user_settings['stats']['freshness'] . "]"); ?>
223 </div>
224 <div class="wpp-stats" id="wpp-monthly">
225 <?php echo do_shortcode("[wpp range='monthly' post_type='".$this->user_settings['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$this->user_settings['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li><a href=\"{url}\" target=\"_blank\" class=\"wpp-post-title\">{text_title}</a> <span class=\"post-stats\">{stats}</span></li>' limit=".$this->user_settings['stats']['limit']." freshness=" . $this->user_settings['stats']['freshness'] . "]"); ?>
226 </div>
227 <div class="wpp-stats" id="wpp-all">
228 <?php echo do_shortcode("[wpp range='all' post_type='".$this->user_settings['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$this->user_settings['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li><a href=\"{url}\" target=\"_blank\" class=\"wpp-post-title\">{text_title}</a> <span class=\"post-stats\">{stats}</span></li>' limit=".$this->user_settings['stats']['limit']." freshness=" . $this->user_settings['stats']['freshness'] . "]"); ?>
229 </div>
230 </div>
231 </div>
232 <!-- End stats -->
233
234 <!-- Start tools -->
235 <div id="wpp_tools" class="wpp_boxes"<?php if ( "tools" == $current ) {?> style="display:block;"<?php } ?>>
236
237 <h3 class="wmpp-subtitle"><?php _e("Thumbnails", $this->plugin_slug); ?></h3>
238 <form action="" method="post" id="wpp_thumbnail_options" name="wpp_thumbnail_options">
239 <table class="form-table">
240 <tbody>
241 <tr valign="top">
242 <th scope="row"><label for="thumb_default"><?php _e("Default thumbnail", $this->plugin_slug); ?>:</label></th>
243 <td>
244 <div id="thumb-review">
245 <img src="<?php echo $this->user_settings['tools']['thumbnail']['default']; ?>" alt="" border="0" />
246 </div>
247 <input id="upload_thumb_button" type="button" class="button" value="<?php _e( "Upload thumbnail", $this->plugin_slug ); ?>" />
248 <input type="hidden" id="upload_thumb_src" name="upload_thumb_src" value="" />
249 <p class="description"><?php _e("How-to: upload (or select) an image, set Size to Full and click on Upload. After it's done, hit on Apply to save changes", $this->plugin_slug); ?>.</p>
250 </td>
251 </tr>
252 <tr valign="top">
253 <th scope="row"><label for="thumb_source"><?php _e("Pick image from", $this->plugin_slug); ?>:</label></th>
254 <td>
255 <select name="thumb_source" id="thumb_source">
256 <option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "featured") {?>selected="selected"<?php } ?> value="featured"><?php _e("Featured image", $this->plugin_slug); ?></option>
257 <option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "first_image") {?>selected="selected"<?php } ?> value="first_image"><?php _e("First image on post", $this->plugin_slug); ?></option>
258 <option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "first_attachment") {?>selected="selected"<?php } ?> value="first_attachment"><?php _e("First attachment", $this->plugin_slug); ?></option>
259 <option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "custom_field") {?>selected="selected"<?php } ?> value="custom_field"><?php _e("Custom field", $this->plugin_slug); ?></option>
260 </select>
261 <br />
262 <p class="description"><?php _e("Tell WordPress Popular Posts where it should get thumbnails from", $this->plugin_slug); ?>.</p>
263 </td>
264 </tr>
265 <tr valign="top" <?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field">
266 <th scope="row"><label for="thumb_field"><?php _e("Custom field name", $this->plugin_slug); ?>:</label></th>
267 <td>
268 <input type="text" id="thumb_field" name="thumb_field" value="<?php echo esc_attr( $this->user_settings['tools']['thumbnail']['field'] ); ?>" size="10" <?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> />
269 </td>
270 </tr>
271 <tr valign="top" <?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field_resize">
272 <th scope="row"><label for="thumb_field_resize"><?php _e("Resize image from Custom field?", $this->plugin_slug); ?>:</label></th>
273 <td>
274 <select name="thumb_field_resize" id="thumb_field_resize">
275 <option <?php if ( !$this->user_settings['tools']['thumbnail']['resize'] ) {?>selected="selected"<?php } ?> value="0"><?php _e("No, I will upload my own thumbnail", $this->plugin_slug); ?></option>
276 <option <?php if ( $this->user_settings['tools']['thumbnail']['resize'] == 1 ) {?>selected="selected"<?php } ?> value="1"><?php _e("Yes", $this->plugin_slug); ?></option>
277 </select>
278 </td>
279 </tr>
280 <tr valign="top">
281 <th scope="row"><label for="thumb_responsive"><?php _e("Responsive support", $this->plugin_slug); ?>:</label></th>
282 <td>
283 <select name="thumb_responsive" id="thumb_responsive">
284 <option <?php if ($this->user_settings['tools']['thumbnail']['responsive']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
285 <option <?php if (!$this->user_settings['tools']['thumbnail']['responsive']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
286 </select>
287 <br />
288 <p class="description"><?php _e("If enabled, WordPress Popular Posts will strip height and width attributes out of thumbnails' image tags", $this->plugin_slug); ?>.</p>
289 </td>
290 </tr>
291 <?php
292 $wp_upload_dir = wp_upload_dir();
293 if ( is_dir( $wp_upload_dir['basedir'] . "/" . $this->plugin_slug ) ) :
294 ?>
295 <tr valign="top">
296 <th scope="row"></th>
297 <td>
298 <input type="button" name="wpp-reset-cache" id="wpp-reset-cache" class="button-secondary" value="<?php _e("Empty image cache", $this->plugin_slug); ?>" onclick="confirm_clear_image_cache()" />
299 <p class="description"><?php _e("Use this button to clear WPP's thumbnails cache", $this->plugin_slug); ?>.</p>
300 </td>
301 </tr>
302 <?php
303 endif;
304 ?>
305 <tr valign="top">
306 <td colspan="2">
307 <input type="hidden" name="section" value="thumb" />
308 <input type="submit" class="button-secondary action" id="btn_th_ops" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
309 </td>
310 </tr>
311 </tbody>
312 </table>
313
314 <?php wp_nonce_field( 'wpp-update-thumbnail-options', 'wpp-admin-token' ); ?>
315 </form>
316 <br />
317 <p style="display:block; float:none; clear:both">&nbsp;</p>
318
319 <h3 class="wmpp-subtitle"><?php _e("Data", $this->plugin_slug); ?></h3>
320 <form action="" method="post" id="wpp_ajax_options" name="wpp_ajax_options">
321 <table class="form-table">
322 <tbody>
323 <tr valign="top">
324 <th scope="row"><label for="log_option"><?php _e("Log views from", $this->plugin_slug); ?>:</label></th>
325 <td>
326 <select name="log_option" id="log_option">
327 <option <?php if ($this->user_settings['tools']['log']['level'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Visitors only", $this->plugin_slug); ?></option>
328 <option <?php if ($this->user_settings['tools']['log']['level'] == 2) {?>selected="selected"<?php } ?> value="2"><?php _e("Logged-in users only", $this->plugin_slug); ?></option>
329 <option <?php if ($this->user_settings['tools']['log']['level'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Everyone", $this->plugin_slug); ?></option>
330 </select>
331 <br />
332 </td>
333 </tr>
334 <tr valign="top">
335 <th scope="row"><label for="log_limit"><?php _e("Log limit", $this->plugin_slug); ?>:</label></th>
336 <td>
337 <select name="log_limit" id="log_limit">
338 <option <?php if ($this->user_settings['tools']['log']['limit'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
339 <option <?php if ($this->user_settings['tools']['log']['limit'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Keep data for", $this->plugin_slug); ?></option>
340 </select>
341
342 <label for="log_expire_time"<?php echo ($this->user_settings['tools']['log']['limit'] == 0) ? ' style="display:none;"' : ''; ?>><input type="text" id="log_expire_time" name="log_expire_time" value="<?php echo esc_attr( $this->user_settings['tools']['log']['expires_after'] ); ?>" size="3" /> <?php _e("day(s)", $this->plugin_slug); ?></label>
343
344 <p class="description"<?php echo ($this->user_settings['tools']['log']['limit'] == 0) ? ' style="display:none;"' : ''; ?>><?php _e("Data from entries that haven't been viewed within the specified time frame will be automatically discarded", $this->plugin_slug); ?>.</p>
345
346 <br<?php echo ($this->user_settings['tools']['log']['limit'] == 1) ? ' style="display:none;"' : ''; ?> />
347 </td>
348 </tr>
349 <tr valign="top">
350 <th scope="row"><label for="ajax"><?php _e("Ajaxify widget", $this->plugin_slug); ?>:</label></th>
351 <td>
352 <select name="ajax" id="ajax">
353 <option <?php if (!$this->user_settings['tools']['ajax']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
354 <option <?php if ($this->user_settings['tools']['ajax']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
355 </select>
356
357 <br />
358 <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", $this->plugin_slug); ?>.</p>
359 </td>
360 </tr>
361 <tr valign="top">
362 <th scope="row"><label for="cache"><?php _e("WPP Cache Expiry Policy", $this->plugin_slug); ?>:</label> <small>[<a href="https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#caching" target="_blank" title="<?php _e('What is this?', $this->plugin_slug); ?>">?</a>]</small></th>
363 <td>
364 <select name="cache" id="cache">
365 <option <?php if ( !$this->user_settings['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Never cache", $this->plugin_slug); ?></option>
366 <option <?php if ( $this->user_settings['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enable caching", $this->plugin_slug); ?></option>
367 </select>
368
369 <br />
370 <p class="description"><?php _e("Sets WPP's cache expiration time. WPP can cache the popular list for a specified amount of time. Recommended for large / high traffic sites", $this->plugin_slug); ?>.</p>
371 </td>
372 </tr>
373 <tr valign="top" <?php if ( !$this->user_settings['tools']['cache']['active'] ) { ?>style="display:none;"<?php } ?> id="cache_refresh_interval">
374 <th scope="row"><label for="cache_interval_value"><?php _e("Refresh cache every", $this->plugin_slug); ?>:</label></th>
375 <td>
376 <input name="cache_interval_value" type="text" id="cache_interval_value" value="<?php echo ( isset($this->user_settings['tools']['cache']['interval']['value']) ) ? (int) $this->user_settings['tools']['cache']['interval']['value'] : 1; ?>" class="small-text">
377 <select name="cache_interval_time" id="cache_interval_time">
378 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "minute") {?>selected="selected"<?php } ?> value="minute"><?php _e("Minute(s)", $this->plugin_slug); ?></option>
379 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "hour") {?>selected="selected"<?php } ?> value="hour"><?php _e("Hour(s)", $this->plugin_slug); ?></option>
380 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "day") {?>selected="selected"<?php } ?> value="day"><?php _e("Day(s)", $this->plugin_slug); ?></option>
381 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "week") {?>selected="selected"<?php } ?> value="week"><?php _e("Week(s)", $this->plugin_slug); ?></option>
382 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "month") {?>selected="selected"<?php } ?> value="month"><?php _e("Month(s)", $this->plugin_slug); ?></option>
383 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "year") {?>selected="selected"<?php } ?> value="month"><?php _e("Year(s)", $this->plugin_slug); ?></option>
384 </select>
385 <br />
386 <p class="description" style="display:none;" id="cache_too_long"><?php _e("Really? That long?", $this->plugin_slug); ?></p>
387 </td>
388 </tr>
389 <tr valign="top">
390 <th scope="row"><label for="sampling"><?php _e("Data Sampling", $this->plugin_slug); ?>:</label> <small>[<a href="https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#data-sampling" target="_blank" title="<?php _e('What is this?', $this->plugin_slug); ?>">?</a>]</small></th>
391 <td>
392 <select name="sampling" id="sampling">
393 <option <?php if ( !$this->user_settings['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
394 <option <?php if ( $this->user_settings['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
395 </select>
396
397 <br />
398 <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>)', $this->plugin_slug), 'http://en.wikipedia.org/wiki/Sample_%28statistics%29', 'https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance#data-sampling' ); ?>.</p>
399 </td>
400 </tr>
401 <tr valign="top" <?php if ( !$this->user_settings['tools']['sampling']['active'] ) { ?>style="display:none;"<?php } ?>>
402 <th scope="row"><label for="sample_rate"><?php _e("Sample Rate", $this->plugin_slug); ?>:</label></th>
403 <td>
404 <input name="sample_rate" type="text" id="sample_rate" value="<?php echo ( isset($this->user_settings['tools']['sampling']['rate']) ) ? (int) $this->user_settings['tools']['sampling']['rate'] : 100; ?>" class="small-text">
405 <br />
406 <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", $this->plugin_slug), $this->default_user_settings['tools']['sampling']['rate'] ); ?>.</p>
407 </td>
408 </tr>
409 <tr valign="top">
410 <td colspan="2">
411 <input type="hidden" name="section" value="data" />
412 <input type="submit" class="button-secondary action" id="btn_ajax_ops" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
413 </td>
414 </tr>
415 </tbody>
416 </table>
417
418 <?php wp_nonce_field( 'wpp-update-data-options', 'wpp-admin-token' ); ?>
419 </form>
420 <br />
421 <p style="display:block; float:none; clear:both">&nbsp;</p>
422
423 <h3 class="wmpp-subtitle"><?php _e("Miscellaneous", $this->plugin_slug); ?></h3>
424 <form action="" method="post" id="wpp_link_options" name="wpp_link_options">
425 <table class="form-table">
426 <tbody>
427 <tr valign="top">
428 <th scope="row"><label for="link_target"><?php _e("Open links in", $this->plugin_slug); ?>:</label></th>
429 <td>
430 <select name="link_target" id="link_target">
431 <option <?php if ( $this->user_settings['tools']['link']['target'] == '_self' ) {?>selected="selected"<?php } ?> value="_self"><?php _e("Current window", $this->plugin_slug); ?></option>
432 <option <?php if ( $this->user_settings['tools']['link']['target'] == '_blank' ) {?>selected="selected"<?php } ?> value="_blank"><?php _e("New tab/window", $this->plugin_slug); ?></option>
433 </select>
434 <br />
435 </td>
436 </tr>
437 <tr valign="top">
438 <th scope="row"><label for="css"><?php _e("Use plugin's stylesheet", $this->plugin_slug); ?>:</label></th>
439 <td>
440 <select name="css" id="css">
441 <option <?php if ($this->user_settings['tools']['css']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
442 <option <?php if (!$this->user_settings['tools']['css']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
443 </select>
444 <br />
445 <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.", $this->plugin_slug); ?></p>
446 </td>
447 </tr>
448 <tr valign="top">
449 <td colspan="2">
450 <input type="hidden" name="section" value="misc" />
451 <input type="submit" class="button-secondary action" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
452 </td>
453 </tr>
454 </tbody>
455 </table>
456
457 <?php wp_nonce_field( 'wpp-update-misc-options', 'wpp-admin-token' ); ?>
458 </form>
459 <br />
460 <p style="display:block; float:none; clear:both">&nbsp;</p>
461
462 <br /><br />
463
464 <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.', $this->plugin_slug) ?></p>
465 <p><input type="button" name="wpp-reset-cache" id="wpp-reset-cache" class="button-secondary" value="<?php _e("Empty cache", $this->plugin_slug); ?>" onclick="confirm_reset_cache()" /> <label for="wpp-reset-cache"><small><?php _e('Use this button to manually clear entries from WPP cache only', $this->plugin_slug); ?></small></label></p>
466 <p><input type="button" name="wpp-reset-all" id="wpp-reset-all" class="button-secondary" value="<?php _e("Clear all data", $this->plugin_slug); ?>" onclick="confirm_reset_all()" /> <label for="wpp-reset-all"><small><?php _e('Use this button to manually clear entries from all WPP data tables', $this->plugin_slug); ?></small></label></p>
467 </div>
468 <!-- End tools -->
469
470 <!-- Start params -->
471 <div id="wpp_params" class="wpp_boxes"<?php if ( "params" == $current ) {?> style="display:block;"<?php } ?>>
472 <div>
473 <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>.', $this->plugin_slug),
474 admin_url('options-general.php?page=wordpress-popular-posts&tab=faq#template-tags'),
475 admin_url('options-general.php?page=wordpress-popular-posts&tab=faq#shortcode')
476 ); ?></p>
477 <br />
478 <table cellspacing="0" class="wp-list-table widefat fixed posts">
479 <thead>
480 <tr>
481 <th class="manage-column column-title"><?php _e('Parameter', $this->plugin_slug); ?></th>
482 <th class="manage-column column-title"><?php _e('What it does ', $this->plugin_slug); ?></th>
483 <th class="manage-column column-title"><?php _e('Possible values', $this->plugin_slug); ?></th>
484 <th class="manage-column column-title"><?php _e('Defaults to', $this->plugin_slug); ?></th>
485 <th class="manage-column column-title"><?php _e('Example', $this->plugin_slug); ?></th>
486 </tr>
487 </thead>
488 <tbody>
489 <tr>
490 <td><strong>header</strong></td>
491 <td><?php _e('Sets a heading for the list', $this->plugin_slug); ?></td>
492 <td><?php _e('Text string', $this->plugin_slug); ?></td>
493 <td><?php _e('None', $this->plugin_slug); ?></td>
494 <td>&lt;?php wpp_get_mostpopular( 'header="Popular Posts"' ); ?&gt;</td>
495 </tr>
496 <tr class="alternate">
497 <td><strong>header_start</strong></td>
498 <td><?php _e('Set the opening tag for the heading of the list', $this->plugin_slug); ?></td>
499 <td><?php _e('Text string', $this->plugin_slug); ?></td>
500 <td>&lt;h2&gt;</td>
501 <td>&lt;?php wpp_get_mostpopular( 'header_start="&lt;h2&gt;"&amp;header_end="&lt;/h2&gt;"' ); ?&gt;</td>
502 </tr>
503 <tr>
504 <td><strong>header_end</strong></td>
505 <td><?php _e('Set the closing tag for the heading of the list', $this->plugin_slug); ?></td>
506 <td><?php _e('Text string', $this->plugin_slug); ?></td>
507 <td>&lt;/h2&gt;</td>
508 <td>&lt;?php wpp_get_mostpopular( 'header_start="&lt;h2&gt;"&amp;header_end="&lt;/h2&gt;"' ); ?&gt;</td>
509 </tr>
510 <tr class="alternate">
511 <td><strong>limit</strong></td>
512 <td><?php _e('Sets the maximum number of popular posts to be shown on the listing', $this->plugin_slug); ?></td>
513 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
514 <td>10</td>
515 <td>&lt;?php wpp_get_mostpopular( 'limit=10' ); ?&gt;</td>
516 </tr>
517 <tr>
518 <td><strong>range</strong></td>
519 <td><?php _e('Tells WordPress Popular Posts to retrieve the most popular entries within the time range specified by you', $this->plugin_slug); ?></td>
520 <td>"daily", "weekly", "monthly", "all"</td>
521 <td>daily</td>
522 <td>&lt;?php wpp_get_mostpopular( 'range="daily"' ); ?&gt;</td>
523 </tr>
524 <tr class="alternate">
525 <td><strong>freshness</strong></td>
526 <td><?php _e('Tells WordPress Popular Posts to retrieve the most popular entries published within the time range specified by you', $this->plugin_slug); ?></td>
527 <td>1 (true), 0 (false)</td>
528 <td>0</td>
529 <td>&lt;?php wpp_get_mostpopular( 'freshness=1' ); ?&gt;</td>
530 </tr>
531 <tr>
532 <td><strong>order_by</strong></td>
533 <td><?php _e('Sets the sorting option of the popular posts', $this->plugin_slug); ?></td>
534 <td>"comments", "views", "avg" <?php _e('(for average views per day)', $this->plugin_slug); ?></td>
535 <td>views</td>
536 <td>&lt;?php wpp_get_mostpopular( 'order_by="comments"' ); ?&gt;</td>
537 </tr>
538 <tr class="alternate">
539 <td><strong>post_type</strong></td>
540 <td><?php _e('Defines the type of posts to show on the listing', $this->plugin_slug); ?></td>
541 <td><?php _e('Text string', $this->plugin_slug); ?></td>
542 <td>post,page</td>
543 <td>&lt;?php wpp_get_mostpopular( 'post_type="post,page,your-custom-post-type"' ); ?&gt;</td>
544 </tr>
545 <tr>
546 <td><strong>pid</strong></td>
547 <td><?php _e('If set, WordPress Popular Posts will exclude the specified post(s) ID(s) form the listing.', $this->plugin_slug); ?></td>
548 <td><?php _e('Text string', $this->plugin_slug); ?></td>
549 <td><?php _e('None', $this->plugin_slug); ?></td>
550 <td>&lt;?php wpp_get_mostpopular( 'pid="60,25,31"' ); ?&gt;</td>
551 </tr>
552 <tr class="alternate">
553 <td><strong>cat</strong></td>
554 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries that belong to the specified category(ies) ID(s). If a minus sign is used, the category(ies) will be excluded instead.', $this->plugin_slug); ?></td>
555 <td><?php _e('Text string', $this->plugin_slug); ?></td>
556 <td><?php _e('None', $this->plugin_slug); ?></td>
557 <td>&lt;?php wpp_get_mostpopular( 'cat="1,55,-74"' ); ?&gt;</td>
558 </tr>
559 <tr>
560 <td><strong>author</strong></td>
561 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries created by specified author(s) ID(s).', $this->plugin_slug); ?></td>
562 <td><?php _e('Text string', $this->plugin_slug); ?></td>
563 <td><?php _e('None', $this->plugin_slug); ?></td>
564 <td>&lt;?php wpp_get_mostpopular( 'author="75,8,120"' ); ?&gt;</td>
565 </tr>
566 <tr class="alternate">
567 <td><strong>title_length</strong></td>
568 <td><?php _e('If set, WordPress Popular Posts will shorten each post title to "n" characters whenever possible', $this->plugin_slug); ?></td>
569 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
570 <td>25</td>
571 <td>&lt;?php wpp_get_mostpopular( 'title_length=25' ); ?&gt;</td>
572 </tr>
573 <tr>
574 <td><strong>title_by_words</strong></td>
575 <td><?php _e('If set to 1, WordPress Popular Posts will shorten each post title to "n" words instead of characters', $this->plugin_slug); ?></td>
576 <td>1 (true), (0) false</td>
577 <td>0</td>
578 <td>&lt;?php wpp_get_mostpopular( 'title_by_words=1' ); ?&gt;</td>
579 </tr>
580 <tr class="alternate">
581 <td><strong>excerpt_length</strong></td>
582 <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', $this->plugin_slug); ?></td>
583 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
584 <td>0</td>
585 <td>&lt;?php wpp_get_mostpopular( 'excerpt_length=55&amp;post_html="&lt;li&gt;{thumb} {title} {summary}&lt;/li&gt;"' ); ?&gt;</td>
586 </tr>
587 <tr>
588 <td><strong>excerpt_format</strong></td>
589 <td><?php _e('If set, WordPress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt', $this->plugin_slug); ?></td>
590 <td>1 (true), (0) false</td>
591 <td>0</td>
592 <td>&lt;?php wpp_get_mostpopular( 'excerpt_format=1&amp;excerpt_length=55&amp;post_html="&lt;li&gt;{thumb} {title} {summary}&lt;/li&gt;"' ); ?&gt;</td>
593 </tr>
594 <tr class="alternate">
595 <td><strong>excerpt_by_words</strong></td>
596 <td><?php _e('If set to 1, WordPress Popular Posts will shorten the excerpt to "n" words instead of characters', $this->plugin_slug); ?></td>
597 <td>1 (true), (0) false</td>
598 <td>0</td>
599 <td>&lt;?php wpp_get_mostpopular( 'excerpt_by_words=1&amp;excerpt_length=55&amp;post_html="&lt;li&gt;{thumb} {title} {summary}&lt;/li&gt;"' ); ?&gt;</td>
600 </tr>
601 <tr>
602 <td><strong>thumbnail_width</strong></td>
603 <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', $this->plugin_slug); ?></td>
604 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
605 <td>0</td>
606 <td>&lt;?php wpp_get_mostpopular( 'thumbnail_width=30&amp;thumbnail_height=30' ); ?&gt;</td>
607 </tr>
608 <tr class="alternate">
609 <td><strong>thumbnail_height</strong></td>
610 <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', $this->plugin_slug); ?></td>
611 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
612 <td>0</td>
613 <td>&lt;?php wpp_get_mostpopular( 'thumbnail_width=30&amp;thumbnail_height=30' ); ?&gt;</td>
614 </tr>
615 <tr>
616 <td><strong>rating</strong></td>
617 <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', $this->plugin_slug); ?></td>
618 <td>1 (true), (0) false</td>
619 <td>0</td>
620 <td>&lt;?php wpp_get_mostpopular( 'rating=1&amp;post_html="&lt;li&gt;{thumb} {title} {rating}&lt;/li&gt;"' ); ?&gt;</td>
621 </tr>
622 <tr class="alternate">
623 <td><strong>stats_comments</strong></td>
624 <td><?php _e('If set, WordPress Popular Posts will show how many comments each popular post has got until now', $this->plugin_slug); ?></td>
625 <td>1 (true), 0 (false)</td>
626 <td>1</td>
627 <td>&lt;?php wpp_get_mostpopular( 'stats_comments=1' ); ?&gt;</td>
628 </tr>
629 <tr>
630 <td><strong>stats_views</strong></td>
631 <td><?php _e('If set, WordPress Popular Posts will show how many views each popular post has got since it was installed', $this->plugin_slug); ?></td>
632 <td>1 (true), (0) false</td>
633 <td>0</td>
634 <td>&lt;?php wpp_get_mostpopular( 'stats_views=1' ); ?&gt;</td>
635 </tr>
636 <tr class="alternate">
637 <td><strong>stats_author</strong></td>
638 <td><?php _e('If set, WordPress Popular Posts will show who published each popular post on the list', $this->plugin_slug); ?></td>
639 <td>1 (true), (0) false</td>
640 <td>0</td>
641 <td>&lt;?php wpp_get_mostpopular( 'stats_author=1' ); ?&gt;</td>
642 </tr>
643 <tr>
644 <td><strong>stats_date</strong></td>
645 <td><?php _e('If set, WordPress Popular Posts will display the date when each popular post on the list was published', $this->plugin_slug); ?></td>
646 <td>1 (true), (0) false</td>
647 <td>0</td>
648 <td>&lt;?php wpp_get_mostpopular( 'stats_date=1' ); ?&gt;</td>
649 </tr>
650 <tr class="alternate">
651 <td><strong>stats_date_format</strong></td>
652 <td><?php _e('Sets the date format', $this->plugin_slug); ?></td>
653 <td><?php _e('Text string', $this->plugin_slug); ?></td>
654 <td>0</td>
655 <td>&lt;?php wpp_get_mostpopular( 'stats_date_format="F j, Y"' ); ?&gt;</td>
656 </tr>
657 <tr>
658 <td><strong>stats_category</strong></td>
659 <td><?php _e('If set, WordPress Popular Posts will display the category', $this->plugin_slug); ?></td>
660 <td>1 (true), (0) false</td>
661 <td>0</td>
662 <td>&lt;?php wpp_get_mostpopular( 'stats_category=1' ); ?&gt;</td>
663 </tr>
664 <tr class="alternate">
665 <td><strong>wpp_start</strong></td>
666 <td><?php _e('Sets the opening tag for the listing', $this->plugin_slug); ?></td>
667 <td><?php _e('Text string', $this->plugin_slug); ?></td>
668 <td>&lt;ul&gt;</td>
669 <td>&lt;?php wpp_get_mostpopular( 'wpp_start="&lt;ol&gt;"&amp;wpp_end="&lt;/ol&gt;"' ); ?&gt;</td>
670 </tr>
671 <tr>
672 <td><strong>wpp_end</strong></td>
673 <td><?php _e('Sets the closing tag for the listing', $this->plugin_slug); ?></td>
674 <td><?php _e('Text string', $this->plugin_slug); ?></td>
675 <td>&lt;/ul&gt;</td>
676 <td>&lt;?php wpp_get_mostpopular( 'wpp_start="&lt;ol&gt;"&amp;wpp_end="&lt;/ol&gt;"' ); ?&gt;</td>
677 </tr>
678 <tr class="alternate">
679 <td><strong>post_html</strong></td>
680 <td><?php _e('Sets the HTML structure of each post', $this->plugin_slug); ?></td>
681 <td><?php _e('Text string, custom HTML', $this->plugin_slug); ?>.<br /><br /><strong><?php _e('Available Content Tags', $this->plugin_slug); ?>:</strong> <br /><br /><em>{thumb}</em> (<?php _e('displays thumbnail linked to post/page, requires thumbnail_width & thumbnail_height', $this->plugin_slug); ?>)<br /><br /> <em>{thumb_img}</em> (<?php _e('displays thumbnail image without linking to post/page, requires thumbnail_width & thumbnail_height', $this->plugin_slug); ?>)<br /><br /> <em>{title}</em> (<?php _e('displays linked post/page title', $this->plugin_slug); ?>)<br /><br /> <em>{summary}</em> (<?php _e('displays post/page excerpt, and requires excerpt_length to be greater than 0', $this->plugin_slug); ?>)<br /><br /> <em>{stats}</em> (<?php _e('displays the default stats tags', $this->plugin_slug); ?>)<br /><br /> <em>{rating}</em> (<?php _e('displays post/page current rating, requires WP-PostRatings installed and enabled', $this->plugin_slug); ?>)<br /><br /> <em>{score}</em> (<?php _e('displays post/page current rating as an integer, requires WP-PostRatings installed and enabled', $this->plugin_slug); ?>)<br /><br /> <em>{url}</em> (<?php _e('outputs the URL of the post/page', $this->plugin_slug); ?>)<br /><br /> <em>{text_title}</em> (<?php _e('displays post/page title, no link', $this->plugin_slug); ?>)<br /><br /> <em>{author}</em> (<?php _e('displays linked author name, requires stats_author=1', $this->plugin_slug); ?>)<br /><br /> <em>{category}</em> (<?php _e('displays linked category name, requires stats_category=1', $this->plugin_slug); ?>)<br /><br /> <em>{views}</em> (<?php _e('displays views count only, no text', $this->plugin_slug); ?>)<br /><br /> <em>{comments}</em> (<?php _e('displays comments count only, no text, requires stats_comments=1', $this->plugin_slug); ?>)<br /><br /> <em>{date}</em> (<?php _e('displays post/page date, requires stats_date=1', $this->plugin_slug); ?>)</td>
682 <td>&lt;li&gt;{thumb} {title} {stats}&lt;/li&gt;</td>
683 <td>&lt;?php wpp_get_mostpopular( 'post_html="&lt;li&gt;{thumb} &lt;a href=\'{url}\'&gt;{text_title}&lt;/a&gt;&lt;/li&gt;"' ); ?&gt;</td>
684 </tr>
685 </tbody>
686 </table>
687 </div>
688 </div>
689 <!-- End params -->
690
691 <!-- Start faq -->
692 <div id="wpp_faq" class="wpp_boxes"<?php if ( "faq" == $current ) {?> style="display:block;"<?php } ?>>
693
694 <p><?php echo sprintf( __('These FAQs are widget specific. For more general FAQs about WordPress Popular Posts, please click <a href="%s" target="_blank">here</a>', $this->plugin_slug), 'https://github.com/cabrerahector/wordpress-popular-posts/wiki/5.-FAQ' ); ?>.</p>
695
696 <h4 id="widget-title">&raquo; <a href="#" rel="q-1"><?php _e('What does "Title" do?', $this->plugin_slug); ?></a></h4>
697
698 <div class="wpp-ans" id="q-1">
699 <p><?php _e('It allows you to show a heading for your most popular posts listing. If left empty, no heading will be displayed at all.', $this->plugin_slug); ?></p>
700 </div>
701
702 <h4 id="filter-post-type">&raquo; <a href="#" rel="q-8"><?php _e('What is "Post type" for?', $this->plugin_slug); ?></a></h4>
703 <div class="wpp-ans" id="q-8">
704 <p><?php _e('This filter allows you to decide which post types to show on the listing. By default, it will retrieve only posts and pages (which should be fine for most cases).', $this->plugin_slug); ?></p>
705 </div>
706
707 <h4 id="filter-category">&raquo; <a href="#" rel="q-9"><?php _e('What is "Category(ies) ID(s)" for?', $this->plugin_slug); ?></a></h4>
708 <div class="wpp-ans" id="q-9">
709 <p><?php _e('This filter allows you to select which categories should be included or excluded from the listing. A negative sign in front of the category ID number will exclude posts belonging to it from the list, for example. You can specify more than one ID with a comma separated list.', $this->plugin_slug); ?></p>
710 </div>
711
712 <h4 id="filter-author">&raquo; <a href="#" rel="q-10"><?php _e('What is "Author(s) ID(s)" for?', $this->plugin_slug); ?></a></h4>
713 <div class="wpp-ans" id="q-10">
714 <p><?php _e('Just like the Category filter, this one lets you filter posts by author ID. You can specify more than one ID with a comma separated list.', $this->plugin_slug); ?></p>
715 </div>
716
717 <h4 id="display-rating">&raquo; <a href="#" rel="q-4"><?php _e('What does "Display post rating" do?', $this->plugin_slug); ?></a></h4>
718 <div class="wpp-ans" id="q-4">
719 <p><?php _e('If checked, WordPress Popular Posts will show how your readers are rating your most popular posts. This feature requires having WP-PostRatings plugin installed and enabled on your blog for it to work.', $this->plugin_slug); ?></p>
720 </div>
721
722 <h4 id="custom-html-markup">&raquo; <a href="#" rel="q-17"><?php _e('What does "Use custom HTML Markup" do?', $this->plugin_slug); ?></a></h4>
723 <div class="wpp-ans" id="q-17">
724 <p><?php _e('If checked, you will be able to customize the HTML markup of your popular posts listing. For example, you can decide whether to wrap your posts in an unordered list, an ordered list, a div, etc. If you know xHTML/CSS, this is for you!', $this->plugin_slug); ?></p>
725 </div>
726
727 </div>
728 <!-- End faq -->
729
730 <!-- Start about -->
731 <div id="wpp_faq" class="wpp_boxes"<?php if ( "about" == $current ) {?> style="display:block;"<?php } ?>>
732
733 <h3><?php echo sprintf( __('About WordPress Popular Posts %s', $this->plugin_slug), $this->version); ?></h3>
734 <p><?php _e( 'This version includes the following changes', $this->plugin_slug ); ?>:</p>
735
736 <ul>
737 <li>Fixes potential XSS exploit in WPP's admin dashboard.</li>
738 <li>Adds filter to set which post types should be tracked by WPP (details).</li>
739 <li>Adds ability to select first attached image as thumbnail source (thanks, <a href="https://github.com/serglopatin">@serglopatin</a>!)</li>
740 </ul>
741
742 </div>
743 <!-- End about -->
744
745 <div id="wpp_donate" class="wpp_box" style="">
746 <h3 style="margin-top:0; text-align:center;"><?php _e('Do you like this plugin?', $this->plugin_slug); ?></h3>
747 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
748 <input type="hidden" name="cmd" value="_s-xclick">
749 <input type="hidden" name="hosted_button_id" value="RP9SK8KVQHRKS">
750 <input type="image" src="//www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="display:block; margin:0 auto;">
751 <img alt="" border="0" src="//www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
752 </form>
753 <p><?php _e( 'Each donation motivates me to keep releasing free stuff for the WordPress community!', $this->plugin_slug ); ?></p>
754 <p><?php echo sprintf( __('You can <a href="%s" target="_blank">leave a review</a>, too!', $this->plugin_slug), 'https://wordpress.org/support/view/plugin-reviews/wordpress-popular-posts?rate=5#postform' ); ?></p>
755 </div>
756
757 <div id="wpp_advertisement" class="wpp_box" style=""></div>
758
759 <div id="wpp_support" class="wpp_box" style="">
760 <h3 style="margin-top:0; text-align:center;"><?php _e('Need help?', $this->plugin_slug); ?></h3>
761 <p><?php echo sprintf( __('Visit <a href="%s" target="_blank">the forum</a> for support, questions and feedback.', $this->plugin_slug), 'https://wordpress.org/support/plugin/wordpress-popular-posts' ); ?></p>
762 <p><?php _e('Let\'s make this plugin even better!', $this->plugin_slug); ?></p>
763 </div>
764
765 </div>