Skip to content
Willington Vega edited this page Mar 9, 2020 · 4 revisions

This is a comprehensive list of deprecated methods within the framework files/classes with indication of ideal supported substitute.

Deprecated methods should be removed at the next major release of the framework. Once deprecated methods have been removed from the framework, they should also be removed from this list.

When a method is deprecated, it should be added to this list for reference.

WIP v5.7.0

SV_WC_Payment_Gateway_My_Payment_Methods methods

Saved payment methods are now rendered in WooCommerce's table of payment methods. Use woocommerce_payment_methods_list_item, woocommerce_account_payment_methods_columns, and woocommerce_account_payment_methods_column_{column_id} hooks to customize the information displayed.

  • SV_WC_Payment_Gateway_My_Payment_Methods::render(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_title_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_head_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_headers(): use SV_WC_Payment_Gateway_My_Payment_Methods::add_payment_methods_columns()
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_body_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_body_row_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_table_body_row_data(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_payment_method_expiry_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_payment_method_actions_html(): no replacement
  • SV_WC_Payment_Gateway_My_Payment_Methods::get_payment_method_actions(): no replacement

SV_WC_Payment_Gateway_Integration_Subscriptions methods

  • SV_WC_Payment_Gateway_Integration_Subscriptions::add_my_payment_methods_table_body_row_data(): no replacement
  • SV_WC_Payment_Gateway_Integration_Subscriptions::disable_my_payment_methods_table_method_delete(): no replacement, similar behavior is implemented in Subscriptions plugin

v5.6.0 and older

SV_WC_Helper methods

  • SV_WC_Helper::convert_country_code(): use Country_Helper::convert_alpha_country_code( $code )
  • SV_WC_Helper::get_post(): use SV_WC_Helper::get_posted_value()
  • SV_WC_Helper::get_request(): use SV_WC_Helper::get_requested_value()

SV_WC_Plugin_Compatibility methods

  • SV_WC_Plugin_Compatibility::wc_get_is_paid_statuses(): use (array) wc_get_is_paid_status() for consistent return type
  • SV_WC_Plugin_Compatibility::wc_doing_it_wrong(): use wc_doing_it_wrong()
  • SV_WC_Plugin_Compatibility::wc_deprecated_function(): use wc_deprecated_function() (also, prefer this to WP _deprecated_function())
  • SV_WC_Plugin_Compatibility::wc_format_datetime(): use wc_format_datetime()
  • SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0(): use SV_WC_Plugin_Compatibility::is_wc_version_gte()
  • SV_WC_Plugin_Compatibility::is_wc_version_lt_3_0(): use SV_WC_Plugin_Compatibility::is_wc_version_lt()
  • SV_WC_Plugin_Compatibility::is_wc_version_gte_3_1(): use SV_WC_Plugin_Compatibility::is_wc_version_gte()
  • SV_WC_Plugin_Compatibility::is_wc_version_lt_3_1(): use SV_WC_Plugin_Compatibility::is_wc_version_lt()
  • SV_WC_Plugin_Compatibility::is_wc_subscriptions_version_gte_2_0(): use SV_WC_Plugin_Compatibility::is_wc_subscriptions_version_gte()

SV_WC_Plugin methods

  • SV_WC_Plugin::do_install(): just implement Lifecycle handler
  • SV_WC_Plugin::install_default_settings(): extend Lifecycle handler install_default_settings if necessary
  • SV_WC_Plugin::activate(): no replacement necessary
  • SV_WC_Plugin::deactivate(): no replacement necessary
  • SV_WC_Plugin::get_missing_extension_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_missing_function_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_incompatible_php_settings(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_extension_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_function_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::get_php_settings_dependencies(): define dependencies in plugin constructor, handling is automatic
  • SV_WC_Plugin::set_dependencies(): define dependencies in plugin constructor, handling is automatic

Lifecycle methods

  • Lifecycle::do_update(): no replacement, define upgrade routines in constructor

SV_WC_DateTime methods

The whole SV_WC_DateTime class is deprecated and calling the constructor or any of its methods will trigger deprecation notices. Use standard DateTime and DateTimezone objects which are now fully supported.

SV_WC_Data_Compatibility methods

These methods are also applicable to SV_WC_Order_Compatibility and SV_WC_Product_Compatibility.

  • SV_WC_Data_Compatibility::get_prop(): use WC_Data objects getter methods keeping the context (pass edit if not currently passing any context)
  • SV_WC_Data_Compatibility::set_props(): use WC_Data::set_props() objects method
  • SV_WC_Data_Compatibility::get_meta(): use WC_Data::get_meta() objects method (with view context, if not currently passing any context)
  • SV_WC_Data_Compatibility::add_meta_data(): use WC_Data::add_meta_data() and remember to save with WC_Data::save_meta_data()
  • SV_WC_Data_Compatibility::update_meta_data(): use WC_Data::update_meta_data()and remember to save withWC_Data::save_meta_data()`
  • SV_WC_Data_Compatibility::delete_meta_data(): use WC_Data::delete_meta_data() and remember to persist change with WC_Data::save_meta_data()

SV_WC_Order_Compatibility methods

  • SV_WC_Order_Compatibility::get_date_created(): use WC_Order::get_date_created()
  • SV_WC_Order_Compatibility::get_date_modified(): use WC_Order::get_date_modified()
  • SV_WC_Order_Compatibility::get_date_paid(): use WC_Order::get_date_paid()
  • SV_WC_Order_Compatibility::get_date_completed(): use WC_Order::get_date_completed()
  • SV_WC_Order_Compatibility::get_date_prop(): use WC_Order date getters
  • SV_WC_Order_Compatibility::get_prop(): just deprecated as its parent (keep the context - pass edit if not currently passing any context)
  • SV_WC_Order_Compatibility::set_props(): just deprecated as its parent
  • SV_WC_Order_Compatibility::add_coupon(): add a $coupon = new WC_Order_Item_Coupon() object to WC_Order::add_item( $coupon )
  • SV_WC_Order_Compatibility::add_fee(): add a $fee = new WC_Order_Item_Fee() object to WC_Order::add_item( $fee )
  • SV_WC_Order_Compatibility::add_shipping(): add a $shipping = new WC_Order_Item_Shipping() object to WC_Order::add_item( $shipping )
  • SV_WC_Order_Compatibility::add_tax(): add a $tax = new WC_Order_Item_Tax() object to WC_Order::add_item( $tax )
  • SV_WC_Order_Compatibility::update_coupon(): use WC_Order_Item_Coupon methods
  • SV_WC_Order_Compatibility::update_fee(): use WC_Order_Item_Fee methods
  • SV_WC_Order_Compatibility::reduce_stock_levels(): use wc_reduce_stock_levels()
  • SV_WC_Order_Compatibility::update_total_sales_counts(): use wc_update_total_sales_counts()
  • SV_WC_Order_Compatibility::has_shipping_address(): use WC_Order::has_shipping_address()

SV_WC_Product_Compatibility methods

  • SV_WC_Product_Compatibility::get_prop(): just deprecated as its parent (keep the context - pass edit if not currently passing any context)
  • SV_WC_Product_Compatibility::set_props(): just deprecated as its parent
  • SV_WC_Product_Compatibility::get_parent(): use wc_get_product( $product_instance->get_parent_id() )
  • SV_WC_Product_Compatibility::wc_update_product_stock(): use wc_update_product_stock()
  • SV_WC_Product_Compatibility::wc_get_price_html_from_text(): use wc_get_price_html_from_text()
  • SV_WC_Product_Compatibility::wc_get_price_including_tax(): use wc_get_price_including_tax()
  • SV_WC_Product_Compatibility::wc_get_price_excluding_tax(): use wc_get_price_excluding_tax()
  • SV_WC_Product_Compatibility::wc_get_price_to_display(): use wc_get_price_to_display()
  • SV_WC_Product_Compatibility::wc_get_product_category_list(): use wc_get_product_category_list()
  • SV_WC_Product_Compatibility::wc_get_rating_html(): use wc_get_rating_html()

SV_WC_Payment_Gateway_Plugin methods

  • SV_WC_Payment_Gateway_Plugin::get_payment_gateway_configuration_section(): use strtolower( $gateway_id )

SV_WC_Payment_Gateway methods

  • SV_WC_Payment_Gateway::authorization_valid_for_capture(): use SV_WC_Payment_Gateway::get_capture_handler()::order_can_be_captured()
  • SV_WC_Payment_Gateway::authorization_captured(): use SV_WC_Payment_Gateway::get_capture_handler()::is_order_captured()
  • SV_WC_Payment_Gateway::has_authorization_expired(): use SV_WC_Payment_Gateway::get_capture_handler()::has_order_authorization_expired()
  • SV_WC_Payment_Gateway::authorization_fully_captured(): use SV_WC_Payment_Gateway::get_capture_handler()::is_order_fully_captured()
  • SV_WC_Payment_Gateway::do_credit_card_capture(): use SV_WC_Payment_Gateway::get_capture_handler()::perform_capture()
  • SV_WC_Payment_Gateway::do_credit_card_capture_failed(): use SV_WC_Payment_Gateway::get_capture_handler()::do_capture_failed()
  • SV_WC_Payment_Gateway::get_order_capture_maximum(): use SV_WC_Payment_Gateway::get_capture_handler()::get_order_capture_maximum()
  • SV_WC_Payment_Gateway::get_order_authorization_amount(): use SV_WC_Payment_Gateway::get_capture_handler()::get_order_authorization_amount()
  • SV_WC_Payment_Gateway::add_capture_data(): use SV_WC_Payment_Gateway::get_capture_handler()::do_capture_success()
  • SV_WC_Payment_Gateway::add_payment_gateway_capture_data(): no replacement
  • SV_WC_Payment_Gateway::get_post(): use SV_WC_Helper::get_posted_value()
  • SV_WC_Payment_Gateway::get_request(): use SV_WC_Helper::get_requested_value()

SV_WC_Payment_Gateway_Admin_Order methods

  • SV_WC_Payment_Gateway_Admin_Order::maybe_capture_charge(): implement capture handler
  • SV_WC_Payment_Gateway_Admin_Order::maybe_capture_paid_order(): implement caputre handler
  • SV_WC_Payment_Gateway_Admin_Order::is_order_ready_for_capture(): implement capture handler

SV_WC_Payment_Gateway_Payment_Token methods

  • SV_WC_Payment_Gateway_Payment_Token::get_token(): use SV_WC_Payment_Gateway_Payment_Token::get_id()
  • SV_WC_Payment_Gateway_Payment_Token::is_check(): use SV_WC_Payment_Gateway_Payment_Token::is_echeck()
  • SV_WC_Payment_Gateway_Payment_Token::type_from_account_number(): use SV_WC_Payment_Gateway_Helper::card_type_from_account_number()

SV_WC_Payment_Gateway_My_Payment_Methods methods

  • SV_WC_Payment_Gateway_My_Payment_Methods::get_payment_method_title(): use SV_WC_Payment_Gateway_My_Payment_Methods::get_payment_method_title_html()

SV_WC_API_XML_Request methods

  • SV_WC_API_XML_Request::get_request_data(): use SV_WC_API_XML_Request::get_data()