Skip to content

Refactor: add_options explicitly as autoload=no #8

Description

@westonruter

I just now came across @rmccue's reported Core bug #28701(Deleted option is not deleted if value was ever null) in the wild, specifically here in hm-top-posts. The password had been changed for the Google Account, and so this notice was appearing on every admin page:

Top Posts by Google Analytics Error: GAPI: Failed to authenticate user. Error: "Error=BadAuthentication "

Now, this notice is stored in the option hmtp_top_posts_error_message and it is supposed to get deleted after it is shown. However, it was not getting deleted. It was persisting. It seems that the problem is that this option gets set to null at some point, and since it is an auto-loaded option (since it is not declared otherwise with add_option), any delete_option calls result in a no-op.

I don't think that these Top Posts options actually should be autoloaded, so I suggest that they get registered up-front via add_option and pass the $autoload argument as no.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions