Plugin Directory

Changeset 3345192


Ignore:
Timestamp:
08/15/2025 02:22:18 PM (8 months ago)
Author:
trainingbusinesspros
Message:

Update to version 4.2.4.2 from GitHub

Location:
groundhogg
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • groundhogg/tags/4.2.4.2/README.txt

    r3344140 r3345192  
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.4.1
     9Stable tag: 4.2.4.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    374374
    375375== Changelog ==
     376
     377= 4.2.4.2 (2025-08-15) =
     378* TWEAKED Refactored usages of `file_get_contents()` to use the `WP_Filesystem` instead.
     379* FIXED Don't use `esc_html()` for CSS. You'd think WordPress core would have a better internal solution for outputting CSS 🙄
    376380
    377381= 4.2.4.1 (2025-08-13) =
  • groundhogg/tags/4.2.4.2/groundhogg.php

    r3344140 r3345192  
    44 * Plugin URI:  https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    55 * Description: CRM and marketing automation for WordPress
    6  * Version: 4.2.4.1
     6 * Version: 4.2.4.2
    77 * Author: Groundhogg Inc.
    88 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2525if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    2626
    27 define( 'GROUNDHOGG_VERSION', '4.2.4.1' );
    28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.3.1' );
     27define( 'GROUNDHOGG_VERSION', '4.2.4.2' );
     28define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.4.1' );
    2929
    3030define( 'GROUNDHOGG__FILE__', __FILE__ );
  • groundhogg/tags/4.2.4.2/includes/bulk-jobs/manager.php

    r3343709 r3345192  
    4141    }
    4242
    43 
    4443    /**
    4544     * Magic get method
  • groundhogg/tags/4.2.4.2/includes/functions.php

    r3343709 r3345192  
    12161216            case 'action':
    12171217            case 'src':
     1218            case 'background':
    12181219                $value = strpos( $value, 'data:image/png;base64,' ) === false ? esc_url( $value ) : esc_attr( $value );
    12191220                break;
     
    36643665                // check the time the file was created, if within our ttl, return the contents
    36653666                if ( $time && $time > time() - $cache_ttl ) {
    3666                     $json = json_decode( @file_get_contents( $cached_file ), $as_array );
     3667                    $json = json_decode( files()->get_contents( $cached_file ), $as_array );
    36673668                    if ( ! empty( $json ) ) {
    36683669                        return $json;
     
    37163717    // We don't cache errors...
    37173718    if ( $cache_ttl !== 0 && $cache_key ) {
    3718         @file_put_contents( files()->get_uploads_dir( 'requests', $cache_key . '.json', true ), json_encode( $json ) );
     3719        files()->put( files()->get_uploads_dir( 'requests', $cache_key . '.json', true ), wp_json_encode( $json ) );
    37193720    }
    37203721
     
    46154616function install_gh_cron_file() {
    46164617
    4617     $gh_cron_php = file_get_contents( GROUNDHOGG_PATH . 'gh-cron.txt' );
    4618     $bytes       = file_put_contents( ABSPATH . 'gh-cron.php', $gh_cron_php );
     4618    $gh_cron_php = files()->get_contents( GROUNDHOGG_PATH . 'gh-cron.txt' );
     4619    $bytes       = files()->put_contents( ABSPATH . 'gh-cron.php', $gh_cron_php );
    46194620
    46204621    return (bool) $bytes;
     
    46274628 */
    46284629function uninstall_gh_cron_file() {
    4629     return @unlink( ABSPATH . 'gh-cron.php' );
     4630    return wp_delete_file( ABSPATH . 'gh-cron.php' );
    46304631}
    46314632
     
    73957396    // initialize providers
    73967397    if ( empty( $providers ) ) {
    7397         $providers = json_decode( file_get_contents( GROUNDHOGG_ASSETS_PATH . 'lib/free-email-providers.json' ), true );
     7398        $providers = json_decode( files()->get( GROUNDHOGG_ASSETS_PATH . 'lib/free-email-providers.json' ), true );
    73987399    }
    73997400
     
    88298830
    88308831    // Read file content
    8831     $content = file_get_contents( $file_path );
     8832    $content = files()->get_contents( $file_path );
    88328833
    88338834    // Replace occurrences
     
    88358836
    88368837    // Write back to file
    8837     return file_put_contents( $file_path, $updated_content ) !== false;
     8838    return files()->put_contents( $file_path, $updated_content ) !== false;
    88388839}
    88398840
     
    90019002function redact_meta_table( $table ) {
    90029003
    9003     global $wpdb;
    9004 
    90059004    $table      = db()->get_db( $table );
    90069005    $table_name = $table->table_name;
     
    90089007
    90099008    $time = time();
    9010 
    90119009
    90129010    global $wpdb;
  • groundhogg/tags/4.2.4.2/includes/utils/files.php

    r3343709 r3345192  
    66
    77class Files {
     8
     9    /**
     10     * Proxy for filesystem())
     11     *
     12     * @param $name
     13     * @param $arguments
     14     *
     15     * @return mixed
     16     */
     17    public function __call( $name, $arguments ) {
     18        if ( method_exists( $this->filesystem(), $name ) ) {
     19            return call_user_func_array( [ $this->filesystem(), $name ], $arguments );
     20        }
     21
     22        throw new \BadMethodCallException( sprintf( "Method %s does not exist.", esc_html( $name ) ) );
     23    }
    824
    925    /**
  • groundhogg/tags/4.2.4.2/templates/email/boxed.php

    r3343709 r3345192  
    6161    </style>
    6262    <style id="block-styles">
    63         <?php echo esc_html( $email->get_css() ) ?>
     63        <?php
     64        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     65        echo wp_strip_all_tags( $email->get_css() ); ?>
    6466    </style>
    6567    <?php do_action( 'groundhogg/templates/email/boxed/head' ); ?>
     
    7173<table class="alignment-container" style="width: 100%;border-collapse: collapse;" cellpadding="0" cellspacing="0" role="presentation">
    7274    <tr>
    73         <td align="<?php echo esc_attr( $alignment ); ?>" bgcolor="<?php echo esc_attr( $bgColor ); ?>"
    74             background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) );?>">
     75        <td align="<?php echo esc_attr( $alignment ); ?>" bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    7576            <table class="content-container" cellpadding="0" cellspacing="0" style="border-collapse: collapse" role="presentation">
    7677                <tr>
    77                     <td width="<?php echo esc_attr( $email->get_width() ); ?>"
    78                         style="width: <?php echo esc_attr( $email->get_width() ); ?>px">
     78                    <td width="<?php echo esc_attr( $email->get_width() ); ?>" style="width: <?php echo esc_attr( $email->get_width() ); ?>px">
     79                        <?php
    7980
    80                         <?php load_part( 'browser-view' ); ?>
     81                        load_part( 'browser-view' );
     82                        do_action( 'groundhogg/templates/email/boxed/content/before' );
    8183
    82                         <div class="body-content">
    83                             <?php
    84                             do_action( 'groundhogg/templates/email/boxed/content/before' );
     84                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
     85                        echo $email->get_merged_content();
    8586
    86                             // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
    87                             echo $email->get_merged_content();
    88 
    89                             do_action( 'groundhogg/templates/email/boxed/content/after' ); ?>
    90                         </div>
    91 
    92                         <?php load_part( 'footer' ); ?>
     87                        do_action( 'groundhogg/templates/email/boxed/content/after' );
     88                        load_part( 'footer' ); ?>
    9389                    </td>
    9490                </tr>
  • groundhogg/tags/4.2.4.2/templates/email/full_width.php

    r3343709 r3345192  
    4949    <meta name="x-apple-disable-message-reformatting"/>
    5050    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    51 
    5251    <title><?php echo esc_html( $email_title ); ?></title>
    5352    <base target="_blank">
     
    6059    </style>
    6160    <style id="block-styles">
    62         <?php echo esc_html( $email->get_css() ); ?>
     61        <?php
     62        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     63        echo wp_strip_all_tags( $email->get_css() ); ?>
    6364    </style>
    6465    <?php do_action( 'groundhogg/templates/email/full-width/head' ); ?>
  • groundhogg/tags/4.2.4.2/templates/email/full_width_contained.php

    r3343709 r3345192  
    4949    <meta name="x-apple-disable-message-reformatting"/>
    5050    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    51 
    5251    <title><?php echo esc_html( $email_title ); ?></title>
    5352    <base target="_blank">
     
    6059    </style>
    6160    <style id="block-styles">
    62         <?php echo esc_html( $email->get_css() ) ?>
     61        <?php
     62        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     63        echo wp_strip_all_tags( $email->get_css() ); ?>
    6364    </style>
    6465    <?php do_action( 'groundhogg/templates/email/full-width/head' ); ?>
     
    6768<table class="body-content" cellspacing="0" cellpadding="0" role="presentation" width="100%">
    6869    <tr>
    69         <td bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>"
    70             style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    71             <?php load_part( 'preview-text' ); ?>
    72             <?php load_part( 'browser-view' ); ?>
    73             <?php do_action( 'groundhogg/templates/email/full-width/content/before' ); ?>
     70        <td bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    7471            <?php
     72
     73            load_part( 'preview-text' );
     74            load_part( 'browser-view' );
     75            do_action( 'groundhogg/templates/email/full-width/content/before' );
     76
    7577            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
    76             echo $email->get_merged_content(); ?>
    77             <?php do_action( 'groundhogg/templates/email/full-width/content/after' ); ?>
    78             <?php if ( ! $email->has_footer_block() ): ?>
     78            echo $email->get_merged_content();
     79
     80            do_action( 'groundhogg/templates/email/full-width/content/after' );
     81
     82            if ( ! $email->has_footer_block() ): ?>
    7983            <table cellspacing="0" cellpadding="0" role="presentation" align="center">
    8084                <tr>
  • groundhogg/tags/4.2.4.2/templates/email/template-functions.php

    r3343709 r3345192  
    11<?php
     2
     3use function Groundhogg\files;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
     
    4042
    4143        do_action( "groundhogg/templates/email/css/$file" );
     44        $css = files()->get_contents( $file );
    4245
    43         echo esc_html( file_get_contents( $file ) );
     46        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     47        echo wp_strip_all_tags( $css );
    4448    }
    4549}
  • groundhogg/trunk/README.txt

    r3344140 r3345192  
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.4.1
     9Stable tag: 4.2.4.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    374374
    375375== Changelog ==
     376
     377= 4.2.4.2 (2025-08-15) =
     378* TWEAKED Refactored usages of `file_get_contents()` to use the `WP_Filesystem` instead.
     379* FIXED Don't use `esc_html()` for CSS. You'd think WordPress core would have a better internal solution for outputting CSS 🙄
    376380
    377381= 4.2.4.1 (2025-08-13) =
  • groundhogg/trunk/groundhogg.php

    r3344140 r3345192  
    44 * Plugin URI:  https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    55 * Description: CRM and marketing automation for WordPress
    6  * Version: 4.2.4.1
     6 * Version: 4.2.4.2
    77 * Author: Groundhogg Inc.
    88 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2525if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    2626
    27 define( 'GROUNDHOGG_VERSION', '4.2.4.1' );
    28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.3.1' );
     27define( 'GROUNDHOGG_VERSION', '4.2.4.2' );
     28define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.4.1' );
    2929
    3030define( 'GROUNDHOGG__FILE__', __FILE__ );
  • groundhogg/trunk/includes/bulk-jobs/manager.php

    r3343709 r3345192  
    4141    }
    4242
    43 
    4443    /**
    4544     * Magic get method
  • groundhogg/trunk/includes/functions.php

    r3343709 r3345192  
    12161216            case 'action':
    12171217            case 'src':
     1218            case 'background':
    12181219                $value = strpos( $value, 'data:image/png;base64,' ) === false ? esc_url( $value ) : esc_attr( $value );
    12191220                break;
     
    36643665                // check the time the file was created, if within our ttl, return the contents
    36653666                if ( $time && $time > time() - $cache_ttl ) {
    3666                     $json = json_decode( @file_get_contents( $cached_file ), $as_array );
     3667                    $json = json_decode( files()->get_contents( $cached_file ), $as_array );
    36673668                    if ( ! empty( $json ) ) {
    36683669                        return $json;
     
    37163717    // We don't cache errors...
    37173718    if ( $cache_ttl !== 0 && $cache_key ) {
    3718         @file_put_contents( files()->get_uploads_dir( 'requests', $cache_key . '.json', true ), json_encode( $json ) );
     3719        files()->put( files()->get_uploads_dir( 'requests', $cache_key . '.json', true ), wp_json_encode( $json ) );
    37193720    }
    37203721
     
    46154616function install_gh_cron_file() {
    46164617
    4617     $gh_cron_php = file_get_contents( GROUNDHOGG_PATH . 'gh-cron.txt' );
    4618     $bytes       = file_put_contents( ABSPATH . 'gh-cron.php', $gh_cron_php );
     4618    $gh_cron_php = files()->get_contents( GROUNDHOGG_PATH . 'gh-cron.txt' );
     4619    $bytes       = files()->put_contents( ABSPATH . 'gh-cron.php', $gh_cron_php );
    46194620
    46204621    return (bool) $bytes;
     
    46274628 */
    46284629function uninstall_gh_cron_file() {
    4629     return @unlink( ABSPATH . 'gh-cron.php' );
     4630    return wp_delete_file( ABSPATH . 'gh-cron.php' );
    46304631}
    46314632
     
    73957396    // initialize providers
    73967397    if ( empty( $providers ) ) {
    7397         $providers = json_decode( file_get_contents( GROUNDHOGG_ASSETS_PATH . 'lib/free-email-providers.json' ), true );
     7398        $providers = json_decode( files()->get( GROUNDHOGG_ASSETS_PATH . 'lib/free-email-providers.json' ), true );
    73987399    }
    73997400
     
    88298830
    88308831    // Read file content
    8831     $content = file_get_contents( $file_path );
     8832    $content = files()->get_contents( $file_path );
    88328833
    88338834    // Replace occurrences
     
    88358836
    88368837    // Write back to file
    8837     return file_put_contents( $file_path, $updated_content ) !== false;
     8838    return files()->put_contents( $file_path, $updated_content ) !== false;
    88388839}
    88398840
     
    90019002function redact_meta_table( $table ) {
    90029003
    9003     global $wpdb;
    9004 
    90059004    $table      = db()->get_db( $table );
    90069005    $table_name = $table->table_name;
     
    90089007
    90099008    $time = time();
    9010 
    90119009
    90129010    global $wpdb;
  • groundhogg/trunk/includes/utils/files.php

    r3343709 r3345192  
    66
    77class Files {
     8
     9    /**
     10     * Proxy for filesystem())
     11     *
     12     * @param $name
     13     * @param $arguments
     14     *
     15     * @return mixed
     16     */
     17    public function __call( $name, $arguments ) {
     18        if ( method_exists( $this->filesystem(), $name ) ) {
     19            return call_user_func_array( [ $this->filesystem(), $name ], $arguments );
     20        }
     21
     22        throw new \BadMethodCallException( sprintf( "Method %s does not exist.", esc_html( $name ) ) );
     23    }
    824
    925    /**
  • groundhogg/trunk/templates/email/boxed.php

    r3343709 r3345192  
    6161    </style>
    6262    <style id="block-styles">
    63         <?php echo esc_html( $email->get_css() ) ?>
     63        <?php
     64        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     65        echo wp_strip_all_tags( $email->get_css() ); ?>
    6466    </style>
    6567    <?php do_action( 'groundhogg/templates/email/boxed/head' ); ?>
     
    7173<table class="alignment-container" style="width: 100%;border-collapse: collapse;" cellpadding="0" cellspacing="0" role="presentation">
    7274    <tr>
    73         <td align="<?php echo esc_attr( $alignment ); ?>" bgcolor="<?php echo esc_attr( $bgColor ); ?>"
    74             background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) );?>">
     75        <td align="<?php echo esc_attr( $alignment ); ?>" bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    7576            <table class="content-container" cellpadding="0" cellspacing="0" style="border-collapse: collapse" role="presentation">
    7677                <tr>
    77                     <td width="<?php echo esc_attr( $email->get_width() ); ?>"
    78                         style="width: <?php echo esc_attr( $email->get_width() ); ?>px">
     78                    <td width="<?php echo esc_attr( $email->get_width() ); ?>" style="width: <?php echo esc_attr( $email->get_width() ); ?>px">
     79                        <?php
    7980
    80                         <?php load_part( 'browser-view' ); ?>
     81                        load_part( 'browser-view' );
     82                        do_action( 'groundhogg/templates/email/boxed/content/before' );
    8183
    82                         <div class="body-content">
    83                             <?php
    84                             do_action( 'groundhogg/templates/email/boxed/content/before' );
     84                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
     85                        echo $email->get_merged_content();
    8586
    86                             // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
    87                             echo $email->get_merged_content();
    88 
    89                             do_action( 'groundhogg/templates/email/boxed/content/after' ); ?>
    90                         </div>
    91 
    92                         <?php load_part( 'footer' ); ?>
     87                        do_action( 'groundhogg/templates/email/boxed/content/after' );
     88                        load_part( 'footer' ); ?>
    9389                    </td>
    9490                </tr>
  • groundhogg/trunk/templates/email/full_width.php

    r3343709 r3345192  
    4949    <meta name="x-apple-disable-message-reformatting"/>
    5050    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    51 
    5251    <title><?php echo esc_html( $email_title ); ?></title>
    5352    <base target="_blank">
     
    6059    </style>
    6160    <style id="block-styles">
    62         <?php echo esc_html( $email->get_css() ); ?>
     61        <?php
     62        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     63        echo wp_strip_all_tags( $email->get_css() ); ?>
    6364    </style>
    6465    <?php do_action( 'groundhogg/templates/email/full-width/head' ); ?>
  • groundhogg/trunk/templates/email/full_width_contained.php

    r3343709 r3345192  
    4949    <meta name="x-apple-disable-message-reformatting"/>
    5050    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    51 
    5251    <title><?php echo esc_html( $email_title ); ?></title>
    5352    <base target="_blank">
     
    6059    </style>
    6160    <style id="block-styles">
    62         <?php echo esc_html( $email->get_css() ) ?>
     61        <?php
     62        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     63        echo wp_strip_all_tags( $email->get_css() ); ?>
    6364    </style>
    6465    <?php do_action( 'groundhogg/templates/email/full-width/head' ); ?>
     
    6768<table class="body-content" cellspacing="0" cellpadding="0" role="presentation" width="100%">
    6869    <tr>
    69         <td bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>"
    70             style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    71             <?php load_part( 'preview-text' ); ?>
    72             <?php load_part( 'browser-view' ); ?>
    73             <?php do_action( 'groundhogg/templates/email/full-width/content/before' ); ?>
     70        <td bgcolor="<?php echo esc_attr( $bgColor ); ?>" background="<?php echo esc_url( $bgImage ); ?>" style="<?php echo esc_attr( \Groundhogg\array_to_css( $bodyStyle ) ); ?>">
    7471            <?php
     72
     73            load_part( 'preview-text' );
     74            load_part( 'browser-view' );
     75            do_action( 'groundhogg/templates/email/full-width/content/before' );
     76
    7577            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- handled upstream
    76             echo $email->get_merged_content(); ?>
    77             <?php do_action( 'groundhogg/templates/email/full-width/content/after' ); ?>
    78             <?php if ( ! $email->has_footer_block() ): ?>
     78            echo $email->get_merged_content();
     79
     80            do_action( 'groundhogg/templates/email/full-width/content/after' );
     81
     82            if ( ! $email->has_footer_block() ): ?>
    7983            <table cellspacing="0" cellpadding="0" role="presentation" align="center">
    8084                <tr>
  • groundhogg/trunk/templates/email/template-functions.php

    r3343709 r3345192  
    11<?php
     2
     3use function Groundhogg\files;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
     
    4042
    4143        do_action( "groundhogg/templates/email/css/$file" );
     44        $css = files()->get_contents( $file );
    4245
    43         echo esc_html( file_get_contents( $file ) );
     46        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_html() breaks `div > span` selectors
     47        echo wp_strip_all_tags( $css );
    4448    }
    4549}
Note: See TracChangeset for help on using the changeset viewer.