Plugin Directory

Changeset 3457735


Ignore:
Timestamp:
02/10/2026 07:55:47 AM (8 weeks ago)
Author:
them.es
Message:

updated trunk

Location:
i-dont-like-spam
Files:
11 added
2 edited

Legend:

Unmodified
Added
Removed
  • i-dont-like-spam/trunk/i-dont-like-spam.php

    r3208349 r3457735  
    44 * Plugin URI: https://them.es/plugins/i-dont-like-spam
    55 * 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.0
     6 * Version: 1.3.1
    77 * Author: them.es
    88 * Author URI: https://them.es
     
    4949     * A helper function to initiate actions, hooks and other features needed.
    5050     */
    51     public function init() {
     51    public function init(): void {
    5252        // [WP 5.5+] https://make.wordpress.org/core/2020/07/23/codebase-language-improvements-in-5-5
    5353        $disallowed_keys     = ( false === get_option( 'disallowed_keys' ) ? get_option( 'blacklist_keys' ) : get_option( 'disallowed_keys' ) );
     
    6565     * @return void
    6666     */
    67     public function pluginmissing_admin_notice() {
     67    public function pluginmissing_admin_notice(): void {
    6868        $plugins = array(
    6969            'Gutenberg',
     
    8888     * On load.
    8989     *
    90      * @return false|void
    91      */
    92     public function on_load() {
     90     * @return void
     91     */
     92    public function on_load(): void {
    9393        // [Experimental] Gutenberg Form Block.
    9494        if ( function_exists( 'gutenberg_is_experiment_enabled' ) && gutenberg_is_experiment_enabled( 'gutenberg-form-blocks' ) ) {
     
    133133     * @return array New flattened fields array.
    134134     */
    135     public function flatten_fields_array( $arr ) {
     135    public function flatten_fields_array( $arr ): array {
    136136        $arr_new = array();
    137137        array_walk_recursive(
    138138            $arr,
    139             function ( $a ) use ( &$arr_new ) {
     139            function ( $a ) use ( &$arr_new ): void {
    140140                $arr_new[] = $a;
    141141            }
     
    152152     * @return void
    153153     */
    154     public function customizer_settings( $wp_customize ) {
     154    public function customizer_settings( $wp_customize ): void {
    155155        // Section.
    156156        $wp_customize->add_section(
     
    190190     * https://gist.github.com/aristath/7f5ed7185a35e58c8ea65d1154b3d86d
    191191     *
    192      * @param array $content Content.
    193      * @param array $params  Form data array.
     192     * @param string $content Content.
     193     * @param array  $params  Form data array.
    194194     *
    195195     * @return string
    196196     */
    197     public function core_form_data( $content, $params ) {
     197    public function core_form_data( $content, $params ): string {
    198198        foreach ( $params as $row => $field ) {
    199199            // Skip referer row.
     
    230230     * @return array $form_data Spam checked form data array.
    231231     */
    232     public function nf_submit_data( $form_data ) {
     232    public function nf_submit_data( $form_data ): array {
    233233        foreach ( $form_data['fields'] as $field ) {
    234234            // Skip array values.
     
    269269     * @return string $honeypot Spam checked honeypot field.
    270270     */
    271     public function wpf_process_honeypot( $honeypot, $fields, $entry, $form_data ) {
     271    public function wpf_process_honeypot( $honeypot, $fields, $entry, $form_data ): string {
    272272        // Flatten fields array (e.g. "Name" field).
    273273        $entry_fields = $this->flatten_fields_array( $entry['fields'] );
     
    305305     * @return string|null
    306306     */
    307     public function mcfb_validate( $error, $form ) {
     307    public function mcfb_validate( $error, $form ): mixed {
    308308        foreach ( $form as $field ) {
    309309            foreach ( self::$bad_words as $bad_word ) {
     
    316316
    317317                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 );
    319319                }
    320320            }
  • i-dont-like-spam/trunk/readme.txt

    r3391330 r3457735  
    55Requires at least: 5.9
    66Tested up to: 6.9
    7 Stable tag: 1.3.0
     7Stable tag: 1.3.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51
     52= 1.3.1 =
     53Code quality
    5154
    5255= 1.3.0 =
Note: See TracChangeset for help on using the changeset viewer.