Plugin Directory

Changeset 2576219


Ignore:
Timestamp:
08/02/2021 05:58:12 AM (5 years ago)
Author:
_luigi
Message:

Publishing RedBrick 1.0.3

Location:
redbrick
Files:
4 edited
10 copied

Legend:

Unmodified
Added
Removed
  • redbrick/tags/1.0.3/includes/comment-validator.class.php

    r2567958 r2576219  
    201201           
    202202            // Entrusted TLDs.
    203             if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly)#', $url ) ) {
     203            if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly|st)#', $url ) ) {
    204204                $this->updateScore( -1 );
    205205            }
  • redbrick/tags/1.0.3/includes/core.class.php

    r2570172 r2576219  
    3535     */
    3636    public function pluginDidFinishLaunching() {
    37         global $pagenow;
    38 
    3937        $this->verifyVersionOfStoredData();
    4038
    41         switch ( $pagenow ) {
    42             case 'index.php':
    43                 if ( is_admin() ) {
    44                     add_action( 'wp_dashboard_setup', array( $this, 'wpDidSetupDashboard' ) );
    45                 }
    46                 break;
    47 
    48             default:
    49                 add_filter( 'preprocess_comment', array( $this, 'wpWillProcessComment' ), 1 );
    50                 break;
     39        if ( is_admin() ) {
     40            add_action( 'wp_dashboard_setup', array( $this, 'wpDidSetupDashboard' ) );
     41        }
     42        else {
     43            add_filter( 'preprocess_comment', array( $this, 'wpWillProcessComment' ), 1 );
    5144        }
    5245    }
     
    10093
    10194        $this->updateCounter( $validation_id );
    102        
     95
    10396        switch ( $validation_id ) {
    10497            case 'spam':
     
    112105        }
    113106
     107        add_action( 'wp_insert_comment', array( $this, 'wpDidInsertComment' ) );
     108
    114109        return $comment_data;
    115110    }
     
    128123        $this->db->setOption( $counter_id, ++$count, 'counters' );
    129124        $this->db->setOption( 'last_processed_time', time() );
     125    }
     126
     127    /**
     128     * @since 1.0.3
     129     * @param int $id
     130     */
     131    public function wpDidInsertComment( $id ) {
     132        $id = (int) $id;
     133
     134        if ( $id > 0 ) {
     135            $this->db->setOption( 'last_processed_comment_id', $id );
     136        }
    130137    }
    131138
     
    172179        }
    173180
    174         echo '<p>', sprintf( __( '%1$s comments were blocked, %2$s were held in the moderation queue, while %3$s passed checks.', 'redbrick' ), "<strong>{$counters['spam']}</strong>", "<strong>{$counters['moderate']}</strong>", "<strong>{$counters['approved']}</strong>" ), '</p>';
     181        echo '<p>';
     182
     183        printf(
     184            __( '%1$s comments were blocked, %2$s were held in the moderation queue, while %3$s passed checks.', 'redbrick' ),
     185            "<strong>{$counters['spam']}</strong>",
     186            "<strong>{$counters['moderate']}</strong>",
     187            "<strong>{$counters['approved']}</strong>"
     188        );
     189
     190        echo '</p>';
    175191       
    176192        $gm_time = (int) $this->db->getOption( 'last_processed_time' );
     
    181197            $date_time = '<em>' . date_i18n( $format, $time ) . '</em>';
    182198
    183             echo '<p><small>', sprintf( __( 'The last comment was processed on %s.', 'redbrick' ), $date_time ), '</small></p>';
     199            $comment_id      = (int) $this->db->getOption( 'last_processed_comment_id' );
     200            $comment_id_text = ( $comment_id > 0 ) ? ( '(#' . $comment_id . ')' ) : '';
     201
     202            echo '<p><small>';
     203
     204            printf( __( 'The last comment %1$s was processed on %2$s.', 'redbrick' ), $comment_id_text, $date_time );
     205
     206            echo '</small></p>';
    184207        }
    185208
  • redbrick/tags/1.0.3/readme.txt

    r2570172 r2576219  
    77Tested up to: 5.8
    88Requires PHP: 7.0
    9 Stable tag: 1.0.2
     9Stable tag: 1.0.3
    1010License: GPLv3
    1111License URI: https://opensource.org/licenses/GPL-3.0
     
    4949== Changelog ==
    5050
     51= 1.0.3 (2 August 2021) =
     52
     53If available, RedBrick shows in the WordPress Dashboard also the ID of the last processed comment.
     54
     55
    5156= 1.0.2 (22 July 2021) =
    5257
  • redbrick/tags/1.0.3/redbrick.php

    r2570172 r2576219  
    44 * Plugin URI: https://wordpress.org/plugins/redbrick/
    55 * Description: Simple anti-spam plugin for WordPress blogs.
    6  * Version: 1.0.2
     6 * Version: 1.0.3
    77 * Requires: 5.5
    88 * Author: Luigi Cavalieri
     
    1313 *
    1414 * @package RedBrick
    15  * @version 1.0.2
     15 * @version 1.0.3
    1616 * @copyright Copyright 2021 Luigi Cavalieri.
    1717 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
  • redbrick/trunk/includes/comment-validator.class.php

    r2567958 r2576219  
    201201           
    202202            // Entrusted TLDs.
    203             if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly)#', $url ) ) {
     203            if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly|st)#', $url ) ) {
    204204                $this->updateScore( -1 );
    205205            }
  • redbrick/trunk/includes/core.class.php

    r2570172 r2576219  
    3535     */
    3636    public function pluginDidFinishLaunching() {
    37         global $pagenow;
    38 
    3937        $this->verifyVersionOfStoredData();
    4038
    41         switch ( $pagenow ) {
    42             case 'index.php':
    43                 if ( is_admin() ) {
    44                     add_action( 'wp_dashboard_setup', array( $this, 'wpDidSetupDashboard' ) );
    45                 }
    46                 break;
    47 
    48             default:
    49                 add_filter( 'preprocess_comment', array( $this, 'wpWillProcessComment' ), 1 );
    50                 break;
     39        if ( is_admin() ) {
     40            add_action( 'wp_dashboard_setup', array( $this, 'wpDidSetupDashboard' ) );
     41        }
     42        else {
     43            add_filter( 'preprocess_comment', array( $this, 'wpWillProcessComment' ), 1 );
    5144        }
    5245    }
     
    10093
    10194        $this->updateCounter( $validation_id );
    102        
     95
    10396        switch ( $validation_id ) {
    10497            case 'spam':
     
    112105        }
    113106
     107        add_action( 'wp_insert_comment', array( $this, 'wpDidInsertComment' ) );
     108
    114109        return $comment_data;
    115110    }
     
    128123        $this->db->setOption( $counter_id, ++$count, 'counters' );
    129124        $this->db->setOption( 'last_processed_time', time() );
     125    }
     126
     127    /**
     128     * @since 1.0.3
     129     * @param int $id
     130     */
     131    public function wpDidInsertComment( $id ) {
     132        $id = (int) $id;
     133
     134        if ( $id > 0 ) {
     135            $this->db->setOption( 'last_processed_comment_id', $id );
     136        }
    130137    }
    131138
     
    172179        }
    173180
    174         echo '<p>', sprintf( __( '%1$s comments were blocked, %2$s were held in the moderation queue, while %3$s passed checks.', 'redbrick' ), "<strong>{$counters['spam']}</strong>", "<strong>{$counters['moderate']}</strong>", "<strong>{$counters['approved']}</strong>" ), '</p>';
     181        echo '<p>';
     182
     183        printf(
     184            __( '%1$s comments were blocked, %2$s were held in the moderation queue, while %3$s passed checks.', 'redbrick' ),
     185            "<strong>{$counters['spam']}</strong>",
     186            "<strong>{$counters['moderate']}</strong>",
     187            "<strong>{$counters['approved']}</strong>"
     188        );
     189
     190        echo '</p>';
    175191       
    176192        $gm_time = (int) $this->db->getOption( 'last_processed_time' );
     
    181197            $date_time = '<em>' . date_i18n( $format, $time ) . '</em>';
    182198
    183             echo '<p><small>', sprintf( __( 'The last comment was processed on %s.', 'redbrick' ), $date_time ), '</small></p>';
     199            $comment_id      = (int) $this->db->getOption( 'last_processed_comment_id' );
     200            $comment_id_text = ( $comment_id > 0 ) ? ( '(#' . $comment_id . ')' ) : '';
     201
     202            echo '<p><small>';
     203
     204            printf( __( 'The last comment %1$s was processed on %2$s.', 'redbrick' ), $comment_id_text, $date_time );
     205
     206            echo '</small></p>';
    184207        }
    185208
  • redbrick/trunk/readme.txt

    r2570172 r2576219  
    77Tested up to: 5.8
    88Requires PHP: 7.0
    9 Stable tag: 1.0.2
     9Stable tag: 1.0.3
    1010License: GPLv3
    1111License URI: https://opensource.org/licenses/GPL-3.0
     
    4949== Changelog ==
    5050
     51= 1.0.3 (2 August 2021) =
     52
     53If available, RedBrick shows in the WordPress Dashboard also the ID of the last processed comment.
     54
     55
    5156= 1.0.2 (22 July 2021) =
    5257
  • redbrick/trunk/redbrick.php

    r2570172 r2576219  
    44 * Plugin URI: https://wordpress.org/plugins/redbrick/
    55 * Description: Simple anti-spam plugin for WordPress blogs.
    6  * Version: 1.0.2
     6 * Version: 1.0.3
    77 * Requires: 5.5
    88 * Author: Luigi Cavalieri
     
    1313 *
    1414 * @package RedBrick
    15  * @version 1.0.2
     15 * @version 1.0.3
    1616 * @copyright Copyright 2021 Luigi Cavalieri.
    1717 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
Note: See TracChangeset for help on using the changeset viewer.