WordPress-Phoenix/sm-sticky-clicky-star

String vs int bug in the plugin causes sticky to not get toggled

archon810 opened this issue · 1 comments

We ran into a bug with the plugin that prevented consistent and reliable sticky-toggling due to what I found to be a bug with the code that uses strings vs ints.

For example, if you first set a sticky using WP's built-in function, it uses an int, like so:

a:2:{i:0;i:725308;i:1;i:744381;}

If you then use the sticky clicky plugin to toggle off 725308, instead of removing it, it will actually add a string, like so:

a:3:{i:0;s:6:"725308";i:1;i:725308;i:2;i:744381;}

At this point you can toggle and untoggle forever and it won't unsticky post 725308.

The fix should be relatively trivial, I hope you can release it, and the plugin isn't deprecated.

Crossposted this to https://wordpress.org/support/topic/string-vs-int-bug-in-the-plugin-causes-sticky-to-not-get-toggled/.

Just letting you know I received your bug and I see what you mean. Given the holidays, it may be some time before I get to a fix, but if anyone wants to propose a PR i could work on releasing it.