Plugin Directory

Changeset 3441188


Ignore:
Timestamp:
01/16/2026 06:00:43 PM (3 months ago)
Author:
bmarshall511
Message:

Release 5.5.9 - fix(api): encode email_details as JSON before sending to API

Location:
zero-spam
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • zero-spam/tags/5.5.9/modules/class-zerospam.php

    r3434746 r3441188  
    231231        $api_data['reporter_email'] = sanitize_email( get_bloginfo( 'admin_email' ) );
    232232        $api_data['app_key']        = \ZeroSpam\Core\Utilities::clean_domain( esc_url( site_url() ) );
    233         $api_data['app_type']       = 'WordPress';
    234         $api_data['app_details']    = array(
    235             'app_version'      => sanitize_text_field( get_bloginfo( 'version' ) ),
    236             'app_type_version' => sanitize_text_field( ZEROSPAM_VERSION ),
    237             'app_language'     => sanitize_text_field( strtolower( get_bloginfo( 'language' ) ) ),
    238             'app_email'        => sanitize_email( get_bloginfo( 'admin_email' ) ),
    239             'app_name'         => sanitize_text_field( get_bloginfo( 'name' ) ),
    240             'app_desc'         => sanitize_text_field( get_bloginfo( 'description' ) ),
     233        $api_data['app_type']       = 'wordpress';
     234        $api_data['app_details']    = wp_json_encode(
     235            array(
     236                'app_version'      => sanitize_text_field( get_bloginfo( 'version' ) ),
     237                'app_type_version' => sanitize_text_field( ZEROSPAM_VERSION ),
     238                'app_language'     => sanitize_text_field( strtolower( get_bloginfo( 'language' ) ) ),
     239                'app_email'        => sanitize_email( get_bloginfo( 'admin_email' ) ),
     240                'app_name'         => sanitize_text_field( get_bloginfo( 'name' ) ),
     241                'app_desc'         => sanitize_text_field( get_bloginfo( 'description' ) ),
     242            )
    241243        );
    242244
     
    357359            }
    358360
     361            // Encode email_details as JSON string (API expects JSON, not array).
     362            $report_details['email_details'] = wp_json_encode( $report_details['email_details'] );
     363
    359364            // Append global data and submit the email report.
    360365            self::remote_request( $endpoint, [ 'body' => [ 'data' => array_merge( $report_details, $global_data ) ] ] );
  • zero-spam/tags/5.5.9/readme.txt

    r3434746 r3441188  
    66Tested up to: 6.9
    77Requires PHP: 8.2
    8 Stable tag: 5.5.8
     8Stable tag: 5.5.9
    99License: GPL v2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    107107
    108108== Changelog ==
     109
     110= v5.5.9 =
     111
     112* fix(api): corrected app_type case mismatch and app_details/email_details encoding
    109113
    110114= v5.5.8 =
  • zero-spam/tags/5.5.9/wordpress-zero-spam.php

    r3434753 r3441188  
    1616 * Plugin URI:        https://wordpress.com/plugins/zero-spam/
    1717 * Description:       Tired of all the ineffective WordPress anti-spam & security plugins? Zero Spam for WordPress makes blocking spam &amp; malicious activity a cinch. <strong>Just activate, configure, and say goodbye to spam.</strong>
    18  * Version:           5.5.8
     18 * Version:           5.5.9
    1919 * Requires at least: 6.9
    2020 * Requires PHP:      8.2
     
    3434define( 'ZEROSPAM_PATH', plugin_dir_path( ZEROSPAM ) );
    3535define( 'ZEROSPAM_PLUGIN_BASE', plugin_basename( ZEROSPAM ) );
    36 define( 'ZEROSPAM_VERSION', '5.5.8' );
     36define( 'ZEROSPAM_VERSION', '5.5.9' );
    3737
    3838if ( defined( 'ZEROSPAM_DEVELOPMENT_URL' ) ) {
  • zero-spam/trunk/modules/class-zerospam.php

    r3434746 r3441188  
    231231        $api_data['reporter_email'] = sanitize_email( get_bloginfo( 'admin_email' ) );
    232232        $api_data['app_key']        = \ZeroSpam\Core\Utilities::clean_domain( esc_url( site_url() ) );
    233         $api_data['app_type']       = 'WordPress';
    234         $api_data['app_details']    = array(
    235             'app_version'      => sanitize_text_field( get_bloginfo( 'version' ) ),
    236             'app_type_version' => sanitize_text_field( ZEROSPAM_VERSION ),
    237             'app_language'     => sanitize_text_field( strtolower( get_bloginfo( 'language' ) ) ),
    238             'app_email'        => sanitize_email( get_bloginfo( 'admin_email' ) ),
    239             'app_name'         => sanitize_text_field( get_bloginfo( 'name' ) ),
    240             'app_desc'         => sanitize_text_field( get_bloginfo( 'description' ) ),
     233        $api_data['app_type']       = 'wordpress';
     234        $api_data['app_details']    = wp_json_encode(
     235            array(
     236                'app_version'      => sanitize_text_field( get_bloginfo( 'version' ) ),
     237                'app_type_version' => sanitize_text_field( ZEROSPAM_VERSION ),
     238                'app_language'     => sanitize_text_field( strtolower( get_bloginfo( 'language' ) ) ),
     239                'app_email'        => sanitize_email( get_bloginfo( 'admin_email' ) ),
     240                'app_name'         => sanitize_text_field( get_bloginfo( 'name' ) ),
     241                'app_desc'         => sanitize_text_field( get_bloginfo( 'description' ) ),
     242            )
    241243        );
    242244
     
    357359            }
    358360
     361            // Encode email_details as JSON string (API expects JSON, not array).
     362            $report_details['email_details'] = wp_json_encode( $report_details['email_details'] );
     363
    359364            // Append global data and submit the email report.
    360365            self::remote_request( $endpoint, [ 'body' => [ 'data' => array_merge( $report_details, $global_data ) ] ] );
  • zero-spam/trunk/readme.txt

    r3434746 r3441188  
    66Tested up to: 6.9
    77Requires PHP: 8.2
    8 Stable tag: 5.5.8
     8Stable tag: 5.5.9
    99License: GPL v2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    107107
    108108== Changelog ==
     109
     110= v5.5.9 =
     111
     112* fix(api): corrected app_type case mismatch and app_details/email_details encoding
    109113
    110114= v5.5.8 =
  • zero-spam/trunk/wordpress-zero-spam.php

    r3434753 r3441188  
    1616 * Plugin URI:        https://wordpress.com/plugins/zero-spam/
    1717 * Description:       Tired of all the ineffective WordPress anti-spam & security plugins? Zero Spam for WordPress makes blocking spam &amp; malicious activity a cinch. <strong>Just activate, configure, and say goodbye to spam.</strong>
    18  * Version:           5.5.8
     18 * Version:           5.5.9
    1919 * Requires at least: 6.9
    2020 * Requires PHP:      8.2
     
    3434define( 'ZEROSPAM_PATH', plugin_dir_path( ZEROSPAM ) );
    3535define( 'ZEROSPAM_PLUGIN_BASE', plugin_basename( ZEROSPAM ) );
    36 define( 'ZEROSPAM_VERSION', '5.5.8' );
     36define( 'ZEROSPAM_VERSION', '5.5.9' );
    3737
    3838if ( defined( 'ZEROSPAM_DEVELOPMENT_URL' ) ) {
Note: See TracChangeset for help on using the changeset viewer.