• Resolved jroberts.gd

    (@jrobertsgd)


    I’d like to submit a pull request that removes the serialize() and unserialize() functions calls wrapping the get and set of the config. WordPress does this automatically and the result is double-serialization which blocks me from being able to manipulate these options using wp-cli’s pluck and patch commands.

    From the changelog it looks like ownership changed recently and I went looking for the repo mentioned in the latest release, but it resulted in a 404 at Github. (##### [Version 4.5.3](https://github.com/Codeinwp/WP-Cloudflare-Super-Page-Cache/compare/v4.5.2…v4.5.3) (2021-05-25))

    Please advise how I might contribute to this project.

    • This topic was modified 3 years, 6 months ago by jroberts.gd.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jroberts.gd

    (@jrobertsgd)

    For reference: https://nacin.com/2010/04/18/wordpress-serializing-data/

    The changes would be in wp-cloudflare-super-page-cache.php, line 369 and 381 where the serialization is redundant:

    $this->config = unserialize( $this->config );
    update_option( 'swcfpc_config', serialize( $this->config ) );

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @jrobertsgd,
    First of all, thank you so much for reporting it. I really appreciate it. Unfortunately, the repo is private and that’s why you are unable to submit a PR.

    But worry not, I will patch the issues as you mentioned. So, just to clarify, what you are saying is that in wp-cloudflare-super-page-cache.php on line no. 372 the line:

    update_option( 'swcfpc_config', serialize( $this->config ) );

    will become:

    update_option( 'swcfpc_config', $this->config );

    and on line no. 384 the line:

    $this->config = unserialize( $this->config );

    would basically be removed as

    $this->config = $this->config;

    is not needed.

    Please check and confirm.

    Plugin Contributor iSaumya

    (@isaumya)

    Hey @jrobertsgd,
    download this patched version and try it out. Let me know if it resolves your issue.

    Thread Starter jroberts.gd

    (@jrobertsgd)

    Thank you Saumya for the quick response and patch. I’ve tested this version and it resolves the issue. I’m now able to use wp option pluck and wp option patch to execute operations like wp option pluck swcfpc_config cf_apitoken.

    I’m new to how WordPress plugins repositories are managed. Can you help me understand why you’ve chosen to keep this particular plugin repo private?

    Plugin Contributor iSaumya

    (@isaumya)

    I’m new to how WordPress plugins repositories are managed. Can you help me understand why you’ve chosen to keep this particular plugin repo private?

    – Mostly because of the insane complexities of the plugin. We really don’t want people to making random changes to the code and sending PR without understanding the full reputations across the board. I mean that change might fix certain things but might break something else which they will have no idea. So, it is easier than people report them here as I will make the changes after properly validating them.

    Another issue is that, as soon as the repo is public, people will start posting support questions in the GitHub issues, and it is impossible to manage all those chaos.

    I hope you understand. Thanks for confirming. It will be added to the next release of the plugin.

    Thread Starter jroberts.gd

    (@jrobertsgd)

    I’ve never had to do it myself, but I’ve read other maintainer’s blog or comment on the challenge of managing an open source project. While my preference would be for a public repo where changes can be validated through a PR process, I recognize the burden this places on contributors like you and I understand your reasoning.

    Thank you again for your work and responsiveness.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove serialization functions’ is closed to new replies.