• Resolved wp1222

    (@wp1222)


    Hi there,
    it seems that the plugin stores bad characters in the database table wp_options. As a result I cannot edit the database with a search and replace tool.

    Use this sql query:
    SELECT * FROM wp_options where option_name=’fs_accounts’

    The option_value includes the bad characters:
    …s:22:”?FS_Entity?_is_updated…

    When I edit the option_value like this:
    …s:22:”XFS_EntityX_is_updated…

    Everything works perfect as long as I refresh the plugin page in the wordpress backend for example.

    What can I do to solve this issue?

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter wp1222

    (@wp1222)

    Additional info:
    When I monitor the sql queries thats what the plugin writes into the table ws_options:
    …s:22:\”\0FS_Entity\0_is_updated\”…

    Plugin Author Daniel Iser

    (@danieliser)

    @wp1222 – it appears you are modifying serialized data without properly understanding the format. You added characters but didn’t change the string length (s:22). Your not gonna want to do search and replace directly on serialized data unless your absolutely sure you understand the format. Any change from what is expected causes it to not translate back to a PHP array or object properly.

    Try a S&R plugin that was built to handle serialized data.

    Those options come from Freemius (which we and hundreds of other plugins use), not our plugin itself.

    Further when you pass an array to wp_options, it’s WordPress itself that converts it to serialized data. So core is where those character manipulations and serialization come from. Not a plugin. When core reads those options it converts them back to arrays for plugin authors automatically.

    Changing them is not a good idea as the names your changing reference PHP classes. Changing them will lead to data corruption since XFS classes probably don’t exist. The characters you see likely are PHPs way of handling namespaces.

    Hope that helps.

    Thread Starter wp1222

    (@wp1222)

    Hi Daniel,

    thanks for your fast reply! I would like to comment your answers:

    …without properly understanding the format. You added characters but didn’t change the string length (s:22).

    Well I know that the value “s:22″ refers to the following string length and that it always has to match. That’s the reason why the plugin fails with the original database entry. Also https://www.unserialize.me fails to unserialize the original data. The original string lenght is not 22 characters long as the following example shows. You can test with https://www.unserialize.me:

    Original string:
    a:1:{s:22:”?FS_Entity?_is_updated”;b:0;}
    Result: fails

    Test #1:
    a:1:{s:26:”?FS_Entity?_is_updated”;b:0;}
    Result: OK

    Test #2 (as mentioned in my 1st post):
    a:1:{s:22:”XFS_EntityX_is_updated”;b:0;}
    Result: OK

    Try a S&R plugin that was built to handle serialized data.

    The plugin I used is especially designed for this purpose: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/.

    Changing them is not a good idea as the names your changing reference PHP classes.

    I adjusted the serialized data only for test purposes to debug the issue.

    Do you have a suggestion how to solve this issue?

    Best regards

    Thread Starter wp1222

    (@wp1222)

    I just installed the plugin in a fresh wordpress installation without any backend adjustments and without any further plugins to check if the issue is also there. Unfortunately yes, the database entry also includes the string “…s:22:”?FS_Entity?_is_updated”;b:0;…”

    Plugin Author Daniel Iser

    (@danieliser)

    @wp1222 Interesting but again, your in the wrong place. That is a 3rd party library (which I admit we use) that creates those options. We do not maintain or troubleshoot that code ourselves generally speaking. That said it’s used by a lot of plugins so if there is an issue I’m not sure how it’s gotten by this far without notice.

    Check it out and report the issue there please. We can update the copy included with our plugin once the issue is worked out and they provide a new release. I honestly wouldn’t know where in their code to start to try and fix an issue like that.

    https://github.com/Freemius/wordpress-sdk/issues

    Also if you want you could probably disable Freemius entirely and make that option irrelevant.

    Hope that helps. Let us know what the issue link is so we can follow it and get in in when it’s patched.

    Thread Starter wp1222

    (@wp1222)

    Hi Daniel,
    thanks for your support! I will let you know if freemius has solved the issue.
    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Database corrupted (wp_options)’ is closed to new replies.