WordPress.org

Ready to get started?Download WordPress

Forums

Spots
[resolved] Problems with nested serialized data structures (3 posts)

  1. JochenT
    Member
    Posted 2 years ago #

    Hi,

    currently I've a problem with nested serialized data structures stored as _transient_spot_xxxx in table wp_options. The problem emerges when cloning a site (e.g. live server to staging or vice versa).

    The original value is:
    option_name: _transient_spot_9310
    option_value:
    s:266:"a:2:{s:6:"output";s:211:"<p>Sie möchten noch mehr über die E-Plus Gruppe erfahren und benötigen zusätzliche Informationen?</p>
    <p>Kontaktieren Sie uns</p>
    ";s:6:"status";s:7:"publish";}";

    After cloning the modified entry is:
    option_name: _transient_spot_9310
    option_value:
    s:279:"a:2:{s:6:"output";s:211:"<p>Sie möchten noch mehr über die E-Plus Gruppe erfahren und benötigen zusätzliche Informationen?</p>
    <p>Kontaktieren Sie uns</p>
    ";s:6:"status";s:7:"publish";}";

    The over all length of the string is modified correctly (+13 characters). But the length of the string of the second array element (length=211) is unmodified. This results in a failure when executing the unserialize() in function icit_get_spot() on line 1028 of the plugin.

    I use a professional plugin for the cloning process (BackupBuddy) and have reported the problem to them. Their answer is: "The WordPress Codex states that you do not need to serialise values, if the option value needs to be serialised then it will be serialised (by WordPress function) before it is inserted into the database. ... You will need to contact the plugin author to have them update the plugin to conform to the WordPress convention."

    Although I've suggested them to add a feature which will convert nested serialized structures as well, it might be very helpful if you could modify the plugin to avoid such nested elements.

    This is a great plugin and we use it for a complex footer to allow editors to modify the footer elements without having to deal with the widgets itself.

    http://wordpress.org/extend/plugins/spots/

  2. sanchothefat
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jochen,

    You're right - interesting bug that. WP should know if it's got serialised data to insert so I didn't think it would cause an issue like that.

    I've removed the explicit serialisation in version 1.0.7 of the plugin along with some improvements to the caching.

    Can you update the plugin and then try it again and let me know if the problem comes back?

  3. JochenT
    Member
    Posted 2 years ago #

    Hi,

    I've updated to v1.0.7 and reviewed the entry in table wp_options. Now it contains a straight none nested serialized data structure. This should make no problems when cloning the site, any more.

    Thanks for the quick update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.