Plugin Directory

Changeset 3323888


Ignore:
Timestamp:
07/07/2025 08:42:22 PM (9 months ago)
Author:
trainingbusinesspros
Message:

Update to version 4.2.2.1 from GitHub

Location:
groundhogg
Files:
16 edited
1 copied

Legend:

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

    r3321992 r3323888  
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.2
     9Stable tag: 4.2.2.1
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    354354
    355355== Changelog ==
     356
     357= 4.2.2.1 (2025-07-07) =
     358* FIXED Fatal error when uploading new contact CSV import.
    356359
    357360= 4.2.2 (2025-07-03) =
  • groundhogg/tags/4.2.2.1/admin/tools/exports-table.php

    r3031209 r3323888  
    88use function Groundhogg\count_csv_rows;
    99use function Groundhogg\file_access_url;
     10use function Groundhogg\files;
    1011
    1112/**
     
    178179        $data = [];
    179180
    180         if ( file_exists( Plugin::$instance->utils->files->get_csv_exports_dir() ) ) {
    181 
    182             $scanned_directory = array_diff( scandir( Plugin::$instance->utils->files->get_csv_exports_dir() ), [
     181        if ( file_exists( files()->get_csv_exports_dir() ) ) {
     182
     183            $scanned_directory = array_diff( scandir( files()->get_csv_exports_dir() ), [
    183184                '..',
    184185                '.'
     
    188189            foreach ( $scanned_directory as $filename ) {
    189190
    190                 $filepath = Plugin::$instance->utils->files->get_csv_exports_dir( $filename );
     191                $filepath = files()->get_csv_exports_dir( $filename );
    191192
    192193                $file = [
     
    195196                    'file_url'  => file_access_url( '/exports/' . $filename, true ),
    196197                    'date'      => filemtime( $filepath ),
    197                     'rows'      => count_csv_rows( $filepath ) - 1,
     198                    'rows'      => count_csv_rows( $filepath ),
    198199                ];
    199200
  • groundhogg/tags/4.2.2.1/admin/tools/imports-table.php

    r2998930 r3323888  
    194194                    'file_url'  => file_access_url( '/imports/' . $filename, true ),
    195195                    'date'      => filemtime( $filepath ),
    196                     'rows'      => count_csv_rows( $filepath ) - 1,
     196                    'rows'      => count_csv_rows( $filepath ),
    197197                ];
    198198
  • groundhogg/tags/4.2.2.1/admin/tools/map-import.php

    r3031209 r3323888  
    4242$items       = get_items_from_csv( $file_path, 1, $selected );
    4343$sample_item = $items[0];
    44 $total_items = count_csv_rows( $file_path ) - 1;
     44$total_items = count_csv_rows( $file_path );
    4545
    4646function guess_column_map_to( $column ) {
  • groundhogg/tags/4.2.2.1/admin/tools/tools-page.php

    r3321992 r3323888  
    574574            'action' => 'map',
    575575            'tab'    => 'import',
    576             'import' => urlencode( basename( $result['path'] ) ),
     576            'import' => urlencode( basename( $result['file'] ) ),
    577577        ] ) );
    578578
     
    629629
    630630    /**
    631      * @return int delete the files
     631     * @return int|WP_Error
    632632     */
    633633    public function process_import_delete() {
     
    642642            $filepath = files()->get_csv_imports_dir( sanitize_file_name( $file_name ) );
    643643
    644             if ( file_exists( $filepath ) ) {
    645                 if ( ! unlink( $filepath ) ) {
    646                     return new WP_Error( 'failed', 'Unable to delete imports.' );
    647                 }
     644            if ( ! file_exists( $filepath ) || ! unlink( $filepath ) ) {
     645                return new WP_Error( 'failed', 'Unable to delete file.' );
    648646            }
    649647        }
     
    840838
    841839    /**
    842      * @return int delete the files
     840     * @return int|WP_Error
    843841     */
    844842    public function process_export_delete() {
     
    852850        foreach ( $files as $file_name ) {
    853851            $filepath = files()->get_csv_exports_dir( sanitize_file_name( $file_name ) );
    854             if ( file_exists( $filepath ) ) {
    855                 if ( ! unlink( $filepath ) ) {
    856                     return new WP_Error( 'failed', 'Unable to delete exports.' );
    857                 }
     852            if ( ! file_exists( $filepath ) || ! unlink( $filepath ) ) {
     853                return new WP_Error( 'failed', 'Unable to delete file.' );
    858854            }
    859855        }
  • groundhogg/tags/4.2.2.1/groundhogg.php

    r3321992 r3323888  
    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.2
     6 * Version: 4.2.2.1
    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.2' );
     27define( 'GROUNDHOGG_VERSION', '4.2.2.1' );
    2828define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2' );
    2929
  • groundhogg/tags/4.2.2.1/includes/bulk-jobs/import-contacts.php

    r3198996 r3323888  
    5454
    5555        // -1 because headers
    56         $num_rows     = count_csv_rows( $file_path ) - 1;
     56        $num_rows     = count_csv_rows( $file_path );
    5757        $num_requests = floor( $num_rows / self::LIMIT );
    5858
  • groundhogg/tags/4.2.2.1/includes/functions.php

    r3321992 r3323888  
    20302030/**
    20312031 * Return the number of rows in a CSV file
    2032  * todo this seems to be over-counting the total rows by 2
    20332032 *
    20342033 * @param $file_path
     
    20472046
    20482047    while ( ! $file->eof() ) {
    2049         $file->fgets();
    2050         $rows ++;
     2048        $line = $file->fgets();
     2049        if ( ! empty( $line ) ) {
     2050            $rows ++;
     2051        }
    20512052    }
    20522053
  • groundhogg/trunk/README.txt

    r3321992 r3323888  
    77Tested up to: 6.8
    88Requires PHP: 7.1
    9 Stable tag: 4.2.2
     9Stable tag: 4.2.2.1
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl.md
     
    354354
    355355== Changelog ==
     356
     357= 4.2.2.1 (2025-07-07) =
     358* FIXED Fatal error when uploading new contact CSV import.
    356359
    357360= 4.2.2 (2025-07-03) =
  • groundhogg/trunk/admin/tools/exports-table.php

    r3031209 r3323888  
    88use function Groundhogg\count_csv_rows;
    99use function Groundhogg\file_access_url;
     10use function Groundhogg\files;
    1011
    1112/**
     
    178179        $data = [];
    179180
    180         if ( file_exists( Plugin::$instance->utils->files->get_csv_exports_dir() ) ) {
    181 
    182             $scanned_directory = array_diff( scandir( Plugin::$instance->utils->files->get_csv_exports_dir() ), [
     181        if ( file_exists( files()->get_csv_exports_dir() ) ) {
     182
     183            $scanned_directory = array_diff( scandir( files()->get_csv_exports_dir() ), [
    183184                '..',
    184185                '.'
     
    188189            foreach ( $scanned_directory as $filename ) {
    189190
    190                 $filepath = Plugin::$instance->utils->files->get_csv_exports_dir( $filename );
     191                $filepath = files()->get_csv_exports_dir( $filename );
    191192
    192193                $file = [
     
    195196                    'file_url'  => file_access_url( '/exports/' . $filename, true ),
    196197                    'date'      => filemtime( $filepath ),
    197                     'rows'      => count_csv_rows( $filepath ) - 1,
     198                    'rows'      => count_csv_rows( $filepath ),
    198199                ];
    199200
  • groundhogg/trunk/admin/tools/imports-table.php

    r2998930 r3323888  
    194194                    'file_url'  => file_access_url( '/imports/' . $filename, true ),
    195195                    'date'      => filemtime( $filepath ),
    196                     'rows'      => count_csv_rows( $filepath ) - 1,
     196                    'rows'      => count_csv_rows( $filepath ),
    197197                ];
    198198
  • groundhogg/trunk/admin/tools/map-import.php

    r3031209 r3323888  
    4242$items       = get_items_from_csv( $file_path, 1, $selected );
    4343$sample_item = $items[0];
    44 $total_items = count_csv_rows( $file_path ) - 1;
     44$total_items = count_csv_rows( $file_path );
    4545
    4646function guess_column_map_to( $column ) {
  • groundhogg/trunk/admin/tools/tools-page.php

    r3321992 r3323888  
    574574            'action' => 'map',
    575575            'tab'    => 'import',
    576             'import' => urlencode( basename( $result['path'] ) ),
     576            'import' => urlencode( basename( $result['file'] ) ),
    577577        ] ) );
    578578
     
    629629
    630630    /**
    631      * @return int delete the files
     631     * @return int|WP_Error
    632632     */
    633633    public function process_import_delete() {
     
    642642            $filepath = files()->get_csv_imports_dir( sanitize_file_name( $file_name ) );
    643643
    644             if ( file_exists( $filepath ) ) {
    645                 if ( ! unlink( $filepath ) ) {
    646                     return new WP_Error( 'failed', 'Unable to delete imports.' );
    647                 }
     644            if ( ! file_exists( $filepath ) || ! unlink( $filepath ) ) {
     645                return new WP_Error( 'failed', 'Unable to delete file.' );
    648646            }
    649647        }
     
    840838
    841839    /**
    842      * @return int delete the files
     840     * @return int|WP_Error
    843841     */
    844842    public function process_export_delete() {
     
    852850        foreach ( $files as $file_name ) {
    853851            $filepath = files()->get_csv_exports_dir( sanitize_file_name( $file_name ) );
    854             if ( file_exists( $filepath ) ) {
    855                 if ( ! unlink( $filepath ) ) {
    856                     return new WP_Error( 'failed', 'Unable to delete exports.' );
    857                 }
     852            if ( ! file_exists( $filepath ) || ! unlink( $filepath ) ) {
     853                return new WP_Error( 'failed', 'Unable to delete file.' );
    858854            }
    859855        }
  • groundhogg/trunk/groundhogg.php

    r3321992 r3323888  
    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.2
     6 * Version: 4.2.2.1
    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.2' );
     27define( 'GROUNDHOGG_VERSION', '4.2.2.1' );
    2828define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2' );
    2929
  • groundhogg/trunk/includes/bulk-jobs/import-contacts.php

    r3198996 r3323888  
    5454
    5555        // -1 because headers
    56         $num_rows     = count_csv_rows( $file_path ) - 1;
     56        $num_rows     = count_csv_rows( $file_path );
    5757        $num_requests = floor( $num_rows / self::LIMIT );
    5858
  • groundhogg/trunk/includes/functions.php

    r3321992 r3323888  
    20302030/**
    20312031 * Return the number of rows in a CSV file
    2032  * todo this seems to be over-counting the total rows by 2
    20332032 *
    20342033 * @param $file_path
     
    20472046
    20482047    while ( ! $file->eof() ) {
    2049         $file->fgets();
    2050         $rows ++;
     2048        $line = $file->fgets();
     2049        if ( ! empty( $line ) ) {
     2050            $rows ++;
     2051        }
    20512052    }
    20522053
Note: See TracChangeset for help on using the changeset viewer.