pinterest-for-woocommerce icon indicating copy to clipboard operation
pinterest-for-woocommerce copied to clipboard

Add mechanism for handling deprecated functions/methods

Open JPry opened this issue 3 years ago • 0 comments

During the review of #305, I noticed that we don't currently have a way of deprecating or otherwise removing functions and methods that are no longer needed. Now that this extension is publicly released, we need to be cognizant of the possibility that others are writing code and using our public functions and methods. To that end, we need to be responsible about how we handle renaming and/or removing functions and methods that could be called from 3rd party code.

WordPress itself has the _deprecated_function() function and WooCommerce has wc_deprecated_function(). We don't necessarily need to use either of these, as these are geared more towards functions than methods. For methods, one possibility would be something like a DeprecatedTrait trait that can be pulled into classes with deprecated methods.

Alongside this, we should also have a plan for ultimately removing deprecated code.

JPry avatar Dec 22 '21 19:12 JPry