Skip to content

7. Deprecation Policy

Dominik Schilling edited this page Sep 12, 2017 · 6 revisions

All applications eventually find code that is no longer used or has been replaced with other code but has been left behind for backwards compatibility reasons.

GlotPress' policy on removing this deprecated code needs to be consistent and transparent to developers and users alike.

This page provides a formal policy for deprecating and then removing code from GlotPress:

Deprecating Code

Code is deprecated when it is no longer of value or has been made redundant by other code in GlotPress.

Rule

Code can be deprecated in GlotPress in any major (ie 1.0 or 2.0) or point release (ie 1.1 or 2.1), but not in a hotfix release (ie 1.0.1 or 2.1.1).

Example

For example, in version 1.0 of GlotPress the lambda() function was marked as deprecated as PHP 5.3 supports anonymous functions and GlotPress 1.0 required PHP 5.3.

This function was not directly removed as several known plugins depended on it but was marked as deprecated.

Notes

Deprecated code should be tagged with the @deprecated tag with the version and a comment about the deprecation.

Removing Deprecated Code

Once code has been flagged as deprecated it still resides in GlotPress to allow for backward compatibility.

The act of actually removing the code will take place in a future release.

Rule

Deprecated code will be removed only in major (ie 1.0 or 2.0) releases and not until it has been deprecated for at least one major release cycle or at least 6 months.

Examples

  • Code deprecated in GlotPress 2.1 would not be removed until GlotPress 4.0 assuming more than 6 months between 2.1 and 4.0.
  • Code deprecated in GlotPress 3.0 would not be removed until GlotPress 4.0 assuming more than 6 months between 3.0 and 4.0.
  • Code deprecated in GlotPress 3.1 would not be removed until GlotPress 5.0 assuming more than 6 months between 3.1 and 4.0.
  • Code deprecated in GlotPress 3.1 would not be removed until GlotPress 6.0 if there was less than 6 months between 3.1 and 5.0.