Plugin Directory

Changeset 470181


Ignore:
Timestamp:
12/02/2011 10:59:59 AM (14 years ago)
Author:
allarem
Message:

update to 2.1.1

Location:
revision-cleaner/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • revision-cleaner/trunk/readme.txt

    r469862 r470181  
    44Requires at least: 3.1
    55Tested up to: 3.2
    6 Stable tag: 2.1
     6Stable tag: 2.1.1
    77License: GPLv2 or later
    88
     
    24243. Each user can set their own clean interval in Personal Profile.
    2525
    26 == Frequently Asked Questions ==
    27 
    28 = How can I set my Interval =
    29 A:In your personal profile.
    3026
    3127
     
    3531 after you've translated it please send it to wordpress(at)mengzhuo.org, and attach with po file name by what your language called in English.
    3632
    37 = Acknowledge =
     33== Changelog ==
    3834
    39 == Changelog ==
     35= 2.1.1 =
     36* Add:delete the old setting while not valid
     37* Fixed:the bug http://wordpress.org/support/topic/plugin-revision-cleaner-can-activate-the-plugin
    4038
    4139= 2.1 =
  • revision-cleaner/trunk/revision-cleaner.php

    r469862 r470181  
    77Plugin URI: http://wordpress.org/extend/plugins/revision-cleaner/
    88Description: Auto clean your revisions while you don't needed any more
    9 Version: 2.1
     9Version: 2.1.1
    1010Author: Meng Zhuo
    1111Author URI: http://mengzhuo.org
     
    2929*/
    3030//definition goes here...
    31 define('REVISION_CLEANER_VERSION', '2.1');
     31define('REVISION_CLEANER_VERSION', '2.1.1');
    3232define('REVISION_CLEANER_NAME','revision-cleaner');
    3333define('RevC_DEBUG',FALSE);
     
    5757            $Revis_Setting["neo_id"] = $admin_list[0]->ID;
    5858        }
    59         return $Revis_Setting['neo_id'];
     59        if ( isset($Revis_Setting["neo_id"]) && $Revis_Setting["neo_id"] > 0   ){
     60            return $Revis_Setting['neo_id'];
     61        }
     62        else{
     63            return 1;
     64        }
     65       
    6066    }
    6167   
     
    6369       
    6470        $neo_id = Revis_get_neo_id();
    65 
     71       
     72       
    6673        $neo_setting = get_user_meta($neo_id,'Revis_Setting');
    6774        if (isset($neo_setting[0])){
     
    8794            }
    8895            else{
    89                 if ( update_user_meta( $neo_id, 'Revis_Setting', $neo_setting) )
    90                     return TRUE;
    91             }
    92 
    93         }
    94         Revis_crazy_type(5,__FUNCTION__);
     96                if ( update_user_meta( $neo_id, 'Revis_Setting', $neo_setting) ){
     97                        return TRUE;
     98                    }
     99            }
     100
     101        }
     102        Revis_crazy_type(5,__FUNCTION__.'$neo_id='.$neo_id);
    95103    }
    96104   
     
    245253    }
    246254   
     255    function Revis_check_setting($global_setting){
     256        if (is_array($global_setting)){
     257            extract($global_setting);
     258            if (isset($neo_id) && $neo_id > 0 ){
     259                return TRUE;
     260            }
     261        }
     262        return FALSE;
     263    }
     264   
    247265    function Revis_Cleaner() {
    248266   
     
    250268    $global_setting = get_option('Revis_Setting');
    251269           
    252         if ($global_setting){
     270        if ( $global_setting && Revis_check_setting($global_setting ) ){
    253271
    254272            global $wpdb,$current_user;
    255            
    256             //----For those users immigrant from 1.2----
    257            
    258             if (get_option('Revis_ctop') != FALSE ){
    259                     //get what is set in old version
    260                     $revis_interval = get_option('Revis_interval');
    261                     $revis_keeplast = get_option('Revis_keeplast');
    262                     $revis_ddr = get_option('Revis_delete_draft_revision');
    263                    
    264                     // update it into new form
    265                     $admin_setting_array = array(
    266                         'interval' => $revis_interval,
    267                         'keep_draft_revision' => TRUE
    268                     );
    269                     update_user_meta( 1, 'Revis_Setting', $user_settting_array );
    270                    
    271                     //delete the old version's data
    272                     delete_option('Revis_interval');
    273                     delete_option('Revis_ctop');
    274                     delete_option('Revis_keeplast');
    275                     delete_option('Revis_ctop');
    276                    
    277                     //set new Setting, default multi_user is FALSE
    278                     $initial_array = array(
    279                         'multi_user' => FALSE,
    280                         'version' => REVISION_CLEANER_VERSION
    281                     );
    282                     add_option('Revis_Setting',$initial_array,'','no');
    283                    
    284                     //initial other user's setting
    285                     $wp_user_search = new WP_User_Query( array( 'exclude'=>array('id'=>1) ) );
    286                     $authors = $wp_user_search->get_results();
    287                     if ($authors[0]->ID != 1){
    288                         foreach ( $authors as $author){
    289                             Revis_update_author($author->ID,FALSE,TRUE);
    290                         }
    291                     }
    292                     else{
    293                         Revis_crazy_type(6,__FUNCTION__);
    294                     }
    295             }
    296             //-----immigrant block end-----
    297273           
    298274
     
    339315                    'neo_id' => $neo_id
    340316                    );
     317            delete_option('Revis_Setting');
     318            delete_option('Revis_Cleaned');
    341319            add_option('Revis_Setting',$initial_array,'','no');
    342320            add_option('Revis_Cleaned',0,'','no');
Note: See TracChangeset for help on using the changeset viewer.