PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 3.3.4
WP Popular Posts v3.3.4
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
798 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 /*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.", $this->plugin_slug); ?> \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?", $this->plugin_slug); ?>")) {
123 jQuery.post(ajaxurl, {action: 'wpp_clear_data', token: '<?php echo get_site_option("wpp_rand"); ?>', clear: 'cache'}, function(data){
124 var response = "";
125
126 switch( data ) {
127 case "1":
128 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!', $this->plugin_slug); ?>";
129 break;
130
131 case "2":
132 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.', $this->plugin_slug); ?>";
133 break;
134
135 case "3":
136 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.', $this->plugin_slug); ?>";
137 break;
138
139 case "4":
140 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.', $this->plugin_slug); ?>";
141 break;
142
143 default:
144 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.', $this->plugin_slug); ?>";
145 break;
146 }
147
148 alert(response);
149 });
150 }
151 }
152
153 function confirm_reset_all() {
154 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.", $this->plugin_slug); ?> \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?", $this->plugin_slug); ?>")) {
155 jQuery.post(ajaxurl, {action: 'wpp_clear_data', token: '<?php echo get_site_option("wpp_rand"); ?>', clear: 'all'}, function(data){
156 var response = "";
157
158 switch( data ) {
159 case "1":
160 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!', $this->plugin_slug); ?>";
161 break;
162
163 case "2":
164 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.', $this->plugin_slug); ?>";
165 break;
166
167 case "3":
168 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.', $this->plugin_slug); ?>";
169 break;
170
171 case "4":
172 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.', $this->plugin_slug); ?>";
173 break;
174
175 default:
176 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.', $this->plugin_slug); ?>";
177 break;
178 }
179
180 alert(response);
181 });
182 }
183 }
184
185 function confirm_clear_image_cache() {
186 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.", $this->plugin_slug); ?> \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?", $this->plugin_slug); ?>")) {
187 jQuery.post(ajaxurl, {action: 'wpp_clear_thumbnail', token: '<?php echo get_site_option("wpp_rand"); ?>'}, function(data){
188 var response = "";
189
190 switch( data ) {
191 case "1":
192 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!', $this->plugin_slug); ?>";
193 break;
194
195 case "2":
196 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!', $this->plugin_slug); ?>";
197 break;
198
199 case "3":
200 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.', $this->plugin_slug); ?>";
201 break;
202
203 case "4":
204 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.', $this->plugin_slug); ?>";
205 break;
206
207 default:
208 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.', $this->plugin_slug); ?>";
209 break;
210 }
211
212 alert(response);
213 });
214 }
215 }
216
217 jQuery(document).ready(function($){
218 <?php if ( "params" != $current ) : ?>
219 $('.wpp_boxes:visible').css({
220 display: 'inline',
221 float: 'left'
222 }).width( $('.wpp_boxes:visible').parent().width() - $('.wpp_box').outerWidth() - 15 );
223
224 $(window).on('resize', function(){
225 $('.wpp_boxes:visible').css({
226 display: 'inline',
227 float: 'left'
228 }).width( $('.wpp_boxes:visible').parent().width() - $('.wpp_box').outerWidth() - 15 );
229 });
230 <?php else: ?>
231 $('.wpp_box').hide();
232 <?php endif; ?>
233 });
234 </script>
235
236 <div class="wrap">
237 <div id="icon-options-general" class="icon32"><br /></div>
238 <h2>WordPress Popular Posts</h2>
239
240 <h2 class="nav-tab-wrapper">
241 <?php
242 // build tabs
243 $tabs = array(
244 'stats' => __('Stats', $this->plugin_slug),
245 'tools' => __('Tools', $this->plugin_slug),
246 'params' => __('Parameters', $this->plugin_slug),
247 'about' => __('About', $this->plugin_slug)
248 );
249 foreach( $tabs as $tab => $name ){
250 $class = ( $tab == $current ) ? ' nav-tab-active' : '';
251 echo "<a class='nav-tab$class' href='?page=wordpress-popular-posts&tab=$tab'>$name</a>";
252 }
253 ?>
254 </h2>
255
256 <!-- Start stats -->
257 <div id="wpp_stats" class="wpp_boxes"<?php if ( "stats" == $current ) {?> style="display:block;"<?php } ?>>
258 <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>
259
260 <div class="tablenav top">
261 <div class="alignleft actions">
262 <form action="" method="post" id="wpp_stats_options" name="wpp_stats_options">
263 <select name="stats_order">
264 <option <?php if ($this->user_settings['stats']['order_by'] == "comments") {?>selected="selected"<?php } ?> value="comments"><?php _e("Order by comments", $this->plugin_slug); ?></option>
265 <option <?php if ($this->user_settings['stats']['order_by'] == "views") {?>selected="selected"<?php } ?> value="views"><?php _e("Order by views", $this->plugin_slug); ?></option>
266 <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>
267 </select>
268 <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" />
269 <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" />
270 <input type="hidden" name="section" value="stats" />
271 <input type="submit" class="button-secondary action" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
272
273 <div class="clear"></div>
274 <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>
275
276 <?php wp_nonce_field( 'wpp-update-stats-options', 'wpp-admin-token' ); ?>
277 </form>
278 </div>
279 </div>
280 <div class="clear"></div>
281 <br />
282 <div id="wpp-stats-tabs">
283 <a href="#" class="button-primary" rel="wpp-daily"><?php _e("Last 24 hours", $this->plugin_slug); ?></a>
284 <a href="#" class="button-secondary" rel="wpp-weekly"><?php _e("Last 7 days", $this->plugin_slug); ?></a>
285 <a href="#" class="button-secondary" rel="wpp-monthly"><?php _e("Last 30 days", $this->plugin_slug); ?></a>
286 <a href="#" class="button-secondary" rel="wpp-all"><?php _e("All-time", $this->plugin_slug); ?></a>
287 </div>
288 <div id="wpp-stats-canvas">
289 <div class="wpp-stats wpp-stats-active" id="wpp-daily">
290 <?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'] . "]"); ?>
291 </div>
292 <div class="wpp-stats" id="wpp-weekly">
293 <?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'] . "]"); ?>
294 </div>
295 <div class="wpp-stats" id="wpp-monthly">
296 <?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'] . "]"); ?>
297 </div>
298 <div class="wpp-stats" id="wpp-all">
299 <?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'] . "]"); ?>
300 </div>
301 </div>
302 </div>
303 <!-- End stats -->
304
305 <!-- Start tools -->
306 <div id="wpp_tools" class="wpp_boxes"<?php if ( "tools" == $current ) {?> style="display:block;"<?php } ?>>
307
308 <h3 class="wmpp-subtitle"><?php _e("Thumbnails", $this->plugin_slug); ?></h3>
309 <form action="" method="post" id="wpp_thumbnail_options" name="wpp_thumbnail_options">
310 <table class="form-table">
311 <tbody>
312 <tr valign="top">
313 <th scope="row"><label for="thumb_default"><?php _e("Default thumbnail", $this->plugin_slug); ?>:</label></th>
314 <td>
315 <div id="thumb-review">
316 <img src="<?php echo $this->user_settings['tools']['thumbnail']['default']; ?>" alt="" border="0" />
317 </div>
318 <input id="upload_thumb_button" type="button" class="button" value="<?php _e( "Upload thumbnail", $this->plugin_slug ); ?>" />
319 <input type="hidden" id="upload_thumb_src" name="upload_thumb_src" value="" />
320 <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>
321 </td>
322 </tr>
323 <tr valign="top">
324 <th scope="row"><label for="thumb_source"><?php _e("Pick image from", $this->plugin_slug); ?>:</label></th>
325 <td>
326 <select name="thumb_source" id="thumb_source">
327 <option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "featured") {?>selected="selected"<?php } ?> value="featured"><?php _e("Featured image", $this->plugin_slug); ?></option>
328 <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>
329 <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>
330 <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>
331 </select>
332 <br />
333 <p class="description"><?php _e("Tell WordPress Popular Posts where it should get thumbnails from", $this->plugin_slug); ?>.</p>
334 </td>
335 </tr>
336 <tr valign="top" <?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field">
337 <th scope="row"><label for="thumb_field"><?php _e("Custom field name", $this->plugin_slug); ?>:</label></th>
338 <td>
339 <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 } ?> />
340 </td>
341 </tr>
342 <tr valign="top" <?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field_resize">
343 <th scope="row"><label for="thumb_field_resize"><?php _e("Resize image from Custom field?", $this->plugin_slug); ?>:</label></th>
344 <td>
345 <select name="thumb_field_resize" id="thumb_field_resize">
346 <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>
347 <option <?php if ( $this->user_settings['tools']['thumbnail']['resize'] == 1 ) {?>selected="selected"<?php } ?> value="1"><?php _e("Yes", $this->plugin_slug); ?></option>
348 </select>
349 </td>
350 </tr>
351 <tr valign="top">
352 <th scope="row"><label for="thumb_responsive"><?php _e("Responsive support", $this->plugin_slug); ?>:</label></th>
353 <td>
354 <select name="thumb_responsive" id="thumb_responsive">
355 <option <?php if ($this->user_settings['tools']['thumbnail']['responsive']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
356 <option <?php if (!$this->user_settings['tools']['thumbnail']['responsive']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
357 </select>
358 <br />
359 <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>
360 </td>
361 </tr>
362 <?php
363 $wp_upload_dir = wp_upload_dir();
364 if ( is_dir( $wp_upload_dir['basedir'] . "/" . $this->plugin_slug ) ) :
365 ?>
366 <tr valign="top">
367 <th scope="row"></th>
368 <td>
369 <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()" />
370 <p class="description"><?php _e("Use this button to clear WPP's thumbnails cache", $this->plugin_slug); ?>.</p>
371 </td>
372 </tr>
373 <?php
374 endif;
375 ?>
376 <tr valign="top">
377 <td colspan="2">
378 <input type="hidden" name="section" value="thumb" />
379 <input type="submit" class="button-secondary action" id="btn_th_ops" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
380 </td>
381 </tr>
382 </tbody>
383 </table>
384
385 <?php wp_nonce_field( 'wpp-update-thumbnail-options', 'wpp-admin-token' ); ?>
386 </form>
387 <br />
388 <p style="display:block; float:none; clear:both">&nbsp;</p>
389
390 <h3 class="wmpp-subtitle"><?php _e("Data", $this->plugin_slug); ?></h3>
391 <form action="" method="post" id="wpp_ajax_options" name="wpp_ajax_options">
392 <table class="form-table">
393 <tbody>
394 <tr valign="top">
395 <th scope="row"><label for="log_option"><?php _e("Log views from", $this->plugin_slug); ?>:</label></th>
396 <td>
397 <select name="log_option" id="log_option">
398 <option <?php if ($this->user_settings['tools']['log']['level'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Visitors only", $this->plugin_slug); ?></option>
399 <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>
400 <option <?php if ($this->user_settings['tools']['log']['level'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Everyone", $this->plugin_slug); ?></option>
401 </select>
402 <br />
403 </td>
404 </tr>
405 <tr valign="top">
406 <th scope="row"><label for="log_limit"><?php _e("Log limit", $this->plugin_slug); ?>:</label></th>
407 <td>
408 <select name="log_limit" id="log_limit">
409 <option <?php if ($this->user_settings['tools']['log']['limit'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
410 <option <?php if ($this->user_settings['tools']['log']['limit'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Keep data for", $this->plugin_slug); ?></option>
411 </select>
412
413 <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>
414
415 <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>
416
417 <br<?php echo ($this->user_settings['tools']['log']['limit'] == 1) ? ' style="display:none;"' : ''; ?> />
418 </td>
419 </tr>
420 <tr valign="top">
421 <th scope="row"><label for="ajax"><?php _e("Ajaxify widget", $this->plugin_slug); ?>:</label></th>
422 <td>
423 <select name="ajax" id="ajax">
424 <option <?php if (!$this->user_settings['tools']['ajax']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
425 <option <?php if ($this->user_settings['tools']['ajax']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
426 </select>
427
428 <br />
429 <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>
430 </td>
431 </tr>
432 <tr valign="top">
433 <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>
434 <td>
435 <select name="cache" id="cache">
436 <option <?php if ( !$this->user_settings['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Never cache", $this->plugin_slug); ?></option>
437 <option <?php if ( $this->user_settings['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enable caching", $this->plugin_slug); ?></option>
438 </select>
439
440 <br />
441 <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>
442 </td>
443 </tr>
444 <tr valign="top" <?php if ( !$this->user_settings['tools']['cache']['active'] ) { ?>style="display:none;"<?php } ?> id="cache_refresh_interval">
445 <th scope="row"><label for="cache_interval_value"><?php _e("Refresh cache every", $this->plugin_slug); ?>:</label></th>
446 <td>
447 <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">
448 <select name="cache_interval_time" id="cache_interval_time">
449 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "minute") {?>selected="selected"<?php } ?> value="minute"><?php _e("Minute(s)", $this->plugin_slug); ?></option>
450 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "hour") {?>selected="selected"<?php } ?> value="hour"><?php _e("Hour(s)", $this->plugin_slug); ?></option>
451 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "day") {?>selected="selected"<?php } ?> value="day"><?php _e("Day(s)", $this->plugin_slug); ?></option>
452 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "week") {?>selected="selected"<?php } ?> value="week"><?php _e("Week(s)", $this->plugin_slug); ?></option>
453 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "month") {?>selected="selected"<?php } ?> value="month"><?php _e("Month(s)", $this->plugin_slug); ?></option>
454 <option <?php if ($this->user_settings['tools']['cache']['interval']['time'] == "year") {?>selected="selected"<?php } ?> value="month"><?php _e("Year(s)", $this->plugin_slug); ?></option>
455 </select>
456 <br />
457 <p class="description" style="display:none;" id="cache_too_long"><?php _e("Really? That long?", $this->plugin_slug); ?></p>
458 </td>
459 </tr>
460 <tr valign="top">
461 <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>
462 <td>
463 <select name="sampling" id="sampling">
464 <option <?php if ( !$this->user_settings['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
465 <option <?php if ( $this->user_settings['tools']['sampling']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
466 </select>
467
468 <br />
469 <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>
470 </td>
471 </tr>
472 <tr valign="top" <?php if ( !$this->user_settings['tools']['sampling']['active'] ) { ?>style="display:none;"<?php } ?>>
473 <th scope="row"><label for="sample_rate"><?php _e("Sample Rate", $this->plugin_slug); ?>:</label></th>
474 <td>
475 <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">
476 <br />
477 <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>
478 </td>
479 </tr>
480 <tr valign="top">
481 <td colspan="2">
482 <input type="hidden" name="section" value="data" />
483 <input type="submit" class="button-secondary action" id="btn_ajax_ops" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
484 </td>
485 </tr>
486 </tbody>
487 </table>
488
489 <?php wp_nonce_field( 'wpp-update-data-options', 'wpp-admin-token' ); ?>
490 </form>
491 <br />
492 <p style="display:block; float:none; clear:both">&nbsp;</p>
493
494 <h3 class="wmpp-subtitle"><?php _e("Miscellaneous", $this->plugin_slug); ?></h3>
495 <form action="" method="post" id="wpp_link_options" name="wpp_link_options">
496 <table class="form-table">
497 <tbody>
498 <tr valign="top">
499 <th scope="row"><label for="link_target"><?php _e("Open links in", $this->plugin_slug); ?>:</label></th>
500 <td>
501 <select name="link_target" id="link_target">
502 <option <?php if ( $this->user_settings['tools']['link']['target'] == '_self' ) {?>selected="selected"<?php } ?> value="_self"><?php _e("Current window", $this->plugin_slug); ?></option>
503 <option <?php if ( $this->user_settings['tools']['link']['target'] == '_blank' ) {?>selected="selected"<?php } ?> value="_blank"><?php _e("New tab/window", $this->plugin_slug); ?></option>
504 </select>
505 <br />
506 </td>
507 </tr>
508 <tr valign="top">
509 <th scope="row"><label for="css"><?php _e("Use plugin's stylesheet", $this->plugin_slug); ?>:</label></th>
510 <td>
511 <select name="css" id="css">
512 <option <?php if ($this->user_settings['tools']['css']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", $this->plugin_slug); ?></option>
513 <option <?php if (!$this->user_settings['tools']['css']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", $this->plugin_slug); ?></option>
514 </select>
515 <br />
516 <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>
517 </td>
518 </tr>
519 <tr valign="top">
520 <td colspan="2">
521 <input type="hidden" name="section" value="misc" />
522 <input type="submit" class="button-secondary action" value="<?php _e("Apply", $this->plugin_slug); ?>" name="" />
523 </td>
524 </tr>
525 </tbody>
526 </table>
527
528 <?php wp_nonce_field( 'wpp-update-misc-options', 'wpp-admin-token' ); ?>
529 </form>
530 <br />
531 <p style="display:block; float:none; clear:both">&nbsp;</p>
532
533 <br /><br />
534
535 <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>
536 <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>
537 <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>
538 </div>
539 <!-- End tools -->
540
541 <!-- Start params -->
542 <div id="wpp_params" class="wpp_boxes"<?php if ( "params" == $current ) {?> style="display:block;"<?php } ?>>
543 <div>
544 <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),
545 admin_url('options-general.php?page=wordpress-popular-posts&tab=faq#template-tags'),
546 admin_url('options-general.php?page=wordpress-popular-posts&tab=faq#shortcode')
547 ); ?></p>
548 <br />
549 <table cellspacing="0" class="wp-list-table widefat fixed posts">
550 <thead>
551 <tr>
552 <th class="manage-column column-title"><?php _e('Parameter', $this->plugin_slug); ?></th>
553 <th class="manage-column column-title"><?php _e('What it does ', $this->plugin_slug); ?></th>
554 <th class="manage-column column-title"><?php _e('Possible values', $this->plugin_slug); ?></th>
555 <th class="manage-column column-title"><?php _e('Defaults to', $this->plugin_slug); ?></th>
556 <th class="manage-column column-title"><?php _e('Example', $this->plugin_slug); ?></th>
557 </tr>
558 </thead>
559 <tbody>
560 <tr>
561 <td><strong>header</strong></td>
562 <td><?php _e('Sets a heading for the list', $this->plugin_slug); ?></td>
563 <td><?php _e('Text string', $this->plugin_slug); ?></td>
564 <td><?php _e('None', $this->plugin_slug); ?></td>
565 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'header' => 'Popular Posts'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
566 </tr>
567 <tr class="alternate">
568 <td><strong>header_start</strong></td>
569 <td><?php _e('Set the opening tag for the heading of the list', $this->plugin_slug); ?></td>
570 <td><?php _e('Text string', $this->plugin_slug); ?></td>
571 <td>&lt;h2&gt;</td>
572 <td>&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;</td>
573 </tr>
574 <tr>
575 <td><strong>header_end</strong></td>
576 <td><?php _e('Set the closing tag for the heading of the list', $this->plugin_slug); ?></td>
577 <td><?php _e('Text string', $this->plugin_slug); ?></td>
578 <td>&lt;/h2&gt;</td>
579 <td>&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;</td>
580 </tr>
581 <tr class="alternate">
582 <td><strong>limit</strong></td>
583 <td><?php _e('Sets the maximum number of popular posts to be shown on the listing', $this->plugin_slug); ?></td>
584 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
585 <td>10</td>
586 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'limit' => 5<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
587 </tr>
588 <tr>
589 <td><strong>range</strong></td>
590 <td><?php _e('Tells WordPress Popular Posts to retrieve the most popular entries within the time range specified by you', $this->plugin_slug); ?></td>
591 <td>"daily", "weekly", "monthly", "all"</td>
592 <td>daily</td>
593 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'range' => 'weekly'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
594 </tr>
595 <tr class="alternate">
596 <td><strong>freshness</strong></td>
597 <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>
598 <td>1 (true), 0 (false)</td>
599 <td>0</td>
600 <td>&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;</td>
601 </tr>
602 <tr>
603 <td><strong>order_by</strong></td>
604 <td><?php _e('Sets the sorting option of the popular posts', $this->plugin_slug); ?></td>
605 <td>"comments", "views", "avg" <?php _e('(for average views per day)', $this->plugin_slug); ?></td>
606 <td>views</td>
607 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'order_by' => 'comments'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
608 </tr>
609 <tr class="alternate">
610 <td><strong>post_type</strong></td>
611 <td><?php _e('Defines the type of posts to show on the listing', $this->plugin_slug); ?></td>
612 <td><?php _e('Text string', $this->plugin_slug); ?></td>
613 <td>post,page</td>
614 <td>&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;</td>
615 </tr>
616 <tr>
617 <td><strong>pid</strong></td>
618 <td><?php _e('If set, WordPress Popular Posts will exclude the specified post(s) ID(s) form the listing.', $this->plugin_slug); ?></td>
619 <td><?php _e('Text string', $this->plugin_slug); ?></td>
620 <td><?php _e('None', $this->plugin_slug); ?></td>
621 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'pid' => '60,25,31'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
622 </tr>
623 <tr class="alternate">
624 <td><strong>cat</strong></td>
625 <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>
626 <td><?php _e('Text string', $this->plugin_slug); ?></td>
627 <td><?php _e('None', $this->plugin_slug); ?></td>
628 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'cat' => '1,55,-74'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
629 </tr>
630 <tr>
631 <td><strong>author</strong></td>
632 <td><?php _e('If set, WordPress Popular Posts will retrieve all entries created by specified author(s) ID(s).', $this->plugin_slug); ?></td>
633 <td><?php _e('Text string', $this->plugin_slug); ?></td>
634 <td><?php _e('None', $this->plugin_slug); ?></td>
635 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'author' => '75,8,120'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
636 </tr>
637 <tr class="alternate">
638 <td><strong>title_length</strong></td>
639 <td><?php _e('If set, WordPress Popular Posts will shorten each post title to "n" characters whenever possible', $this->plugin_slug); ?></td>
640 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
641 <td>25</td>
642 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'title_length' => 25<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
643 </tr>
644 <tr>
645 <td><strong>title_by_words</strong></td>
646 <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>
647 <td>1 (true), (0) false</td>
648 <td>0</td>
649 <td>&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;</td>
650 </tr>
651 <tr class="alternate">
652 <td><strong>excerpt_length</strong></td>
653 <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>
654 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
655 <td>0</td>
656 <td>&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} {summary}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
657 </tr>
658 <tr>
659 <td><strong>excerpt_format</strong></td>
660 <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>
661 <td>1 (true), (0) false</td>
662 <td>0</td>
663 <td>&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} {summary}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
664 </tr>
665 <tr class="alternate">
666 <td><strong>excerpt_by_words</strong></td>
667 <td><?php _e('If set to 1, WordPress Popular Posts will shorten the excerpt to "n" words instead of characters', $this->plugin_slug); ?></td>
668 <td>1 (true), (0) false</td>
669 <td>0</td>
670 <td>&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} {summary}&lt;/li&gt;'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
671 </tr>
672 <tr>
673 <td><strong>thumbnail_width</strong></td>
674 <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>
675 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
676 <td>0</td>
677 <td>&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;</td>
678 </tr>
679 <tr class="alternate">
680 <td><strong>thumbnail_height</strong></td>
681 <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>
682 <td><?php _e('Positive integer', $this->plugin_slug); ?></td>
683 <td>0</td>
684 <td>&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;</td>
685 </tr>
686 <tr>
687 <td><strong>rating</strong></td>
688 <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>
689 <td>1 (true), (0) false</td>
690 <td>0</td>
691 <td>&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;</td>
692 </tr>
693 <tr class="alternate">
694 <td><strong>stats_comments</strong></td>
695 <td><?php _e('If set, WordPress Popular Posts will show how many comments each popular post has got until now', $this->plugin_slug); ?></td>
696 <td>1 (true), 0 (false)</td>
697 <td>0</td>
698 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_comments' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
699 </tr>
700 <tr>
701 <td><strong>stats_views</strong></td>
702 <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>
703 <td>1 (true), (0) false</td>
704 <td>1</td>
705 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_views' => 0<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
706 </tr>
707 <tr class="alternate">
708 <td><strong>stats_author</strong></td>
709 <td><?php _e('If set, WordPress Popular Posts will show who published each popular post on the list', $this->plugin_slug); ?></td>
710 <td>1 (true), (0) false</td>
711 <td>0</td>
712 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_author' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
713 </tr>
714 <tr>
715 <td><strong>stats_date</strong></td>
716 <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>
717 <td>1 (true), (0) false</td>
718 <td>0</td>
719 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_date' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
720 </tr>
721 <tr class="alternate">
722 <td><strong>stats_date_format</strong></td>
723 <td><?php _e('Sets the date format', $this->plugin_slug); ?></td>
724 <td><?php _e('Text string', $this->plugin_slug); ?></td>
725 <td>0</td>
726 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_date_format' => 'F j, Y'<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
727 </tr>
728 <tr>
729 <td><strong>stats_category</strong></td>
730 <td><?php _e('If set, WordPress Popular Posts will display the category', $this->plugin_slug); ?></td>
731 <td>1 (true), (0) false</td>
732 <td>0</td>
733 <td>&lt;?php<br />$args = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;'stats_category' => 1<br />);<br /><br />wpp_get_mostpopular( $args );<br />?&gt;</td>
734 </tr>
735 <tr class="alternate">
736 <td><strong>wpp_start</strong></td>
737 <td><?php _e('Sets the opening tag for the listing', $this->plugin_slug); ?></td>
738 <td><?php _e('Text string', $this->plugin_slug); ?></td>
739 <td>&lt;ul&gt;</td>
740 <td>&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;</td>
741 </tr>
742 <tr>
743 <td><strong>wpp_end</strong></td>
744 <td><?php _e('Sets the closing tag for the listing', $this->plugin_slug); ?></td>
745 <td><?php _e('Text string', $this->plugin_slug); ?></td>
746 <td>&lt;/ul&gt;</td>
747 <td>&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;</td>
748 </tr>
749 <tr class="alternate">
750 <td><strong>post_html</strong></td>
751 <td><?php _e('Sets the HTML structure of each post', $this->plugin_slug); ?></td>
752 <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>
753 <td>&lt;li&gt;{thumb} {title} {stats}&lt;/li&gt;</td>
754 <td>&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;</td>
755 </tr>
756 </tbody>
757 </table>
758 </div>
759 </div>
760 <!-- End params -->
761
762 <!-- Start about -->
763 <div id="wpp_faq" class="wpp_boxes"<?php if ( "about" == $current ) {?> style="display:block;"<?php } ?>>
764
765 <h3><?php echo sprintf( __('About WordPress Popular Posts %s', $this->plugin_slug), $this->version); ?></h3>
766 <p><?php _e( 'This version includes the following changes', $this->plugin_slug ); ?>:</p>
767
768 <ul>
769 <li>Attempt to convert tables to InnoDB during upgrade if other engine is being used.</li>
770 <li>Adds a check to prevent the upgrade process from running too many times.</li>
771 <li>Minor improvements and bug fixes.</li>
772 <li>Documentation updated.</li>
773 </ul>
774
775 </div>
776 <!-- End about -->
777
778 <div id="wpp_donate" class="wpp_box" style="">
779 <h3 style="margin-top:0; text-align:center;"><?php _e('Do you like this plugin?', $this->plugin_slug); ?></h3>
780 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
781 <input type="hidden" name="cmd" value="_s-xclick">
782 <input type="hidden" name="hosted_button_id" value="RP9SK8KVQHRKS">
783 <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;">
784 <img alt="" border="0" src="//www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
785 </form>
786 <p><?php _e( 'Each donation motivates me to keep releasing free stuff for the WordPress community!', $this->plugin_slug ); ?></p>
787 <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>
788 </div>
789
790 <div id="wpp_advertisement" class="wpp_box" style=""></div>
791
792 <div id="wpp_support" class="wpp_box" style="">
793 <h3 style="margin-top:0; text-align:center;"><?php _e('Need help?', $this->plugin_slug); ?></h3>
794 <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>
795 <p><?php _e('Let\'s make this plugin even better!', $this->plugin_slug); ?></p>
796 </div>
797
798 </div>