Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After the latest W3 Total Cache and WP Update (3.9) one of my plugins to create images donĀ“t work. This error shows up after i create and publish the post (image) in the front end:

Warning: copy(/var/www/vhosts/dotdotododood.com/httpdocs/custom-wp-content-name/plugins/xyzplugin/images/soft/9111397677283.jpg): failed to open stream: No such file or directory in /var/www/vhosts/dotdotododood.com/httpdocs/custom-wp-content-name/plugins/xyzplugin/output.php on line 73

This is the code from the mentioned file:

                $_pid = wp_insert_post( $my_post );
            $filename = $apath;

            $wp_upload_dir = wp_upload_dir();
            $upath = $wp_upload_dir['path'];
            $ufile = $upath .'/'. basename($filename);
This is line 73-->  copy( $filename, $upath .'/'. basename($filename) );
            $filename   = $ufile;   
            $wp_filetype = wp_check_filetype(basename($filename), null );
            $attachment = array(
                 'guid' => $wp_upload_dir['url'] . '/' . basename( $filename ), 
                 'post_mime_type' => $wp_filetype['type'],
                 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $filename ) ),
                 'post_content' => '',
                 'post_status' => 'inherit'
            );

Update: i debug my site and get this error:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/ccccccccccc/httpdocs/wp-includes/wp-db.php:1342) in /var/www/vhosts/xxxxxxxxxx.com/httpdocs/xxxxxxx/plugins/xxxxxxxxxx/generator.php on line 104

When i deactivate W3 Total Cache the Plugin works again. Any idea?

Thank you so much

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.