Changeset 2576219
- Timestamp:
- 08/02/2021 05:58:12 AM (5 years ago)
- Location:
- redbrick
- Files:
-
- 4 edited
- 10 copied
-
tags/1.0.3 (copied) (copied from redbrick/trunk)
-
tags/1.0.3/includes (copied) (copied from redbrick/trunk/includes)
-
tags/1.0.3/includes/comment-validator.class.php (copied) (copied from redbrick/trunk/includes/comment-validator.class.php) (1 diff)
-
tags/1.0.3/includes/core.class.php (copied) (copied from redbrick/trunk/includes/core.class.php) (6 diffs)
-
tags/1.0.3/index.php (copied) (copied from redbrick/trunk/index.php)
-
tags/1.0.3/library (copied) (copied from redbrick/trunk/library)
-
tags/1.0.3/license.txt (copied) (copied from redbrick/trunk/license.txt)
-
tags/1.0.3/readme.txt (copied) (copied from redbrick/trunk/readme.txt) (2 diffs)
-
tags/1.0.3/redbrick.php (copied) (copied from redbrick/trunk/redbrick.php) (2 diffs)
-
tags/1.0.3/uninstall.php (copied) (copied from redbrick/trunk/uninstall.php)
-
trunk/includes/comment-validator.class.php (modified) (1 diff)
-
trunk/includes/core.class.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/redbrick.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
redbrick/tags/1.0.3/includes/comment-validator.class.php
r2567958 r2576219 201 201 202 202 // Entrusted TLDs. 203 if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly )#', $url ) ) {203 if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly|st)#', $url ) ) { 204 204 $this->updateScore( -1 ); 205 205 } -
redbrick/tags/1.0.3/includes/core.class.php
r2570172 r2576219 35 35 */ 36 36 public function pluginDidFinishLaunching() { 37 global $pagenow;38 39 37 $this->verifyVersionOfStoredData(); 40 38 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 ); 51 44 } 52 45 } … … 100 93 101 94 $this->updateCounter( $validation_id ); 102 95 103 96 switch ( $validation_id ) { 104 97 case 'spam': … … 112 105 } 113 106 107 add_action( 'wp_insert_comment', array( $this, 'wpDidInsertComment' ) ); 108 114 109 return $comment_data; 115 110 } … … 128 123 $this->db->setOption( $counter_id, ++$count, 'counters' ); 129 124 $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 } 130 137 } 131 138 … … 172 179 } 173 180 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>'; 175 191 176 192 $gm_time = (int) $this->db->getOption( 'last_processed_time' ); … … 181 197 $date_time = '<em>' . date_i18n( $format, $time ) . '</em>'; 182 198 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>'; 184 207 } 185 208 -
redbrick/tags/1.0.3/readme.txt
r2570172 r2576219 7 7 Tested up to: 5.8 8 8 Requires PHP: 7.0 9 Stable tag: 1.0. 29 Stable tag: 1.0.3 10 10 License: GPLv3 11 11 License URI: https://opensource.org/licenses/GPL-3.0 … … 49 49 == Changelog == 50 50 51 = 1.0.3 (2 August 2021) = 52 53 If available, RedBrick shows in the WordPress Dashboard also the ID of the last processed comment. 54 55 51 56 = 1.0.2 (22 July 2021) = 52 57 -
redbrick/tags/1.0.3/redbrick.php
r2570172 r2576219 4 4 * Plugin URI: https://wordpress.org/plugins/redbrick/ 5 5 * Description: Simple anti-spam plugin for WordPress blogs. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Requires: 5.5 8 8 * Author: Luigi Cavalieri … … 13 13 * 14 14 * @package RedBrick 15 * @version 1.0. 215 * @version 1.0.3 16 16 * @copyright Copyright 2021 Luigi Cavalieri. 17 17 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0 -
redbrick/trunk/includes/comment-validator.class.php
r2567958 r2576219 201 201 202 202 // Entrusted TLDs. 203 if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly )#', $url ) ) {203 if ( preg_match( '#://.+\.(?:pl|jp|cn|info|ly|st)#', $url ) ) { 204 204 $this->updateScore( -1 ); 205 205 } -
redbrick/trunk/includes/core.class.php
r2570172 r2576219 35 35 */ 36 36 public function pluginDidFinishLaunching() { 37 global $pagenow;38 39 37 $this->verifyVersionOfStoredData(); 40 38 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 ); 51 44 } 52 45 } … … 100 93 101 94 $this->updateCounter( $validation_id ); 102 95 103 96 switch ( $validation_id ) { 104 97 case 'spam': … … 112 105 } 113 106 107 add_action( 'wp_insert_comment', array( $this, 'wpDidInsertComment' ) ); 108 114 109 return $comment_data; 115 110 } … … 128 123 $this->db->setOption( $counter_id, ++$count, 'counters' ); 129 124 $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 } 130 137 } 131 138 … … 172 179 } 173 180 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>'; 175 191 176 192 $gm_time = (int) $this->db->getOption( 'last_processed_time' ); … … 181 197 $date_time = '<em>' . date_i18n( $format, $time ) . '</em>'; 182 198 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>'; 184 207 } 185 208 -
redbrick/trunk/readme.txt
r2570172 r2576219 7 7 Tested up to: 5.8 8 8 Requires PHP: 7.0 9 Stable tag: 1.0. 29 Stable tag: 1.0.3 10 10 License: GPLv3 11 11 License URI: https://opensource.org/licenses/GPL-3.0 … … 49 49 == Changelog == 50 50 51 = 1.0.3 (2 August 2021) = 52 53 If available, RedBrick shows in the WordPress Dashboard also the ID of the last processed comment. 54 55 51 56 = 1.0.2 (22 July 2021) = 52 57 -
redbrick/trunk/redbrick.php
r2570172 r2576219 4 4 * Plugin URI: https://wordpress.org/plugins/redbrick/ 5 5 * Description: Simple anti-spam plugin for WordPress blogs. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Requires: 5.5 8 8 * Author: Luigi Cavalieri … … 13 13 * 14 14 * @package RedBrick 15 * @version 1.0. 215 * @version 1.0.3 16 16 * @copyright Copyright 2021 Luigi Cavalieri. 17 17 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
Note: See TracChangeset
for help on using the changeset viewer.