• Resolved enkirch

    (@enkirch)


    Hi,

    if i do this

            $my_post = array(
                'post_title'   => $label, // Label wird als Titel verwendet
                'post_name'    => $titelform, // Titelform wird als Slug verwendet
                'post_status'  => 'publish',
                'post_type'    => 'manufacturer'
            );
    
            $result = wp_insert_post($my_post);

    i get this


    1. {key: ‘9225f6221f2528d68389b274d5f16ba5’, type: ‘warning’, message: ‘rmdir(D:\\xampp-8-1-25\\htdocs\\xxxx/wp-content/cache…ost/xxxx/marke/vespa/): No such file or directory’, file: ‘wp-content/plugins/wp-super-cache/wp-cache-phase2.php’, line: 3209, …}
      1. component: “Plugin: wp-super-cache”
      2. file: “wp-content/plugins/wp-super-cache/wp-cache-phase2.php”
      3. key: “xxxxx”
      4. line: 3209
      5. message: “rmdir(D:\\xampp-8-1-25\\htdocs\\xxxx/wp-content/cache/supercache/localhost/xxxx/marke/vespa/): No such file or directory”
      6. stack: (9) [‘rmdir()’, ‘wp_cache_post_id_gc()’, ‘wp_cache_post_change()’, ‘wp_cache_post_edit()’, “do_action(‘clean_post_cache’)”, ‘clean_post_cache()’, ‘wp_insert_post()’, ‘import_manufacturer_from_acf_list_callback()’, “do_action(‘wp_ajax_import_manufacturer_from_acf_list_callback’)”]
      7. type: “warning”

    The path “D:\xampp-8-1-25\htdocs\xxxx/wp-content/cache/” ist existing and caching is working. the post is also created without any problems

    • This topic was modified 7 months, 3 weeks ago by enkirch.
Viewing 10 replies - 1 through 10 (of 10 total)
  • What version of WP Super Cache are you using there? The wp_cache_post_id_gc function that calls rmdir is not around line 3209. The rmdir is at 3241 in version 1.12.3 which was current when you posted this. It’s also suppressed so that warning shouldn’t show.

    It’s a harmless warning that won’t interfere with your site, although I’m annoyed it’s showing at all. It shouldn’t.

    Thread Starter enkirch

    (@enkirch)

    Hi,

    we′re running the plugin on several WP Installs. The Notice is with, Version 1.11.0 and 1.12.4.

    Im not sure which version i had on my local machine when copy the notice message.

    It’s just a bit scary when you’re writing a plugin that creates 200 posts via a list and then you get 200 “error” messages ??

    This is also me: https://github.com/Automattic/jetpack/issues/38404 FYI

    • This reply was modified 7 months, 2 weeks ago by enkirch.

    Thanks for linking there. I’ll reply there and mark this ticket as resolved.

    Thread Starter enkirch

    (@enkirch)

    For completeness. the error was actually only shown to me in “Query Monitor – The developer tools panel for WordPress” plugin, not in the debug.log of WordPress itself.

    If I search in the plugin for error_get_last I even find 2 places where this is used.

    Apparently you can turn this off if you define something in the wp-config.

    Thank you very much for your effort!

    Thread Starter enkirch

    (@enkirch)

    Hi, question,

    if i do this in the wp_cache_post_id_gc function would this be ok?

    if (is_dir($dir)) {
    rmdir($dir);
    }

    the error only occurs because an attempt is made to delete a folder that does not exist, but if you first ask whether the path exists and then delete it, you do not need to suppress the error with “@”.

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    Yeah, that will work. It’ll be overwritten the next time you update the plugin, however. We will need to make that change in the plugin itself for it to be permanent.

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    I forgot to say that you may still see odd errors. If a request comes for the post being edited at the wrong time, the request will create the directory after the is_dir() which means that it won’t be removed.

    Or another process removes the directory after is_dir() runs, then rmdir() will try to remove a non-existent directory.

    It’s unlikely but worth bearing in mind, especially if you have a busy site.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there @enkirch,

    Do you have updates about that, do you still need help? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

    Thread Starter enkirch

    (@enkirch)

    HI I didn’t give it any more thought here. it is, after all, a false error.

    And as Donncha O Caoimh (a11n) wrote,

    “Yeah, that will work. It’ll be overwritten the next time you update the plugin, however. We will need to make that change in the plugin itself for it to be permanent.”

    Now I’ll just wait for you to push a small update in between where this “error” is caught ??

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hello @enkirch,

    Now I’ll just wait for you to push a small update in between where this “error” is caught ??

    I checked with Donncha and the team about an ETA for the change to be implemented, and we’re going to include it in our next plugin update. We don’t have an ETA for it at the moment, so keep an eye on the Updates page of your WP Admin so you’ll see the update available as soon as it’s up.

    Or, if you have automatic updates enabled for WP Super Cache, you will be set once the update is released. Hope that helps!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘wp_insert_post’ is closed to new replies.