Plugin Directory

Changeset 1063470


Ignore:
Timestamp:
01/08/2015 10:39:12 PM (10 years ago)
Author:
benohead
Message:

tagging version 0.4

Location:
wp-spam-fighter
Files:
1 added
8 edited
8 copied

Legend:

Unmodified
Added
Removed
  • wp-spam-fighter/tags/0.4/bootstrap.php

    r1063469 r1063470  
    44Plugin URI:  https://wordpress.org/plugins/wp-spam-fighter/
    55Description: Comment spam prevention without moderation, captchas or questions
    6 Version:     0.3
     6Version:     0.4
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-spam-fighter/tags/0.4/classes/wp-spam-fighter.php

    r1054103 r1063470  
    2828         * Plugin version number
    2929         */
    30         const VERSION = '0.3';
     30        const VERSION = '0.4';
    3131
    3232        /**
     
    418418
    419419        function comment_post( $comment_ID, $approved ) {
    420             if (isset($this->modules['WPSF_Settings']->settings['others']['delete']) && $this->modules['WPSF_Settings']->settings['others']['delete']) {
    421                 if ($approved == 'spam') {
    422                     wp_trash_comment( $comment_ID );
    423                 }
    424             }
    425420        }
    426421
     
    456451                }
    457452            }
     453            if ($approved === 'spam') {
     454                if (isset($this->modules['WPSF_Settings']->settings['others']['delete']) && $this->modules['WPSF_Settings']->settings['others']['delete']) {
     455                    add_action('wp_insert_comment', array(&$this, 'handle_auto_trash'), 0, 2);
     456                }
     457                if (isset($this->modules['WPSF_Settings']->settings['others']['discard']) && $this->modules['WPSF_Settings']->settings['others']['discard']) {
     458                    add_action('wp_insert_comment', array(&$this, 'handle_auto_delete'), 0, 2);
     459                }
     460            }
    458461            return $approved;
     462        }
     463
     464        public function handle_auto_delete($id, $comment) {
     465            if(!$comment && !is_object($cmt = get_comment($comment))){
     466                return;
     467            }
     468            wp_delete_comment($id, true);
     469        }
     470
     471        public function handle_auto_trash($id, $comment) {
     472            if(!$comment && !is_object($cmt = get_comment($comment))){
     473                return;
     474            }
     475            wp_trash_comment($id, false);
    459476        }
    460477
  • wp-spam-fighter/tags/0.4/classes/wpsf-settings.php

    r1054103 r1063470  
    225225                "registration" => true,
    226226                "delete" => false,
     227                "discard" => false,
    227228            );
    228229
     
    421422            $this->add_settings_field_others('wpsf_registration', 'Also protect from spammer registration');
    422423            $this->add_settings_field_others('wpsf_delete', 'Move Spam to Trash');
     424            $this->add_settings_field_others('wpsf_discard', 'Immediately discard comment');
    423425
    424426            // The settings container
     
    569571            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'registration', true);
    570572            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'delete', false);
     573            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'discard', false);
    571574
    572575            return $new_settings;
  • wp-spam-fighter/tags/0.4/readme.txt

    r1063469 r1063470  
    55Requires at least: 3.5
    66Tested up to: 4.1
    7 Stable tag: 0.3
     7Stable tag: 0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050== Changelog ==
    5151
     52= 0.4 =
     53
     54* Added option to discard spam comments (without inserting them into the WordPress database) instead of just marking them as spam.
     55
    5256= 0.3 =
    5357
  • wp-spam-fighter/tags/0.4/views/wpsf-settings/page-settings-fields.php

    r1054103 r1063470  
    7777           id="wpsf_settings[others][delete]"
    7878           value="1" <?php if (isset($settings['others']['delete'])) checked(1, $settings['others']['delete']) ?>>
     79<?php
     80elseif ('wpsf_discard' == $field['label_for']) : ?>
     81    <input type="checkbox" name="wpsf_settings[others][discard]"
     82           id="wpsf_settings[others][discard]"
     83           value="1" <?php if (isset($settings['others']['discard'])) checked(1, $settings['others']['discard']) ?>>
    7984<?php endif; ?>
  • wp-spam-fighter/trunk/bootstrap.php

    r1054103 r1063470  
    44Plugin URI:  https://wordpress.org/plugins/wp-spam-fighter/
    55Description: Comment spam prevention without moderation, captchas or questions
    6 Version:     0.3
     6Version:     0.4
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-spam-fighter/trunk/classes/wp-spam-fighter.php

    r1054103 r1063470  
    2828         * Plugin version number
    2929         */
    30         const VERSION = '0.3';
     30        const VERSION = '0.4';
    3131
    3232        /**
     
    418418
    419419        function comment_post( $comment_ID, $approved ) {
    420             if (isset($this->modules['WPSF_Settings']->settings['others']['delete']) && $this->modules['WPSF_Settings']->settings['others']['delete']) {
    421                 if ($approved == 'spam') {
    422                     wp_trash_comment( $comment_ID );
    423                 }
    424             }
    425420        }
    426421
     
    456451                }
    457452            }
     453            if ($approved === 'spam') {
     454                if (isset($this->modules['WPSF_Settings']->settings['others']['delete']) && $this->modules['WPSF_Settings']->settings['others']['delete']) {
     455                    add_action('wp_insert_comment', array(&$this, 'handle_auto_trash'), 0, 2);
     456                }
     457                if (isset($this->modules['WPSF_Settings']->settings['others']['discard']) && $this->modules['WPSF_Settings']->settings['others']['discard']) {
     458                    add_action('wp_insert_comment', array(&$this, 'handle_auto_delete'), 0, 2);
     459                }
     460            }
    458461            return $approved;
     462        }
     463
     464        public function handle_auto_delete($id, $comment) {
     465            if(!$comment && !is_object($cmt = get_comment($comment))){
     466                return;
     467            }
     468            wp_delete_comment($id, true);
     469        }
     470
     471        public function handle_auto_trash($id, $comment) {
     472            if(!$comment && !is_object($cmt = get_comment($comment))){
     473                return;
     474            }
     475            wp_trash_comment($id, false);
    459476        }
    460477
  • wp-spam-fighter/trunk/classes/wpsf-settings.php

    r1054103 r1063470  
    225225                "registration" => true,
    226226                "delete" => false,
     227                "discard" => false,
    227228            );
    228229
     
    421422            $this->add_settings_field_others('wpsf_registration', 'Also protect from spammer registration');
    422423            $this->add_settings_field_others('wpsf_delete', 'Move Spam to Trash');
     424            $this->add_settings_field_others('wpsf_discard', 'Immediately discard comment');
    423425
    424426            // The settings container
     
    569571            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'registration', true);
    570572            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'delete', false);
     573            $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'discard', false);
    571574
    572575            return $new_settings;
  • wp-spam-fighter/trunk/readme.txt

    r1054103 r1063470  
    55Requires at least: 3.5
    66Tested up to: 4.1
    7 Stable tag: 0.3
     7Stable tag: 0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050== Changelog ==
    5151
     52= 0.4 =
     53
     54* Added option to discard spam comments (without inserting them into the WordPress database) instead of just marking them as spam.
     55
    5256= 0.3 =
    5357
  • wp-spam-fighter/trunk/views/wpsf-settings/page-settings-fields.php

    r1054103 r1063470  
    7777           id="wpsf_settings[others][delete]"
    7878           value="1" <?php if (isset($settings['others']['delete'])) checked(1, $settings['others']['delete']) ?>>
     79<?php
     80elseif ('wpsf_discard' == $field['label_for']) : ?>
     81    <input type="checkbox" name="wpsf_settings[others][discard]"
     82           id="wpsf_settings[others][discard]"
     83           value="1" <?php if (isset($settings['others']['discard'])) checked(1, $settings['others']['discard']) ?>>
    7984<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.