Changeset 3323888
- Timestamp:
- 07/07/2025 08:42:22 PM (9 months ago)
- Location:
- groundhogg
- Files:
-
- 16 edited
- 1 copied
-
tags/4.2.2.1 (copied) (copied from groundhogg/trunk)
-
tags/4.2.2.1/README.txt (modified) (2 diffs)
-
tags/4.2.2.1/admin/tools/exports-table.php (modified) (4 diffs)
-
tags/4.2.2.1/admin/tools/imports-table.php (modified) (1 diff)
-
tags/4.2.2.1/admin/tools/map-import.php (modified) (1 diff)
-
tags/4.2.2.1/admin/tools/tools-page.php (modified) (5 diffs)
-
tags/4.2.2.1/groundhogg.php (modified) (2 diffs)
-
tags/4.2.2.1/includes/bulk-jobs/import-contacts.php (modified) (1 diff)
-
tags/4.2.2.1/includes/functions.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/tools/exports-table.php (modified) (4 diffs)
-
trunk/admin/tools/imports-table.php (modified) (1 diff)
-
trunk/admin/tools/map-import.php (modified) (1 diff)
-
trunk/admin/tools/tools-page.php (modified) (5 diffs)
-
trunk/groundhogg.php (modified) (2 diffs)
-
trunk/includes/bulk-jobs/import-contacts.php (modified) (1 diff)
-
trunk/includes/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
groundhogg/tags/4.2.2.1/README.txt
r3321992 r3323888 7 7 Tested up to: 6.8 8 8 Requires PHP: 7.1 9 Stable tag: 4.2.2 9 Stable tag: 4.2.2.1 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl.md … … 354 354 355 355 == Changelog == 356 357 = 4.2.2.1 (2025-07-07) = 358 * FIXED Fatal error when uploading new contact CSV import. 356 359 357 360 = 4.2.2 (2025-07-03) = -
groundhogg/tags/4.2.2.1/admin/tools/exports-table.php
r3031209 r3323888 8 8 use function Groundhogg\count_csv_rows; 9 9 use function Groundhogg\file_access_url; 10 use function Groundhogg\files; 10 11 11 12 /** … … 178 179 $data = []; 179 180 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() ), [ 183 184 '..', 184 185 '.' … … 188 189 foreach ( $scanned_directory as $filename ) { 189 190 190 $filepath = Plugin::$instance->utils->files->get_csv_exports_dir( $filename );191 $filepath = files()->get_csv_exports_dir( $filename ); 191 192 192 193 $file = [ … … 195 196 'file_url' => file_access_url( '/exports/' . $filename, true ), 196 197 'date' => filemtime( $filepath ), 197 'rows' => count_csv_rows( $filepath ) - 1,198 'rows' => count_csv_rows( $filepath ), 198 199 ]; 199 200 -
groundhogg/tags/4.2.2.1/admin/tools/imports-table.php
r2998930 r3323888 194 194 'file_url' => file_access_url( '/imports/' . $filename, true ), 195 195 'date' => filemtime( $filepath ), 196 'rows' => count_csv_rows( $filepath ) - 1,196 'rows' => count_csv_rows( $filepath ), 197 197 ]; 198 198 -
groundhogg/tags/4.2.2.1/admin/tools/map-import.php
r3031209 r3323888 42 42 $items = get_items_from_csv( $file_path, 1, $selected ); 43 43 $sample_item = $items[0]; 44 $total_items = count_csv_rows( $file_path ) - 1;44 $total_items = count_csv_rows( $file_path ); 45 45 46 46 function guess_column_map_to( $column ) { -
groundhogg/tags/4.2.2.1/admin/tools/tools-page.php
r3321992 r3323888 574 574 'action' => 'map', 575 575 'tab' => 'import', 576 'import' => urlencode( basename( $result[' path'] ) ),576 'import' => urlencode( basename( $result['file'] ) ), 577 577 ] ) ); 578 578 … … 629 629 630 630 /** 631 * @return int delete the files631 * @return int|WP_Error 632 632 */ 633 633 public function process_import_delete() { … … 642 642 $filepath = files()->get_csv_imports_dir( sanitize_file_name( $file_name ) ); 643 643 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.' ); 648 646 } 649 647 } … … 840 838 841 839 /** 842 * @return int delete the files840 * @return int|WP_Error 843 841 */ 844 842 public function process_export_delete() { … … 852 850 foreach ( $files as $file_name ) { 853 851 $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.' ); 858 854 } 859 855 } -
groundhogg/tags/4.2.2.1/groundhogg.php
r3321992 r3323888 4 4 * Plugin URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 5 5 * Description: CRM and marketing automation for WordPress 6 * Version: 4.2.2 6 * Version: 4.2.2.1 7 7 * Author: Groundhogg Inc. 8 8 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 25 25 } 26 26 27 define( 'GROUNDHOGG_VERSION', '4.2.2 ' );27 define( 'GROUNDHOGG_VERSION', '4.2.2.1' ); 28 28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2' ); 29 29 -
groundhogg/tags/4.2.2.1/includes/bulk-jobs/import-contacts.php
r3198996 r3323888 54 54 55 55 // -1 because headers 56 $num_rows = count_csv_rows( $file_path ) - 1;56 $num_rows = count_csv_rows( $file_path ); 57 57 $num_requests = floor( $num_rows / self::LIMIT ); 58 58 -
groundhogg/tags/4.2.2.1/includes/functions.php
r3321992 r3323888 2030 2030 /** 2031 2031 * Return the number of rows in a CSV file 2032 * todo this seems to be over-counting the total rows by 22033 2032 * 2034 2033 * @param $file_path … … 2047 2046 2048 2047 while ( ! $file->eof() ) { 2049 $file->fgets(); 2050 $rows ++; 2048 $line = $file->fgets(); 2049 if ( ! empty( $line ) ) { 2050 $rows ++; 2051 } 2051 2052 } 2052 2053 -
groundhogg/trunk/README.txt
r3321992 r3323888 7 7 Tested up to: 6.8 8 8 Requires PHP: 7.1 9 Stable tag: 4.2.2 9 Stable tag: 4.2.2.1 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl.md … … 354 354 355 355 == Changelog == 356 357 = 4.2.2.1 (2025-07-07) = 358 * FIXED Fatal error when uploading new contact CSV import. 356 359 357 360 = 4.2.2 (2025-07-03) = -
groundhogg/trunk/admin/tools/exports-table.php
r3031209 r3323888 8 8 use function Groundhogg\count_csv_rows; 9 9 use function Groundhogg\file_access_url; 10 use function Groundhogg\files; 10 11 11 12 /** … … 178 179 $data = []; 179 180 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() ), [ 183 184 '..', 184 185 '.' … … 188 189 foreach ( $scanned_directory as $filename ) { 189 190 190 $filepath = Plugin::$instance->utils->files->get_csv_exports_dir( $filename );191 $filepath = files()->get_csv_exports_dir( $filename ); 191 192 192 193 $file = [ … … 195 196 'file_url' => file_access_url( '/exports/' . $filename, true ), 196 197 'date' => filemtime( $filepath ), 197 'rows' => count_csv_rows( $filepath ) - 1,198 'rows' => count_csv_rows( $filepath ), 198 199 ]; 199 200 -
groundhogg/trunk/admin/tools/imports-table.php
r2998930 r3323888 194 194 'file_url' => file_access_url( '/imports/' . $filename, true ), 195 195 'date' => filemtime( $filepath ), 196 'rows' => count_csv_rows( $filepath ) - 1,196 'rows' => count_csv_rows( $filepath ), 197 197 ]; 198 198 -
groundhogg/trunk/admin/tools/map-import.php
r3031209 r3323888 42 42 $items = get_items_from_csv( $file_path, 1, $selected ); 43 43 $sample_item = $items[0]; 44 $total_items = count_csv_rows( $file_path ) - 1;44 $total_items = count_csv_rows( $file_path ); 45 45 46 46 function guess_column_map_to( $column ) { -
groundhogg/trunk/admin/tools/tools-page.php
r3321992 r3323888 574 574 'action' => 'map', 575 575 'tab' => 'import', 576 'import' => urlencode( basename( $result[' path'] ) ),576 'import' => urlencode( basename( $result['file'] ) ), 577 577 ] ) ); 578 578 … … 629 629 630 630 /** 631 * @return int delete the files631 * @return int|WP_Error 632 632 */ 633 633 public function process_import_delete() { … … 642 642 $filepath = files()->get_csv_imports_dir( sanitize_file_name( $file_name ) ); 643 643 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.' ); 648 646 } 649 647 } … … 840 838 841 839 /** 842 * @return int delete the files840 * @return int|WP_Error 843 841 */ 844 842 public function process_export_delete() { … … 852 850 foreach ( $files as $file_name ) { 853 851 $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.' ); 858 854 } 859 855 } -
groundhogg/trunk/groundhogg.php
r3321992 r3323888 4 4 * Plugin URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 5 5 * Description: CRM and marketing automation for WordPress 6 * Version: 4.2.2 6 * Version: 4.2.2.1 7 7 * Author: Groundhogg Inc. 8 8 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 25 25 } 26 26 27 define( 'GROUNDHOGG_VERSION', '4.2.2 ' );27 define( 'GROUNDHOGG_VERSION', '4.2.2.1' ); 28 28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2' ); 29 29 -
groundhogg/trunk/includes/bulk-jobs/import-contacts.php
r3198996 r3323888 54 54 55 55 // -1 because headers 56 $num_rows = count_csv_rows( $file_path ) - 1;56 $num_rows = count_csv_rows( $file_path ); 57 57 $num_requests = floor( $num_rows / self::LIMIT ); 58 58 -
groundhogg/trunk/includes/functions.php
r3321992 r3323888 2030 2030 /** 2031 2031 * Return the number of rows in a CSV file 2032 * todo this seems to be over-counting the total rows by 22033 2032 * 2034 2033 * @param $file_path … … 2047 2046 2048 2047 while ( ! $file->eof() ) { 2049 $file->fgets(); 2050 $rows ++; 2048 $line = $file->fgets(); 2049 if ( ! empty( $line ) ) { 2050 $rows ++; 2051 } 2051 2052 } 2052 2053
Note: See TracChangeset
for help on using the changeset viewer.