WordPress.org

Ready to get started?Download WordPress

Forums

Cache Images
Anyway to automate the process? (15 posts)

  1. B03S
    Member
    Posted 3 years ago #

    Anyway to make this plugin auto cache images when publishing a new post via de add_action('publish post') hook?

    http://wordpress.org/extend/plugins/cache-images/

  2. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    I was thinking about this but I wanted to first release improved version of initial functionality.

    Also, I'm still not sure how that would work: will autocaching be done always when plugin activated or user will need to check something.

  3. B03S
    Member
    Posted 3 years ago #

    Some ideas could be:

    Always cache all images when publishing a new post.
    Always cache images from a user specified list of domains.

  4. beku76
    Member
    Posted 3 years ago #

    Maybe can check how the Hot-Linked-Imge-Cacher does the automatization.

    http://wordpress.org/extend/plugins/hot-linked-image-cacher/

    it does a pretty good job automating the image caching,
    but the problem is that it renames the images to alfanumericshit.jpg and does not include the cached images to the media library.

    be careful testing the plugin, because the effects are un-reversible!

  5. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    Good news, guys! If you download development version, you can turn on automatic caching.

    Just go to Settings > Media and check Automatically cache images on post's saving. I tested this and it works good but it'll be great if more people would test.

    I'm only thinking should settings field be moved to Settings > Writing.

  6. microtag
    Member
    Posted 3 years ago #

    Thanks dimadin, great plugin.
    Works fine, but I've a problem with feedwordpress plugin.
    If I use manual update in feedwordpress images are cache fine, but with automatic update I receiving an error:

    Warning:  Invalid argument supplied for foreach()
    in /wp-content/plugins/cache-images/cache-images.php on line 516
    
    Fatal error:  Call to undefined function media_sideload_image()
     in /wp-content/plugins/cache-images/cache-images.php on line 488

    Thanks.

  7. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    Can you try possible fix before my release to a plugin? Go to Plugins > Editor. On the right, from “Select plugin to edit”, choose Cache Images and press “Select”. Now choose file cache-images/cache-images.php from a new list.

    In text editor, find a line
    $upload = media_sideload_image($url, $postid);
    Just above it, add next line:
    require_once(ABSPATH . "wp-admin" . '/includes/media.php');

    Tell me is it works now.

  8. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    You can now also try development version, which includes this code.

  9. microtag
    Member
    Posted 3 years ago #

    Hi.

    Do not works...

    Fatal error: Call to undefined function media_sideload_image() in /wp-content/plugins/cache-images/cache-images.php on line 488

  10. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    Are you sure you used either development version or the one you edited with my instructions?

    In both cases you shouldn't get exactly the same error, line number should be changed.

    Please try again so that I know is this fixed since I'll release a new version with some bug fixes today.

  11. microtag
    Member
    Posted 3 years ago #

    Yes, you're right! I'm sorry.

    New error:

    Call to undefined function download_url() in /wp-admin/includes/media.php on line 556

  12. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    I've just released a new version so please see if issue is fixed now since I added another update that should solve it.

  13. microtag
    Member
    Posted 3 years ago #

    No errors... but do not works.

  14. Milan Dinić
    Member
    Plugin Author

    Posted 3 years ago #

    Maybe problem is with feedwordpress (eg. if they use WP's hooks on different way).

    When I have time, I'll inspect it more deeply. (no promises!)

  15. popokolok
    Member
    Posted 3 years ago #

    Anything new on that? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic