Plugin Directory

Changeset 130677


Ignore:
Timestamp:
06/30/2009 04:49:39 AM (17 years ago)
Author:
gohsy
Message:
 
Location:
delete-revision
Files:
9 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • delete-revision/trunk/changelog.txt

    r75584 r130677  
     12009-06-30  v1.3
     2            Increased the database maintenance and the optimization
     3            增加数据库状态检测和修复优化
     4
    152008-11-24  v1.2
    26            An increase of the international language support
    3             Ôö¼Ó¹ú¼Ê»¯ÓïÑÔÖ§³Ö
     7            增加国际化语言支持
    48
    592008-11-24  v1.1
    610            Fix bugs cann't runat where the datebase name is not the default "wp-*" and some description.
    7             ÐÞ¸´ÁËÒòÊý¾Ý¿âÃû³ÆÇ°×º·ÇĬÈϵÄ"wp-*"ʱµÄÔËÐдíÎóºÍ×ÊÁÏÖÐ˵Ã÷ÖÐÊý×ÖÎÊÌâ¡£
     11            修复了因数据库名称前缀非默认的"wp-*"时的运行错误和资料中说明中数字问题。
    8122008-10-21  v1.0
    913            First public ver1.0
    10             Ê״η¢²¼1.0
     14            首次发布1.0
  • delete-revision/trunk/delete-revision-zh_CN.po

    r75584 r130677  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2008-11-24 17:51+0800\n"
    6 "PO-Revision-Date: 2008-11-24 18:27+0800\n"
    7 "Last-Translator: gohsy <igohsy@gmail.com>\n"
     6"PO-Revision-Date: 2009-06-30 12:44+0800\n"
     7"Last-Translator: gohsy.com <me@gohsy.com>\n"
    88"Language-Team: gohsy <[email protected]>\n"
    99"MIME-Version: 1.0\n"
     
    1717#: delete-revision.php:32
    1818#, php-format
    19 msgid "Now You have <span style='color:red;font-weight:bolder;'> %s </span> posts ,Up to now Delete-Revision has deteted <span style='color:red;font-weight:bolder;'> %s </span> post revision of dedundancy,it's easy . Wish happy ending !"
    20 msgstr "您已经发布了 <span style='color:red;font-weight:bolder;'> %s </span> 篇日志,截止目前,Delete-Revision 已轻松删除了 <span style='color:red;font-weight:bolder;'> %s </span>  篇冗余日志,祝您愉快!"
     19msgid "Now You have <span style='color:red;font-weight:bolder;'> %s </span> posts ,Up to now Delete-Revision has deteted <span id='revs_no' style='color:red;font-weight:bolder;'> %s </span> post revision of dedundancy,it's easy . Wish happy ending !"
     20msgstr "您已经发布了 <span style='color:red;font-weight:bolder;'> %s </span> 篇日志,截止目前,Delete-Revision 已轻松删除了 <span id='revs_no' style='color:red;font-weight:bolder;'> %s </span>  篇冗余日志,祝您愉快!"
    2121
    2222#: delete-revision.php:41
     
    2727#: delete-revision.php:51
    2828msgid "Check Redundant Revision"
    29 msgstr "检查冗余 Revision 数量"
     29msgstr "检查冗余 日志 数量"
    3030
    3131#: delete-revision.php:57
     
    6262msgstr "太棒了,您的wordpress还没有发现冗余的 revision 日志 ! <br />今天又是您美好的一天 !"
    6363
     64msgid "Optimize DataBase"
     65msgstr "执行数据库优化"
     66
     67msgid "If the Status is green <font color=green>OK</font>, then indicated that is normal, does not need any operation, please go back; If is red, then click on the following button to optimize."
     68msgstr "如果Status是绿色的<font color=green>OK</font>,则表明是正常的,不需要任何操作,请返回。如果是红色的,请点击下来的按钮执行优化。"
     69
     70msgid "Optimization of database completed."
     71msgstr "优化数据库操作完成!"
     72
     73msgid "Database Optimization"
     74msgstr "检测数据库和优化"
     75
  • delete-revision/trunk/delete-revision.php

    r75584 r130677  
    55Description: Delete revision post from Database,let us now to drop Redundancy, lose weight !
    66Author: gohsy
    7 Version: 1.2
     7Version: 1.3
    88Author URI: http://gohsy.com
    99*/
     
    1111/*
    1212Changelog
     13
     142009-06-30  v1.3
     15            Increased the database maintenance and the optimization
     16            Ôö¼ÓÊý¾Ý¿â״̬¼ì²âºÍÐÞ¸´ÓÅ»¯
    1317
    14182008-11-24  v1.2
     
    4145
    4246function my_options_delete_revision() {
    43     $dr_ver = 1.1;
     47    $dr_ver = 1.3;
    4448    $get_my_posts = get_my_posts();
    4549    $del_revision_no = get_option('del_revision_no');
     
    4751    <div class="wrap">
    4852        <h2>Delete-revision Manager  <font size=1>ver $dr_ver</font></h2>
    49         <div style="padding:5px 0;border:1px dashed #80B5D0;padding:10px;background:#E4F2FD;margin:15px 0;">
     53        <div class="widget"><p style="margin:10px;">
    5054EOT;
    51         printf(__("Now You have <span style='color:red;font-weight:bolder;'> %s </span> posts ,Up to now Delete-Revision has deteted <span style='color:red;font-weight:bolder;'> %s </span> post revision of dedundancy,it's easy . Wish happy ending !",'delete-revision'), $get_my_posts,$del_revision_no);
    52         echo '</div>';
    53 
    54        
     55        printf(__("Now You have <span style='color:red;font-weight:bolder;'> %s </span> posts ,Up to now Delete-Revision has deteted <span id='revs_no' style='color:red;font-weight:bolder;'> %s </span> post revision of dedundancy,it's easy . Wish happy ending !",'delete-revision'), $get_my_posts,$del_revision_no);
     56        echo '</p></div>';
     57
    5558    if (isset($_POST['del_act'])) {
    5659        delete_revision_act();
     
    5962        echo '<div class="updated" style="margin-top:50px;"><p><strong>';
    6063        printf(__("Deleted <span style='color:red;font-weight:bolder;'> %s </span> redundancy posts !",'delete-revision'),$del_no);
    61         echo '</strong></p></div></div>';
     64        echo "</strong></p></div></div><script>
     65        var del_no = document.getElementById('revs_no').innerHTML;
     66        document.getElementById('revs_no').innerHTML = Number(del_no)+ $del_no;
     67        </script>";
    6268    }
    6369    elseif (isset($_POST['get_rev'])) {
     
    6571       
    6672    }
     73    elseif (isset($_POST['maintain_mysql'])) {
     74        if ($_POST['operation'] == 'OPTIMIZE' ) {echo maintain_mysql('OPTIMIZE');}
     75        else echo maintain_mysql('ANALYZE');
     76    }
    6777    else {
    6878        echo '<form method="post" action="">';
    69         echo '<input type="submit" name="get_rev" value="';
     79        echo '<input class="button" type="submit" name="get_rev" value="';
    7080        _e('Check Redundant Revision','delete-revision');
     81        echo '" />  <input class="button" type="submit" name="maintain_mysql" value="';
     82        _e('Database Optimization','delete-revision');
    7183        echo '" /></form></div>';
    7284
    7385    }
    7486   
    75     echo '<div style="line-height:22px;padding:5px 0;border:1px dashed #80B5D0;padding:10px;background:#E4F2FD;margin:15px;">';
     87    echo '<br /><div class="widget"><div style="margin:12px;line-height: 1.5em;">';
    7688    _e('Revision Post is in the 2.6 version of WordPress after the automatic accession to the revised edition of the journal preservation cause, you modify a log of each, will add a revision, if you modify many times, log on the few speeches, it will be a very frightening number!','delete-revision');
    77     //echo '<br />';
    7889    _e('If you have 100 on the log, your revisiong redundancy may be as many as 1,000 articles!','delete-revision');
    7990    echo '<br />';
     
    8293    _e('Thank you for your useing. I hope this will give you convenient plug-ins!','delete-revision');
    8394    _e('Author','delete-revision');
    84     echo ':<a href="http://www.gohsy.com" target="_blank">http://www.gohsy.com</a></div>';
     95    echo ':<a href="http://www.gohsy.com" target="_blank">http://www.gohsy.com</a></div></div>';
    8596   
    8697}
     
    110121    if($results) {
    111122    $res_no = count($results);
    112     echo "<table>";
    113     echo "<tr style=\"background:#C6D9E9\"><td width=30> Id </td><td width=450> Title </td><td width=180> Post date </td><td width=180> Last modified </td></tr>";
     123    echo "<table class='widefat'><thead>";
     124    echo "<tr><th width=30> Id </th><th width=450> Title </th><th width=180> Post date </th><th width=180> Last modified </th></tr></thead>";
    114125    for($i = 0 ; $i < $res_no ; $i++) {
    115126        echo "<tr><td>".$results[$i] -> ID."</td>";
     
    123134        <input type="hidden" name="rev_no" value=" $res_no " />
    124135EOT;
    125         echo '<input type="submit" name="del_act" value="';
    126         printf(__('Yes,I would like to delete them!(A Total Of %s)','delete-revision'),$res_no);
    127         echo '" /><input type="submit" name="goback" value="';
    128         _e('No,I would not mind deleted!','delete-revision');
     136        echo '<input class="button" type="submit" name="del_act" value="';
     137        printf(__('Yes , I would like to delete them!(A Total Of %s)','delete-revision'),$res_no);
     138        echo '" /><input class="button" type="submit" name="goback" value="';
     139        _e('No , I would not mind deleted!','delete-revision');
    129140        echo '" /></form></div>';
    130141
     
    144155}
    145156
     157function maintain_mysql($operation = "ANALYZE"){
     158        global $wpdb;
     159       
     160        $Tables = $wpdb -> get_results('SHOW TABLES IN '.DB_NAME);
     161        $query = "$operation TABLE ";
     162
     163        $Tables_in_DB_NAME = 'Tables_in_'.DB_NAME;
     164        foreach($Tables as $k=>$v){
     165            $_tabName = $v -> $Tables_in_DB_NAME ;
     166           $query .= " `$_tabName`,";
     167        }
     168
     169        $query = substr($query,0,strlen($query)-1);
     170        $result = $wpdb -> get_results($query);
     171        if ($operation == "OPTIMIZE") {
     172            return '<h3>'.__('Optimization of database completed.','delete-revision').'</h3>';
     173        }
     174
     175        $res = "<table border=\"0\" class=\"widefat\">";
     176        $res .= "<thead><tr>
     177            <th>Table</th>
     178            <th>OP</th>
     179            <th>Status</th>
     180            </tr><thead>";
     181        $bgcolor = $color3;
     182        foreach($result as $j=>$o) {
     183            $res .= "<tr>";
     184            foreach ($o as $k=>$v) {
     185                $tdClass = $j%2 == 1 ? 'active alt' : 'inactive';
     186                if($k == 'Msg_type') continue;
     187                if($k == 'Msg_text' ) {
     188                    if ($v == 'OK') {
     189                    $res .= "<td class='$tdClass' ><font color='green'><b>$v</b></font></td>";
     190                    }
     191                    else {
     192                    $res .= "<td class='$tdClass' ><font color='red'><b>$v</b></font></td>";
     193                    }
     194                }
     195                else $res .= "<td class='$tdClass' >$v</td>";
     196            }
     197            $res .= "</tr>";
     198        }
     199        $res .= "<tfoot><tr><th colspan=3>".__('If the Status is green <font color=green>OK</font>, then indicated that is normal, does not need any operation, please go back; If is red, then click on the following button to optimize.','delete-revision')."</th></tr></tfoot></table>";
     200        $res .= "<br /><form method='post' action=''>
     201            <input name='operation' type='hidden' value='OPTIMIZE' />
     202            <input name='maintain_mysql' type='hidden' value='OPTIMIZE' />
     203            <input name='submit' type='submit' class='button' value='".__('Optimize DataBase','delete-revision')."' /></form>";
     204        return $res;
     205    }
     206
    146207?>
  • delete-revision/trunk/readme.txt

    r75584 r130677  
    55Tags:revision,posts,datebase,Redundancy
    66Requires at least:2.6.X
    7 Tested up to:1.2
    8 Stable tag:1.2
     7Tested up to:1.3
     8Stable tag:1.3
    99
    1010Delete revision post from Database,let us now to drop Redundancy, lose weight !
     
    3030== Contributors/Changelog ==
    3131
     322009-06-30  v1.3
     33            Increased the database maintenance and the optimization
     34            增加数据库状态检测和修复优化
     35
     36
    32372008-11-24  v1.2
    3338            An increase of the international language support
    34             Ôö¼Ó¹ú¼Ê»¯ÓïÑÔÖ§³Ö
     39            增加国际化语言支持
    3540
    36412008-11-24  v1.1
    3742            Fix bugs cann't runat where the datebase name is not the default "wp-*" and some description.
    38             ÐÞ¸´ÁËÒòÊý¾Ý¿âÃû³ÆÇ°×º·ÇĬÈϵÄ"wp-*"ʱµÄÔËÐдíÎóºÍ×ÊÁÏÖÐ˵Ã÷ÖÐÊý×ÖÎÊÌâ¡£
     43            修复了因数据库名称前缀非默认的"wp-*"时的运行错误和资料中说明中数字问题。
    39442008-10-21  v1.0
    4045            First public ver1.0
    41             Ê״η¢²¼1.0
     46            首次发布1.0
    4247           
    4348== Frequently Asked Questions ==
Note: See TracChangeset for help on using the changeset viewer.