mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Merge pull request #512 from woocommerce/fix-get-plugin-data
Require plugin.php if no get_plugin_data
This commit is contained in:
commit
6b86e45287
2 changed files with 13 additions and 0 deletions
|
@ -63,6 +63,9 @@ trait PaymentsStatusHandlingTrait {
|
||||||
switch ( $status->name() ) {
|
switch ( $status->name() ) {
|
||||||
case CaptureStatus::COMPLETED:
|
case CaptureStatus::COMPLETED:
|
||||||
$wc_order->payment_complete();
|
$wc_order->payment_complete();
|
||||||
|
/**
|
||||||
|
* Fired when PayPal order is captured.
|
||||||
|
*/
|
||||||
do_action( 'woocommerce_paypal_payments_order_captured', $wc_order, $capture );
|
do_action( 'woocommerce_paypal_payments_order_captured', $wc_order, $capture );
|
||||||
break;
|
break;
|
||||||
// It is checked in the capture endpoint already, but there are other ways to capture,
|
// It is checked in the capture endpoint already, but there are other ways to capture,
|
||||||
|
|
|
@ -56,6 +56,16 @@ class FilePathPluginFactory implements FilePathPluginFactoryInterface {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! function_exists( 'get_plugin_data' ) ) {
|
||||||
|
/**
|
||||||
|
* Skip check for WP files and constants.
|
||||||
|
*
|
||||||
|
* @psalm-suppress UnresolvableInclude
|
||||||
|
* @psalm-suppress UndefinedConstant
|
||||||
|
*/
|
||||||
|
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||||
|
}
|
||||||
|
|
||||||
$plugin_data = get_plugin_data( $filePath );
|
$plugin_data = get_plugin_data( $filePath );
|
||||||
if ( empty( $plugin_data ) ) {
|
if ( empty( $plugin_data ) ) {
|
||||||
throw new UnexpectedValueException(
|
throw new UnexpectedValueException(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue