Changeset 3457735
- Timestamp:
- 02/10/2026 07:55:47 AM (8 weeks ago)
- Location:
- i-dont-like-spam
- Files:
-
- 11 added
- 2 edited
-
tags/1.3.1 (added)
-
tags/1.3.1/LICENSE (added)
-
tags/1.3.1/README.md (added)
-
tags/1.3.1/SECURITY.md (added)
-
tags/1.3.1/i-dont-like-spam.php (added)
-
tags/1.3.1/languages (added)
-
tags/1.3.1/languages/i-dont-like-spam-de_DE.l10n.php (added)
-
tags/1.3.1/languages/i-dont-like-spam-de_DE.mo (added)
-
tags/1.3.1/languages/i-dont-like-spam-de_DE.po (added)
-
tags/1.3.1/languages/i-dont-like-spam.pot (added)
-
tags/1.3.1/readme.txt (added)
-
trunk/i-dont-like-spam.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i-dont-like-spam/trunk/i-dont-like-spam.php
r3208349 r3457735 4 4 * Plugin URI: https://them.es/plugins/i-dont-like-spam 5 5 * Description: Block contact form submissions containing bad words from the WordPress Comment Blocklist. Compatible with the Gutenberg form block (experimental), Ninja Forms, WPForms and Meow Contact Form Block. 6 * Version: 1.3. 06 * Version: 1.3.1 7 7 * Author: them.es 8 8 * Author URI: https://them.es … … 49 49 * A helper function to initiate actions, hooks and other features needed. 50 50 */ 51 public function init() {51 public function init(): void { 52 52 // [WP 5.5+] https://make.wordpress.org/core/2020/07/23/codebase-language-improvements-in-5-5 53 53 $disallowed_keys = ( false === get_option( 'disallowed_keys' ) ? get_option( 'blacklist_keys' ) : get_option( 'disallowed_keys' ) ); … … 65 65 * @return void 66 66 */ 67 public function pluginmissing_admin_notice() {67 public function pluginmissing_admin_notice(): void { 68 68 $plugins = array( 69 69 'Gutenberg', … … 88 88 * On load. 89 89 * 90 * @return false|void91 */ 92 public function on_load() {90 * @return void 91 */ 92 public function on_load(): void { 93 93 // [Experimental] Gutenberg Form Block. 94 94 if ( function_exists( 'gutenberg_is_experiment_enabled' ) && gutenberg_is_experiment_enabled( 'gutenberg-form-blocks' ) ) { … … 133 133 * @return array New flattened fields array. 134 134 */ 135 public function flatten_fields_array( $arr ) {135 public function flatten_fields_array( $arr ): array { 136 136 $arr_new = array(); 137 137 array_walk_recursive( 138 138 $arr, 139 function ( $a ) use ( &$arr_new ) {139 function ( $a ) use ( &$arr_new ): void { 140 140 $arr_new[] = $a; 141 141 } … … 152 152 * @return void 153 153 */ 154 public function customizer_settings( $wp_customize ) {154 public function customizer_settings( $wp_customize ): void { 155 155 // Section. 156 156 $wp_customize->add_section( … … 190 190 * https://gist.github.com/aristath/7f5ed7185a35e58c8ea65d1154b3d86d 191 191 * 192 * @param array$content Content.193 * @param array $params Form data array.192 * @param string $content Content. 193 * @param array $params Form data array. 194 194 * 195 195 * @return string 196 196 */ 197 public function core_form_data( $content, $params ) {197 public function core_form_data( $content, $params ): string { 198 198 foreach ( $params as $row => $field ) { 199 199 // Skip referer row. … … 230 230 * @return array $form_data Spam checked form data array. 231 231 */ 232 public function nf_submit_data( $form_data ) {232 public function nf_submit_data( $form_data ): array { 233 233 foreach ( $form_data['fields'] as $field ) { 234 234 // Skip array values. … … 269 269 * @return string $honeypot Spam checked honeypot field. 270 270 */ 271 public function wpf_process_honeypot( $honeypot, $fields, $entry, $form_data ) {271 public function wpf_process_honeypot( $honeypot, $fields, $entry, $form_data ): string { 272 272 // Flatten fields array (e.g. "Name" field). 273 273 $entry_fields = $this->flatten_fields_array( $entry['fields'] ); … … 305 305 * @return string|null 306 306 */ 307 public function mcfb_validate( $error, $form ) {307 public function mcfb_validate( $error, $form ): mixed { 308 308 foreach ( $form as $field ) { 309 309 foreach ( self::$bad_words as $bad_word ) { … … 316 316 317 317 if ( str_contains( $field, $bad_word ) ) { 318 return ( empty( self::$error_message ) ? sprintf( __( 'This %s contains a word that has been blocked.', 'i-dont-like-spam' ), __( 'form', 'i-dont-like-spam' ) ) : esc_attr( self::$error_message ));318 return empty( self::$error_message ) ? sprintf( __( 'This %s contains a word that has been blocked.', 'i-dont-like-spam' ), __( 'form', 'i-dont-like-spam' ) ) : esc_attr( self::$error_message ); 319 319 } 320 320 } -
i-dont-like-spam/trunk/readme.txt
r3391330 r3457735 5 5 Requires at least: 5.9 6 6 Tested up to: 6.9 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 50 50 == Changelog == 51 52 = 1.3.1 = 53 Code quality 51 54 52 55 = 1.3.0 =
Note: See TracChangeset
for help on using the changeset viewer.