Support » Plugin: Media Cleaner » Attach unattached images

  • Resolved olalindberg

    (@olalindberg)


    I’m making some updates to my own (really old, 1998) blog. Through the years different web sites has been imported to it and many old images are in the media library but not attached to any post. They are linked in content but the attachment from media library to a post is missing.

    Can this plugin search the content and attach images to the blog post where it’s shown in. I think all images are only shown on one blog post.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @olalindberg,

    Indeed, that’s what this plugin does. Have a look at the tutorial: https://meowapps.com/media-cleaner-tutorial/ (especially the recommended procedures). Should work out of the box 🙂

    Thank you so much! I just made a local copy on my site (in Local by Flywheel that I normally use as dev. environment).

    When scanning my library it stucks at 75 posts. Debug log gives the following:

    [05-Nov-2019 08:02:47 UTC] PHP Notice:  Undefined index: blog_subscription-2 in /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/engine.php on line 72
    [05-Nov-2019 08:02:47 UTC] PHP Stack trace:
    [05-Nov-2019 08:02:47 UTC] PHP   1. {main}() /Users/ola/local-sites/ola/app/public/wp-admin/admin-ajax.php:0
    [05-Nov-2019 08:02:47 UTC] PHP   2. do_action() /Users/ola/local-sites/ola/app/public/wp-admin/admin-ajax.php:173
    [05-Nov-2019 08:02:47 UTC] PHP   3. WP_Hook->do_action() /Users/ola/local-sites/ola/app/public/wp-includes/plugin.php:465
    [05-Nov-2019 08:02:47 UTC] PHP   4. WP_Hook->apply_filters() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:310
    [05-Nov-2019 08:02:47 UTC] PHP   5. Meow_WPMC_API->wp_ajax_wpmc_prepare_do() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:286
    [05-Nov-2019 08:02:47 UTC] PHP   6. Meow_WPMC_Engine->parse() /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/api.php:27
    [05-Nov-2019 08:02:47 UTC] PHP Notice:  Trying to get property 'option_name' of non-object in /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/parsers/common.php on line 37
    [05-Nov-2019 08:02:47 UTC] PHP Stack trace:
    [05-Nov-2019 08:02:47 UTC] PHP   1. {main}() /Users/ola/local-sites/ola/app/public/wp-admin/admin-ajax.php:0
    [05-Nov-2019 08:02:47 UTC] PHP   2. do_action() /Users/ola/local-sites/ola/app/public/wp-admin/admin-ajax.php:173
    [05-Nov-2019 08:02:47 UTC] PHP   3. WP_Hook->do_action() /Users/ola/local-sites/ola/app/public/wp-includes/plugin.php:465
    [05-Nov-2019 08:02:47 UTC] PHP   4. WP_Hook->apply_filters() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:310
    [05-Nov-2019 08:02:47 UTC] PHP   5. Meow_WPMC_API->wp_ajax_wpmc_prepare_do() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:286
    [05-Nov-2019 08:02:47 UTC] PHP   6. Meow_WPMC_Engine->parse() /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/api.php:27
    [05-Nov-2019 08:02:47 UTC] PHP   7. do_action() /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/engine.php:72
    [05-Nov-2019 08:02:47 UTC] PHP   8. WP_Hook->do_action() /Users/ola/local-sites/ola/app/public/wp-includes/plugin.php:465
    [05-Nov-2019 08:02:47 UTC] PHP   9. WP_Hook->apply_filters() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:310
    [05-Nov-2019 08:02:47 UTC] PHP  10. MeowApps_WPMC_Parser->scan_widget() /Users/ola/local-sites/ola/app/public/wp-includes/class-wp-hook.php:286
    [05-Nov-2019 08:02:47 UTC] PHP  11. MeowApps_WPMC_Parser->get_images_from_widget() /Users/ola/local-sites/ola/app/public/wp-content/plugins/media-cleaner/parsers/common.php:71
    

    Seem to me as there is something wrong with “blog_subscription-2” but I tried to find it in my site without any luck.

    Any idea?

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @olalindberg,

    Can you try to make those two changes?

    First, in the /parsers/common.php file, at line 37, it should be:

    $widget_class = isset( $widget['callback'][0] ) ? $widget['callback'][0]->option_name : '';

    And in the engine.php file, at line 72 (inside the foreach):

    if ( isset( $syswidgets[$widget] ) )
      do_action( 'wpmc_scan_widget', $syswidgets[$widget] );

    I am on the road, so I can’t make those changes and send you a new version now, but hopefully, that will help. If it works for you, I will make sure those changes are part of the next releases 🙂

    This time it stucks at Preparing posts (70 posts)… (before your update it stuck on Preparing posts (75 posts)…

    Unfortunately I cannot see anything in the log now.

    Tell if I can do anything to help debug it.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Do you mean it’s a timeout? You can check this in the Network tab of the Chrome Developer Tools for example. But normally, Media Cleaner pops a message. More info here: https://meowapps.com/media-cleaner-debug-issues.

    Thanks for your help.

    I’m not exactly sure what happens but I think some part of Local Lightning (my local dev environment) crashes or gets really really slow.

    local-lightning.log, nginx/error.log, php/php-fpm.log, wp-content/debug.log are all empty (after running)

    media-cleaner.log gives only:

    2019-11-13 09:48:21: Parsed references:

    I changed media buffer, post buffer, analysis buffer, delay to the values you suggested here: https://meowapps.com/media-cleaner-debug-issues/ But it still gets stuck. I also disabled all my plugins (except media cleaner). No change.

    I’m clueless but willing to try to find the problem.

    Thanks again and hope we find the problem!

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @olalindberg,

    There is normally no crash without errors 🙂 So you should be able to get some information about the debug. Unfortunately, without anything, I have no idea of what’s going on.

    Just a quick easy idea: why not using something else than Local Lightning? I don’t know what is Local Lightning, but maybe you will at least be able to understand the issue with a different environment.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Oh, I see what is Local Lightning! 🙂 I am not using it yet, still using Local by Flywheel for my tests (which works pretty well). Maybe that’s because it’s beta, who knows. You really should be able to get your logs, at least, otherwise, it will be hard for you to understand what’s happening.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.