Commit 245146c8 authored by lucha's avatar lucha
Browse files

[auto] Plugin: wordpress-popular-posts 3.1.1

parent 2d242a9c
......@@ -34,6 +34,9 @@ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
// delete tables
uninstall();
// delete thumbnails cache and its directory
delete_thumb_cache();
}
......@@ -41,6 +44,7 @@ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
switch_to_blog( $original_blog_id );
} else {
// Delete plugin's options
delete_option( 'wpp_ver' );
delete_option( 'wpp_settings_config' );
......@@ -49,6 +53,29 @@ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
// delete tables
uninstall();
// delete thumbnails cache and its directory
delete_thumb_cache();
}
function delete_thumb_cache() {
$wp_upload_dir = wp_upload_dir();
if ( is_dir( $wp_upload_dir['basedir'] . "/wordpress-popular-posts" ) ) {
$files = glob( $wp_upload_dir['basedir'] . "/wordpress-popular-posts/*" ); // get all file names
if ( is_array($files) && !empty($files) ) {
foreach($files as $file){ // iterate files
if ( is_file($file) )
@unlink($file); // delete file
}
}
// Finally, delete wpp's upload directory
@rmdir( $wp_upload_dir['basedir'] . "/wordpress-popular-posts" );
}
}
function uninstall(){
......
......@@ -95,7 +95,7 @@
<div style="display:<?php if ($instance['stats_tag']['date']['active']) : ?>block<?php else: ?>none<?php endif; ?>; width:90%; margin:10px 0; padding:3% 5%; background:#f5f5f5;">
<legend><strong><?php _e('Date Format', 'wordpress-popular-posts'); ?></strong></legend><br />
<label title='<?php echo get_option('date_format'); ?>'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='<?php echo get_option('date_format'); ?>' <?php echo ($instance['stats_tag']['date']['format'] == get_option('date_format')) ? 'checked="checked"' : ''; ?> /><?php echo date_i18n(get_option('date_format'), time()); ?></label> <small>(<a href="<?php echo admin_url('options-general.php'); ?>" title="<?php _e('Wordpress Date Format', 'wordpress-popular-posts'); ?>" target="_blank"><?php _e('Wordpress Date Format', 'wordpress-popular-posts'); ?></a>)</small><br />
<label title='<?php echo get_option('date_format'); ?>'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='<?php echo get_option('date_format'); ?>' <?php echo ($instance['stats_tag']['date']['format'] == get_option('date_format')) ? 'checked="checked"' : ''; ?> /><?php echo date_i18n(get_option('date_format'), time()); ?></label> <small>(<a href="<?php echo admin_url('options-general.php'); ?>" title="<?php _e('WordPress Date Format', 'wordpress-popular-posts'); ?>" target="_blank"><?php _e('WordPress Date Format', 'wordpress-popular-posts'); ?></a>)</small><br />
<label title='F j, Y'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='F j, Y' <?php echo ($instance['stats_tag']['date']['format'] == 'F j, Y') ? 'checked="checked"' : ''; ?> /><?php echo date_i18n('F j, Y', time()); ?></label><br />
<label title='Y/m/d'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='Y/m/d' <?php echo ($instance['stats_tag']['date']['format'] == 'Y/m/d') ? 'checked="checked"' : ''; ?> /><?php echo date_i18n('Y/m/d', time()); ?></label><br />
<label title='m/d/Y'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='m/d/Y' <?php echo ($instance['stats_tag']['date']['format'] == 'm/d/Y') ? 'checked="checked"' : ''; ?> /><?php echo date_i18n('m/d/Y', time()); ?></label><br />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment