Skip to content

Commit

Permalink
Version 5.6
Browse files Browse the repository at this point in the history
* New maintainer kudlav - updated links and docs
* Removed links to paid version
* Stat info is no longer warning
  • Loading branch information
kudlav committed Apr 17, 2020
1 parent 5008beb commit 814533c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 59 deletions.
17 changes: 10 additions & 7 deletions anti-spam-functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
/*
Anti-spam Reloaded plugin
*/

if ( ! defined( 'ABSPATH' ) ) { // Avoid direct calls to this file and prevent full path disclosure
exit;
Expand Down Expand Up @@ -33,22 +36,22 @@ function antispam_counter_stats() {

function antispam_check_for_spam() {
$spam_flag = false;

$antspm_q = '';
if (isset($_POST['antspm-q'])) {
$antspm_q = trim($_POST['antspm-q']);
}

$antspm_d = '';
if (isset($_POST['antspm-d'])) {
$antspm_d = trim($_POST['antspm-d']);
}

$antspm_e = '';
if (isset($_POST['antspm-e-email-url-website'])) {
$antspm_e = trim($_POST['antspm-e-email-url-website']);
}

if ( $antspm_q != date('Y') ) { // year-answer is wrong - it is spam
if ( $antspm_d != date('Y') ) { // extra js-only check: there is no js added input - it is spam
$spam_flag = true;
Expand All @@ -58,7 +61,7 @@ function antispam_check_for_spam() {
if ( ! empty($antspm_e)) { // trap field is not empty - it is spam
$spam_flag = true;
}

return $spam_flag;
}

Expand Down Expand Up @@ -130,6 +133,6 @@ function antispam_store_comment($commentdata) {
return false;
}
}

wp_set_comment_status( $comment_ID, 'spam' );
}
}
12 changes: 7 additions & 5 deletions anti-spam-info.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
/*
Anti-spam Reloaded plugin
*/

if ( ! defined( 'ABSPATH' ) ) { // Avoid direct calls to this file and prevent full path disclosure
exit;
Expand All @@ -16,10 +19,9 @@ function antispam_admin_notice() {
$blocked_total = $antispam_stats['blocked_total'];
}
?>
<div class="update-nag antispam-panel-info">
<p style="margin: 0;">
<?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam/">Anti-spam</a> plugin so far.
<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" title="Anti-spam Pro">Upgrade to Pro</a> for more advanced protection.
<div class="notice notice-info">
<p>
<?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam-reloaded/">Anti-spam Reloaded</a> plugin so far.
</p>
</div>
<?php
Expand Down Expand Up @@ -51,7 +53,7 @@ function antispam_display_screen_option() {
<input type="hidden" name="antispam_option_submit" value="1" />
<label>
<input name="antispam_info_visibility" type="checkbox" value="1" <?php echo $checked; ?> />
Anti-spam info
Anti-spam Reloaded info
</label>
<input type="submit" class="button" value="<?php _e('Apply'); ?>" />
</form>
Expand Down
23 changes: 10 additions & 13 deletions anti-spam-settings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
Anti-spam settings code
Anti-spam Reloaded settings code
used WordPress Settings API - http://codex.wordpress.org/Settings_API
*/

Expand All @@ -10,7 +10,7 @@


function antispam_menu() { // add menu item
add_options_page('Anti-spam', 'Anti-spam', 'manage_options', 'anti-spam', 'antispam_settings');
add_options_page('Anti-spam Reloaded', 'Anti-spam Reloaded', 'manage_options', 'anti-spam', 'antispam_settings');
}
add_action('admin_menu', 'antispam_menu');

Expand All @@ -36,7 +36,7 @@ function antispam_settings_init() { // set default settings

function antispam_settings_validate($input) {
$default_settings = antispam_get_settings();

// checkbox
$output['save_spam_comments'] = $input['save_spam_comments'];

Expand Down Expand Up @@ -65,16 +65,13 @@ function antispam_settings() {
}
?>
<div class="wrap">

<h2><span class="dashicons dashicons-admin-generic"></span> Anti-spam</h2>

<div class="antispam-panel-info">
<p style="margin: 0;">
<span class="dashicons dashicons-chart-bar"></span>
<strong><?php echo $blocked_total; ?></strong> spam comments were blocked by <a href="https://wordpress.org/plugins/anti-spam/" target="_blank">Anti-spam</a> plugin so far.
Upgrade to <strong><a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" target="_blank">Anti-spam Pro</a></strong> for advanced protection.
</p>
</div>

<h2><span class="dashicons dashicons-admin-generic"></span> Anti-spam Reloaded</h2>

<p>
<span class="dashicons dashicons-chart-bar"></span>
<strong><?php echo $blocked_total; ?></strong> spam comments were blocked by <a href="https://wordpress.org/plugins/anti-spam-reloaded/" target="_blank">Anti-spam Reloaded</a>
</p>

<form method="post" action="options.php">
<?php settings_fields('antispam_settings_group'); ?>
Expand Down
26 changes: 12 additions & 14 deletions anti-spam.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php
/*
Plugin Name: Anti-spam
Plugin URI: http://wordpress.org/plugins/anti-spam/
Plugin Name: Anti-spam Reloaded
Plugin URI: http://wordpress.org/plugins/anti-spam-reloaded/
Description: No spam in comments. No captcha.
Version: 5.5
Author: webvitaly
Text Domain: anti-spam
Author URI: http://web-profile.net/wordpress/plugins/
Version: 5.6
Author: kudlav, webvitaly
Text Domain: anti-spam-reloaded
Author URI: https://kudlav.github.io/
License: GPLv3
*/

if ( ! defined( 'ABSPATH' ) ) { // Avoid direct calls to this file and prevent full path disclosure
exit;
}

define('ANTISPAM_PLUGIN_VERSION', '5.5');
define('ANTISPAM_PLUGIN_VERSION', '5.6');

include('anti-spam-functions.php');
include('anti-spam-settings.php');
Expand All @@ -24,7 +24,7 @@
function antispam_enqueue_script() {
global $withcomments; // WP flag to show comments on all pages
if ((is_singular() || $withcomments) && comments_open()) { // load script only for pages with comments form
wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-5.5.js', __FILE__), null, null, true);
wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-5.6.js', __FILE__), null, null, true);
}
}
add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
Expand All @@ -34,7 +34,7 @@ function antispam_form_part() {
$rn = "\r\n"; // .chr(13).chr(10)

if ( ! is_user_logged_in()) { // add anti-spam fields only for not logged in users
echo $rn.'<!-- Anti-spam plugin v.'.ANTISPAM_PLUGIN_VERSION.' wordpress.org/plugins/anti-spam/ -->'.$rn;
echo $rn.'<!-- Anti-spam plugin v.'.ANTISPAM_PLUGIN_VERSION.' wordpress.org/plugins/anti-spam-reloaded/ -->'.$rn;
echo ' <p class="antispam-group antispam-group-q" style="clear: both;">
<label>Current ye@r <span class="required">*</span></label>
<input type="hidden" name="antspm-a" class="antispam-control antispam-control-a" value="'.date('Y').'" />
Expand All @@ -51,7 +51,7 @@ function antispam_form_part() {

function antispam_check_comment($commentdata) {
$antispam_settings = antispam_get_settings();

extract($commentdata);

if ( ! is_user_logged_in() && $comment_type != 'pingback' && $comment_type != 'trackback') { // logged in user is not a spammer
Expand All @@ -63,7 +63,7 @@ function antispam_check_comment($commentdata) {
wp_die('Comment is a spam.'); // die - do not send comment and show error message
}
}

if ($comment_type == 'trackback') {
if( $antispam_settings['save_spam_comments'] ) {
antispam_store_comment($commentdata);
Expand All @@ -83,9 +83,7 @@ function antispam_check_comment($commentdata) {
function antispam_plugin_meta($links, $file) { // add some links to plugin meta row
if ( $file == plugin_basename( __FILE__ ) ) {
$row_meta = array(
'support' => '<a href="http://web-profile.net/wordpress/plugins/anti-spam/" target="_blank">' . __( 'Anti-spam', 'anti-spam' ) . '</a>',
'donate' => '<a href="http://web-profile.net/donate/" target="_blank">' . __( 'Donate', 'anti-spam' ) . '</a>',
'upgrage' => '<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" target="_blank">' . __( 'Anti-spam Pro', 'anti-spam' ) . '</a>'
'github' => '<a href="https://github.com/kudlav/anti-spam/" target="_blank" rel="noreferrer">' . __( 'Github', 'github' ) . '</a>'
);
$links = array_merge( $links, $row_meta );
}
Expand Down
6 changes: 2 additions & 4 deletions js/anti-spam-5.5.js → js/anti-spam-5.6.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
Anti-spam plugin
No spam in comments. No captcha.
wordpress.org/plugins/anti-spam/
Anti-spam Reloaded plugin
*/

"use strict";
Expand Down Expand Up @@ -31,7 +29,7 @@ wordpress.org/plugins/anti-spam/
for (i = 0; i < len; i++) { // set answer into other input instead of user
elements[i].value = answer;
}

// clear value of the empty input because some themes are adding some value for all inputs
elements = document.querySelectorAll('.antispam-control-e');
len = elements.length;
Expand Down
30 changes: 14 additions & 16 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
=== Anti-spam ===
Contributors: webvitaly
Donate link: http://web-profile.net/donate/
=== Anti-spam Reloaded ===
Contributors: webvitaly, kudlav
Tags: spam, spammer, comment, comments, comment-spam, antispam, anti-spam, block-spam, spam-free, spambot, spam-bot, bot
Requires at least: 3.3
Tested up to: 5.2
Stable tag: 5.5
Tested up to: 5.4
Stable tag: 5.6
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl.html

No spam in comments. No captcha.

== Description ==

* **[Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro")**
* **[Anti-spam](http://web-profile.net/wordpress/plugins/anti-spam/ "Plugin page")**
* **[Donate](http://web-profile.net/donate/ "Support the development")**
* **[GitHub](https://github.com/webvitalii/anti-spam "Fork")**
* **[GitHub](https://github.com/kudlav/anti-spam/ "Fork")**


Anti-spam plugin blocks automatic spam in comments section. No captcha.
Anti-spam plugin blocks automatic spam in comments section. No captcha.

Plugin is easy to use: just install it and it just works.

Expand All @@ -31,7 +26,7 @@ Anti-spam plugin is GDPR compliant and does not store any other user data except


After installing the Anti-spam plugin **try to submit a comment on your site being logged out**.
If you get an error - you may check the solution in the [Support section](http://wordpress.org/support/plugin/anti-spam) or submit a new topic with detailed description of your problem.
If you get an error - you may check the solution in the [Support section](http://wordpress.org/support/plugin/anti-spam-reloaded) or submit a new topic with detailed description of your problem.


== Installation ==
Expand All @@ -52,7 +47,6 @@ Saving spam comments can help you to keep all the comments saved and review them

Anti-spam plugin blocks 100% of automatic spam messages (sent by spam-bots via post requests).
Plugin does not block manual spam (submitted by spammers manually via browser).
You can use [Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro") plugin if you need to block manual spam.

= Incompatible with: =

Expand Down Expand Up @@ -96,8 +90,7 @@ If you installed and activated the plugin and you still receiving spam - probabl

Users rarely use trackbacks because it is manual and requires extra input. Spammers uses trackbacks because it is easy to cheat here.
Users use pingbacks very often because they work automatically. Spammers does not use pingbacks because backlinks are checked.
So trackbacks are blocked but pingbacks are enabled.
You may use [Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro") plugin if you need to enable trackbacks.
So trackbacks are blocked but pingbacks are enabled.
You may read more about the [difference between trackbacks and pingbacks](http://web-profile.net/web/trackback-vs-pingback/)

= What browsers are supported? =
Expand All @@ -116,12 +109,17 @@ and there is no plugin inputs in comments form - plugin tries to add hidden fiel

= Not enough information about the plugin? =

You may check out the [source code of the plugin](http://plugins.trac.wordpress.org/browser/anti-spam/trunk/anti-spam.php).
You may check out the [source code of the plugin](http://plugins.trac.wordpress.org/browser/anti-spam-reloaded/trunk/anti-spam.php).
The plugin is pretty small and easy to read.


== Changelog ==

= 5.6 =
* New maintainer kudlav - updated links and docs
* Removed links to paid version
* Stat info is no longer warning

= 5.5 =
* Code cleanup
* Removed dismissible notice
Expand Down

0 comments on commit 814533c

Please sign in to comment.