Ultimate CSV Importer - Version 3.9.2

Version Description

Download this release

Release Info

Developer smackcoders
Plugin Icon 128x128 Ultimate CSV Importer
Version 3.9.2
Comparing to
See all releases

Code changes from version 3.9.1 to 3.9.2

README.md DELETED
@@ -1,641 +0,0 @@
1
- ## Import CSV with Ultimate CSV Importer ##
2
- **Contributors:** smackcoders
3
-
4
- **Donate link:** http://www.smackcoders.com/donate.html
5
-
6
- **Tags:** admin, administration, author, automatic, blog, categories, category, cms, contact, content, custom, custom post, dashboard, database, e-commerce, ecommerce, edit, event, events, feed, Formatting, free, gallery, image, images, import, integration, language, link, links, list, marketing, media, menu, meta, mobile, multisite, navigation, News, page, pages, performance, photo, photos, picture, pictures, plugin, plugins, Post, posts, profile, registration, rss, seo, Share, sharing, shop, shortcode, shortcodes, statistics, stats, store, tag, tags, Taxonomy, template, text, thumbnail, thumbnails, title, upload, url, user, users, video, woocommerce, wordpress, wpmu, xml, youtube.
7
-
8
- **Requires at least:** 4.2
9
-
10
- **Tested up to:** 4.3.1
11
-
12
- **Stable tag:** 3.8.3
13
-
14
- **Version:** 3.8.3
15
-
16
- **Author:** smackcoders
17
-
18
- **Author URI:** http://profiles.wordpress.org/smackcoders/
19
-
20
- **License:** GPLv2 or later
21
-
22
- Import CSV with CSV Importer made simple to import & export posts, pages, custom posts and custom fields in few simple clicks
23
-
24
- #### Description ####
25
-
26
- Import CSV data to WordPress is made very easy even for novice users as in few clicks and 3 simple steps with CSV Importer plugin.
27
-
28
- Now csv importer supports multi language and almost every WordPress modules and plugin fields as follows. Import data feed periodically from csv file as
29
-
30
- #### Supported Core Modules and Attributes ####
31
- * Post
32
- * Page
33
- * Featured image support
34
- * Post inline image handling
35
- * Standard WP Custom Post types
36
- * WordPress themes custom posts
37
- * Custom post type UI plugin Post types
38
- * Users with roles
39
- * Comments
40
- * Custom Fields
41
- * Author
42
- * Tags import and multi tag for each post import
43
- * Categories import and multi category for each post
44
- * Eshop
45
- * All-in-one SEO
46
-
47
- #### Highlights of 3.8 ####
48
- * Multilanguage support (fr_FR,es_ES,nl_NL)
49
- * Inline image handling shortcode with image attributes Example:[WPIMPINLINE:greensroad.jpg|width='150'|height='80'|alt='post_title_redtree']
50
- * Fixed user reported Warnings and Bugs
51
- * Any delimiter support for csv export
52
-
53
- Note: Now you can import no. of images in in-line post content as image shortcodes using advanced media handling option as zip files.
54
-
55
- #### CSV Importer ####
56
-
57
- WP Ultimate CSV Importer Plugin proven much effective advanced CSV Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import csv file exported from any tool, app or software. Import as any WordPress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
58
-
59
- It is more easy to import csv database maintained in Excel xls or spread sheets into valuable content for your web site without missing any. It is possible now to schedule a import csv periodically for content update, maintenance, prices, offers, coupons and inventory etc.
60
-
61
- Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best WordPress themes available online. Now manage multi site & buddy press, Amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
62
-
63
- #### Helpful Links ####
64
-
65
- [Get More Details Here>>](https://www.smackcoders.com/wp-ultimate-csv-importer-pro.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
66
-
67
- [Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
68
-
69
- [Get Started Sample CSV Files](https://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
70
-
71
- [Documentation and Tutorial for CSV Importer ](https://www.smackcoders.com/documentation/ultimate-csv-importer-pro?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
72
-
73
-
74
- #### Video Walkthrough ####
75
- [![Demo CountPages alpha](https://i.ytimg.com/vi/Guv5zR7fgW0/sddefault.jpg)](https://www.youtube.com/watch?v=Guv5zR7fgW0&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC)
76
-
77
- #### Highlights ####
78
- * import csv from any source as WordPress posts
79
- * New Terminate & Continue feature is added.
80
- * Complete export feature with improved filters
81
- * Import external/internal images in line to any posts
82
- * Upload images related to each csv
83
- * Auto delimiter
84
- * Auto UTF-8 handling
85
- * All-in-SEO import support.
86
- * Drag drop import
87
- * Define any type of post
88
- * Control post status (Publish, Private, Pending, Draft, Sticky and Protected)
89
- * Simple yet Powerful mapping feature
90
- * Convert any csv import as perfect posts and fields
91
- * Scheduled Publishing
92
- * Duplicate Title and content handling
93
- * Multi Lingual import (CSV format must be UTF-8 without BOM)
94
- * Multi-site also supported now
95
- * Compatible to WordPress themes
96
- * Better alternative for xml
97
- * Post Format option added
98
- * Page template attribute feature
99
- * EShop Products import (included from V3.6.3)
100
-
101
- #### Power Import Features to Control your csv import ####
102
- * Post title, content and even excerpt
103
- * Text, WYSIWYG/HTML, in line CSS in post content
104
- * Images, Youtube, Videos in post content
105
- * Featured image by Url
106
- * Multi authors
107
- * Multiple tags and categories
108
- * Non existing tags and categories are created automatically
109
- * Any Short Codes in post content
110
- * Assign sidebar widget, slider, slide show as short codes
111
- * Manual slug feature for SEO friendly urls
112
- * Different post status for each post in CSV file.
113
- * Custom fields support for WP standard
114
- * Map custom fields by adding new on the fly.
115
-
116
- #### Imp. Notes ####
117
- * All CSV files should be should be strictly UTF-8 CSV format. Now this can be handled by plugin.
118
- * All WordPress supported languages can imported with csv format as UTF-8 without BOM (See FAQ for instructions).
119
- * User import option is disabled for multi site mode.
120
- * To Schedule posts for publishing provide future date and time in date column in CSV File.
121
-
122
- #### Featured Image Support ####
123
- Your WordPress theme should support featured image. If not, please add the following code to where you need to display. E.g)wp-contents/themes/header.php
124
-
125
- `<?php add_theme_support( 'post-thumbnails' ); ?>`
126
-
127
- #### Pro Features ####
128
- * Advanced Features
129
- * Multi language Support
130
- * Woocommerce Support with woocommerce_products, woocommerce_variations, woocommerce_refunds, woocommerce_orders, woocommerce_coupons
131
- * Market press
132
- * ACF, TYPES, PODS, CCTM Custom Fields
133
- * Advanced Export with Delimiter and Filters
134
- * Advanced Media Handling
135
- * Schedule Imports
136
- * Dashboard, CSV Manager and Custom Mapping Templates
137
- * DB Optimizer, System status etc.
138
-
139
- Compare Free Vs Pro [Features](https://www.wpultimatecsvimporter.com/wp-ultimate-csv-importer-plugin?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
140
- Learn More from [User Manual](https://www.wpultimatecsvimporter.com/documentation?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
141
-
142
-
143
- #### Common Issues ####
144
-
145
- How to solve auto_prepend_file and auto_append_file error?
146
-
147
- Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
148
-
149
- Create an .htaccess file in root and set the following values.
150
- php_value auto_prepend_file none
151
- php_value auto_append_file none
152
-
153
- This will solve your issue or get support from hosting if you dint have sufficient permission.
154
-
155
- Also you can follow the instructions as given here
156
-
157
- * [http://codex.wordpress.org/Function_Reference/the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
158
- * [http://codex.wordpress.org/Post_Thumbnails](http://codex.wordpress.org/Post_Thumbnails)
159
- * [http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5](http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5)
160
-
161
-
162
- #### Extended Pro Power Features in WP Ultimate CSV Importer ####
163
- * Types Plugin support
164
- * Woocommerce CSV importer with product variation
165
- * Marketpress Lite Importer
166
- * WP Members Importer
167
- * WP Customer Reviews Importer
168
- * Auto Schedule all your Imports
169
- * Save mapping as Templates for reuse
170
- * Auto Mapping Feature
171
- * Strict UTF-8 auto conversion
172
- * All In One SEO Fields Import
173
- * WordPress SEO by Yoast Fields Import
174
- * Custom Post Type UI plugin import
175
- * Advanced Custom Fields Import
176
- * CCTM Posts and Fields Import
177
- * Woocommerce CSV Importer,
178
- * WP ecommerce Products CSV Importer with WP e-Commerce Custom Fields
179
- * Categories & tags Import with Category icons plugin support
180
- * Custom Taxonomy import
181
-
182
- #### And we thank @respectyoda, @alantygel and @James Golovich for their wonderful support to us. ####
183
-
184
- #### Installation ####
185
-
186
- * [Step By Step Installation with Snaps](https://www.wpultimatecsvimporter.com/documentation/all-import/user-guide/simple-step-by-step-user-guide/?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
187
-
188
-
189
- #### Screenshots ####
190
-
191
- 1. New Interactive Dashboard with Chart and Graph
192
- 2. Advanced CSV Importer With Ultimate User Friendly Features with drag and drop etc.
193
- 3. User friendly easy mapping for any csv file data to WordPress field attributes with sampling.
194
- 4. Advanced duplicate post name and content check with server request control for high performance factor.
195
- 5. Detailed real time log to know pinpoint status.
196
- 6. Module based environment for easy and reduced interface to enable most required modules and when ever needed.
197
- 7. Inbuilt support form for easy feedback, support, feature request with all useful links for easy and better csv import.
198
- 8. New export module for posts, page, eshop, users, comments and all custom posts type plugins.
199
-
200
-
201
- #### Frequently Asked Questions ####
202
-
203
- How to solve auto_prepend_file and auto_append_file error?
204
-
205
- Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
206
-
207
- Create an .htaccess file in root and set the following values.
208
- php_value auto_prepend_file none
209
- php_value auto_append_file none
210
-
211
- This will solve your issue or get support from hosting if you dint have sufficient permission.
212
-
213
- [Click Here for More Details](https://www.wpultimatecsvimporter.com/documentation/all-import/user-guide/simple-step-by-step-user-guide/?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
214
-
215
- #### Changelog ####
216
-
217
- **3.8.3**
218
- * Fixed : Text domain is added for language translation system.
219
- * Fixed : Bugs fixed for detecting duplicate post content and title option.
220
-
221
- **3.8.2**
222
- * Fixed : Wordpress 4.3.1 compatibility added.
223
- * Fixed : Dashboard entry issue fix.
224
- * Fixed : Featured image filename with empty space import issue fix.
225
- * Fixed : Duplicate featured images on import fixed.
226
- * Fixed : Core custom Field mapping group added
227
-
228
- **3.8.1**
229
- * Fixed : WordPress 4.2.3 and 4.2.4 compatibility checked.
230
- * Fixed : Fixed the unwanted warnings in all files.
231
- * Fixed : XSS vulnerability.
232
- * Fixed : Removed the ../../../../../../wp-load.php and used the wordpress ajax call.
233
- * Fixed : Removed the wp-content that are directly used in some files.
234
- * Added : Checked the ABSPATH in each file.
235
- * Added : Comments are exported by specific date and author option.
236
-
237
- **3.8**
238
- * Multilanguage support (fr_FR,es_ES,nl_NL)
239
- * Inline image handling shortcode with image attributes
240
- * Warnings and bugs Fixes
241
- * Any delimiter support for csv export
242
-
243
- **3.7.4**
244
- * Fixed : Allow Editor/Author to import.(Multisite also).
245
- * Added : WordPress 4.2.2 compatibility.
246
-
247
- **3.7.3**
248
- * Fixed: Vulnerablility security issue fix.
249
-
250
- **3.7.2**
251
- * Added: WordPress 4.2 and 4.2.1 compatibility.
252
- * Fixed: Blank page conflict issue
253
-
254
- **3.7.1**
255
- * Added: Security fix for curl.
256
- * Added: Security fix for session status.
257
-
258
- **3.7**
259
- * Fixed: Featured image hotlink issue.
260
-
261
- **3.6.78**
262
- * Added: Hot security fix in readfile.php. ( Thanks - @James Golovich )
263
-
264
- **3.6.77**
265
- * Added: WordPress 4.1.1 compatibility checked.
266
- * Improved: Inline image import feature. Added recursive method to assign the image.
267
- * Fixed: Featured image naming issue. [Solved](https://wordpress.org/support/topic/problem-in-import-with-the-image-name)
268
- * Fixed: Removed unwanted warnings.
269
-
270
- **3.6.76**
271
- * Improved: Post Format.
272
- * Fixed: Export eshop data issue.
273
- * Fixed: Import with image name issue.
274
- * Fixed: Groups plugin conflict.
275
-
276
- **3.6.75**
277
- * Added: Terminate & Continue option in import section.
278
- * Improved: Log section. Issue fixed in Web View & Admin View.
279
- * Fixed: Security fix for export module.
280
-
281
- **3.6.74**
282
- * Added: Security fix.
283
-
284
- **3.6.73**
285
- * Added: WordPress 4.0 compatibility checked.
286
- * Added: https format support for all WP instances.
287
- * Added: Warning to guide user to create uploads directory with writeable permissions.
288
- * Fixed: Image handling issues in featured image.
289
- * Fixed: Multisite compatible issue.
290
- * Removed: Post Content field mandatory option.
291
- * Removed: All console warnings.
292
- * Improved: Details added in security and performance tab under settings module.
293
-
294
- **3.6.72**
295
- * Added: Debug mode enable/disable options.
296
- * Modified: Menu order changes.
297
-
298
- **3.6.71**
299
- * Minor bug fixed
300
-
301
- **3.6.7**
302
- * Added: Export features for all missing modules.
303
- * Fixed: All console warnings and reported logs.
304
-
305
- **3.6.6**
306
- * Dashboard chart issue fixed for multi site.
307
- * UI improvements along with easy usability.
308
- * Fixed Groups plugin conflicts
309
-
310
- **3.6.5**
311
- * Added in line image support with advance media handling
312
- * PDO check added
313
-
314
- **3.6.4**
315
- * Added: Advanced export features with filter options.
316
- * Improved: Advanced log section.
317
- * Fixed reported jquery issues.
318
- * WordPress 4.0 compatibility checked.
319
-
320
- **3.6.3**
321
- * Added: Eshop import support.
322
- * Fixed reported conflicts with other plugins.
323
- * WordPress 3.9.2 compatibility checked.
324
-
325
- **3.6.2**
326
- * Hot security fix added.
327
-
328
- **3.6.1**
329
- * Multi-site support issue fixed
330
- * Duplicate import issue fixed
331
- * Security issue fixed
332
-
333
- **3.6**
334
- * New interactive graphs and charts in plugin dashboard
335
- * New Admin dashboard widgets
336
- * Added Users and comments export feature
337
- * Auto delimiter handling
338
- * Auto mapping feature
339
- * Now allow authors to access import features
340
-
341
- **3.5.5**
342
- * post_format attribute support added
343
- * page_template attribute added
344
- * update_post_meta added for duplicate meta issue (Thanks to @alantygel)
345
- * Type error issue in jQuery fixed
346
-
347
- **3.5.4**
348
- * Added: All-in-SEO import support.
349
- * WordPress 3.9.1 compatibility added.
350
-
351
- **3.5.3**
352
- * Added: Compatible up to WordPress 3.9.
353
- * Added: Export feature added for posts, page, custom posts type plugins.
354
- * Improved: Removed all warnings.
355
- * Fixed reported bugs
356
-
357
- **3.5.2**
358
- * Import posts with author names as numerical apart from User ID
359
- * Added menu_order attribute import
360
- * Added Auto image rename option
361
- * Option to cancel an partial import at middle
362
- * Improved image handling even special characters in Url
363
- * Import can handle image urls without any extensions
364
- * User reported bugs fixed
365
-
366
- **3.5.1**
367
- * User reported issue fixes
368
- * Activation and other plugin conflict issue solved like Jet pack
369
- * Admin UI freezing issues - screen option, Help links issues fixed.
370
- * WYSIWIG editor UI issue fixed.
371
-
372
- **3.5.0**
373
- * Combined major release version of 3.5 and 3.4
374
- * Improved MVC structure.
375
- * Improved User interface with drag and drop feature.
376
- * Improved: WordPress 3.8.1 compatibility added.
377
- * Module based system allows simplify UI
378
- * Added: Detailed log feature added.
379
- * Added: Support and Useful links added.
380
- * Added: Support made easy now from plugin.
381
-
382
- **3.3.1**
383
- * Added: Multi site compatibility except User import.
384
- * Added: Comments, Users modules mandatory fields validation added.
385
- * Improved: Removed unwanted warnings.
386
-
387
- **3.3.0**
388
- * Added: WordPress 3.8 compatibility.
389
- * Added: Bulk users with role import feature.
390
- * Added: Comments import feature with relevant post ids.
391
-
392
- **3.2.3**
393
- * Added: WordPress 3.7.1 compatibility added.
394
- * Added: Different media path support added.
395
- * Added: Sub folder installations support added.
396
- * Improved: Updated plugin directory path.
397
- * Improved: Removed unwanted warnings.
398
- * Improved: Performance check.
399
-
400
- **3.2.2**
401
- * Added: WordPress 3.6.1 compatibility added.
402
- * Added: Mapping UI improved with on select dynamic update feature
403
- * Added: Help content added
404
- * Fixed: Post slug issue fixed and tested for 3.6 and 3.6.1
405
-
406
- **3.2.1**
407
- * Improved: Performance improvements on SQL and CSV parsing
408
- * Fixed: Plugin deactivation issue fixed and updated the code.
409
- * Fixed: Links in the cells makes problems with the "quote"
410
- * Fixed: Loading content from more than one column
411
- * Fixed: Custom Post type issues fixed
412
-
413
- **3.2.0**
414
- * Improved: User interface improvements
415
- * Improved:WordPress 3.6 compatibility added, Much Improved UI.
416
- * Fixed: Featured image issues fixed for WordPress-3.6.
417
-
418
- **3.1.0**
419
- * Improved: Much Improved Featured Image feature
420
- * Fixed: Image url for featured image issues fixed
421
- * Fixed: PHP 5.4 upgrade fix
422
-
423
- **3.0.0**
424
- * Added: Category in numericals are restricted and skipped to Uncategorized
425
- * Added: Now password should be mentioned as {password}
426
- * Added: Post authors can be User ID or name
427
- * Improved: Much improved work flow
428
- * Improved: Add custom field option improved.
429
- * Improved: Date format handling improved
430
- * Improved: Any Date format is supported now
431
- * Improved: Future scheduling and status improved
432
- * Improved: Can apply post status for individual post via csv itself
433
- * Improved: Featured image handling improved and fixed. More improvement are scheduled.
434
- * Improved: Duplicate check options improved for both title and content option.
435
- * Improved: Post author issue fixed and improved
436
- * Improved: Wrong user id or name are automatically assigned under admin
437
- * Improved: Multi category and tags improved
438
- * Fixed: Custom Field mapping and import fixed
439
- * Fixed: Overall Status option improved and issue fixed
440
- * Fixed: Password field fixed for Protected
441
- * Fixed: Status as in CSV option improved and fixed
442
-
443
- **2.7.0**
444
- * Added: Added more post status options
445
- * Added: Publish, Sticky, Private, Draft and Pending Status for whole import
446
- * Added: Protected status with a common password option added
447
- * Added: "Status as in CSV" to assign status for individual post through CSV as ID or Field Tag
448
- * Added: User ID and User Name support for Post author feature added
449
- * Added: In case of missing or false IDs post assigned to admin as draft
450
- * Added: Add Custom Field Text box auto-filled with CSV header tag.
451
- * Added: Duplicate detection for post content and post title added as options.
452
- * Added: User can choose either one or both to avoid duplicate issues.
453
- * Improved: 6 Standard date format added as drop down to choose.
454
- * Improved: Renamed post_name as post_slug to avoid confusion
455
- * Improved: Mapping Fields
456
- * Improved: Field tags are formatted to support auto mapping option (next milestone)
457
- * Improved: Listed custom fields with prefix as CF: Name for easy identification.
458
- * Fixed: Date format conflict at import fixed.
459
-
460
- **2.6.0**
461
- * Fixed: Major Bug fixed
462
- * Fixed: Added UTF-8 support.
463
- * Fixed: Fixed Html tag conflicts.
464
-
465
- **2.5.0**
466
- * Major issues fixed and updated to WordPress-3.5.1 compatibility.
467
-
468
- **2.0.1**
469
- * Update to WordPress-3.5 compatibility.
470
-
471
- **2.0.0**
472
- * WPDEBUG errors fixed. CSV import folder changed to WP native uploads folder.
473
-
474
- **1.1.1**
475
- * Renamed the mapping field attachment as featured_image and category as post_category.
476
-
477
- **1.1.0**
478
- * Added featured image import feature along with post/page/custom post.
479
-
480
- **1.0.2**
481
- * Bug fixed to recognize the trimmed trailing space in the CSV file
482
- * Added validation for the duplicate field mapping.
483
-
484
- **1.0.1**
485
- * Added features to import multiple tags and categories with different delimiters.
486
-
487
- **1.0.0**
488
- * Initial release version. Tested and found works well without any issues.
489
-
490
-
491
-
492
- #### Upgrade Notice ####
493
-
494
- **3.8.3**
495
- * Upgrade now for improvements in multi language translation.
496
-
497
- **3.8.2**
498
- * Upgrade now for more improvements.
499
-
500
- **3.8.1**
501
- * Upgrade now for ABSPATH used in all files and also fixed all the warnings,bugs.
502
-
503
- **3.8**
504
- * Upgrade now for Multi language support and bug fixes
505
-
506
- **3.7.4**
507
- * Upgrade now for allow author/editor to import fix.
508
-
509
- **3.7.3**
510
- * Upgrade now for Vulnerability fix.
511
-
512
- **3.7.2**
513
- * Important Upgrade for wordpress 4.2 and above
514
-
515
- **3.7.1**
516
- * Upgrade now for security fix.
517
-
518
- **3.7**
519
- * Upgrade now for minor bug fixes.
520
-
521
- **3.6.78**
522
- * Upgrade now for security fix.
523
-
524
- **3.6.77**
525
- * Upgrade now for WordPress 4.1.1 compatibility and minor bug fixes.
526
-
527
- **3.6.76**
528
- * Upgrade now for more bug fixes.
529
-
530
- **3.6.75**
531
- * Upgrade now for improved experience.
532
-
533
- **3.6.74**
534
- * Upgrade now for security fix.
535
-
536
- **3.6.73**
537
- * Upgrade now for WordPress 4.0 compatibility and minor bug fixes.
538
-
539
- **3.6.72**
540
- * Upgrade to enable/disable debug mode in settings.
541
-
542
- **3.6.71**
543
- * Upgrade now for complete export features as in Pro with bug fix.
544
-
545
- **3.6.7**
546
- * Upgrade now for complete export features as in Pro.
547
-
548
- **3.6.6**
549
- * Upgrade now for improved experience.
550
-
551
- **3.6.5**
552
- * Upgrade Now for advanced media handling for post in line images
553
-
554
- **3.6.4**
555
- * Upgrade Now for filtered export and improved log features.
556
-
557
- **3.6.3**
558
- * Upgrade now for Eshop product import feature.
559
-
560
- **3.6.2**
561
- * Important Security Update
562
-
563
- **3.6.1**
564
- * Important issue fixes update
565
-
566
- **3.6**
567
- * Must upgrade with major values added features
568
-
569
- **3.5.5**
570
- * Upgrade for minor bug fix, conflicts and new attribute support.
571
-
572
- **3.5.4**
573
- * Upgrade now for All-in-SEO import support.
574
-
575
- **3.5.3**
576
- * Upgrade for added export feature and bug fixes
577
-
578
- **3.5.2**
579
- * Upgrade for bug free version and improved image handling
580
-
581
- **3.5.1**
582
- * Must upgrade now for 3.5 bug fixes
583
-
584
- **3.5.0**
585
- * Upgrade now for major release 3.5. Note - Old version files need to be deleted.
586
-
587
- **3.3.1**
588
- * Upgrade now for multi site compatibility.
589
-
590
- **3.3.0**
591
- * Upgrade now for WP 3.8 compatibility and added bulk user,comments feature.
592
-
593
- **3.2.3**
594
- * Upgrade for WordPress 3.7.1 compatibility and minor bug fixes
595
-
596
- **3.2.2**
597
- * WordPress 3.6.1 compatible, bug fix and UI improvements
598
-
599
- **3.2.1**
600
- * Performance improvements on SQL and CSV parsing
601
-
602
- **3.2.0**
603
- * Now compatible with 3.6 and improved featured image
604
-
605
- **3.1.0**
606
- * Now Much Improved Featured Image and url handling
607
-
608
- **3.0.0**
609
- * Must upgrade to have Major improvements, performance fixes and issue fixes
610
-
611
- **2.7.0**
612
- * Major improvements and feature changes.
613
-
614
- **2.6.0**
615
- * Bug fixed and should upgrade.
616
-
617
- **2.5.0**
618
- * Duplicate detection added.
619
- * Added more information in success message.
620
- * Import memory issues solved.
621
-
622
- **2.0.1**
623
- * Update to WordPress-3.5 compatibility.
624
-
625
- **2.0.0**
626
- * Major Bug fixed and should upgrade. WPDEBUG errors fixed. CSV import folder changed to WP native uploads folder.
627
-
628
- **1.1.1**
629
- * Minor correction and fix applied.
630
-
631
- **1.1.0**
632
- * A major new feature added in this version. Update needed.
633
-
634
- **1.0.2**
635
- * This version have important bug fixes and newly added features. Must be upgrade immediately.
636
-
637
- **1.0.1**
638
- * Added features to import multiple tags and categories with different delimiters.
639
-
640
- **1.0.0**
641
- * Initial release of plugin.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === WP Ultimate CSV Importer ===
2
  Contributors: smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
- Tags: csv importer, import, export, featured image, migration, scheduled importer, categories, custom post type, ecommerce, free, images, multisite, page, plugin, Post, products, rss, seo, shortcode, tag, Taxonomy, template, thumbnail, upload, url, user, woocommerce, MarketPress, WordPress, wpml, multilingual, csv, xml, csvimporter.
5
  Requires at least: 4.0
6
  Tested up to: 4.4.2
7
- Stable tag: 3.9.1
8
- Version: 3.9.1
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
@@ -58,16 +58,13 @@ Ultimate CSV Importer PRO has all the features of WP Ultimate CSV Importer and i
58
  * [Imported modules can be managed in the File manager and the logs are maintained in the Log manager.](https://www.youtube.com/watch?v=iBqWrq7M6g0)
59
 
60
  = Helpful Links =
61
- [Documentation](https://www.wpultimatecsvimporter.com/documentation/all-import/wordpress-ultimate-csv-importer/?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
62
 
63
  Try the demo of our [PRO plugin](http://demo.smackcoders.com/wordpressdemofour/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro%2Findex.php&__module=dashboard)
64
- and [Free plugin](
65
- http://demo.smackcoders.com/wordpressdemotwo/wp-admin/admin.php?page=wp-ultimate-csv-importer%2Findex.php&__module=dashboard
66
- ). You can also read our [blog](
67
- https://www.smackcoders.com/blog/import-marketpress-pro-event-manager-and-more.html
68
- ) to know more about the new features of PRO plugin.
69
 
70
- Compare Free Vs Pro [Features](https://www.wpultimatecsvimporter.com/wp-ultimate-csv-importer-plugin?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
71
 
72
 
73
  [Troubleshooting tips](https://wordpress.org/support/topic/tips-to-trouble-shoot-wp-ultimate-csv-importer-issues-1)
@@ -84,16 +81,21 @@ Compare Free Vs Pro [Features](https://www.wpultimatecsvimporter.com/wp-ultimate
84
  5. Detailed real time log.
85
  6. Settings with php.ini details.
86
  7. Export module with filters.
 
87
  == Frequently Asked Questions ==
 
88
  = Common Issues =
89
- How to solve auto_prepend_file and auto_append_file error?
90
  Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled.
91
  If not you can disable it in php.ini settings file yourself. You can also do it by a .htaccess file
92
- Create an .htaccess file in the root and set the following values.
93
- php_value auto_prepend_file none
94
- php_value auto_append_file none
95
- This will solve your issue or get support from hosting if you didn’t have sufficient permission.
 
96
  == Changelog ==
 
 
97
  = 3.9.1 =
98
  * Added: Post parent now supports for post title and post name.
99
  * Fixed: jQuery conflicts.
@@ -352,7 +354,10 @@ This will solve your issue or get support from hosting if you didn’t have suff
352
  * Added features to import multiple tags and categories with different delimiters.
353
  = 1.0.0 =
354
  * Initial release version. Tested and found works well without any issues.
 
355
  == Upgrade Notice ==
 
 
356
  = 3.9.1 =
357
  * Upgrade now for import post parent with post name and post title.
358
  = 3.9 =
1
+ === CSV Import for Wordpress ===
2
  Contributors: smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
+ Tags: csv importer, import csv, import woocommerce, import marketpress, import seo by yoast, import all in one seo, scheduled import, import remote file, export woocommerce, import types fields, import acf fields, import inline images.
5
  Requires at least: 4.0
6
  Tested up to: 4.4.2
7
+ Stable tag: 3.9.2
8
+ Version: 3.9.2
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
58
  * [Imported modules can be managed in the File manager and the logs are maintained in the Log manager.](https://www.youtube.com/watch?v=iBqWrq7M6g0)
59
 
60
  = Helpful Links =
61
+ [Documentation](https://www.smackcoders.com/documentation/ultimate-csv-importer-pro/how-to-import-csv/?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
62
 
63
  Try the demo of our [PRO plugin](http://demo.smackcoders.com/wordpressdemofour/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro%2Findex.php&__module=dashboard)
64
+ and [Free plugin](http://demo.smackcoders.com/wordpressdemotwo/wp-admin/admin.php?page=wp-ultimate-csv-importer%2Findex.php&__module=dashboard
65
+ ). You can also read our [blog](https://www.smackcoders.com/blog/import-marketpress-pro-event-manager-and-more.html) to know more about the new features of PRO plugin.
 
 
 
66
 
67
+ Compare Free Vs Pro [Features](https://www.smackcoders.com/wp-ultimate-csv-importer-pro/features.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
68
 
69
 
70
  [Troubleshooting tips](https://wordpress.org/support/topic/tips-to-trouble-shoot-wp-ultimate-csv-importer-issues-1)
81
  5. Detailed real time log.
82
  6. Settings with php.ini details.
83
  7. Export module with filters.
84
+
85
  == Frequently Asked Questions ==
86
+
87
  = Common Issues =
88
+ How to solve auto_prepend_file and auto_append_file error? <br />
89
  Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled.
90
  If not you can disable it in php.ini settings file yourself. You can also do it by a .htaccess file
91
+ Create an .htaccess file in the root and set the following values. <br />
92
+ php_value auto_prepend_file none <br />
93
+ php_value auto_append_file none <br />
94
+ This will solve your issue or get support from hosting if you didn’t have sufficient permission. <br />
95
+
96
  == Changelog ==
97
+ = 3.9.2 =
98
+ * Replaced CSVParserEngine with SmackCSVParser, a high speed robust parser
99
  = 3.9.1 =
100
  * Added: Post parent now supports for post title and post name.
101
  * Fixed: jQuery conflicts.
354
  * Added features to import multiple tags and categories with different delimiters.
355
  = 1.0.0 =
356
  * Initial release version. Tested and found works well without any issues.
357
+
358
  == Upgrade Notice ==
359
+ = 3.9.2 =
360
+ * Upgrade now to get a high speed robust parser.
361
  = 3.9.1 =
362
  * Upgrade now for import post parent with post name and post title.
363
  = 3.9 =
includes/SmackCSVLogger.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************************************************************
3
+ * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
+ * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
+ *
6
+ * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Affero General Public License version 3
8
+ * as published by the Free Software Foundation with the addition of the
9
+ * following permission added to Section 15 as permitted in Section 7(a): FOR
10
+ * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
+ * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
+ * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
+ *
14
+ * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
+ * License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public License
20
+ * along with this program; if not, see http://www.gnu.org/licenses or write
21
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
+ * Boston, MA 02110-1301 USA.
23
+ *
24
+ * You can contact Smackcoders at email address info@smackcoders.com.
25
+ *
26
+ * The interactive user interfaces in original and modified versions
27
+ * of this program must display Appropriate Legal Notices, as required under
28
+ * Section 5 of the GNU Affero General Public License version 3.
29
+ *
30
+ * In accordance with Section 7(b) of the GNU Affero General Public License
31
+ * version 3, these Appropriate Legal Notices must retain the display of the
32
+ * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
+ * not reasonably feasible for technical reasons, the Appropriate Legal
34
+ * Notices must display the words
35
+ * "Copyright Smackcoders. 2015. All rights reserved".
36
+ ********************************************************************************/
37
+
38
+ require_once "SmackCSVObserver.php";
39
+
40
+ class SmackCSVLogger
41
+ {
42
+
43
+ /**
44
+ * SmackCSVLogger constructor.
45
+ * @param null $log_file
46
+ * @throws Exception
47
+ */
48
+ function __construct($log_file = null)
49
+ {
50
+ if (!$log_file)
51
+ {
52
+ $log_file = WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . $this->log_file;
53
+ }
54
+
55
+ if (!file_exists($log_file))
56
+ {
57
+ touch($log_file);
58
+ }
59
+
60
+ if (!(is_writable($log_file) || $this->win_is_writable($log_file)))
61
+ {
62
+ //Cant write to file,
63
+ throw new Exception("LOGGER ERROR: Can't write to log", 1);
64
+ }
65
+
66
+ }
67
+
68
+ /**
69
+ * logD - Log Debug
70
+ * @param String tag - Log Tag
71
+ * @param String message - message to spit out
72
+ * @return void
73
+ **/
74
+ public function logD($tag, $message)
75
+ {
76
+ $this->writeToLog("DEBUG", $tag, $message);
77
+ }
78
+
79
+ /**
80
+ * logE - Log Error
81
+ * @param String tag - Log Tag
82
+ * @param String message - message to spit out
83
+ * @author
84
+ **/
85
+ public function logE($tag, $message)
86
+ {
87
+ $this->writeToLog("ERROR", $tag, $message);
88
+ }
89
+
90
+ /**
91
+ * logW - Log Warning
92
+ * @param String tag - Log Tag
93
+ * @param String message - message to spit out
94
+ * @author
95
+ **/
96
+ public function logW($tag, $message)
97
+ {
98
+ $this->writeToLog("WARNING", $tag, $message);
99
+ }
100
+
101
+ /**
102
+ * logI - Log Info
103
+ * @param String tag - Log Tag
104
+ * @param String message - message to spit out
105
+ * @return void
106
+ **/
107
+ public function logI($tag, $message)
108
+ {
109
+ $this->writeToLog("INFO", $tag, $message);
110
+ }
111
+
112
+ /**
113
+ * writeToLog - writes out timestamped message to the log file as
114
+ * defined by the $log_file class variable.
115
+ *
116
+ * @param String status - "INFO"/"DEBUG"/"ERROR"/"WARNING"/"ALL"/"NONE"
117
+ * @param String tag - "Small tag to help find log entries"
118
+ * @param String message - The message you want to output.
119
+ * @return void
120
+ **/
121
+ private function writeToLog($status, $tag, $message)
122
+ {
123
+ if ($this->log_status == "ALL" || $this->log_status == $status)
124
+ {
125
+ $date = date('[Y-m-d H:i:s]');
126
+ $msg = "$date: [$tag][$status] - $message" . PHP_EOL;
127
+ file_put_contents($this->log_file, $msg, FILE_APPEND);
128
+ }
129
+ }
130
+
131
+ /**
132
+ * win_is_writable function lifted from WordPress
133
+ * @param $path
134
+ * @return bool
135
+ */
136
+ private function win_is_writable($path)
137
+ {
138
+ if ($path[ strlen($path) - 1 ] == '/')
139
+ return win_is_writable($path . uniqid(mt_rand()) . '.tmp');
140
+ else if (is_dir($path))
141
+ return win_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');
142
+
143
+ $should_delete_tmp_file = !file_exists($path);
144
+ $f = @fopen($path, 'a');
145
+ if ($f === false)
146
+ return false;
147
+
148
+ fclose($f);
149
+
150
+ if ($should_delete_tmp_file)
151
+ unlink($path);
152
+
153
+ return true;
154
+ }
155
+ }
includes/SmackCSVObserver.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************************************************************
3
+ * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
+ * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
+ *
6
+ * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Affero General Public License version 3
8
+ * as published by the Free Software Foundation with the addition of the
9
+ * following permission added to Section 15 as permitted in Section 7(a): FOR
10
+ * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
+ * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
+ * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
+ *
14
+ * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
+ * License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public License
20
+ * along with this program; if not, see http://www.gnu.org/licenses or write
21
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
+ * Boston, MA 02110-1301 USA.
23
+ *
24
+ * You can contact Smackcoders at email address info@smackcoders.com.
25
+ *
26
+ * The interactive user interfaces in original and modified versions
27
+ * of this program must display Appropriate Legal Notices, as required under
28
+ * Section 5 of the GNU Affero General Public License version 3.
29
+ *
30
+ * In accordance with Section 7(b) of the GNU Affero General Public License
31
+ * version 3, these Appropriate Legal Notices must retain the display of the
32
+ * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
+ * not reasonably feasible for technical reasons, the Appropriate Legal
34
+ * Notices must display the words
35
+ * "Copyright Smackcoders. 2015. All rights reserved".
36
+ ********************************************************************************/
37
+
38
+ require_once "SmackCSVVars.php";
39
+
40
+ class SmackCSVObserver extends SmackCSVVars
41
+ {
42
+
43
+
44
+ }
includes/SmackCSVParser.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************************************************************
3
+ * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
+ * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
+ *
6
+ * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Affero General Public License version 3
8
+ * as published by the Free Software Foundation with the addition of the
9
+ * following permission added to Section 15 as permitted in Section 7(a): FOR
10
+ * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
+ * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
+ * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
+ *
14
+ * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
+ * License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public License
20
+ * along with this program; if not, see http://www.gnu.org/licenses or write
21
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
+ * Boston, MA 02110-1301 USA.
23
+ *
24
+ * You can contact Smackcoders at email address info@smackcoders.com.
25
+ *
26
+ * The interactive user interfaces in original and modified versions
27
+ * of this program must display Appropriate Legal Notices, as required under
28
+ * Section 5 of the GNU Affero General Public License version 3.
29
+ *
30
+ * In accordance with Section 7(b) of the GNU Affero General Public License
31
+ * version 3, these Appropriate Legal Notices must retain the display of the
32
+ * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
+ * not reasonably feasible for technical reasons, the Appropriate Legal
34
+ * Notices must display the words
35
+ * "Copyright Smackcoders. 2015. All rights reserved".
36
+ ********************************************************************************/
37
+
38
+ ini_set('auto_detect_line_endings', true);
39
+ require_once "SmackCSVUtilClasses.php";
40
+
41
+ class SmackCSVParser extends SmackImpUtilClasses
42
+ {
43
+
44
+ # $fileObj - SplFileObject
45
+ private $fileObj;
46
+
47
+ /**
48
+ * parseCSV - Parse the CSV and return as Array
49
+ * @param null $file
50
+ * @param null $offset
51
+ * @param null $limit
52
+ * @return array|bool
53
+ */
54
+ public function parseCSV($file = null, $offset = null, $limit = null)
55
+ {
56
+ global $wp_session;
57
+
58
+ if ($file)
59
+ {
60
+ $this->file = $file;
61
+ }
62
+
63
+ if ($this->initializeFile($file))
64
+ {
65
+ $Hdata = $this->get_CSVheaders();
66
+ $Cdata = $this->_parseCSV($offset, $limit);
67
+ $this->total_row_count = count($Cdata);
68
+
69
+ if (!$Hdata)
70
+ {
71
+ $this->logE("CSVParser", "Empty header, throws exception in the function parseCSV");
72
+ $wp_session['smimp']['error'] = "Empty header, throws exception in the function parseCSV";
73
+
74
+ return false;
75
+ } elseif (!$Cdata)
76
+ {
77
+ $this->logE("CSVParser", "Empty CSV data, throws exception in the function parseCSV");
78
+ $wp_session['smimp']['error'] = "Empty CSV data, throws exception in the function parseCSV";
79
+
80
+ return false;
81
+ } else
82
+ {
83
+ return $this->_array_combine($Hdata, $Cdata);
84
+ }
85
+ } else
86
+ {
87
+ return false;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * initializeFile - Initialize the CSV file for parsing
93
+ * @param null $file
94
+ * @return bool
95
+ */
96
+ function initializeFile($file = null)
97
+ {
98
+ global $wp_session;
99
+ if (file_exists($file))
100
+ {
101
+ $this->file = $file;
102
+
103
+ return true;
104
+ } else
105
+ {
106
+ $this->logE("CSVParser", "CSV file not exist");
107
+ $wp_session['smimp']['error'] = "CSV file not exist";
108
+
109
+ return false;
110
+ }
111
+ }
112
+
113
+ /**
114
+ * getFileObj - The singleton method to get file Obj
115
+ * @return bool|SplFileObject
116
+ */
117
+ private function getFileObj()
118
+ {
119
+ if (!isset(self::$fileObj))
120
+ {
121
+ if (file_exists($this->file) == false) return false;
122
+ $fileObj = new SplFileObject($this->file, 'r');
123
+
124
+ return $fileObj;
125
+ }
126
+
127
+ $this->logI("CSVParser", "SplFileObject instantiated ");
128
+
129
+ return self::$fileObj;
130
+ }
131
+
132
+ /**
133
+ * get_CSVheaders - Returns the CSV header
134
+ * @return array
135
+ */
136
+ function get_CSVheaders()
137
+ {
138
+ $this->logI("CSVParser", "get_CSVheaders function called");
139
+
140
+ return $this->_getCSVHeaderData();
141
+ }
142
+
143
+ /**
144
+ * set_CSVheaders - Set the CSV header array globally
145
+ */
146
+ function set_CSVheaders()
147
+ {
148
+ $this->logI("CSVParser", "set_CSVheaders function called");
149
+ $this->csvfile_header = $this->_getCSVHeaderData();
150
+ }
151
+
152
+ /**
153
+ * getDelimiter - Get the delimiter of the CSV file
154
+ * @return mixed
155
+ */
156
+ public function getDelimiter()
157
+ {
158
+ $this->logI("CSVParser", "getDelimiter function called");
159
+
160
+ return $this->_autoDetectDelimiter();
161
+ }
162
+
163
+ /**
164
+ * setDelimiter - Set the delimiter of the CSV file
165
+ */
166
+ public function setDelimiter()
167
+ {
168
+ $this->logI("CSVParser", "setDelimiter function called");
169
+ $this->delimiter = $this->_autoDetectDelimiter();
170
+ }
171
+
172
+ /**
173
+ * _array_combine - Combine CSV header & data
174
+ * @param $headerArray
175
+ * @param $dataArray
176
+ * @return array
177
+ */
178
+ public function _array_combine($headerArray, $dataArray)
179
+ {
180
+ $this->logI("CSVParser", "Combining CSV header and data");
181
+ $result = array();
182
+
183
+ $Hdata = $headerArray[0];
184
+
185
+ foreach ($dataArray as $row => $Cdata)
186
+ {
187
+ $result[ $row ] = @array_combine($Hdata, $Cdata);
188
+ }
189
+
190
+ return $result;
191
+ }
192
+
193
+ /**
194
+ * _getCSVHeaderData - Get the CSV header
195
+ * @return array
196
+ */
197
+ public function _getCSVHeaderData()
198
+ {
199
+ $this->logI("CSVParser", "_getCSVHeaderData function called");
200
+
201
+ $hData = $this->_parseCSV(0, 1);
202
+
203
+ if (!$hData)
204
+ {
205
+ $this->logE("CSVParser", "Empty header value returned");
206
+ }
207
+
208
+ return $hData;
209
+ }
210
+
211
+ /**
212
+ * _autoDetectDelimiter - Auto detect delimiter
213
+ * @return mixed
214
+ */
215
+ public function _autoDetectDelimiter()
216
+ {
217
+ $this->logI("CSVParser", "_autoDetectDelimiter function called");
218
+ $dObj = $this->getFileObj();
219
+ $dObj->seek(0);
220
+
221
+ $content = $dObj->current();
222
+
223
+ foreach ($this->delimiters as $delimiter => &$count)
224
+ {
225
+ $count = count(str_getcsv($content, $delimiter));
226
+ }
227
+
228
+ return array_search(max($this->delimiters), $this->delimiters);
229
+ }
230
+
231
+
232
+ /**
233
+ * _parseCSV - Core parsing function
234
+ * @param null $offset
235
+ * @param null $limit
236
+ * @return array
237
+ */
238
+ public function _parseCSV($offset = null, $limit = null)
239
+ {
240
+ $this->logI("CSVParser", "_parseCSV function called");
241
+
242
+ $data = array();
243
+ if (!is_null($offset))
244
+ {
245
+ $this->offset = $offset;
246
+ }
247
+ if (!is_null($limit))
248
+ {
249
+ $this->limit = $limit;
250
+ }
251
+
252
+ $pObj = $this->getFileObj();
253
+ $this->delimiter = $this->getDelimiter();
254
+ $pObj->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
255
+ $pObj->setFlags(SplFileObject::READ_CSV | SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE);
256
+
257
+ foreach (new LimitIterator($pObj, $this->offset, $this->limit) as $num => $line)
258
+ {
259
+ $data[ $num ] = $line;
260
+ }
261
+
262
+ return $data;
263
+
264
+ }
265
+ }
includes/SmackCSVUtilClasses.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************************************************************
3
+ * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
+ * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
+ *
6
+ * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Affero General Public License version 3
8
+ * as published by the Free Software Foundation with the addition of the
9
+ * following permission added to Section 15 as permitted in Section 7(a): FOR
10
+ * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
+ * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
+ * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
+ *
14
+ * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
+ * License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public License
20
+ * along with this program; if not, see http://www.gnu.org/licenses or write
21
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
+ * Boston, MA 02110-1301 USA.
23
+ *
24
+ * You can contact Smackcoders at email address info@smackcoders.com.
25
+ *
26
+ * The interactive user interfaces in original and modified versions
27
+ * of this program must display Appropriate Legal Notices, as required under
28
+ * Section 5 of the GNU Affero General Public License version 3.
29
+ *
30
+ * In accordance with Section 7(b) of the GNU Affero General Public License
31
+ * version 3, these Appropriate Legal Notices must retain the display of the
32
+ * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
+ * not reasonably feasible for technical reasons, the Appropriate Legal
34
+ * Notices must display the words
35
+ * "Copyright Smackcoders. 2015. All rights reserved".
36
+ ********************************************************************************/
37
+
38
+ require_once "SmackCSVLogger.php";
39
+
40
+ class SmackImpUtilClasses extends SmackCSVObserver
41
+ {
42
+
43
+ /**
44
+ * getXMLString - Get XML string from file
45
+ * @param null $file
46
+ * @return bool|string
47
+ */
48
+ function getXMLString($file = null)
49
+ {
50
+ global $wp_session;
51
+
52
+ $this->logI("SMUtils", "getXMLFileContents function called");
53
+
54
+ if (!file_exists($file))
55
+ {
56
+ $this->logE("SMUtils", "XML file doesn't exist");
57
+ $wp_session['smimp']['error'] = "XML file doesn't exist";
58
+
59
+ return false;
60
+ } else
61
+ {
62
+ $this->xmlstring = file_get_contents($file);
63
+ if (!$this->xmlstring)
64
+ {
65
+ $this->logE("XMLParser", "XMLString is empty");
66
+ $wp_session['smimp']['error'] = "XMLString is empty";
67
+
68
+ return false;
69
+ }
70
+
71
+ return $this->xmlstring;
72
+ }
73
+ }
74
+ }
includes/SmackCSVVars.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************************************************************
3
+ * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
+ * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
+ *
6
+ * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Affero General Public License version 3
8
+ * as published by the Free Software Foundation with the addition of the
9
+ * following permission added to Section 15 as permitted in Section 7(a): FOR
10
+ * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
+ * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
+ * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
+ *
14
+ * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
+ * License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public License
20
+ * along with this program; if not, see http://www.gnu.org/licenses or write
21
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
+ * Boston, MA 02110-1301 USA.
23
+ *
24
+ * You can contact Smackcoders at email address info@smackcoders.com.
25
+ *
26
+ * The interactive user interfaces in original and modified versions
27
+ * of this program must display Appropriate Legal Notices, as required under
28
+ * Section 5 of the GNU Affero General Public License version 3.
29
+ *
30
+ * In accordance with Section 7(b) of the GNU Affero General Public License
31
+ * version 3, these Appropriate Legal Notices must retain the display of the
32
+ * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
+ * not reasonably feasible for technical reasons, the Appropriate Legal
34
+ * Notices must display the words
35
+ * "Copyright Smackcoders. 2015. All rights reserved".
36
+ ********************************************************************************/
37
+
38
+ class SmackCSVVars extends SmackCSVLogger
39
+ {
40
+
41
+ #Plugin information
42
+
43
+ var $plugin_slug = "wp-ultimate-csv-importer";
44
+
45
+ # default delimiter (comma) and default enclosure (double quote)
46
+ var $delimiter = ',';
47
+ var $enclosure = '"';
48
+ var $escape = "\\";
49
+
50
+ # number of rows to ignore from beginning of data
51
+ var $offset = 2;
52
+
53
+ # limits the number of returned rows to specified amount
54
+ var $limit = 2;
55
+
56
+ # preferred delimiter characters
57
+ var $delimiters = array(
58
+ ';' => 0,
59
+ ',' => 0,
60
+ "\t" => 0,
61
+ "|" => 0,
62
+ ":" => 0,
63
+ );
64
+
65
+ # current file
66
+ var $file;
67
+
68
+ # loaded file contents
69
+ var $csvfile_data;
70
+
71
+ # current CSV header data
72
+ var $csvfile_header;
73
+
74
+ #Logger configuration
75
+ var $log_file = "logs/wp-ultimate-csv-importer.log";
76
+
77
+ #String status - "INFO"/"DEBUG"/"ERROR"/"WARNING"/"ALL"/"NONE"
78
+ var $log_status = "ERROR";
79
+
80
+ #XML string
81
+ var $xmlstring;
82
+
83
+ #total row count
84
+ var $total_row_count;
85
+ }
86
+
87
+
includes/WPImporter_includes_helper.php CHANGED
@@ -294,33 +294,52 @@ class WPImporter_includes_helper {
294
  * @param $delim delimiter for the CSV
295
  * @return array formatted CSV output as array
296
  */
297
- function csv_file_data($file) {
298
  $file = $this->getUploadDirectory() . '/' . $file;
299
- require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'includes/Importer.php');
300
- $csv = new ImporterLib();
301
- $csv->delim($file);
302
- foreach ($csv->data as $hkey => $hval) {
303
- foreach ($hval as $hk => $hv) {
304
- $this->headers[] = $hk;
305
- }
306
- break;
307
- }
308
- return $csv->data;
309
- }
310
-
311
- function csv_file_readdata($file, $obj) {
312
- $file = $obj->getUploadDirectory() . '/' . $file;
313
- require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'includes/Importer.php');
314
- $csv = new ImporterLib();
315
- $csv->delim($file);
316
- foreach ($csv->data as $hkey => $hval) {
317
- foreach ($hval as $hk => $hv) {
318
- $this->headers[] = $hk;
319
  }
320
- break;
 
 
321
  }
322
- return $csv->data;
323
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  function get_availgroups($module) {
326
  $groups = array();
@@ -605,7 +624,7 @@ class WPImporter_includes_helper {
605
 
606
  // Date format post
607
  if (!isset($data_array ['post_date'])) {
608
- $data_array ['post_date'] = date('Y-m-d H:i:s');
609
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'];
610
  } else {
611
  if(strtotime($data_array ['post_date'])){
@@ -613,7 +632,7 @@ class WPImporter_includes_helper {
613
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'];
614
  }
615
  else {
616
- $data_array ['post_date'] = date('Y-m-d H:i:s');
617
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'] . ' . Unformatted date so current date was replaced.';
618
  }
619
  }
@@ -1208,7 +1227,7 @@ class WPImporter_includes_helper {
1208
 
1209
  function helpnotes() {
1210
  $smackhelpnotes = '<span style="position:absolute;margin-top:6px;margin-left:15px;">
1211
- <a href="" class="tooltip">
1212
  <img src="' . esc_url(WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/help.png").'" />
1213
  <span class="tooltipPostStatus">
1214
  <img class="callout" src="' . esc_url(WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/callout.gif").'" />
294
  * @param $delim delimiter for the CSV
295
  * @return array formatted CSV output as array
296
  */
297
+ function csv_file_data($file,$startlimit,$endlimit = null) {
298
  $file = $this->getUploadDirectory() . '/' . $file;
299
+ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'includes/SmackCSVParser.php');
300
+ if(file_exists($file)){
301
+ $csv = new SmackCSVParser();
302
+ $data = $csv->parseCSV($file,$startlimit,$endlimit);
303
+ foreach ($data as $hkey => $hval) {
304
+ foreach ($hval as $hk => $hv) {
305
+ $this->headers[] = $hk;
306
+ }
307
+ break;
 
 
 
 
 
 
 
 
 
 
 
308
  }
309
+ return $data;
310
+ }else{
311
+ return false;
312
  }
 
313
  }
314
+ function csv_file_readdata($file,$path,$delim) {
315
+ $data_rows = array();
316
+ $path = $this->getUploadDirectory() . '/' . $file;
317
+ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'includes/SmackCSVParser.php');
318
+ $csv = new SmackCSVParser();
319
+ $csv->parseCSV($path,1,1);
320
+ $delim = $csv->delimiter;
321
+ # Check whether file is present in the given file location
322
+ $fileexists = file_exists($path);
323
+ if ($fileexists) {
324
+ $resource = fopen($path, 'r');
325
+ $init = 0;
326
+ while ($keys = fgetcsv($resource, '', $delim, '"')) {
327
+ if ($init == 0) {
328
+ $this->headers = $keys;
329
+ } else {
330
+ if (!(($keys[0] == null) && (count($keys) == 1))) {
331
+ array_push($data_rows, $keys);
332
+ }
333
+ }
334
+ $init++;
335
+ }
336
+ fclose($resource);
337
+ ini_set("auto_detect_line_endings", false);
338
+ } else {
339
+ return false;
340
+ }
341
+ return $data_rows;
342
+ }
343
 
344
  function get_availgroups($module) {
345
  $groups = array();
624
 
625
  // Date format post
626
  if (!isset($data_array ['post_date'])) {
627
+ $data_array ['post_date'] = current_time('Y-m-d H:i:s');
628
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'];
629
  } else {
630
  if(strtotime($data_array ['post_date'])){
632
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'];
633
  }
634
  else {
635
+ $data_array ['post_date'] = current_time('Y-m-d H:i:s');
636
  $this->detailedLog[$currentLimit]['postdate'] = "<b>" . __('Date', 'wp-ultimate-csv-importer') . " - </b>" . $data_array ['post_date'] . ' . Unformatted date so current date was replaced.';
637
  }
638
  }
1227
 
1228
  function helpnotes() {
1229
  $smackhelpnotes = '<span style="position:absolute;margin-top:6px;margin-left:15px;">
1230
+ <a href="#" class="tooltip">
1231
  <img src="' . esc_url(WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/help.png").'" />
1232
  <span class="tooltipPostStatus">
1233
  <img class="callout" src="' . esc_url(WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/callout.gif").'" />
index.php CHANGED
@@ -2,7 +2,7 @@
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
- * Version: 3.9.1
6
  * Author: smackcoders.com
7
  * Text Domain: wp-ultimate-csv-importer
8
  * Domain Path: /languages
@@ -81,7 +81,7 @@ define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-
81
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
82
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
83
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
84
- define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.9.1');
85
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
86
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
87
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
@@ -96,10 +96,9 @@ function load_lang_files(){
96
  $csv_importer_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
97
  load_plugin_textdomain( 'wp-ultimate-csv-importer', false, $csv_importer_dir);
98
  }
99
-
100
  require_once('plugins/class.inlineimages.php');
101
  require_once('includes/WPImporter_includes_helper.php');
102
-
103
  # Activation & Deactivation
104
  register_activation_hook(__FILE__, array('WPImporter_includes_helper', 'activate'));
105
  register_deactivation_hook(__FILE__, array('WPImporter_includes_helper', 'deactivate'));
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
+ * Version: 3.9.2
6
  * Author: smackcoders.com
7
  * Text Domain: wp-ultimate-csv-importer
8
  * Domain Path: /languages
81
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
82
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
83
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
84
+ define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.9.2');
85
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
86
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
87
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
96
  $csv_importer_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
97
  load_plugin_textdomain( 'wp-ultimate-csv-importer', false, $csv_importer_dir);
98
  }
 
99
  require_once('plugins/class.inlineimages.php');
100
  require_once('includes/WPImporter_includes_helper.php');
101
+ require_once('includes/SmackCSVParser.php');
102
  # Activation & Deactivation
103
  register_activation_hook(__FILE__, array('WPImporter_includes_helper', 'activate'));
104
  register_deactivation_hook(__FILE__, array('WPImporter_includes_helper', 'deactivate'));
js/ultimate-importer-free.js CHANGED
@@ -499,6 +499,10 @@ function customimagelocation(val) {
499
 
500
  function importRecordsbySettings(siteurl) {
501
  var importlimit = document.getElementById('importlimit').value;
 
 
 
 
502
  var noncekey = document.getElementById('wpnoncekey').value;
503
  var get_requested_count = importlimit;
504
  var tot_no_of_records = document.getElementById('checktotal').value;
@@ -561,6 +565,7 @@ function importRecordsbySettings(siteurl) {
561
  'dupContent': dupContent,
562
  'dupTitle': dupTitle,
563
  'importlimit': importlimit,
 
564
  'limit': currentlimit,
565
  'totRecords': tot_no_of_records,
566
  'selectedImporter': importas,
@@ -586,7 +591,7 @@ function importRecordsbySettings(siteurl) {
586
  if (parseInt(tmpCnt) == parseInt(tot_no_of_records)) {
587
  document.getElementById('terminatenow').style.display = "none";
588
  }
589
- if (parseInt(tmpCnt) < parseInt(tot_no_of_records)) {
590
  var terminate_action = document.getElementById('terminateaction').value;
591
  currentlimit = parseInt(currentlimit) + parseInt(importlimit);
592
  document.getElementById('currentlimit').value = currentlimit;
@@ -683,6 +688,13 @@ function import_again() {
683
  function check_allnumeric(inputtxt) {
684
  var numbers = /^[0-9]+$/;
685
  if (inputtxt.match(numbers)) {
 
 
 
 
 
 
 
686
  return true;
687
  }
688
  else {
499
 
500
  function importRecordsbySettings(siteurl) {
501
  var importlimit = document.getElementById('importlimit').value;
502
+ var check_limit = check_allnumeric(importlimit);
503
+ if(!check_limit){
504
+ return false;
505
+ }
506
  var noncekey = document.getElementById('wpnoncekey').value;
507
  var get_requested_count = importlimit;
508
  var tot_no_of_records = document.getElementById('checktotal').value;
565
  'dupContent': dupContent,
566
  'dupTitle': dupTitle,
567
  'importlimit': importlimit,
568
+ 'get_requested_count': get_requested_count,
569
  'limit': currentlimit,
570
  'totRecords': tot_no_of_records,
571
  'selectedImporter': importas,
591
  if (parseInt(tmpCnt) == parseInt(tot_no_of_records)) {
592
  document.getElementById('terminatenow').style.display = "none";
593
  }
594
+ if (parseInt(tmpCnt) <= parseInt(tot_no_of_records)) {
595
  var terminate_action = document.getElementById('terminateaction').value;
596
  currentlimit = parseInt(currentlimit) + parseInt(importlimit);
597
  document.getElementById('currentlimit').value = currentlimit;
688
  function check_allnumeric(inputtxt) {
689
  var numbers = /^[0-9]+$/;
690
  if (inputtxt.match(numbers)) {
691
+ no_of_tot_records = document.getElementById('tot_records').value;
692
+ if (parseInt(inputtxt) <= parseInt(no_of_tot_records)) {
693
+ document.getElementById('server_request_warning').style.display = 'none';
694
+ } else {
695
+ document.getElementById('server_request_warning').style.display = '';
696
+ return false;
697
+ }
698
  return true;
699
  }
700
  else {
logs/wp-ultimate-csv-importer.log ADDED
File without changes
modules/custompost/templates/index.php CHANGED
@@ -135,6 +135,7 @@ $nonce_Key = $impCE->create_nonce_key();
135
  </h2>
136
  <?php
137
  if (isset($_FILES['inlineimages'])) {
 
138
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename'] != '')) {
139
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
140
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
@@ -241,7 +242,13 @@ $nonce_Key = $impCE->create_nonce_key();
241
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
242
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
243
  }
244
- $getrecords = $impCE->csv_file_data($filename);
 
 
 
 
 
 
245
  $getcustomposts = get_post_types();
246
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
247
  foreach ($getcustomposts as $keys => $value) {
@@ -255,9 +262,9 @@ $nonce_Key = $impCE->create_nonce_key();
255
  <tr>
256
  <div align='center' style='float:right;'>
257
  <?php $cnt = count($impCE->defCols) + 2;
258
- $cnt1 = count($impCE->headers);
259
- $records = count($getrecords);
260
- $imploaded_array = implode(',', $impCE->headers); ?>
261
  <input type='hidden' id='imploded_header' name='imploded_array'
262
  value='<?php if (isset($imploaded_array)) {
263
  echo $imploaded_array;
@@ -350,8 +357,8 @@ $nonce_Key = $impCE->create_nonce_key();
350
  id="mapping<?php print($count); ?>">
351
  <?php } ?>
352
  <option>-- Select --</option>
353
- <?php if(is_array($impCE->headers) && !empty($impCE->headers)) {
354
- foreach ($impCE->headers as $key1 => $value1) { ?>
355
 
356
  <option><?php echo $value1; ?></option>
357
  <?php }
@@ -411,8 +418,8 @@ $nonce_Key = $impCE->create_nonce_key();
411
  <select name="coremapping<?php print($count); ?>"
412
  id="coremapping<?php print($count); ?>">
413
  <option>-- Select --</option>
414
- <?php if(is_array($impCE->headers) && !empty($impCE->headers)) {
415
- foreach ($impCE->headers as $key1 => $value1) { ?>
416
  <option><?php echo $value1; ?></option>
417
  <?php }
418
  } ?>
@@ -473,8 +480,8 @@ $nonce_Key = $impCE->create_nonce_key();
473
  <select name="term_mapping<?php print($count); ?>" id="term_mapping<?php print($count); ?>">
474
  <option>-- Select --</option>
475
  <?php
476
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
477
- foreach ($impCE->headers as $key1 => $value1) { ?>
478
  <option><?php echo $value1; ?></option>
479
  <?php }
480
  }?>
@@ -532,8 +539,8 @@ $nonce_Key = $impCE->create_nonce_key();
532
  id="seomapping<?php print($count); ?>">
533
  <option>-- Select --</option>
534
  <?php
535
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
536
- foreach ($impCE->headers as $key1 => $value1) { ?>
537
  <option><?php echo $value1; ?></option>
538
  <?php }
539
  }?>
@@ -663,9 +670,11 @@ $nonce_Key = $impCE->create_nonce_key();
663
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
664
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
665
  <br>
 
666
  <span class='msg' id='server_request_warning'
667
- style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']); ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
668
- <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
 
669
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
670
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
671
  <label id="innertitle">Inline image options</label><br/>
135
  </h2>
136
  <?php
137
  if (isset($_FILES['inlineimages'])) {
138
+ $uploadDir = wp_upload_dir();
139
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename'] != '')) {
140
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
141
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
242
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
243
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
244
  }
245
+ $total_row_count = '';
246
+ $parserObj = new SmackCSVParser();
247
+ $file = $impCE->getUploadDirectory() . '/' . $filename;
248
+ $parserObj->parseCSV($file, 0, -1);
249
+ $headers = $parserObj->get_CSVheaders();
250
+ $headers = $headers[0];
251
+ $total_row_count = $parserObj->total_row_count - 1;
252
  $getcustomposts = get_post_types();
253
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
254
  foreach ($getcustomposts as $keys => $value) {
262
  <tr>
263
  <div align='center' style='float:right;'>
264
  <?php $cnt = count($impCE->defCols) + 2;
265
+ $cnt1 = count($headers);
266
+ $records = $total_row_count;
267
+ $imploaded_array = implode(',', $headers); ?>
268
  <input type='hidden' id='imploded_header' name='imploded_array'
269
  value='<?php if (isset($imploaded_array)) {
270
  echo $imploaded_array;
357
  id="mapping<?php print($count); ?>">
358
  <?php } ?>
359
  <option>-- Select --</option>
360
+ <?php if(is_array($headers) && !empty($headers)) {
361
+ foreach ($headers as $key1 => $value1) { ?>
362
 
363
  <option><?php echo $value1; ?></option>
364
  <?php }
418
  <select name="coremapping<?php print($count); ?>"
419
  id="coremapping<?php print($count); ?>">
420
  <option>-- Select --</option>
421
+ <?php if(is_array($headers) && !empty($headers)) {
422
+ foreach ($headers as $key1 => $value1) { ?>
423
  <option><?php echo $value1; ?></option>
424
  <?php }
425
  } ?>
480
  <select name="term_mapping<?php print($count); ?>" id="term_mapping<?php print($count); ?>">
481
  <option>-- Select --</option>
482
  <?php
483
+ if(is_array($headers) && !empty($headers)) {
484
+ foreach ($headers as $key1 => $value1) { ?>
485
  <option><?php echo $value1; ?></option>
486
  <?php }
487
  }?>
539
  id="seomapping<?php print($count); ?>">
540
  <option>-- Select --</option>
541
  <?php
542
+ if(is_array($headers) && !empty($headers)) {
543
+ foreach ($headers as $key1 => $value1) { ?>
544
  <option><?php echo $value1; ?></option>
545
  <?php }
546
  }?>
670
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
671
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
672
  <br>
673
+ <div>
674
  <span class='msg' id='server_request_warning'
675
+ style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo ' '.sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']).' '; ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
676
+ </div>
677
+ <input type="hidden" id="currentlimit" name="currentlimit" value="1"/>
678
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
679
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
680
  <label id="innertitle">Inline image options</label><br/>
modules/eshop/actions/actions.php CHANGED
@@ -94,7 +94,7 @@ class EshopActions extends SkinnyActions {
94
  /**
95
  * Mapping fields
96
  */
97
- public $defCols = array('post_title' => null, 'post_content' => null, 'post_excerpt' => null, 'post_date' => null, 'post_name' => null, 'post_status' => null, 'post_author' => null, 'post_parent' => 0, 'comment_status' => 'open', 'ping_status' => 'open', 'SKU' => null, 'products_option' => null, 'sale_price' => 0, 'regular_price' => 0, 'description' => null, 'shiprate' => 'no', 'optset' => null, 'featured_product' => 'no', 'product_in_sale' => 'no', 'stock_available' => 'no', 'cart_option' => 'null', 'featured_image' => null,'tags'=>null,'category'=>null);
98
 
99
  /**
100
  * Manage duplicates
94
  /**
95
  * Mapping fields
96
  */
97
+ public $defCols = array('post_title' => null, 'post_content' => null, 'post_excerpt' => null, 'post_date' => null, 'post_name' => null, 'post_status' => null, 'post_author' => null, 'post_parent' => 0, 'comment_status' => 'open', 'ping_status' => 'open', 'SKU' => null, 'products_option' => null, 'sale_price' => 0, 'regular_price' => 0, 'description' => null, 'shiprate' => 'no', 'optset' => null, 'featured_product' => 'no', 'product_in_sale' => 'no', 'stock_available' => 'no', 'cart_option' => 'null', 'featured_image' => null);
98
 
99
  /**
100
  * Manage duplicates
modules/eshop/templates/index.php CHANGED
@@ -137,6 +137,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
137
  <h2><div class="secondformheader"><?php echo esc_html__('Import Data Configuration','wp-ultimate-csv-importer'); ?></div></h2>
138
  <?php
139
  if(isset($_FILES['inlineimages'])) {
 
140
  if(isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != ''){
141
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
142
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
@@ -203,8 +204,13 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
203
  if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
204
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
205
  }
206
-
207
- $getrecords = $impCE->csv_file_data($filename);
 
 
 
 
 
208
  $getcustomposts = get_post_types();
209
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
210
  foreach($getcustomposts as $keys => $value)
@@ -219,9 +225,9 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
219
  <tr>
220
  <div align='center' style='float:right;'>
221
  <?php $cnt = count($impCE->defCols) + 2;
222
- $cnt1 = count($impCE->headers);
223
- $records = count($getrecords);
224
- $imploaded_array = implode(',', $impCE->headers); ?>
225
  <input type = 'hidden' id = 'imploded_header' name = 'imploded_array' value = '<?php if(isset($imploaded_array)) { echo $imploaded_array; } ?>'>
226
  <input type='hidden' id='h1' name='h1' value="<?php if(isset($cnt)) { echo $cnt; } ?>"/>
227
  <input type='hidden' id='h2' name='h2' value="<?php if(isset($cnt1)) { echo $cnt1; } ?>"/>
@@ -276,8 +282,8 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
276
  <?php } ?>
277
  <option>-- Select --</option>
278
  <?php
279
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
280
- foreach($impCE->headers as $key1 => $value1){?>
281
  <option><?php echo $value1; ?></option>
282
  <?php }
283
  }?>
@@ -322,8 +328,8 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
322
  <select name="coremapping<?php print($count); ?>" id="coremapping<?php print($count); ?>">
323
  <option>-- Select --</option>
324
  <?php
325
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
326
- foreach($impCE->headers as $key1 => $value1){?>
327
  <option><?php echo $value1; ?></option>
328
  <?php
329
  }
@@ -379,8 +385,8 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
379
  <select name="term_mapping<?php print($count); ?>" id="term_mapping<?php print($count); ?>">
380
  <option>-- Select --</option>
381
  <?php
382
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
383
- foreach ($impCE->headers as $key1 => $value1) { ?>
384
  <option><?php echo $value1; ?></option>
385
  <?php }
386
  }?>
@@ -436,8 +442,8 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
436
  <select name="seomapping<?php print($count); ?>" id="seomapping<?php print($count); ?>">
437
  <option>-- Select --</option>
438
  <?php
439
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
440
- foreach($impCE->headers as $key1 => $value1){?>
441
  <option><?php echo $value1; ?></option>
442
  <?php
443
  }
@@ -522,8 +528,10 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] !== 'not_avail'
522
  <input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
523
  <label id='importalign'><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo esc_html__('Detect duplicate post title','wp-ultimate-csv-importer'); ?></label> <br>
524
  <label id='importalign'><?php echo esc_html__('No. of posts/rows per server request','wp-ultimate-csv-importer'); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
525
- <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto','wp-ultimate-csv-importer'); ?> <?php echo sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']); ?> <?php echo esc_html__('per request.','wp-ultimate-csv-importer'); ?></span>
526
- <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
 
 
527
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
528
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
529
  <label id="innertitle"><?php echo esc_html__('Inline image options','wp-ultimate-csv-importer'); ?></label><br />
137
  <h2><div class="secondformheader"><?php echo esc_html__('Import Data Configuration','wp-ultimate-csv-importer'); ?></div></h2>
138
  <?php
139
  if(isset($_FILES['inlineimages'])) {
140
+ $uploadDir = wp_upload_dir();
141
  if(isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != ''){
142
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
143
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
204
  if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
205
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
206
  }
207
+ $total_row_count = '';
208
+ $parserObj = new SmackCSVParser();
209
+ $file = $impCE->getUploadDirectory() . '/' . $filename;
210
+ $parserObj->parseCSV($file, 0, -1);
211
+ $headers = $parserObj->get_CSVheaders();
212
+ $headers = $headers[0];
213
+ $total_row_count = $parserObj->total_row_count - 1;
214
  $getcustomposts = get_post_types();
215
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
216
  foreach($getcustomposts as $keys => $value)
225
  <tr>
226
  <div align='center' style='float:right;'>
227
  <?php $cnt = count($impCE->defCols) + 2;
228
+ $cnt1 = count($headers);
229
+ $records = $total_row_count;
230
+ $imploaded_array = implode(',', $headers); ?>
231
  <input type = 'hidden' id = 'imploded_header' name = 'imploded_array' value = '<?php if(isset($imploaded_array)) { echo $imploaded_array; } ?>'>
232
  <input type='hidden' id='h1' name='h1' value="<?php if(isset($cnt)) { echo $cnt; } ?>"/>
233
  <input type='hidden' id='h2' name='h2' value="<?php if(isset($cnt1)) { echo $cnt1; } ?>"/>
282
  <?php } ?>
283
  <option>-- Select --</option>
284
  <?php
285
+ if(is_array($headers) && !empty($headers)) {
286
+ foreach($headers as $key1 => $value1){?>
287
  <option><?php echo $value1; ?></option>
288
  <?php }
289
  }?>
328
  <select name="coremapping<?php print($count); ?>" id="coremapping<?php print($count); ?>">
329
  <option>-- Select --</option>
330
  <?php
331
+ if(is_array($headers) && !empty($headers)) {
332
+ foreach($headers as $key1 => $value1){?>
333
  <option><?php echo $value1; ?></option>
334
  <?php
335
  }
385
  <select name="term_mapping<?php print($count); ?>" id="term_mapping<?php print($count); ?>">
386
  <option>-- Select --</option>
387
  <?php
388
+ if(is_array($headers) && !empty($headers)) {
389
+ foreach ($headers as $key1 => $value1) { ?>
390
  <option><?php echo $value1; ?></option>
391
  <?php }
392
  }?>
442
  <select name="seomapping<?php print($count); ?>" id="seomapping<?php print($count); ?>">
443
  <option>-- Select --</option>
444
  <?php
445
+ if(is_array($headers) && !empty($headers)) {
446
+ foreach($headers as $key1 => $value1){?>
447
  <option><?php echo $value1; ?></option>
448
  <?php
449
  }
528
  <input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
529
  <label id='importalign'><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo esc_html__('Detect duplicate post title','wp-ultimate-csv-importer'); ?></label> <br>
530
  <label id='importalign'><?php echo esc_html__('No. of posts/rows per server request','wp-ultimate-csv-importer'); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
531
+ <div>
532
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto','wp-ultimate-csv-importer'); ?> <?php echo ' '.sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']).' '; ?> <?php echo esc_html__('per request.','wp-ultimate-csv-importer'); ?></span>
533
+ </div>
534
+ <input type="hidden" id="currentlimit" name="currentlimit" value="1"/>
535
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
536
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
537
  <label id="innertitle"><?php echo esc_html__('Inline image options','wp-ultimate-csv-importer'); ?></label><br />
modules/page/templates/index.php CHANGED
@@ -137,6 +137,7 @@ $nonce_Key = $impCE->create_nonce_key();
137
  </h2>
138
  <?php
139
  if (isset($_FILES['inlineimages'])) {
 
140
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != '') {
141
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
142
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
@@ -206,7 +207,13 @@ $nonce_Key = $impCE->create_nonce_key();
206
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
207
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
208
  }
209
- $getrecords = $impCE->csv_file_data($filename);
 
 
 
 
 
 
210
  $getcustomposts = get_post_types();
211
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
212
  foreach ($getcustomposts as $keys => $value) {
@@ -220,9 +227,9 @@ $nonce_Key = $impCE->create_nonce_key();
220
  <tr>
221
  <div align='center' style='float:right;'>
222
  <?php $cnt = count($impCE->defCols) + 2;
223
- $cnt1 = count($impCE->headers);
224
- $records = count($getrecords);
225
- $imploaded_array = implode(',', $impCE->headers); ?>
226
  <input type='hidden' id='imploded_header' name='imploded_array'
227
  value='<?php if (isset($imploaded_array)) {
228
  echo $imploaded_array;
@@ -310,8 +317,8 @@ $nonce_Key = $impCE->create_nonce_key();
310
  <?php } ?>
311
  <option>-- Select --</option>
312
  <?php
313
- if(is_array($impCE->headers) && !empty($impCE->headers)) {
314
- foreach ($impCE->headers as $key1 => $value1) { ?>
315
 
316
  <option><?php echo $value1; ?></option>
317
  <?php }
@@ -365,8 +372,8 @@ $nonce_Key = $impCE->create_nonce_key();
365
  id="coremapping<?php print($count); ?>">
366
  <option>-- Select --</option>
367
  <?php
368
- if(!empty($impCE->headers) && is_array($impCE->headers)) {
369
- foreach ($impCE->headers as $key1 => $value1) { ?>
370
  <option><?php echo $value1; ?></option>
371
  <?php }
372
  }?>
@@ -434,8 +441,8 @@ $nonce_Key = $impCE->create_nonce_key();
434
  id="seomapping<?php print($count); ?>">
435
  <option>-- Select --</option>
436
  <?php
437
- if(!empty($impCE->headers) && is_array($impCE->headers)) {
438
- foreach ($impCE->headers as $key1 => $value1) { ?>
439
  <option><?php echo $value1; ?></option>
440
  <?php
441
  }
@@ -557,9 +564,11 @@ $nonce_Key = $impCE->create_nonce_key();
557
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
558
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
559
  <br>
 
560
  <span class='msg' id='server_request_warning'
561
- style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto ', 'wp-ultimate-csv-importer'); ?><?php echo sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']); ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
562
- <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
 
563
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
564
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
565
  <label
137
  </h2>
138
  <?php
139
  if (isset($_FILES['inlineimages'])) {
140
+ $uploadDir = wp_upload_dir();
141
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != '') {
142
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
143
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
207
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
208
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
209
  }
210
+ $total_row_count = '';
211
+ $parserObj = new SmackCSVParser();
212
+ $file = $impCE->getUploadDirectory() . '/' . $filename;
213
+ $parserObj->parseCSV($file, 0, -1);
214
+ $headers = $parserObj->get_CSVheaders();
215
+ $headers = $headers[0];
216
+ $total_row_count = $parserObj->total_row_count - 1;
217
  $getcustomposts = get_post_types();
218
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
219
  foreach ($getcustomposts as $keys => $value) {
227
  <tr>
228
  <div align='center' style='float:right;'>
229
  <?php $cnt = count($impCE->defCols) + 2;
230
+ $cnt1 = count($headers);
231
+ $records = $total_row_count;
232
+ $imploaded_array = implode(',', $headers); ?>
233
  <input type='hidden' id='imploded_header' name='imploded_array'
234
  value='<?php if (isset($imploaded_array)) {
235
  echo $imploaded_array;
317
  <?php } ?>
318
  <option>-- Select --</option>
319
  <?php
320
+ if(is_array($headers) && !empty($headers)) {
321
+ foreach ($headers as $key1 => $value1) { ?>
322
 
323
  <option><?php echo $value1; ?></option>
324
  <?php }
372
  id="coremapping<?php print($count); ?>">
373
  <option>-- Select --</option>
374
  <?php
375
+ if(!empty($headers) && is_array($headers)) {
376
+ foreach ($headers as $key1 => $value1) { ?>
377
  <option><?php echo $value1; ?></option>
378
  <?php }
379
  }?>
441
  id="seomapping<?php print($count); ?>">
442
  <option>-- Select --</option>
443
  <?php
444
+ if(!empty($headers) && is_array($headers)) {
445
+ foreach ($headers as $key1 => $value1) { ?>
446
  <option><?php echo $value1; ?></option>
447
  <?php
448
  }
564
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
565
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
566
  <br>
567
+ <div>
568
  <span class='msg' id='server_request_warning'
569
+ style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto ', 'wp-ultimate-csv-importer'); ?><?php echo ' '.sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']).' '; ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
570
+ </div>
571
+ <input type="hidden" id="currentlimit" name="currentlimit" value="1"/>
572
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
573
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
574
  <label
modules/post/templates/index.php CHANGED
@@ -125,6 +125,7 @@ $nonce_Key = $impCE->create_nonce_key();
125
  </h2>
126
  <?php
127
  if (isset($_FILES['inlineimages'])) {
 
128
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != '') {
129
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
130
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
@@ -194,7 +195,13 @@ $nonce_Key = $impCE->create_nonce_key();
194
  if (isset($_POST['upload_csv_realname']) && sanitize_text_field($_POST['upload_csv_realname']) != '') {
195
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
196
  }
197
- $getrecords = $impCE->csv_file_data($filename);
 
 
 
 
 
 
198
  $getcustomposts = get_post_types();
199
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
200
  foreach ($getcustomposts as $keys => $value) {
@@ -208,9 +215,9 @@ $nonce_Key = $impCE->create_nonce_key();
208
  <tr>
209
  <div align='center' style='float:right;'>
210
  <?php $cnt = count($impCE->defCols) + 2;
211
- $cnt1 = count($impCE->headers);
212
- $records = count($getrecords);
213
- $imploaded_array = implode(',', $impCE->headers); ?>
214
  <input type='hidden' id='imploded_header' name='imploded_array' value='<?php if (isset($imploaded_array)) { echo $imploaded_array; } ?>' />
215
  <input type='hidden' id='h1' name='h1' value="<?php if (isset($cnt)) { echo $cnt; } ?>" />
216
  <input type='hidden' id='h2' name='h2' value="<?php if (isset($cnt1)) { echo $cnt1; } ?>" />
@@ -273,8 +280,8 @@ $nonce_Key = $impCE->create_nonce_key();
273
  id="mapping<?php print($count); ?>">
274
  <?php } ?>
275
  <option>-- Select --</option>
276
- <?php if(is_array($impCE->headers) && !empty($impCE->headers)) {
277
- foreach ($impCE->headers as $key1 => $value1) { ?>
278
  <option><?php echo $value1; ?></option>
279
  <?php }
280
  }?>
@@ -320,8 +327,8 @@ $nonce_Key = $impCE->create_nonce_key();
320
  <select name="coremapping<?php print($count); ?>"
321
  id="coremapping<?php print($count); ?>">
322
  <option>-- Select --</option>
323
- <?php if(!empty($impCE->headers) && is_array($impCE->headers)) {
324
- foreach ($impCE->headers as $key1 => $value1) { ?>
325
  <option><?php echo $value1; ?></option>
326
  <?php }
327
  }?>
@@ -377,8 +384,8 @@ $nonce_Key = $impCE->create_nonce_key();
377
  <select name="term_mapping<?php print($count); ?>"
378
  id="term_mapping<?php print($count); ?>">
379
  <option>-- Select --</option>
380
- <?php if(is_array($impCE->headers) && !empty($impCE->headers)) {
381
- foreach ($impCE->headers as $key1 => $value1) { ?>
382
  <option><?php echo $value1; ?></option>
383
  <?php }
384
  }?>
@@ -433,8 +440,8 @@ $nonce_Key = $impCE->create_nonce_key();
433
  <select name="seomapping<?php print($count); ?>"
434
  id="seomapping<?php print($count); ?>">
435
  <option>-- Select --</option>
436
- <?php if(is_array($impCE->headers) && !empty($impCE->headers)) {
437
- foreach ($impCE->headers as $key1 => $value1) { ?>
438
  <option><?php echo $value1; ?></option>
439
  <?php }
440
  }?>
@@ -542,8 +549,9 @@ $nonce_Key = $impCE->create_nonce_key();
542
  </label>
543
  <?php echo $impCE->helpnotes(); ?>
544
  <br>
545
- <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']); ?><?php echo __('per request.', 'wp-ultimate-csv-importer'); ?></span>
546
- <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
 
547
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
548
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
549
  <label id="innertitle"><?php echo esc_html__('Inline image options', 'wp-ultimate-csv-importer'); ?></label><br/>
125
  </h2>
126
  <?php
127
  if (isset($_FILES['inlineimages'])) {
128
+ $uploadDir = wp_upload_dir();
129
  if (isset($_POST['uploadfilename']) && sanitize_file_name($_POST['uploadfilename']) != '') {
130
  $get_file_name = sanitize_file_name($_POST['uploadfilename']);
131
  $filehashkey = $impCE->convert_string2hash_key($get_file_name);
195
  if (isset($_POST['upload_csv_realname']) && sanitize_text_field($_POST['upload_csv_realname']) != '') {
196
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
197
  }
198
+ $total_row_count = '';
199
+ $parserObj = new SmackCSVParser();
200
+ $file = $impCE->getUploadDirectory() . '/' . $filename;
201
+ $parserObj->parseCSV($file, 0, -1);
202
+ $headers = $parserObj->get_CSVheaders();
203
+ $headers = $headers[0];
204
+ $total_row_count = $parserObj->total_row_count - 1;
205
  $getcustomposts = get_post_types();
206
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
207
  foreach ($getcustomposts as $keys => $value) {
215
  <tr>
216
  <div align='center' style='float:right;'>
217
  <?php $cnt = count($impCE->defCols) + 2;
218
+ $cnt1 = count($headers);
219
+ $records = $total_row_count;
220
+ $imploaded_array = implode(',', $headers); ?>
221
  <input type='hidden' id='imploded_header' name='imploded_array' value='<?php if (isset($imploaded_array)) { echo $imploaded_array; } ?>' />
222
  <input type='hidden' id='h1' name='h1' value="<?php if (isset($cnt)) { echo $cnt; } ?>" />
223
  <input type='hidden' id='h2' name='h2' value="<?php if (isset($cnt1)) { echo $cnt1; } ?>" />
280
  id="mapping<?php print($count); ?>">
281
  <?php } ?>
282
  <option>-- Select --</option>
283
+ <?php if(is_array($headers) && !empty($headers)) {
284
+ foreach ($headers as $key1 => $value1) { ?>
285
  <option><?php echo $value1; ?></option>
286
  <?php }
287
  }?>
327
  <select name="coremapping<?php print($count); ?>"
328
  id="coremapping<?php print($count); ?>">
329
  <option>-- Select --</option>
330
+ <?php if(!empty($headers) && is_array($headers)) {
331
+ foreach ($headers as $key1 => $value1) { ?>
332
  <option><?php echo $value1; ?></option>
333
  <?php }
334
  }?>
384
  <select name="term_mapping<?php print($count); ?>"
385
  id="term_mapping<?php print($count); ?>">
386
  <option>-- Select --</option>
387
+ <?php if(is_array($headers) && !empty($headers)) {
388
+ foreach ($headers as $key1 => $value1) { ?>
389
  <option><?php echo $value1; ?></option>
390
  <?php }
391
  }?>
440
  <select name="seomapping<?php print($count); ?>"
441
  id="seomapping<?php print($count); ?>">
442
  <option>-- Select --</option>
443
+ <?php if(is_array($headers) && !empty($headers)) {
444
+ foreach ($headers as $key1 => $value1) { ?>
445
  <option><?php echo $value1; ?></option>
446
  <?php }
447
  }?>
549
  </label>
550
  <?php echo $impCE->helpnotes(); ?>
551
  <br>
552
+ <div>
553
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo ' '.sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']).' '; ?><?php echo __('per request.', 'wp-ultimate-csv-importer'); ?></span></div>
554
+ <input type="hidden" id="currentlimit" name="currentlimit" value="1"/>
555
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
556
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
557
  <label id="innertitle"><?php echo esc_html__('Inline image options', 'wp-ultimate-csv-importer'); ?></label><br/>
modules/users/templates/index.php CHANGED
@@ -151,7 +151,13 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_include
151
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
152
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
153
  }
154
- $getrecords = $impCE->csv_file_data($filename);
 
 
 
 
 
 
155
  $getcustomposts = get_post_types();
156
  $allcustomposts = '';
157
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
@@ -166,8 +172,8 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_include
166
  <tr>
167
  <div align='center' style='float:right;'>
168
  <?php $cnt = count($impCE->defCols) + 2;
169
- $cnt1 = count($impCE->headers);
170
- $records = count($getrecords); ?>
171
  <input type='hidden' id='h1' name='h1' value="<?php if (isset($cnt)) {
172
  echo $cnt;
173
  } ?>"/>
@@ -238,8 +244,8 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_include
238
  id="mapping<?php print($count); ?>">
239
  <option>-- Select --</option>
240
  <?php
241
- if(!empty($impCE->headers) && is_array($impCE->headers)){
242
- foreach ($impCE->headers as $key1 => $value1) { ?>
243
 
244
  <option><?php echo $value1; ?></option>
245
  <?php }
@@ -344,9 +350,11 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_include
344
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
345
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
346
  <br>
 
347
  <span class='msg' id='server_request_warning'
348
- style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']); ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
349
- <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
 
350
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
351
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
352
  </li>
151
  if (isset($_POST['upload_csv_realname']) && sanitize_file_name($_POST['upload_csv_realname']) != '') {
152
  $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']);
153
  }
154
+ $total_row_count = '';
155
+ $parserObj = new SmackCSVParser();
156
+ $file = $impCE->getUploadDirectory() . '/' . $filename;
157
+ $parserObj->parseCSV($file, 0, -1);
158
+ $headers = $parserObj->get_CSVheaders();
159
+ $headers = $headers[0];
160
+ $total_row_count = $parserObj->total_row_count - 1;
161
  $getcustomposts = get_post_types();
162
  $allcustomposts = '';
163
  if(!empty($getcustomposts) && is_array($getcustomposts)) {
172
  <tr>
173
  <div align='center' style='float:right;'>
174
  <?php $cnt = count($impCE->defCols) + 2;
175
+ $cnt1 = count($headers);
176
+ $records = $total_row_count ?>
177
  <input type='hidden' id='h1' name='h1' value="<?php if (isset($cnt)) {
178
  echo $cnt;
179
  } ?>"/>
244
  id="mapping<?php print($count); ?>">
245
  <option>-- Select --</option>
246
  <?php
247
+ if(!empty($headers) && is_array($headers)){
248
+ foreach ($headers as $key1 => $value1) { ?>
249
 
250
  <option><?php echo $value1; ?></option>
251
  <?php }
350
  name="importlimit" id="importlimit" type="text" value="1" placeholder="10"
351
  onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?>
352
  <br>
353
+ <div>
354
  <span class='msg' id='server_request_warning'
355
+ style="display:none;color:red;margin-left:-10px;"><?php echo esc_html__('You can set upto', 'wp-ultimate-csv-importer'); ?><?php echo ' '.sanitize_text_field($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']).' '; ?><?php echo esc_html__('per request.', 'wp-ultimate-csv-importer'); ?></span>
356
+ </div>
357
+ <input type="hidden" id="currentlimit" name="currentlimit" value="1"/>
358
  <input type="hidden" id="tmpcount" name="tmpcount" value="0"/>
359
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue"/>
360
  </li>
templates/Addcustomfields.php CHANGED
@@ -40,9 +40,12 @@ if (!defined('ABSPATH')) {
40
  } // Exit if accessed directly
41
  $filename = isset($_POST['filename']) ? sanitize_text_field($_POST['filename']) : '';
42
  $count = isset($_POST['corecount']) ? intval($_POST['corecount']) : '';
43
- $impobj = new WPImporter_includes_helper();
44
- $getrec = $impobj->csv_file_data($filename);
45
- $csvheaders = $impobj->headers;
 
 
 
46
  $returndata = "<tr><td class='left_align' style='width:54.5%; padding-left:150px;'><input type='text' name='addcorefieldname$count' id = 'addcorefieldname$count'/></td>";
47
  $returndata .= "<td class='left_align'> <select name='addcoremapping$count' id='addcoremapping$count' class='uiButton'>";
48
  $returndata .= "<option id = 'select'>-- Select --</option>";
40
  } // Exit if accessed directly
41
  $filename = isset($_POST['filename']) ? sanitize_text_field($_POST['filename']) : '';
42
  $count = isset($_POST['corecount']) ? intval($_POST['corecount']) : '';
43
+ $upload_dir = wp_upload_dir();
44
+ $parserObj = new SmackCSVParser();
45
+ $file = $upload_dir ['basedir'] . "/ultimate_importer/" . $filename;
46
+ $parserObj->parseCSV($file, 0, -1);
47
+ $csvheaders = $parserObj->get_CSVheaders();
48
+ $csvheaders = $csvheaders[0];
49
  $returndata = "<tr><td class='left_align' style='width:54.5%; padding-left:150px;'><input type='text' name='addcorefieldname$count' id = 'addcorefieldname$count'/></td>";
50
  $returndata .= "<td class='left_align'> <select name='addcoremapping$count' id='addcoremapping$count' class='uiButton'>";
51
  $returndata .= "<option id = 'select'>-- Select --</option>";
templates/import.php CHANGED
@@ -95,12 +95,13 @@ if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'customp
95
 
96
 
97
  $limit = intval($_POST['postdata']['limit']);
 
98
  $totRecords = intval($_POST['postdata']['totRecords']);
99
  $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['importlimit'] = intval($_POST['postdata']['importlimit']);
100
  $count = intval($_POST['postdata']['importlimit']);
101
  $requested_limit = intval($_POST['postdata']['importlimit']);
102
  $tmpCnt = intval($_POST['postdata']['tmpcount']);
103
- if ($count < $totRecords) {
104
  $count = $tmpCnt + $count;
105
  if ($count > $totRecords) {
106
  $count = $totRecords;
@@ -113,8 +114,11 @@ $res2 = array();
113
  $res1 = array();
114
  $get_mapped_array = array();
115
  $mapping_value = '';
 
116
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
117
- $resultArr = $skinnyObj->csv_file_data($filename);
 
 
118
  if (sanitize_text_field($_POST['postdata']['dupTitle'])) {
119
  $importObj->titleDupCheck = sanitize_text_field($_POST['postdata']['dupTitle']);
120
  }
@@ -143,9 +147,8 @@ foreach ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'] as $seskey => $sesval ) {
143
  }
144
  $mapped = count($res2);
145
  $unmapped = count($res1);
146
-
147
- for ($i = $limit; $i < $count; $i++) {
148
- if ($limit == 0) {
149
  echo "<div style='margin-left:10px;'> Total no of records - " . $totRecords . ".</div><br>";
150
  echo "<div style='margin-left:10px;'> Total no of mapped fields for single record - " . $mapped . ".</div><br>";
151
  echo "<div style='margin-left:10px;'> Total no of unmapped fields for a record - " . $unmapped . ".</div><br>";
@@ -206,10 +209,9 @@ for ($i = $limit; $i < $count; $i++) {
206
  }
207
 
208
  $limit++;
209
- unset($to_be_import_rec);
210
  }
211
-
212
- if ($limit >= $totRecords) {
213
  $advancemedia = sanitize_text_field($_POST['postdata']['advance_media']);
214
  $dir = $skinnyObj->getUploadDirectory();
215
  $get_inline_imageDir = explode('/', $extracted_image_location);
@@ -260,7 +262,7 @@ if ($inserted_post_count != 0) {
260
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount']);
261
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId']);
262
  }
263
- if ($limit == $totRecords) {
264
  echo "<br><div style='margin-left:10px; color:green;'>";
265
  echo __('Import successfully completed!.', 'wp-ultimate-csv-importer');
266
  echo "</div>";
95
 
96
 
97
  $limit = intval($_POST['postdata']['limit']);
98
+ $get_request_limit = $_POST['postdata']['get_requested_count'];
99
  $totRecords = intval($_POST['postdata']['totRecords']);
100
  $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['importlimit'] = intval($_POST['postdata']['importlimit']);
101
  $count = intval($_POST['postdata']['importlimit']);
102
  $requested_limit = intval($_POST['postdata']['importlimit']);
103
  $tmpCnt = intval($_POST['postdata']['tmpcount']);
104
+ if ($count <= $totRecords) {
105
  $count = $tmpCnt + $count;
106
  if ($count > $totRecords) {
107
  $count = $totRecords;
114
  $res1 = array();
115
  $get_mapped_array = array();
116
  $mapping_value = '';
117
+ $import_obj = new WPImporter_includes_helper();
118
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
119
+ $parserObj = new SmackCSVParser();
120
+ $file = $import_obj->getUploadDirectory() . '/' . $filename;
121
+ $resultArr = $parserObj->parseCSV($file, $limit, $get_request_limit);
122
  if (sanitize_text_field($_POST['postdata']['dupTitle'])) {
123
  $importObj->titleDupCheck = sanitize_text_field($_POST['postdata']['dupTitle']);
124
  }
147
  }
148
  $mapped = count($res2);
149
  $unmapped = count($res1);
150
+ for ($i = $limit; $i <= $count; $i++) {
151
+ if ($limit == 1) {
 
152
  echo "<div style='margin-left:10px;'> Total no of records - " . $totRecords . ".</div><br>";
153
  echo "<div style='margin-left:10px;'> Total no of mapped fields for single record - " . $mapped . ".</div><br>";
154
  echo "<div style='margin-left:10px;'> Total no of unmapped fields for a record - " . $unmapped . ".</div><br>";
209
  }
210
 
211
  $limit++;
212
+ //unset($to_be_import_rec);
213
  }
214
+ if ($limit > $totRecords) {
 
215
  $advancemedia = sanitize_text_field($_POST['postdata']['advance_media']);
216
  $dir = $skinnyObj->getUploadDirectory();
217
  $get_inline_imageDir = explode('/', $extracted_image_location);
262
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount']);
263
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId']);
264
  }
265
+ if ($limit > $totRecords) {
266
  echo "<br><div style='margin-left:10px; color:green;'>";
267
  echo __('Import successfully completed!.', 'wp-ultimate-csv-importer');
268
  echo "</div>";