Changeset 1063470
- Timestamp:
- 01/08/2015 10:39:12 PM (10 years ago)
- 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 4 4 Plugin URI: https://wordpress.org/plugins/wp-spam-fighter/ 5 5 Description: Comment spam prevention without moderation, captchas or questions 6 Version: 0. 36 Version: 0.4 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-spam-fighter/tags/0.4/classes/wp-spam-fighter.php
r1054103 r1063470 28 28 * Plugin version number 29 29 */ 30 const VERSION = '0. 3';30 const VERSION = '0.4'; 31 31 32 32 /** … … 418 418 419 419 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 }425 420 } 426 421 … … 456 451 } 457 452 } 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 } 458 461 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); 459 476 } 460 477 -
wp-spam-fighter/tags/0.4/classes/wpsf-settings.php
r1054103 r1063470 225 225 "registration" => true, 226 226 "delete" => false, 227 "discard" => false, 227 228 ); 228 229 … … 421 422 $this->add_settings_field_others('wpsf_registration', 'Also protect from spammer registration'); 422 423 $this->add_settings_field_others('wpsf_delete', 'Move Spam to Trash'); 424 $this->add_settings_field_others('wpsf_discard', 'Immediately discard comment'); 423 425 424 426 // The settings container … … 569 571 $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'registration', true); 570 572 $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); 571 574 572 575 return $new_settings; -
wp-spam-fighter/tags/0.4/readme.txt
r1063469 r1063470 5 5 Requires at least: 3.5 6 6 Tested up to: 4.1 7 Stable tag: 0. 37 Stable tag: 0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 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 52 56 = 0.3 = 53 57 -
wp-spam-fighter/tags/0.4/views/wpsf-settings/page-settings-fields.php
r1054103 r1063470 77 77 id="wpsf_settings[others][delete]" 78 78 value="1" <?php if (isset($settings['others']['delete'])) checked(1, $settings['others']['delete']) ?>> 79 <?php 80 elseif ('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']) ?>> 79 84 <?php endif; ?> -
wp-spam-fighter/trunk/bootstrap.php
r1054103 r1063470 4 4 Plugin URI: https://wordpress.org/plugins/wp-spam-fighter/ 5 5 Description: Comment spam prevention without moderation, captchas or questions 6 Version: 0. 36 Version: 0.4 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-spam-fighter/trunk/classes/wp-spam-fighter.php
r1054103 r1063470 28 28 * Plugin version number 29 29 */ 30 const VERSION = '0. 3';30 const VERSION = '0.4'; 31 31 32 32 /** … … 418 418 419 419 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 }425 420 } 426 421 … … 456 451 } 457 452 } 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 } 458 461 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); 459 476 } 460 477 -
wp-spam-fighter/trunk/classes/wpsf-settings.php
r1054103 r1063470 225 225 "registration" => true, 226 226 "delete" => false, 227 "discard" => false, 227 228 ); 228 229 … … 421 422 $this->add_settings_field_others('wpsf_registration', 'Also protect from spammer registration'); 422 423 $this->add_settings_field_others('wpsf_delete', 'Move Spam to Trash'); 424 $this->add_settings_field_others('wpsf_discard', 'Immediately discard comment'); 423 425 424 426 // The settings container … … 569 571 $new_settings = $this->setting_default_if_not_set($new_settings, 'others', 'registration', true); 570 572 $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); 571 574 572 575 return $new_settings; -
wp-spam-fighter/trunk/readme.txt
r1054103 r1063470 5 5 Requires at least: 3.5 6 6 Tested up to: 4.1 7 Stable tag: 0. 37 Stable tag: 0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 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 52 56 = 0.3 = 53 57 -
wp-spam-fighter/trunk/views/wpsf-settings/page-settings-fields.php
r1054103 r1063470 77 77 id="wpsf_settings[others][delete]" 78 78 value="1" <?php if (isset($settings['others']['delete'])) checked(1, $settings['others']['delete']) ?>> 79 <?php 80 elseif ('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']) ?>> 79 84 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.