• Resolved azraph

    (@azraph)


    Hello! Thank you for the awesome plugin!

    I’m using it on a multisite network, activated the plugin on one site, FTP uploaded 1001 SVG files inside a month directory (uploads/siteID/2019/11). In media sync page it was able to find the images, dry run sync without issues, real sync without issues. When resync them I find their links and all working correctly.

    But on the media library page, it loads the first few rows of thumbnails, and then the loading spinner keeps spinning but doesn’t load the rest of thumbs. The search works though, if I start typing keywords to search the library it finds them and shows their thumbs normally.

    In the months dropdown, it shows a newly added month Feb, 2019 that has some images associated with it, although, physically, there’s no “2” folder in the uploads, and the images are all still in “11” folder, even their links are correctly pointing to the “11” folder, only this dropdown is off.

    I have no idea whether this is related to WP, SVG’s, Media Sync, or the number of images. I’ll keep testing and update here. Meanwhile, any pointers would be greatly appreciated 🙂

    • This topic was modified 4 years, 7 months ago by azraph.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author erolsk8

    (@erolsk8)

    Oh wow, it seems quite bad :/

    But I’m guessing it might be due to “post_date” which is set for each new Media Library record. Someone requested to explicitly set it to the date of the actual file (when it was modified). So it was implemented, but now it seems like it’s sometimes causing strange behavior.

    And since this issue seems quite scary to me, I worked out a solution to make that date/time value customizable (as radio buttons right below Import button). So in the new version “1.1.0” you will be able to use:

    1. “Default” (current time),
    2. “File time” (as it was before) and
    3. “Smart file time” which was suggested in another support comment: https://wordpress.org/support/topic/addition-date/#post-11741296.

    The last one works like this: if file timestamp does not match the folder in which it is – it will construct the date/time based on the folder: {year}-{month}-01 00:00:00 or if it’s ok it will use file’s timestamp.
    So it shouldn’t put “Feb, 2019” dates your SVGs from /2019/11 folder.

    It’s not so easy to cover all use cases, but I hope these options would make it much better.

    Oh and yes, I made it so that you can write your own hook function to overwrite this functionality. So you can set that time/date to anything you want. Here is an example:

    
    function my_custom_media_sync_post_date($post_date, $file_path, $selected_date_time_option)
    {
      // Custom logic...
      // Should return date in this format: "Y-m-d H:i:s"
      return $post_date;
    }
    add_filter('media_sync_filter_post_date', 'my_custom_media_sync_post_date', 10, 3);
    
    • This reply was modified 4 years, 7 months ago by erolsk8. Reason: formatting
    Thread Starter azraph

    (@azraph)

    Oh amazing work! Thank you <3

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possible Bug: Media Library doesn’t load correctly after importing 1000 SVG’s’ is closed to new replies.