Closed sybrew closed 6 years ago
Perhaps the approach could be semantic π Instead of enabling the sitemap, it could be a checkbox for "Disable Sitemap", so the user won't have any sitemap because he decided to disable ir. And the scenario where there's another sitemap plugin, we just don't fire the SEO sitemap action. The checkbox for disabling would stay unchecked.
It's like 3, but more understandable, at least for me.
@ramon-villain, thanks for the feedback!
Although it's a nice idea, in the end that would make it actually even more work (and confusing for most users and me).
Food for thought: Mixing "negative" and "positive" (enable/disable) options is a design disaster and I have a very difficult time implementing the right wording. This is because disabling mostly implies removing something negative caused by external conditions. Whereas enabling something would imply a positive addition to your website.
We could argue that the "enable no-index/archive/follow" options should actually be "disable indexing/archiving/following". Now, those options add an extra tag/condition, so there's the counter argument... ugh π
But I digress... because this isn't the actual issue.
Back to the issue: The issue is that any option could be conditional in any situation. Be it now or in the future. Some might even wish to remove some metaboxes from view for their users.
Converting all those options each time from positive to negative requires another upgrade handler checking for them (an example: The Twitter Card upgrader).
There are more arguments supporting this, but I think the point (at least from a coding perspective) is clear enough for now π
What I want to achieve: A solution that will work now and in the future. Without ever needing to look back; thus completely automated.
Yes, you're right, we can't work for an unique option, it should respect the whole scenario/experience. Therefore I guess you are in the right road.
The proposed resolution will lead to bugs if not tightly controlled. Moved to a later version where we output options through a schematic format, rather than plain HTML.
We're maintaining resolution 5 in the meantime, without backward compatibility until it waters down. If we can assure almost all sites are running TSF 3.0 or later, this shouldn't be an issue anymore.
The upgrade handler and all affected settings are now handled differently since the commits listed above. These changes make this issue obsolete. We'll see what needs to be done differently later.
The current options upgrade handler was great when it was first introduced.
...and then the options were conditionally shown, e.g.:
Whenever POST is processed, all hidden options are essentially deleted from the saved options array.
The issue
The issue is that the upgrade handler will miss the options, and will notice "new" options. These options are added back to the database on every single DB update.
The user will get an annoying (although one-time) notification, and it also introduces filter incompatibilities.
Available ways to handle this
To summarize:
Although 5. seems to be a nice candidate, it requires new upgrade methods whenever a new option is added. This can't be automated and needs to be manually inserted every single time.
I guess I'll need to go for 3.
Bear with me, currently:
This way, when you enable another sitemap plugin, and save the SEO settings, then the next time you check in the sitemap suddenly isn't disabled.
So, with 3.:
Thoughts?