Cloner Plugin Fails dramatically

Hi

The cloner plugin fails dramatically in duplicating as all attached images which have unique id's in the original website are renumbered.

This means that code in pages which are pointing to those id's and even settings or featured images are lost and all need to be redone.

This is really very badly written code.

All my featured images were gone. But shortcode like below cannot find its image anymore.

[image source_type="attachment_id" source_value="2212" alt="GRIT Poster" width="628" height="447" autoHeight="true" quality="100"]

More over url's within the new website where not changed. I had to run the search and replace script to get those right.

This plugin should either be corrected or not being sold like this.

Cloning means a one on one copy !! This plugin is duplicating the posts and images and recreates all id's which results in all post types, custom or not losing its attached images.

Please provide a solution

Thank you

Best regards,
Paul

    Ignacio

    Hi @Paul Backus

    I can understand you about the Posts IDs. Cloner was designed to use WordPress in the best possible way. In fact, the plugin make uses of WordPress native functions instead of direct queries because we have had problems with cache systems when you create posts directly in Database.

    The good thing? Native actions will be triggered giving more consistency to the database. Cloner get rids of many errors indeed. Direct queries are bad, using native functions is the best way to go, everything works much better this way. If you think that the code is bad, I'd tell you to take a look to WordPress Importer plugin, made by Automattic. It does not copy the posts IDs also.

    The bad thing? Sometimes you need to add some custom code to make it work with some plugins or themes but fortunately we have thinked about that and Cloner is very, very extensible and easy to extend.

    Mostly, I'm opened to extend it when the code is simple (shortcodes are usually simple to). I see that your shortcode attachment ID needs to be remapped, could you tell me which plugin/theme is generating that shortcode? I think WordPress does not have nothing like that so I guess is a plugin or theme.

    That said, it seems that you're having difficulties with featured images. We are currently fixing some issues with them but they should be remapped to the new posts again. Do you mean the featured images on posts, pages or any other custom post type?

    Regards.
    Ignacio.

    Paul Backus

    Hi

    If i use backup buddy or the wpms duplicator plugin i get a exact one on one copy with the correct id's

    I tried striking, rttheme18, avada etc. And they all have the same issue with your plugin.

    A clone means a exact copy. And it does not. If i open the website all images are gone, Even the featured images that are attached to a custom posttype by the use of the default wordpress featured image ability, but also in posts.

    I am a coder and i write themes and plugins. This is really a big faillure as i need a exact clone not one were i have tons of work afterwards to restore all images and id's

    All featured images were missing after the clone. But i cant really walk through all posts and theme settings which use and store images by id's as those id's have changed.

    Really a clone should be a clone 100%. And you could clone a website id by id starting from 0 to the last one getting the exact duplicate with the same id's

    Best regards,
    Paul

    Ignacio

    Hi @Paul Backus

    I think I have good news. I just discovered (it wasn't documented in Codex) that you can pass an ID when creating a new post using 'import_id' argument in wp_insert_post. WordPress will try to use that ID.

    As Cloner deletes posts before inserting them, all posts/pages/CPTs and attachments should keep their IDs.

    This won't work for comments or taxonomies but I think it will be an important change for the next release (will be released soon).

    Regards.
    Ignacio.