Version Description
- Stable plugin released
=
Download this release
Release Info
Developer | janmejai |
Plugin | Delete All Comments Easily |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- delete all comments easily.php +93 -0
- readme.txt +45 -0
delete all comments easily.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Delete All Comments Easily
|
4 |
+
Plugin URI: http://www.wpcub.com/delete-all-comments-all-pending-comments-easily-using-plugin/
|
5 |
+
Description: Plugin to delete all comments or all Pending comments
|
6 |
+
Author: J P S
|
7 |
+
Version: 1.0
|
8 |
+
Author URI: http://www.wpcub.com
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
<?php
|
12 |
+
function dce_main()
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
$c_all = $wpdb->query("SELECT comment_ID FROM $wpdb->comments");
|
16 |
+
$c_pend = $wpdb->query("SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '0'");
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class="wrap">
|
20 |
+
<h2>Delete All Comments or All Pending Comments Easily</h2>
|
21 |
+
|
22 |
+
<?php if($_POST['c_all'] == 'a' && $_POST['all'] == 'a')
|
23 |
+
{
|
24 |
+
if($wpdb->query("DELETE FROM $wpdb->comments") != FALSE)
|
25 |
+
{
|
26 |
+
$wpdb->query("DELETE FROM $wpdb->comments");
|
27 |
+
echo "<p style='color:green'><strong>All comments have been deleted.</strong></p>";
|
28 |
+
}
|
29 |
+
else
|
30 |
+
{echo "<p style='color:red'><strong>Something Went Wrong,Please Try Again!</strong></p>";}
|
31 |
+
}
|
32 |
+
else {
|
33 |
+
?>
|
34 |
+
<?php echo "<h4>Number of all Comments : " . $c_all . " </h4>" ; ?>
|
35 |
+
|
36 |
+
<?php if($c_all > 0) { ?>
|
37 |
+
<form name="dce" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
|
38 |
+
<input type="hidden" name="c_all" value="a">
|
39 |
+
<input type="checkbox" name="all" value="a" /> Delete all comments
|
40 |
+
<p class="submit">
|
41 |
+
<input type="submit" name="Submit" value="Delete all Comments" />
|
42 |
+
</p>
|
43 |
+
</form>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
else
|
47 |
+
{
|
48 |
+
echo "<p><strong>All comments have been deleted.</strong></p>" ;
|
49 |
+
}
|
50 |
+
?>
|
51 |
+
<?php if($_POST['c_pend'] == 'p' && $_POST['pend'] == 'p')
|
52 |
+
{
|
53 |
+
if($wpdb->query("DELETE FROM $wpdb->comments WHERE comment_approved = '0'") != FALSE)
|
54 |
+
{
|
55 |
+
$wpdb->query("DELETE FROM $wpdb->comments WHERE comment_approved = '0'");
|
56 |
+
echo "<p style='color:green'><strong>All Pending comments have been deleted.</strong></p>";
|
57 |
+
}
|
58 |
+
else
|
59 |
+
{echo "<p style='color:red'><strong>Something Went Wrong,Please Try Again!</strong></p>";}
|
60 |
+
}
|
61 |
+
else {
|
62 |
+
?>
|
63 |
+
<?php echo "<h4>Number of Pending Comments : " . $c_pend . " </h4>" ; ?>
|
64 |
+
|
65 |
+
<?php if($c_pend > 0) { ?>
|
66 |
+
<form name="dcep" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
|
67 |
+
<input type="hidden" name="c_pend" value="p">
|
68 |
+
<input type="checkbox" name="pend" value="p" /> Delete all pending comments
|
69 |
+
<p class="submit">
|
70 |
+
<input type="submit" name="Submit" value="Delete all pending Comments" />
|
71 |
+
</p>
|
72 |
+
</form>
|
73 |
+
<?php
|
74 |
+
}
|
75 |
+
else
|
76 |
+
{
|
77 |
+
echo "<p><strong>All pending comments have been deleted.</strong></p>" ;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
?>
|
81 |
+
<h4>Warning : Once Comment Deleted can't be restored!</h4>
|
82 |
+
</div>
|
83 |
+
<?php
|
84 |
+
}
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<?php
|
88 |
+
add_action('admin_menu', 'dce_menu');
|
89 |
+
function dce_menu()
|
90 |
+
{
|
91 |
+
add_management_page("Delete All Comments Easily","Delete All Comments Easily",1,"dce","dce_main" );
|
92 |
+
}
|
93 |
+
?>
|
readme.txt
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Delete All Comments Easily===
|
2 |
+
Author: J P S
|
3 |
+
Author URI: http://www.wpcub.com
|
4 |
+
Donate Link: www.wpcub.com
|
5 |
+
Contributors: janmejai
|
6 |
+
Tags: comment,delete all, remove all comments,remove all pending comments
|
7 |
+
Requires at least: 3.0
|
8 |
+
Tested up to: 3.5.2
|
9 |
+
Stable tag:trunk
|
10 |
+
License: GPLv2 or later
|
11 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
|
13 |
+
Delete all comments or All the Pending Comments from your WordPress Site Easily.
|
14 |
+
|
15 |
+
== Description ==
|
16 |
+
|
17 |
+
The Plugin Helps you in Deleting All the Comments(Approved,Pending,Spam and Trashed Comments) From your Wordpress Site or you can Just Delete All the Pending Comments.
|
18 |
+
|
19 |
+
Tools > Delete All Comments Easily
|
20 |
+
|
21 |
+
== Installation ==
|
22 |
+
|
23 |
+
Standard installation required.
|
24 |
+
|
25 |
+
1. Upload the Downloaded Zip File 'delete-all-comments-easily.zip' to the '/wp-content/plugins/' directory.
|
26 |
+
2. Activate the plugin using the Plugin Tab in your Wordpress Dashboard.
|
27 |
+
3. Use the Plugin From Tools>Delete All Comments Easily.
|
28 |
+
|
29 |
+
== Changelog ==
|
30 |
+
|
31 |
+
= 1.0 =
|
32 |
+
|
33 |
+
* Stable plugin released
|
34 |
+
|
35 |
+
== Upgrade Notice ==
|
36 |
+
|
37 |
+
N/A
|
38 |
+
|
39 |
+
== Frequently Asked Questions ==
|
40 |
+
|
41 |
+
N/A
|
42 |
+
|
43 |
+
== Screenshots ==
|
44 |
+
|
45 |
+
N/A
|