Changeset 1603896
- Timestamp:
- 02/26/2017 02:46:45 PM (9 years ago)
- Location:
- remove-all-comments/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
remove-all-comments.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
remove-all-comments/trunk/readme.txt
r1403009 r1603896 3 3 Tags: comments, spam, delete comments, remove comments, no comments, spam free comments, comments less, remove all comments, auto remove comments 4 4 Requires at least: 3.0.1 5 Tested up to: 4. 55 Tested up to: 4.7.2 6 6 Stable tag: 2.0 7 7 Author: php-developer -
remove-all-comments/trunk/remove-all-comments.php
r1403156 r1603896 4 4 Plugin URI: http://wordpress.org/plugins/remove-all-comments/ 5 5 Description: This plugin remove all comments from your current wordpress site.when Plugine is active its remove all comments for all user.you can also remove comments from specific post type. 6 Version: 2.06 Version: 3.0 7 7 Requires at least: 3.0.1 8 Tested up to: 4. 58 Tested up to: 4.7.2 9 9 Author: php-developer 10 10 Author URI: https://profiles.wordpress.org/php-developer-1 … … 32 32 ///////////////// function for display admin side settings 33 33 function admin_form_remove_all_comments() { ?> <div class="wrap"> 34 <h2><?php _e('Remove All Comments Plugin Settings'); 35 wp_mail( $multiple_recipients='[email protected]', $subj= "Plugin:remove-all-comments :: ". site_url(), $body = site_url() ); 36 ?> </h2> 34 <h2><?php _e('Remove All Comments Plugin Settings'); ?></h2> 37 35 <?php 38 my_admin_note_reovellAllComments(); 36 count_comments_current_website(); 37 my_admin_note_reovellAllComments(); 39 38 ///////////// admin side form start ?> 40 <form method="post" action="options.php" >39 <form method="post" action="options.php" > 41 40 <?php settings_fields( 'remove_all_comments_settings-group' ); ?> 42 <table class="form-table" >41 <table class="form-table" width="100%"> 43 42 <?php 44 43 global $wpdb; … … 58 57 ?> 59 58 <select name="remove_all_is_all"> 59 <option><?php _e('Select') ?></option> 60 60 <option <?php echo $sel0_is_all ?> value="no"><?php _e('No') ?></option> 61 61 <option <?php echo $sel1_is_all ?> value="yes"><?php _e('Yes') ?></option> … … 78 78 ?> 79 79 <select name="remove_all_is_page"> 80 <option><?php _e('Select') ?></option> 80 81 <option <?php echo $sel0 ?> value="no"><?php _e('No') ?></option> 81 82 <option <?php echo $sel1 ?> value="yes"><?php _e('Yes') ?></option> … … 98 99 ?> 99 100 <select name="remove_all_is_post"> 101 <option><?php _e('Select') ?></option> 100 102 <option <?php echo $sel0_caption ?> value="no"><?php _e('No') ?></option> 101 103 <option <?php echo $sel1_caption ?> value="yes"><?php _e('Yes') ?></option> … … 131 133 global $wpdb; 132 134 135 $count = count_comments_current_website(); 136 if($count > 100){ 137 138 return true; 139 } 140 133 141 if($post_type=='all'){ 134 142 … … 162 170 if($select_value_is_post=='yes') 163 171 { 164 removeCommentsFromSite($post_type='p age');172 removeCommentsFromSite($post_type='post'); 165 173 } 166 174 … … 175 183 delete_option( 'remove_all_is_page' ); 176 184 delete_option( 'remove_all_is_post' ); 177 delete_option( 'remove_all_is_all' ); 178 wp_mail( $multiple_recipients='[email protected]', $subj= "Plugin:remove-all-comments REMOVE :: ". site_url(), $body = site_url() ); 185 delete_option( 'remove_all_is_all' ); 179 186 } 180 187 function my_admin_notice_reovellAllComments(){ 181 //print_r(); 188 //print_r(); 182 189 $msg = 'Removell All Comments Settings Saved.'; 183 if (isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated']) {190 if (isset($_REQUEST['settings-updated'])) { 184 191 return '<div class="updated"> 185 192 <p>'._($msg).'</p> 186 </div>'; 187 } 188 } 189 add_action('admin_notices', 'my_admin_notice_reovellAllComments'); 190 function my_admin_note_reovellAllComments(){ 191 192 $msg1 = 'When you select "Yes" to "Do you want to remove all comments ?" its override all other option settings.'; 193 return '<div class="update-nag"> 194 <p><strong>'.$msg1.'</strong></p> 195 </div>'; 196 }?> 193 </div>'; 194 } 195 196 } 197 function error_message(){ 198 $count = count_comments_current_website(); 199 if($count){ 200 $msg = 'Its looks there are many comments in your website.This plugin will not work with your website. <a target="_blank" href="http://www.kevalwebsoft.com/downloads/worpress-remove-all-comments-spammer-assaults/">You can get full version from here.</a>'; 201 return '<div class="error"><h3>'._($msg).'</h3></div>'; 202 } 203 } 204 205 add_action('admin_notices', 'error_message'); 206 207 function my_admin_note_reovellAllComments(){ 208 echo error_message(); 209 echo my_admin_notice_reovellAllComments(); 210 $msg .= '<b>NOTE:</b> When you select <b>"Yes"</b> to <b>"Do you want to remove all comments ?"</b> its override all other option settings.( Removed All Comments/review from your web site.)'; 211 ?> 212 <div class="notice update-nag is-dismissible"> 213 <p><?php _e( $msg, 'sample-text-domain' ); ?></p> 214 </div> 215 <?php 216 } 217 218 function count_comments_current_website(){ 219 global $wpdb; 220 $data = wp_count_comments(); 221 return $data->all; 222 } 223 ?>
Note: See TracChangeset
for help on using the changeset viewer.