Version Description
- First release.
=
Download this release
Release Info
| Developer | acalbert |
| Plugin | |
| Version | 1.1.0 |
| Comparing to | |
| See all releases | |
Version 1.1.0
- img/alipay_donate.png +0 -0
- img/btn_donateCC_LG.gif +0 -0
- img/paypal_32_32.jpg +0 -0
- lang/wp-clean-up-zh_CN.mo +0 -0
- lang/wp-clean-up-zh_CN.po +99 -0
- readme.txt +68 -0
- screenshot-1.png +0 -0
- wp-clean-up.php +93 -0
- wp_clean_up_admin.php +197 -0
img/alipay_donate.png
ADDED
|
Binary file
|
img/btn_donateCC_LG.gif
ADDED
|
Binary file
|
img/paypal_32_32.jpg
ADDED
|
Binary file
|
lang/wp-clean-up-zh_CN.mo
ADDED
|
Binary file
|
lang/wp-clean-up-zh_CN.po
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: WP-Clean-Up Languages\n"
|
| 4 |
+
"Report-Msgid-Bugs-To: \n"
|
| 5 |
+
"POT-Creation-Date: 2012-12-06 14:58+0800\n"
|
| 6 |
+
"PO-Revision-Date: 2012-12-06 15:03+0800\n"
|
| 7 |
+
"Last-Translator: 夜光 <berttung(#)gmail.com>\n"
|
| 8 |
+
"Language-Team: 玻璃泉BoLiQuan.COM <berttung(#)gmail.com>\n"
|
| 9 |
+
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
| 13 |
+
"X-Poedit-Basepath: .\n"
|
| 14 |
+
"X-Poedit-Language: English\n"
|
| 15 |
+
"X-Poedit-Country: CHINA\n"
|
| 16 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
| 17 |
+
"X-Poedit-SearchPath-0: F:\\xampp\\htdocs\\wordpress\\wp-content\\plugins\\wp-clean-up\n"
|
| 18 |
+
|
| 19 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp-clean-up.php:85
|
| 20 |
+
msgid "Settings"
|
| 21 |
+
msgstr "设置"
|
| 22 |
+
|
| 23 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:17
|
| 24 |
+
msgid "All revisions deleted!"
|
| 25 |
+
msgstr "所有修订版本已删除!"
|
| 26 |
+
|
| 27 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:22
|
| 28 |
+
msgid "All drafts deleted!"
|
| 29 |
+
msgstr "所有草稿已删除!"
|
| 30 |
+
|
| 31 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:27
|
| 32 |
+
msgid "All autodrafts deleted!"
|
| 33 |
+
msgstr "所有自动草稿已删除!"
|
| 34 |
+
|
| 35 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:32
|
| 36 |
+
msgid "All moderated comments deleted!"
|
| 37 |
+
msgstr "所有待审评论已删除!"
|
| 38 |
+
|
| 39 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:37
|
| 40 |
+
msgid "All spam comments deleted!"
|
| 41 |
+
msgstr "所有垃圾评论已删除!"
|
| 42 |
+
|
| 43 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:42
|
| 44 |
+
msgid "All trash comments deleted!"
|
| 45 |
+
msgstr "所有回收站评论已删除!"
|
| 46 |
+
|
| 47 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:52
|
| 48 |
+
msgid "All redundant data deleted!"
|
| 49 |
+
msgstr "所有冗余数据已删除!"
|
| 50 |
+
|
| 51 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:64
|
| 52 |
+
msgid "Type"
|
| 53 |
+
msgstr "类型"
|
| 54 |
+
|
| 55 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:65
|
| 56 |
+
msgid "Count"
|
| 57 |
+
msgstr "数量"
|
| 58 |
+
|
| 59 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:66
|
| 60 |
+
msgid "Operate"
|
| 61 |
+
msgstr "操作"
|
| 62 |
+
|
| 63 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:72
|
| 64 |
+
msgid "Revision"
|
| 65 |
+
msgstr "修订版本"
|
| 66 |
+
|
| 67 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:80
|
| 68 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:94
|
| 69 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:108
|
| 70 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:122
|
| 71 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:136
|
| 72 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:150
|
| 73 |
+
msgid "Delete"
|
| 74 |
+
msgstr "删除"
|
| 75 |
+
|
| 76 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:86
|
| 77 |
+
msgid "Draft"
|
| 78 |
+
msgstr "草稿"
|
| 79 |
+
|
| 80 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:100
|
| 81 |
+
msgid "Auto Draft"
|
| 82 |
+
msgstr "自动草稿"
|
| 83 |
+
|
| 84 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:114
|
| 85 |
+
msgid "Moderated Comments"
|
| 86 |
+
msgstr "待审评论"
|
| 87 |
+
|
| 88 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:128
|
| 89 |
+
msgid "Spam Comments"
|
| 90 |
+
msgstr "垃圾评论"
|
| 91 |
+
|
| 92 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:142
|
| 93 |
+
msgid "Trash Comments"
|
| 94 |
+
msgstr "回收站评论"
|
| 95 |
+
|
| 96 |
+
#: F:\xampp\htdocs\wordpress\wp-content\plugins\wp-clean-up/wp_clean_up_admin.php:161
|
| 97 |
+
msgid "Delete All"
|
| 98 |
+
msgstr "删除所有"
|
| 99 |
+
|
readme.txt
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
=== WP Clean Up ===
|
| 2 |
+
Contributors: boliquan
|
| 3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=SKA6TPPWSATKG&item_name=BoLiQuan&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=CA&bn=PP%2dDonationsBF&charset=UTF%2d8
|
| 4 |
+
Tags: wp clean up,clean,cleaner,cleanup,database,mysql,comments,posts,post revisions,optimize,optimize database,revision,draft,auto draft,moderated,spam,trash
|
| 5 |
+
License: GPLv2
|
| 6 |
+
Requires at least: 2.7
|
| 7 |
+
Tested up to: 3.4.2
|
| 8 |
+
Stable tag: 1.1.0
|
| 9 |
+
|
| 10 |
+
WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" and so on.
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
== Description ==
|
| 14 |
+
|
| 15 |
+
WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments".
|
| 16 |
+
It adds a settings page to "Dashboard"->"Settings"->"WP Clean Up" where you can clean up the wordpress database.
|
| 17 |
+
It allows you to remove the redundant data within few clicks.
|
| 18 |
+
It is a effective tool to keep your database clean and surely save a lot of space of your MySQL Database.
|
| 19 |
+
|
| 20 |
+
= Usage =
|
| 21 |
+
|
| 22 |
+
1. Download and extract `wp-clean-up.zip` to `wp-content/plugins/`
|
| 23 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
| 24 |
+
3. "Dashboard"->"Settings"->"WP Clean Up"
|
| 25 |
+
4. For more information of this plugin, please visit: [Plugin Homepage](http://boliquan.com/wp-clean-up/ "WP Clean Up").
|
| 26 |
+
|
| 27 |
+
Related Links:
|
| 28 |
+
|
| 29 |
+
* <a href="http://boliquan.com/wp-clean-up/">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/extend/plugins/wp-clean-up/">Download</a>
|
| 30 |
+
* <a href="http://boliquan.com/wp-smtp/">WP SMTP</a> | <a href="http://wordpress.org/extend/plugins/wp-smtp/">Download</a>
|
| 31 |
+
* <a href="http://boliquan.com/wp-anti-spam/">WP Anti Spam</a> | <a href="http://wordpress.org/extend/plugins/wp-anti-spam/">Download</a>
|
| 32 |
+
* <a href="http://boliquan.com/wp-code-highlight/">WP Code Highlight</a> | <a href="http://wordpress.org/extend/plugins/wp-code-highlight/">Download</a>
|
| 33 |
+
* <a href="http://boliquan.com/wp-slug-translate/">WP Slug Translate</a> | <a href="http://wordpress.org/extend/plugins/wp-slug-translate/">Download</a>
|
| 34 |
+
* <a href="http://boliquan.com/yg-share/">YG Share</a> | <a href="http://wordpress.org/extend/plugins/yg-share/">Download</a>
|
| 35 |
+
* <a href="http://boliquan.com/">BoLiQuan</a>
|
| 36 |
+
* <a href="http://boliquan.com/">玻璃泉</a>
|
| 37 |
+
* <a href="http://boliquan.com/">夜光</a>
|
| 38 |
+
* <a href="http://boliquan.com/ylife/">YLife</a> | <a href="http://code.google.com/p/ylife/downloads/list">Download</a>
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
== Installation ==
|
| 42 |
+
|
| 43 |
+
1. Download and extract `wp-clean-up.zip` to `wp-content/plugins/`
|
| 44 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
| 45 |
+
3. "Dashboard"->"Settings"->"WP Clean Up"
|
| 46 |
+
4. For more information of this plugin, please visit: [Plugin Homepage](http://boliquan.com/wp-clean-up/ "WP Clean Up").
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
== Changelog ==
|
| 50 |
+
|
| 51 |
+
= 1.1.0 =
|
| 52 |
+
|
| 53 |
+
* First release.
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
== Screenshots ==
|
| 57 |
+
|
| 58 |
+
1. Admin page screenshot
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
== Frequently Asked Questions ==
|
| 62 |
+
|
| 63 |
+
You can sumbit it in http://boliquan.com/wp-clean-up/
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
== Upgrade Notice ==
|
| 67 |
+
|
| 68 |
+
Please visit http://boliquan.com/wp-clean-up/
|
screenshot-1.png
ADDED
|
Binary file
|
wp-clean-up.php
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Plugin Name: WP Clean Up
|
| 4 |
+
Plugin URI: http://boliquan.com/wp-clean-up/
|
| 5 |
+
Description: WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments".
|
| 6 |
+
Version: 1.1.0
|
| 7 |
+
Author: BoLiQuan
|
| 8 |
+
Author URI: http://boliquan.com/
|
| 9 |
+
Text Domain: WP-Clean-Up
|
| 10 |
+
Domain Path: /lang
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
function load_wp_clean_up_lang(){
|
| 14 |
+
$currentLocale = get_locale();
|
| 15 |
+
if(!empty($currentLocale)){
|
| 16 |
+
$moFile = dirname(__FILE__) . "/lang/wp-clean-up-" . $currentLocale . ".mo";
|
| 17 |
+
if(@file_exists($moFile) && is_readable($moFile)) load_textdomain('WP-Clean-Up', $moFile);
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
add_filter('init','load_wp_clean_up_lang');
|
| 21 |
+
|
| 22 |
+
function wp_clean_up($type){
|
| 23 |
+
global $wpdb;
|
| 24 |
+
switch($type){
|
| 25 |
+
case "revision":
|
| 26 |
+
$wcu_sql = "DELETE FROM $wpdb->posts WHERE post_type = 'revision'";
|
| 27 |
+
$wpdb->query($wcu_sql);
|
| 28 |
+
break;
|
| 29 |
+
case "draft":
|
| 30 |
+
$wcu_sql = "DELETE FROM $wpdb->posts WHERE post_status = 'draft'";
|
| 31 |
+
$wpdb->query($wcu_sql);
|
| 32 |
+
break;
|
| 33 |
+
case "autodraft":
|
| 34 |
+
$wcu_sql = "DELETE FROM $wpdb->posts WHERE post_status = 'auto-draft'";
|
| 35 |
+
$wpdb->query($wcu_sql);
|
| 36 |
+
break;
|
| 37 |
+
case "moderated":
|
| 38 |
+
$wcu_sql = "DELETE FROM $wpdb->comments WHERE comment_approved = '0'";
|
| 39 |
+
$wpdb->query($wcu_sql);
|
| 40 |
+
break;
|
| 41 |
+
case "spam":
|
| 42 |
+
$wcu_sql = "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam'";
|
| 43 |
+
$wpdb->query($wcu_sql);
|
| 44 |
+
break;
|
| 45 |
+
case "trash":
|
| 46 |
+
$wcu_sql = "DELETE FROM $wpdb->comments WHERE comment_approved = 'trash'";
|
| 47 |
+
$wpdb->query($wcu_sql);
|
| 48 |
+
break;
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
function wp_clean_up_count($type){
|
| 53 |
+
global $wpdb;
|
| 54 |
+
switch($type){
|
| 55 |
+
case "revision":
|
| 56 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'revision'";
|
| 57 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 58 |
+
break;
|
| 59 |
+
case "draft":
|
| 60 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'draft'";
|
| 61 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 62 |
+
break;
|
| 63 |
+
case "autodraft":
|
| 64 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'auto-draft'";
|
| 65 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 66 |
+
break;
|
| 67 |
+
case "moderated":
|
| 68 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'";
|
| 69 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 70 |
+
break;
|
| 71 |
+
case "spam":
|
| 72 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'";
|
| 73 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 74 |
+
break;
|
| 75 |
+
case "trash":
|
| 76 |
+
$wcu_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'trash'";
|
| 77 |
+
$count = $wpdb->get_var($wcu_sql);
|
| 78 |
+
break;
|
| 79 |
+
}
|
| 80 |
+
return $count;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
function wp_clean_up_settings_link($action_links,$plugin_file){
|
| 84 |
+
if($plugin_file==plugin_basename(__FILE__)){
|
| 85 |
+
$wcu_settings_link = '<a href="options-general.php?page=' . dirname(plugin_basename(__FILE__)) . '/wp_clean_up_admin.php">' . __("Settings") . '</a>';
|
| 86 |
+
array_unshift($action_links,$wcu_settings_link);
|
| 87 |
+
}
|
| 88 |
+
return $action_links;
|
| 89 |
+
}
|
| 90 |
+
add_filter('plugin_action_links','wp_clean_up_settings_link',10,4);
|
| 91 |
+
|
| 92 |
+
if(is_admin()){require_once('wp_clean_up_admin.php');}
|
| 93 |
+
?>
|
wp_clean_up_admin.php
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
function wp_clean_up_admin() {
|
| 3 |
+
add_options_page('WP Clean Up Options', 'WP Clean Up','manage_options', __FILE__, 'wp_clean_up_page');
|
| 4 |
+
}
|
| 5 |
+
function wp_clean_up_page(){
|
| 6 |
+
?>
|
| 7 |
+
<div class="wrap">
|
| 8 |
+
|
| 9 |
+
<?php screen_icon(); ?>
|
| 10 |
+
<h2>WP Clean Up</h2>
|
| 11 |
+
|
| 12 |
+
<?php
|
| 13 |
+
$wcu_message = '';
|
| 14 |
+
|
| 15 |
+
if(isset($_POST['wp_clean_up_revision'])){
|
| 16 |
+
wp_clean_up('revision');
|
| 17 |
+
$wcu_message = __("All revisions deleted!","WP-Clean-Up");
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
if(isset($_POST['wp_clean_up_draft'])){
|
| 21 |
+
wp_clean_up('draft');
|
| 22 |
+
$wcu_message = __("All drafts deleted!","WP-Clean-Up");
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
if(isset($_POST['wp_clean_up_autodraft'])){
|
| 26 |
+
wp_clean_up('autodraft');
|
| 27 |
+
$wcu_message = __("All autodrafts deleted!","WP-Clean-Up");
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if(isset($_POST['wp_clean_up_moderated'])){
|
| 31 |
+
wp_clean_up('moderated');
|
| 32 |
+
$wcu_message = __("All moderated comments deleted!","WP-Clean-Up");
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if(isset($_POST['wp_clean_up_spam'])){
|
| 36 |
+
wp_clean_up('spam');
|
| 37 |
+
$wcu_message = __("All spam comments deleted!","WP-Clean-Up");
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if(isset($_POST['wp_clean_up_trash'])){
|
| 41 |
+
wp_clean_up('trash');
|
| 42 |
+
$wcu_message = __("All trash comments deleted!","WP-Clean-Up");
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
if(isset($_POST['wp_clean_up_all'])){
|
| 46 |
+
wp_clean_up('revision');
|
| 47 |
+
wp_clean_up('draft');
|
| 48 |
+
wp_clean_up('autodraft');
|
| 49 |
+
wp_clean_up('moderated');
|
| 50 |
+
wp_clean_up('spam');
|
| 51 |
+
wp_clean_up('trash');
|
| 52 |
+
$wcu_message = __("All redundant data deleted!","WP-Clean-Up");
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if($wcu_message != ''){
|
| 56 |
+
echo '<div id="message" class="updated fade"><p><strong>' . $wcu_message . '</strong></p></div>';
|
| 57 |
+
}
|
| 58 |
+
?>
|
| 59 |
+
|
| 60 |
+
<p>
|
| 61 |
+
<table class="widefat" style="width:36%;">
|
| 62 |
+
<thead>
|
| 63 |
+
<tr>
|
| 64 |
+
<th scope="col"><?php _e('Type','WP-Clean-Up'); ?></th>
|
| 65 |
+
<th scope="col"><?php _e('Count','WP-Clean-Up'); ?></th>
|
| 66 |
+
<th scope="col"><?php _e('Operate','WP-Clean-Up'); ?></th>
|
| 67 |
+
</tr>
|
| 68 |
+
</thead>
|
| 69 |
+
<tbody id="the-list">
|
| 70 |
+
<tr class="alternate">
|
| 71 |
+
<td class="column-name">
|
| 72 |
+
<?php _e('Revision','WP-Clean-Up'); ?>
|
| 73 |
+
</td>
|
| 74 |
+
<td class="column-name">
|
| 75 |
+
<?php echo wp_clean_up_count('revision'); ?>
|
| 76 |
+
</td>
|
| 77 |
+
<td class="column-name">
|
| 78 |
+
<form action="" method="post">
|
| 79 |
+
<input type="hidden" name="wp_clean_up_revision" value="revision" />
|
| 80 |
+
<input type="submit" class="<?php if(wp_clean_up_count('revision')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 81 |
+
</form>
|
| 82 |
+
</td>
|
| 83 |
+
</tr>
|
| 84 |
+
<tr>
|
| 85 |
+
<td class="column-name">
|
| 86 |
+
<?php _e('Draft','WP-Clean-Up'); ?>
|
| 87 |
+
</td>
|
| 88 |
+
<td class="column-name">
|
| 89 |
+
<?php echo wp_clean_up_count('draft'); ?>
|
| 90 |
+
</td>
|
| 91 |
+
<td class="column-name">
|
| 92 |
+
<form action="" method="post">
|
| 93 |
+
<input type="hidden" name="wp_clean_up_draft" value="draft" />
|
| 94 |
+
<input type="submit" class="<?php if(wp_clean_up_count('draft')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 95 |
+
</form>
|
| 96 |
+
</td>
|
| 97 |
+
</tr>
|
| 98 |
+
<tr class="alternate">
|
| 99 |
+
<td class="column-name">
|
| 100 |
+
<?php _e('Auto Draft','WP-Clean-Up'); ?>
|
| 101 |
+
</td>
|
| 102 |
+
<td class="column-name">
|
| 103 |
+
<?php echo wp_clean_up_count('autodraft'); ?>
|
| 104 |
+
</td>
|
| 105 |
+
<td class="column-name">
|
| 106 |
+
<form action="" method="post">
|
| 107 |
+
<input type="hidden" name="wp_clean_up_autodraft" value="autodraft" />
|
| 108 |
+
<input type="submit" class="<?php if(wp_clean_up_count('autodraft')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 109 |
+
</form>
|
| 110 |
+
</td>
|
| 111 |
+
</tr>
|
| 112 |
+
<tr>
|
| 113 |
+
<td class="column-name">
|
| 114 |
+
<?php _e('Moderated Comments','WP-Clean-Up'); ?>
|
| 115 |
+
</td>
|
| 116 |
+
<td class="column-name">
|
| 117 |
+
<?php echo wp_clean_up_count('moderated'); ?>
|
| 118 |
+
</td>
|
| 119 |
+
<td class="column-name">
|
| 120 |
+
<form action="" method="post">
|
| 121 |
+
<input type="hidden" name="wp_clean_up_moderated" value="moderated" />
|
| 122 |
+
<input type="submit" class="<?php if(wp_clean_up_count('moderated')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 123 |
+
</form>
|
| 124 |
+
</td>
|
| 125 |
+
</tr>
|
| 126 |
+
<tr class="alternate">
|
| 127 |
+
<td class="column-name">
|
| 128 |
+
<?php _e('Spam Comments','WP-Clean-Up'); ?>
|
| 129 |
+
</td>
|
| 130 |
+
<td class="column-name">
|
| 131 |
+
<?php echo wp_clean_up_count('spam'); ?>
|
| 132 |
+
</td>
|
| 133 |
+
<td class="column-name">
|
| 134 |
+
<form action="" method="post">
|
| 135 |
+
<input type="hidden" name="wp_clean_up_spam" value="spam" />
|
| 136 |
+
<input type="submit" class="<?php if(wp_clean_up_count('spam')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 137 |
+
</form>
|
| 138 |
+
</td>
|
| 139 |
+
</tr>
|
| 140 |
+
<tr>
|
| 141 |
+
<td class="column-name">
|
| 142 |
+
<?php _e('Trash Comments','WP-Clean-Up'); ?>
|
| 143 |
+
</td>
|
| 144 |
+
<td class="column-name">
|
| 145 |
+
<?php echo wp_clean_up_count('trash'); ?>
|
| 146 |
+
</td>
|
| 147 |
+
<td class="column-name">
|
| 148 |
+
<form action="" method="post">
|
| 149 |
+
<input type="hidden" name="wp_clean_up_trash" value="trash" />
|
| 150 |
+
<input type="submit" class="<?php if(wp_clean_up_count('trash')>0){echo 'button-primary';}else{echo 'button';} ?>" value="<?php _e('Delete','WP-Clean-Up'); ?>" />
|
| 151 |
+
</form>
|
| 152 |
+
</td>
|
| 153 |
+
</tr>
|
| 154 |
+
</tbody>
|
| 155 |
+
</table>
|
| 156 |
+
</p>
|
| 157 |
+
|
| 158 |
+
<p>
|
| 159 |
+
<form action="" method="post">
|
| 160 |
+
<input type="hidden" name="wp_clean_up_all" value="all" />
|
| 161 |
+
<input type="submit" class="button-primary" value="<?php _e('Delete All','WP-Clean-Up'); ?>" />
|
| 162 |
+
</form>
|
| 163 |
+
</p>
|
| 164 |
+
<br />
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
<h3>Related Links</h3>
|
| 168 |
+
1. <a href="http://boliquan.com/wp-clean-up/" target="_blank">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/extend/plugins/wp-clean-up/" target="_blank">Download</a><br />
|
| 169 |
+
2. <a href="http://boliquan.com/wp-smtp/" target="_blank">WP SMTP</a> | <a href="http://wordpress.org/extend/plugins/wp-smtp/" target="_blank">Download</a><br />
|
| 170 |
+
3. <a href="http://boliquan.com/wp-code-highlight/" target="_blank">WP Code Highlight</a> | <a href="http://wordpress.org/extend/plugins/wp-code-highlight/" target="_blank">Download</a><br />
|
| 171 |
+
4. <a href="http://boliquan.com/wp-slug-translate/" target="_blank">WP Slug Translate</a> | <a href="http://wordpress.org/extend/plugins/wp-slug-translate/" target="_blank">Download</a><br />
|
| 172 |
+
5. <a href="http://boliquan.com/wp-anti-spam/" target="_blank">WP Anti Spam</a> | <a href="http://wordpress.org/extend/plugins/wp-anti-spam/" target="_blank">Download</a><br />
|
| 173 |
+
6. <a href="http://boliquan.com/yg-share/" target="_blank">YG Share</a> | <a href="http://wordpress.org/extend/plugins/yg-share/" target="_blank">Download</a>
|
| 174 |
+
|
| 175 |
+
<br /><br />
|
| 176 |
+
<?php $donate_url = plugins_url('/img/paypal_32_32.jpg', __FILE__);?>
|
| 177 |
+
<?php $paypal_donate_url = plugins_url('/img/btn_donateCC_LG.gif', __FILE__);?>
|
| 178 |
+
<?php $ali_donate_url = plugins_url('/img/alipay_donate.png', __FILE__);?>
|
| 179 |
+
<div class="icon32"><img src="<?php echo $donate_url; ?>" alt="Donate" /></div>
|
| 180 |
+
<h2>Donate</h2>
|
| 181 |
+
<p>
|
| 182 |
+
If you find my work useful and you want to encourage the development of more free resources, you can do it by donating.
|
| 183 |
+
</p>
|
| 184 |
+
<p>
|
| 185 |
+
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=SKA6TPPWSATKG&item_name=BoLiQuan&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=CA&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank"><img src="<?php echo $paypal_donate_url; ?>" alt="Paypal Donate" title="Paypal" /></a>
|
| 186 |
+
|
| 187 |
+
<a href="https://me.alipay.com/boliquan" target="_blank"><img src="<?php echo $ali_donate_url; ?>" alt="Alipay Donate" title="Alipay" /></a>
|
| 188 |
+
</p>
|
| 189 |
+
<br />
|
| 190 |
+
|
| 191 |
+
<div style="text-align:center; margin:60px 0 10px 0;">© <?php echo date("Y"); ?> BoLiQuan</div>
|
| 192 |
+
|
| 193 |
+
</div>
|
| 194 |
+
<?php
|
| 195 |
+
}
|
| 196 |
+
add_action('admin_menu', 'wp_clean_up_admin');
|
| 197 |
+
?>
|
