Plugin Directory

Changeset 1603896


Ignore:
Timestamp:
02/26/2017 02:46:45 PM (9 years ago)
Author:
php-developer
Message:

3.0 changes updates

Location:
remove-all-comments/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • remove-all-comments/trunk/readme.txt

    r1403009 r1603896  
    33Tags: comments, spam, delete comments, remove comments, no comments, spam free comments, comments less, remove all comments, auto remove comments
    44Requires at least: 3.0.1
    5 Tested up to: 4.5
     5Tested up to: 4.7.2
    66Stable tag: 2.0
    77Author: php-developer
  • remove-all-comments/trunk/remove-all-comments.php

    r1403156 r1603896  
    44Plugin URI: http://wordpress.org/plugins/remove-all-comments/
    55Description: 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.0
     6Version: 3.0
    77Requires at least: 3.0.1
    8 Tested up to: 4.5
     8Tested up to: 4.7.2
    99Author: php-developer 
    1010Author URI: https://profiles.wordpress.org/php-developer-1
     
    3232///////////////// function for display admin side settings
    3333function 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>
    3735<?php
    38     my_admin_note_reovellAllComments();
     36count_comments_current_website();
     37   my_admin_note_reovellAllComments();
    3938 ///////////// admin side form start ?>                 
    40 <form method="post" action="options.php">
     39<form method="post" action="options.php" >
    4140    <?php settings_fields( 'remove_all_comments_settings-group' ); ?>
    42     <table class="form-table">
     41    <table class="form-table" width="100%">
    4342         <?php
    4443              global $wpdb;
     
    5857        ?>
    5958        <select name="remove_all_is_all">
     59        <option><?php  _e('Select') ?></option>
    6060        <option <?php echo $sel0_is_all ?> value="no"><?php  _e('No') ?></option>
    6161        <option <?php echo $sel1_is_all ?> value="yes"><?php  _e('Yes') ?></option>
     
    7878        ?>
    7979        <select name="remove_all_is_page">
     80        <option><?php  _e('Select') ?></option>
    8081        <option <?php echo $sel0 ?> value="no"><?php  _e('No') ?></option>
    8182        <option <?php echo $sel1 ?> value="yes"><?php  _e('Yes') ?></option>
     
    9899        ?>
    99100        <select name="remove_all_is_post">
     101        <option><?php  _e('Select') ?></option>
    100102        <option <?php echo $sel0_caption ?> value="no"><?php  _e('No') ?></option>
    101103        <option <?php echo $sel1_caption ?> value="yes"><?php  _e('Yes') ?></option>
     
    131133    global $wpdb;
    132134   
     135    $count = count_comments_current_website();
     136    if($count > 100){
     137       
     138       return true;
     139    }
     140   
    133141    if($post_type=='all'){
    134142         
     
    162170                if($select_value_is_post=='yes')
    163171                {
    164                  removeCommentsFromSite($post_type='page');   
     172                 removeCommentsFromSite($post_type='post');   
    165173                }
    166174   
     
    175183    delete_option( 'remove_all_is_page' );
    176184    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' );     
    179186}     
    180187function my_admin_notice_reovellAllComments(){     
    181 //print_r();
     188//print_r(); 
    182189    $msg = 'Removell All Comments Settings Saved.';
    183     if (isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated'] ) {
     190    if (isset($_REQUEST['settings-updated'])) {
    184191         return '<div class="updated">
    185192             <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}
     197function 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
     205add_action('admin_notices', 'error_message');
     206
     207function 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
     218function 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.