mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
removed double retrieving of plugin data
This commit is contained in:
parent
f2ff105a0d
commit
e018dcff7c
1 changed files with 3 additions and 12 deletions
|
@ -91,18 +91,9 @@ define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
|
|||
function () {
|
||||
init();
|
||||
|
||||
if ( ! function_exists( 'get_plugin_data' ) ) {
|
||||
/**
|
||||
* Skip check for WP files.
|
||||
*
|
||||
* @psalm-suppress MissingFile
|
||||
*/
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
$plugin_data = get_plugin_data( __DIR__ . '/woocommerce-paypal-payments.php', false );
|
||||
$plugin_version = $plugin_data['Version'] ?? null;
|
||||
$current_plugin_version = (string) PPCP::container()->get( 'ppcp.plugin' )->getVersion();
|
||||
$installed_plugin_version = get_option( 'woocommerce-ppcp-version' );
|
||||
if ( $installed_plugin_version !== $plugin_version ) {
|
||||
if ( $installed_plugin_version !== $current_plugin_version ) {
|
||||
/**
|
||||
* The hook fired when the plugin is installed or updated.
|
||||
*/
|
||||
|
@ -114,7 +105,7 @@ define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
|
|||
*/
|
||||
do_action( 'woocommerce_paypal_payments_gateway_migrate_on_update' );
|
||||
}
|
||||
update_option( 'woocommerce-ppcp-version', $plugin_version );
|
||||
update_option( 'woocommerce-ppcp-version', $current_plugin_version );
|
||||
}
|
||||
},
|
||||
-1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue