Plugin Directory

Changeset 3340954


Ignore:
Timestamp:
08/07/2025 11:48:43 AM (8 months ago)
Author:
trainingbusinesspros
Message:

Update to version 4.2.3.2 from GitHub

Location:
groundhogg
Files:
26 edited
1 copied

Legend:

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

    r3336117 r3340954  
    1 === WordPress CRM, Email & Marketing Automation for WordPress | Award Winner — Groundhogg ===
     1=== Groundhogg — CRM, Newsletters, and Marketing Automation ===
    22
    33Contributors: trainingbusinesspros, Groundhogg
     
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.3.1
     9Stable tag: 4.2.3.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    354354
    355355== Changelog ==
     356
     357= 4.2.3.2 (2025-08-04) =
     358* UPDATED Repository plugin name.
     359* IMPROVED i18n for date and time.
    356360
    357361= 4.2.3.1 (2025-07-29) =
  • groundhogg/tags/4.2.3.2/admin/contacts/parts/details-card.php

    r3126090 r3340954  
    103103                $today   = new \Groundhogg\Utils\DateTimeHelper();
    104104                $local   = new \Groundhogg\Utils\DateTimeHelper( 'now', $contact->get_time_zone( false ) );
    105                 $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->wpTimeFormat() : $local->wpDateTimeFormat();
     105                $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->time_i18n() : $local->i18n();
    106106
    107107                ?><span><?php
     
    114114                 title="<?php esc_attr_e( 'Date created', 'groundhogg' ); ?>">
    115115                <?php dashicon_e( 'calendar-alt' ); ?><span><?php printf( __( 'Subscribed since %s', 'groundhogg' ), html()->e( 'abbr', [
    116                         'title' => $contact->get_date_created( true )->wpDateTimeFormat()
     116                        'title' => $contact->get_date_created( true )->wi18n()
    117117                    ], $contact->get_date_created( true )->wpDateFormat() ) ); ?></span>
    118118            </div>
  • groundhogg/tags/4.2.3.2/groundhogg.php

    r3336117 r3340954  
    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.3.1
     6 * Version: 4.2.3.2
    77 * Author: Groundhogg Inc.
    88 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2525}
    2626
    27 define( 'GROUNDHOGG_VERSION', '4.2.3.1' );
    28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.2.2' );
     27define( 'GROUNDHOGG_VERSION', '4.2.3.2' );
     28define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.3.1' );
    2929
    3030define( 'GROUNDHOGG__FILE__', __FILE__ );
  • groundhogg/tags/4.2.3.2/includes/block-registry.php

    r3336117 r3340954  
    290290
    291291            $template = self::do_post_merge_tags( $content, $props );
     292            $template = do_shortcode( $template );
    292293            $cells[]  = $this->parse_blocks( $template, $context );
    293294        endwhile;
  • groundhogg/tags/4.2.3.2/includes/classes/activity.php

    r3137833 r3340954  
    8989
    9090        $i18n = [
    91             'diff_time' => $date->i18n()
     91            'diff_time' => $date->wi18n()
    9292        ];
    9393
  • groundhogg/tags/4.2.3.2/includes/classes/event.php

    r3269993 r3340954  
    645645            $diff_time = __( 'Running now...', 'groundhogg' );
    646646        } else {
    647             $diff_time = sprintf( $this->is_waiting() ? __( 'Runs %s', 'groundhogg' ) : __( 'Ran %s', 'groundhogg' ), $date->i18n() );
     647            $diff_time = sprintf( $this->is_waiting() ? __( 'Runs %s', 'groundhogg' ) : __( 'Ran %s', 'groundhogg' ), $date->wi18n() );
    648648        }
    649649
  • groundhogg/tags/4.2.3.2/includes/classes/other-activity.php

    r3225663 r3340954  
    5252
    5353        $i18n = [
    54             'diff_time' => $date->i18n(),
     54            'diff_time' => $date->wi18n(),
    5555            'wp_date'   => $date->wpDateTimeFormat(),
    5656        ];
  • groundhogg/tags/4.2.3.2/includes/classes/page-visit.php

    r3083470 r3340954  
    8080
    8181        $array['i18n'] = [
    82             'diff_time' => $date->i18n()
     82            'diff_time' => $date->wi18n()
    8383        ];
    8484
  • groundhogg/tags/4.2.3.2/includes/classes/submission.php

    r3198996 r3340954  
    152152
    153153        $array['i18n'] = [
    154             'diff_time' => ucfirst( $date->i18n() ),
     154            'diff_time' => ucfirst( $date->wi18n() ),
    155155            'answers'   => $this->get_answers( true )
    156156        ];
  • groundhogg/tags/4.2.3.2/includes/filters.php

    r3314835 r3340954  
    6464function do_replacements_when_rendering_blocks( $content, $parsed_block, \WP_Block $block ) {
    6565
     66    if ( ! isset( $parsed_block['attrs'] ) ) {
     67        return $content;
     68    }
     69
    6670    if ( isset_not_empty( $parsed_block['attrs'], 'ghReplacements' ) && ! empty( $content ) ) {
    6771        $content = do_replacements( $content );
     
    8488 */
    8589function handle_conditional_content_block_filters( $content, $parsed_block, \WP_Block $block ) {
     90
     91    if ( ! isset( $parsed_block['attrs'] ) ) {
     92        return $content;
     93    }
    8694
    8795    // Content restriction is not enabled for this block
     
    764772    $today   = new DateTimeHelper();
    765773    $local   = new DateTimeHelper( 'now', $contact->get_time_zone( false ) );
    766     $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->wpTimeFormat() : $local->wpDateTimeFormat();
     774    $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->time_i18n() : $local->wpDateTimeFormat();
    767775
    768776    $display = html()->e( 'abbr', [ 'title' => $local->wpDateTimeFormat() ], $display );
  • groundhogg/tags/4.2.3.2/includes/form/form-v2.php

    r3335438 r3340954  
    762762                    $dateTime = new DateTimeHelper( $value );
    763763
    764                     return $dateTime->wpDateFormat();
     764                    return $dateTime->date_i18n();
    765765                }
    766766            ],
     
    781781                    $dateTime = new DateTimeHelper( $value );
    782782
    783                     return $dateTime->wpDateTimeFormat();
     783                    return $dateTime->i18n();
    784784                }
    785785            ],
     
    802802                    $dateTime = new DateTimeHelper( $value );
    803803
    804                     return $dateTime->wpTimeFormat();
     804                    return $dateTime->time_i18n();
    805805                }
    806806            ],
  • groundhogg/tags/4.2.3.2/includes/functions.php

    r3336117 r3340954  
    26622662                break;
    26632663            case 'tags':
    2664 
    2665                 if ( is_string( $value ) ) {
    2666                     $value = explode( ',', $value );
    2667                 }
    2668 
    2669                 if ( ! is_array( $value ) ) {
    2670                     $value = [ $value ];
    2671                 }
    2672 
    2673                 $tags = array_merge( $tags, $value );
     2664                $new_tags = array_trim( maybe_explode( $value ) );
     2665                $tags     = array_merge( $tags, array_values( $new_tags ) );
    26742666                break;
    26752667            case 'meta':
     
    48574849    $key = wp_generate_password( 20, false );
    48584850
    4859     add_redaction( $key ) ;
     4851    add_redaction( $key );
    48604852
    48614853    // Generate the permissions_key
     
    57835775    $original_meta_value = $meta_value;
    57845776
    5785     if ( is_string( $meta_value ) && strpos( $meta_value, PHP_EOL ) !== false ) {
     5777    $property = Properties::instance()->get_field( $meta_key );
     5778
     5779    if ( $property ){
     5780        $meta_value = sanitize_custom_field( $meta_value, $property );
     5781    } else if ( is_string( $meta_value ) && strpos( $meta_value, PHP_EOL ) !== false ) {
    57865782        $meta_value = sanitize_textarea_field( $meta_value );
    57875783    } else if ( is_string( $meta_value ) ) {
     
    88728868
    88738869    // we also need to cleverly handle newlines, because "\n" can become <br/> or <p>...</p> and that will cause the exact match to not work :/
    8874     // I think a cleaver way to handle this would be to split the newlines, and simply redact each single line separately
    8875     $lines = array_trim( explode( PHP_EOL, $text ) );
    8876     foreach ( $lines as $line ){
    8877         redactor()->add( $line, get_redaction_replacement( $line ) );
    8878     }
     8870    // I think a cleaver way to handle this would be to split the newlines, and simply redact each single line separately
     8871    $lines = array_trim( explode( PHP_EOL, $text ) );
     8872    foreach ( $lines as $line ) {
     8873        redactor()->add( $line, get_redaction_replacement( $line ) );
     8874    }
    88798875}
    88808876
     
    89318927    $id_col     = $table->get_object_id_col();
    89328928
    8933     $time = time();
     8929    $time = time();
    89348930
    89358931
  • groundhogg/tags/4.2.3.2/includes/utils/date-time-helper.php

    r3269144 r3340954  
    55use function Groundhogg\get_date_time_format;
    66use function Groundhogg\get_time_format;
     7use function Groundhogg\site_locale_is_english;
    78
    89class DateTimeHelper extends \DateTime {
     
    8990    }
    9091
     92    /**
     93     * The date in internationalized format
     94     *
     95     * @return string
     96     */
     97    public function i18n( $format = null ) {
     98        if ( is_null( $format ) ) {
     99            $format = get_date_time_format();
     100        }
     101
     102        return date_i18n( $format, $this->getTimestamp() );
     103    }
     104
     105    public function time_i18n() {
     106        return $this->i18n( get_option( 'time_format' ) );
     107    }
     108
     109    public function date_i18n() {
     110        return $this->i18n( get_option( 'date_format' ) );
     111    }
     112
     113    /**
     114     * Display the localized date
     115     *
     116     * @return string
     117     */
     118    public function wi18n() {
     119
     120        if ( site_locale_is_english() ){
     121            switch ( $this->whenIs() ) {
     122                case 'today':
     123                    return sprintf( __( 'today at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     124                case 'tomorrow':
     125                    return sprintf( __( 'tomorrow at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     126                case 'yesterday':
     127                    return sprintf( __( 'yesterday at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     128            }
     129        }
     130
     131        return $this->i18n();
     132    }
     133
    91134    public function human_time_diff( $time = 0 ) {
    92135
     
    105148    public function isLeapYear() {
    106149        return absint( $this->format( 'L' ) ) === 1;
    107     }
    108 
    109     public function i18n() {
    110 
    111         switch ( $this->whenIs() ) {
    112             case 'today':
    113                 return sprintf( __( 'today at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    114             case 'tomorrow':
    115                 return sprintf( __( 'tomorrow at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    116             case 'yesterday':
    117                 return sprintf( __( 'yesterday at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    118             default:
    119                 return $this->wpDateTimeFormat();
    120         }
    121 
    122150    }
    123151
  • groundhogg/trunk/README.txt

    r3336117 r3340954  
    1 === WordPress CRM, Email & Marketing Automation for WordPress | Award Winner — Groundhogg ===
     1=== Groundhogg — CRM, Newsletters, and Marketing Automation ===
    22
    33Contributors: trainingbusinesspros, Groundhogg
     
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.3.1
     9Stable tag: 4.2.3.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    354354
    355355== Changelog ==
     356
     357= 4.2.3.2 (2025-08-04) =
     358* UPDATED Repository plugin name.
     359* IMPROVED i18n for date and time.
    356360
    357361= 4.2.3.1 (2025-07-29) =
  • groundhogg/trunk/admin/contacts/parts/details-card.php

    r3126090 r3340954  
    103103                $today   = new \Groundhogg\Utils\DateTimeHelper();
    104104                $local   = new \Groundhogg\Utils\DateTimeHelper( 'now', $contact->get_time_zone( false ) );
    105                 $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->wpTimeFormat() : $local->wpDateTimeFormat();
     105                $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->time_i18n() : $local->i18n();
    106106
    107107                ?><span><?php
     
    114114                 title="<?php esc_attr_e( 'Date created', 'groundhogg' ); ?>">
    115115                <?php dashicon_e( 'calendar-alt' ); ?><span><?php printf( __( 'Subscribed since %s', 'groundhogg' ), html()->e( 'abbr', [
    116                         'title' => $contact->get_date_created( true )->wpDateTimeFormat()
     116                        'title' => $contact->get_date_created( true )->wi18n()
    117117                    ], $contact->get_date_created( true )->wpDateFormat() ) ); ?></span>
    118118            </div>
  • groundhogg/trunk/groundhogg.php

    r3336117 r3340954  
    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.3.1
     6 * Version: 4.2.3.2
    77 * Author: Groundhogg Inc.
    88 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2525}
    2626
    27 define( 'GROUNDHOGG_VERSION', '4.2.3.1' );
    28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.2.2' );
     27define( 'GROUNDHOGG_VERSION', '4.2.3.2' );
     28define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.3.1' );
    2929
    3030define( 'GROUNDHOGG__FILE__', __FILE__ );
  • groundhogg/trunk/includes/block-registry.php

    r3336117 r3340954  
    290290
    291291            $template = self::do_post_merge_tags( $content, $props );
     292            $template = do_shortcode( $template );
    292293            $cells[]  = $this->parse_blocks( $template, $context );
    293294        endwhile;
  • groundhogg/trunk/includes/classes/activity.php

    r3137833 r3340954  
    8989
    9090        $i18n = [
    91             'diff_time' => $date->i18n()
     91            'diff_time' => $date->wi18n()
    9292        ];
    9393
  • groundhogg/trunk/includes/classes/event.php

    r3269993 r3340954  
    645645            $diff_time = __( 'Running now...', 'groundhogg' );
    646646        } else {
    647             $diff_time = sprintf( $this->is_waiting() ? __( 'Runs %s', 'groundhogg' ) : __( 'Ran %s', 'groundhogg' ), $date->i18n() );
     647            $diff_time = sprintf( $this->is_waiting() ? __( 'Runs %s', 'groundhogg' ) : __( 'Ran %s', 'groundhogg' ), $date->wi18n() );
    648648        }
    649649
  • groundhogg/trunk/includes/classes/other-activity.php

    r3225663 r3340954  
    5252
    5353        $i18n = [
    54             'diff_time' => $date->i18n(),
     54            'diff_time' => $date->wi18n(),
    5555            'wp_date'   => $date->wpDateTimeFormat(),
    5656        ];
  • groundhogg/trunk/includes/classes/page-visit.php

    r3083470 r3340954  
    8080
    8181        $array['i18n'] = [
    82             'diff_time' => $date->i18n()
     82            'diff_time' => $date->wi18n()
    8383        ];
    8484
  • groundhogg/trunk/includes/classes/submission.php

    r3198996 r3340954  
    152152
    153153        $array['i18n'] = [
    154             'diff_time' => ucfirst( $date->i18n() ),
     154            'diff_time' => ucfirst( $date->wi18n() ),
    155155            'answers'   => $this->get_answers( true )
    156156        ];
  • groundhogg/trunk/includes/filters.php

    r3314835 r3340954  
    6464function do_replacements_when_rendering_blocks( $content, $parsed_block, \WP_Block $block ) {
    6565
     66    if ( ! isset( $parsed_block['attrs'] ) ) {
     67        return $content;
     68    }
     69
    6670    if ( isset_not_empty( $parsed_block['attrs'], 'ghReplacements' ) && ! empty( $content ) ) {
    6771        $content = do_replacements( $content );
     
    8488 */
    8589function handle_conditional_content_block_filters( $content, $parsed_block, \WP_Block $block ) {
     90
     91    if ( ! isset( $parsed_block['attrs'] ) ) {
     92        return $content;
     93    }
    8694
    8795    // Content restriction is not enabled for this block
     
    764772    $today   = new DateTimeHelper();
    765773    $local   = new DateTimeHelper( 'now', $contact->get_time_zone( false ) );
    766     $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->wpTimeFormat() : $local->wpDateTimeFormat();
     774    $display = $today->wpDateFormat() === $local->wpDateFormat() ? $local->time_i18n() : $local->wpDateTimeFormat();
    767775
    768776    $display = html()->e( 'abbr', [ 'title' => $local->wpDateTimeFormat() ], $display );
  • groundhogg/trunk/includes/form/form-v2.php

    r3335438 r3340954  
    762762                    $dateTime = new DateTimeHelper( $value );
    763763
    764                     return $dateTime->wpDateFormat();
     764                    return $dateTime->date_i18n();
    765765                }
    766766            ],
     
    781781                    $dateTime = new DateTimeHelper( $value );
    782782
    783                     return $dateTime->wpDateTimeFormat();
     783                    return $dateTime->i18n();
    784784                }
    785785            ],
     
    802802                    $dateTime = new DateTimeHelper( $value );
    803803
    804                     return $dateTime->wpTimeFormat();
     804                    return $dateTime->time_i18n();
    805805                }
    806806            ],
  • groundhogg/trunk/includes/functions.php

    r3336117 r3340954  
    26622662                break;
    26632663            case 'tags':
    2664 
    2665                 if ( is_string( $value ) ) {
    2666                     $value = explode( ',', $value );
    2667                 }
    2668 
    2669                 if ( ! is_array( $value ) ) {
    2670                     $value = [ $value ];
    2671                 }
    2672 
    2673                 $tags = array_merge( $tags, $value );
     2664                $new_tags = array_trim( maybe_explode( $value ) );
     2665                $tags     = array_merge( $tags, array_values( $new_tags ) );
    26742666                break;
    26752667            case 'meta':
     
    48574849    $key = wp_generate_password( 20, false );
    48584850
    4859     add_redaction( $key ) ;
     4851    add_redaction( $key );
    48604852
    48614853    // Generate the permissions_key
     
    57835775    $original_meta_value = $meta_value;
    57845776
    5785     if ( is_string( $meta_value ) && strpos( $meta_value, PHP_EOL ) !== false ) {
     5777    $property = Properties::instance()->get_field( $meta_key );
     5778
     5779    if ( $property ){
     5780        $meta_value = sanitize_custom_field( $meta_value, $property );
     5781    } else if ( is_string( $meta_value ) && strpos( $meta_value, PHP_EOL ) !== false ) {
    57865782        $meta_value = sanitize_textarea_field( $meta_value );
    57875783    } else if ( is_string( $meta_value ) ) {
     
    88728868
    88738869    // we also need to cleverly handle newlines, because "\n" can become <br/> or <p>...</p> and that will cause the exact match to not work :/
    8874     // I think a cleaver way to handle this would be to split the newlines, and simply redact each single line separately
    8875     $lines = array_trim( explode( PHP_EOL, $text ) );
    8876     foreach ( $lines as $line ){
    8877         redactor()->add( $line, get_redaction_replacement( $line ) );
    8878     }
     8870    // I think a cleaver way to handle this would be to split the newlines, and simply redact each single line separately
     8871    $lines = array_trim( explode( PHP_EOL, $text ) );
     8872    foreach ( $lines as $line ) {
     8873        redactor()->add( $line, get_redaction_replacement( $line ) );
     8874    }
    88798875}
    88808876
     
    89318927    $id_col     = $table->get_object_id_col();
    89328928
    8933     $time = time();
     8929    $time = time();
    89348930
    89358931
  • groundhogg/trunk/includes/utils/date-time-helper.php

    r3269144 r3340954  
    55use function Groundhogg\get_date_time_format;
    66use function Groundhogg\get_time_format;
     7use function Groundhogg\site_locale_is_english;
    78
    89class DateTimeHelper extends \DateTime {
     
    8990    }
    9091
     92    /**
     93     * The date in internationalized format
     94     *
     95     * @return string
     96     */
     97    public function i18n( $format = null ) {
     98        if ( is_null( $format ) ) {
     99            $format = get_date_time_format();
     100        }
     101
     102        return date_i18n( $format, $this->getTimestamp() );
     103    }
     104
     105    public function time_i18n() {
     106        return $this->i18n( get_option( 'time_format' ) );
     107    }
     108
     109    public function date_i18n() {
     110        return $this->i18n( get_option( 'date_format' ) );
     111    }
     112
     113    /**
     114     * Display the localized date
     115     *
     116     * @return string
     117     */
     118    public function wi18n() {
     119
     120        if ( site_locale_is_english() ){
     121            switch ( $this->whenIs() ) {
     122                case 'today':
     123                    return sprintf( __( 'today at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     124                case 'tomorrow':
     125                    return sprintf( __( 'tomorrow at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     126                case 'yesterday':
     127                    return sprintf( __( 'yesterday at %s', 'groundhogg' ), $this->format( get_time_format() ) );
     128            }
     129        }
     130
     131        return $this->i18n();
     132    }
     133
    91134    public function human_time_diff( $time = 0 ) {
    92135
     
    105148    public function isLeapYear() {
    106149        return absint( $this->format( 'L' ) ) === 1;
    107     }
    108 
    109     public function i18n() {
    110 
    111         switch ( $this->whenIs() ) {
    112             case 'today':
    113                 return sprintf( __( 'today at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    114             case 'tomorrow':
    115                 return sprintf( __( 'tomorrow at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    116             case 'yesterday':
    117                 return sprintf( __( 'yesterday at %s', 'groundhogg' ), $this->format( get_time_format() ) );
    118             default:
    119                 return $this->wpDateTimeFormat();
    120         }
    121 
    122150    }
    123151
Note: See TracChangeset for help on using the changeset viewer.