bobbingwide / oik-clone

Clone content between sites
https://www.oik-plugins.com/oik-plugins/oik-clone-clone-your-wordpress-content/
GNU General Public License v2.0
5 stars 0 forks source link

Cater for corrupted post meta data in _oik_clone_ids #14

Closed bobbingwide closed 3 years ago

bobbingwide commented 7 years ago

In the fix for issue #13 we had to deal with corrupt post meta data where the 'id' field was stored as an array of 'id' and 'cloned'.

Unfortunately, the fix didn't go far enough. There are situations where the array gets multiply nested, and without further prevention could get more corrupt.

       [http://oik-plugins.com] => Array
           [id] => Array
                [id] => Array
                    [id] => (integer) 0
                    [cloned] => (integer) 1477940164
                [cloned] => (integer) 1477941536
            [cloned] => (integer) 1477999796

In this particular example there is a further problem - the id field is 0. What's happened here is that the response from the server included HTML as well as JSON data. This HTML was the jQuery enqueued by the [bw_testimonial] shortcode. Why and where the content is being expanded is currently a mystery. Solve that and we're half way to fixing another problem.

bobbingwide commented 6 years ago

Note: It would appear that having an id of 0 will lead to the data getting further corrupted on a subsequent attempt to clone the information. This occurred after updating oik-plugins.co.uk to oik v3.2.1 without having also changed oik-clone.

bobbingwide commented 5 years ago

This problem still exists. It occurs when there's a failure to clone content. The invalid ID ( 0 ) is not updated with the new timestamp.

a:2:{s:23:"https://core.wp-a2z.org";a:2:{s:2:"id";i:35140;s:6:"cloned";i:1552600757;}
s:21:"https://blocks.wp.a2z";a:2:{s:2:"id";a:2:
{s:2:"id";a:2:{s:2:"id";i:0;s:6:"cloned";i:1552586288;}
s:6:"cloned";i:1552599477;}
s:6:"cloned";i:1552600757;}}

When the data has been corrupted, messages about assigning from an array are still being produced in the [cloned] shortcode and the meta box.

bobbingwide commented 3 years ago

oik-clone v2.0.0 has been released. Closing this issue.