Ticket #4915 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Deprecate get_alloptions()

Reported by: mdawaffe Owned by: anonymous
Priority: normal Milestone: 3.0
Component: Optimization Version: 2.9
Severity: normal Keywords: has-patch commit
Cc:

Description

These seem to be near duplicates. One has some filters, one has some caching.

It'd be a strange plugin that used either. Can we deprecate one or the other?

Also note get_alloptions_110().

Attachments

4915.patch Download (2.6 KB) - added by hakre 2 years ago.
4915.diff Download (2.7 KB) - added by nacin 2 years ago.
Deprecate for wp_load_alloptions()

Change History

We have one plugin in the repository that is still using get_alloptions().

 http://svn.wp-plugins.org/inscript/trunk/inscript.php

The methods that use it are doing manual manipulation of the options table, and thus would be incompatible with any WP install using an options cache... so it needs updating anyway.

I say we yank this for 2.4, and notify the author of InScript so he can update his plugin to use the options API.

comment:2   DD324 years ago

Whats the consensus?

dump get_alloptions() as its not used?

Move to depreciated and return wp_load_alloptions()?

comment:3   DD323 years ago

  • Keywords dev-feedback added
  • Keywords needs-patch added

+1 to dumping get_alloptions(). the consensus probably is needs-patch though. :-)

  • Keywords dev-feedback removed

According to the plugins homepage the plugin is only compatible up to WordPress 2.5. Therefore if it once was an argument on how to handle things it is now an argument to remove get_alloptions().

hakre2 years ago

  • Keywords has-patch added; needs-patch removed
  • Summary changed from get_alloptions() v. wp_load_alloptions() to Deprecate get_alloptions()

wp_load_alloptions() is not a 100% suitable replacement so it's not suggested. No occurences wihtin the codebase. The named plugin is not for 2.8 / 2.9 therefore no prolems to patch any longer. If this gets commited early, the plugin author - if still interested - can then update against the latest version before 2.9 will be released.

Cross-Referencing another deprecated patch: #4968

comment:9   ryan2 years ago

  • Milestone changed from 2.9 to Future Release
  • Keywords commit added
  • Type changed from defect (bug) to enhancement
  • Version set to 2.9
  • Component changed from General to Optimization
  • Milestone changed from Future Release to 3.0

Why aren't we deprecating in favor of wp_load_alloptions()? Just because we don't want wp_getalloptions() to return wp_load_alloptions() once it is deprecated, the favored replacement should still be named.

And I'm not sure why we're completely clearing out the function instead of returning wp_load_alloptions(). It isn't an exact replacement but both end up returning the same thing.

It's not used at all in WP, the ticket has been opened for 2 years...

nacin2 years ago

Deprecate for wp_load_alloptions()

Replying to Denis-de-Bernardy:

It's not used at all in WP, the ticket has been opened for 2 years...

Sure, but there's been no sign of deprecation. The codex and wp_load_alloptions() inline docs even denote the difference between the two, which means a plugin author might still use it, even choosing to use it over wp_load_alloptions() due to the difference. While the repository is a good guideline, not all plugins out there are on wordpress.org.

Best I can tell, wp_load_alloptions() should be a named replacement. Generally, it seems we run down this checklist:

  1. Is the functionality and return value of the replacement (if applicable) roughly compatible? If yes, return the replacement. If no:
  1. Does the deprecated function still perform an action? If it still does something: leave it as is and only name the replacement (if applicable). If no:
  1. The function no longer provides any functionality, so strip it down to nothing. (See get_autotoggle() as an example.)

Seems the first one applies here.

works too, yeah.

I am going to contact the inscript plugin author to let him know.

Also looks like the cricket-moods plugin used to use it too but doesn't anymore

  • Status changed from new to closed
  • Resolution set to fixed

(In [12656]) Deprecate get_alloptions(). Fixes #4915 props nacin.

Note: See TracTickets for help on using tickets.