' . sprintf( esc_html__( 'WooCommerce PayPal Payments requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-paypal-payments' ), 'WooCommerce' ) . '

'; } ); return; } if ( version_compare( PHP_VERSION, '7.1', '<' ) ) { add_action( 'admin_notices', function() { echo '

' . esc_html__( 'WooCommerce PayPal Payments requires PHP 7.1 or above.', 'woocommerce-paypal-payments' ), '

'; } ); return; } static $initialized; if ( ! $initialized ) { $bootstrap = require "$root_dir/bootstrap.php"; $app_container = $bootstrap( $root_dir ); $initialized = true; do_action( 'woocommerce_paypal_payments_built_container', $app_container ); } } add_action( 'plugins_loaded', function () { init(); } ); register_activation_hook( __FILE__, function () { init(); do_action( 'woocommerce_paypal_payments_gateway_activate' ); flush_rewrite_rules(); } ); register_deactivation_hook( __FILE__, function () { init(); do_action( 'woocommerce_paypal_payments_gateway_deactivate' ); } ); // Add "Settings" link to Plugins screen. add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), function( $links ) { if ( ! function_exists( 'is_plugin_active' ) ) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { return $links; } array_unshift( $links, sprintf( '%2$s', admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' ), __( 'Settings', 'woocommerce-paypal-payments' ) ) ); return $links; } ); } )();