BACK
BACK
BACK
Loading...

Blog / HowTos /  Fixing a Bug with Image Upload After WordPress Update

September 11, 2015 - Cathy

Fixing a Bug with Image Upload After WordPress Update

Are you having problems with image WordPress file upload after updating?

Some users of WordPress are reporting issues with media upload and “images aren’t showing” after updating their installation to WordPress 4.3. The typical issue is that they will drag a file to be uploaded onto their site using the file upload into the media library for the site and it will appear to be uploading. But after a while they get a message stating that “upload failed, try again later” and the WordPress media folders do not contain the image even though the media library will often have a blank thumbnail where the image should be. Reinstalling WordPress and plugins does not appear to fix the problem so just what can be done to solve the problem?

wordpress file upload

 

Fixing the WordPress file upload issue in 4.3

The easiest answer is to upgrade to WordPress version 4.3.1 if you have access to this version to upgrade your installation and this will solve the issue with uploading to your WordPress media folders. If however you do not have access to this version or for some reason wish to maintain your version at 4.3 then the following steps can be tried to correct the code. The corrections below are as implemented within 4.3.1 to correct this problem.

Backup your installation

Firstly, backup your installation just in case you make any mistakes or if something else goes wrong when you make your modifications. If you do not know how to do this manually then you can use a plugin such as BackWPUp to do it for you.

Correct the Taxonomy file

The first step is to open and correct the taxonomy file which you will find at: wp-includes/taxonomy.php

You will want to change line 4448 which should read as follows:

wp_schedule_single_event( 'wp_batch_split_terms', time() + MINUTE_IN_SECONDS );

The arguments within this string have been reversed and should be corrected as such:

wp_schedule_single_event( time() + MINUTE_IN_SECONDS, 'wp_batch_split_terms' );

media upload

Create a Plugin file to correct the issues

To fully correct the issues you will now need to create a plugin. To do this go to your main /wp-content directory. Here you should see a directory called “mu-plugins”. If this directory does not exist then create it. The directory name is important as it will contain a plugin that will be “Must Use” and will be automatically included within your installation.

Navigate to the mu-plugins directory and create a new file called fix.php or any other similar name that you like, the name at this stage does not matter as long as it is not the same as any other file within the directory.

You now need to edit this file and to include the following code to correct the issues:

<?php
function clear_bad_cron_entries() {
    // Fix incorrect cron entries for term splitting
    $cron_array = _get_cron_array();
    if ( isset( $cron_array['wp_batch_split_terms'] ) ) {
        unset( $cron_array['wp_batch_split_terms'] );
            _set_cron_array( $cron_array );
    }
}
clear_bad_cron_entries();

Now save the file and navigate to your site.

Sometimes when you create a loading page, it might become slow as well, and it has its reasons.

wordpress media folders

It may take a short time to actually clear the problem but once it has you can go back and delete the file that you created as it will only need to have run once to correct your WordPress file upload issues. If you have multiple sites then you will need to ensure that it has run for each site to solve this WordPress file upload problem.

We successfully practice BuddyPress plugin development, so you are welcome to get the work done by using BuddyPress customization as well.

If you are still facing the bug with image upload, feel free to contact us through the form below!

Request a quote

Attach File

(max file size 5MB; allowed extensions: doc, txt, pdf, docx)

Contact us Request a Quote

Your email address will not be published.

Required fields are marked *

Attach File

(max file size 5MB; allowed extensions: doc, txt, pdf, docx)

subscribe to newsletter

Your email address will not be published.

Required fields are marked *

Ask a Question

Your email address will not be published.

Required fields are marked *

Sorry, this page isn't quite ready yet

redirecting to the old site

5

Mobilunity

cannot account for customer alterations, as the site may reflect changes made after the project was completed.

5