Plugin Directory

Changeset 3087634


Ignore:
Timestamp:
05/16/2024 09:57:40 AM (19 months ago)
Author:
konamiman
Message:

PR 14: Fix fatal error when deactivating the plugin

Location:
woocommerce-legacy-rest-api/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-legacy-rest-api/trunk/includes/class-wc-legacy-rest-api-plugin.php

    r3087088 r3087634  
    109109    private static function maybe_remove_hpos_incompatibility_admin_notice() {
    110110        if ( WC_Admin_Notices::has_notice( 'legacy_rest_api_is_incompatible_with_hpos' ) && ! self::hpos_is_enabled() ) {
    111             self::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
     111            WC_Admin_Notices::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
    112112        }
    113113    }
     
    127127
    128128        if ( WC_Admin_Notices::has_notice( 'legacy_rest_api_is_incompatible_with_hpos' ) ) {
    129             self::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
     129            WC_Admin_Notices::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
    130130        }
    131131    }
     
    169169     */
    170170    private static function user_has_dismissed_admin_notice( $notice_id ) {
    171         return '' !== get_user_meta( get_current_user_id(), "dismissed_${notice_id}_notice", true );
     171        if ( method_exists( 'WC_Admin_Notices', 'user_has_dismissed_notice' ) ) {
     172            return WC_Admin_Notices::user_has_dismissed_notice( $notice_id );
     173        } else {
     174            return (bool) get_user_meta( get_current_user_id(), "dismissed_{$notice_id}_notice", true );
     175        }
    172176    }
    173177}
  • woocommerce-legacy-rest-api/trunk/readme.txt

    r3087088 r3087634  
    55Tested up to: 6.3
    66Requires PHP: 7.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3636First version, replicates the WooCommerce Legacy REST API v3.1.0 present in WooCommerce 8.3.
    3737
    38 
    3938= 1.0.1 2024-01-08 =
    4039
     
    4241- Add sanitization for data received via query string arguments and the $_SERVER array.
    4342
     43= 1.0.2 2024-05-01 =
    4444
    45 = 1.0.2 2024-05-01
     45- Add a dismissable admin notice indicating that the Legacy REST API is not compatible with HPOS.
     46- The notice will appear if the orders table is (or has been) selected as the orders data store in the WooCommerce features settings page, and will disappear when that ceases to be true. Once the notice is dismissed it will never appear again.
    4647
    47 Add a dismissable admin notice indicating that the Legacy REST API is not compatible with HPOS.
    48 The notice will appear if the orders table is (or has been) selected as the orders data store in the WooCommerce features settings page,
    49 and will disappear when that ceases to be true. Once the notice is dismissed it will never appear again.
     48= 1.0.3 2024-05-15 =
    5049
     50- Fix a bug introduced in 1.0.2 that caused a fatal error when checking if HPOS is enabled.
    5151
    52 = 1.0.3 2024-05-15
     52= 1.0.4 2024-05-16 =
    5353
    54 Fix a bug introduced in 1.0.2 that caused a fatal error when checking if HPOS is enabled.
     54- Correct a problem in which the attempted removal of admin notices (warning of HPOS incompatibility) could lead to a fatal error during plugin deactivation.
  • woocommerce-legacy-rest-api/trunk/woocommerce-legacy-rest-api.php

    r3087088 r3087634  
    44 * Plugin URI: https://github.com/woocommerce/woocommerce-legacy-rest-api
    55 * Description: The legacy WooCommerce REST API, which used to be part of WooCommerce itself but is removed as of WooCommerce 9.0.
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: WooCommerce
    88 * Author URI: https://woocommerce.com
Note: See TracChangeset for help on using the changeset viewer.