| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Pay with Vipps and MobilePay for WooCommerce |
| 4 |
Plugin URI: https://wordpress.org/plugins/woo-vipps/ |
| 5 |
Description: Offer Vipps as a payment method for WooCommerce |
| 6 |
Author: WP Hosting, Everyday AS |
| 7 |
Author URI: https://www.wp-hosting.no/ |
| 8 |
Text-domain: woo-vipps |
| 9 |
Domain Path: /languages |
| 10 |
Version: 6.1.6 |
| 11 |
Stable tag: 6.1.6 |
| 12 |
Requires at least: 6.3 |
| 13 |
Tested up to: 7.1 |
| 14 |
Requires PHP: 8.0 |
| 15 |
Requires Plugins: woocommerce |
| 16 |
WC requires at least: 8.0.0 |
| 17 |
WC tested up to: 11.1.0 |
| 18 |
License: MIT |
| 19 |
License URI: https://choosealicense.com/licenses/mit/ |
| 20 |
|
| 21 |
|
| 22 |
This file is part of the plugin Pay with Vipps and MobilePay for WooCommerce |
| 23 |
Copyright (c) 2019 WP-Hosting AS |
| 24 |
|
| 25 |
MIT License |
| 26 |
|
| 27 |
Copyright (c) 2019 WP-Hosting AS |
| 28 |
|
| 29 |
Permission is hereby granted, free of charge, to any person obtaining a copy |
| 30 |
of this software and associated documentation files (the "Software"), to deal |
| 31 |
in the Software without restriction, including without limitation the rights |
| 32 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 33 |
copies of the Software, and to permit persons to whom the Software is |
| 34 |
furnished to do so, subject to the following conditions: |
| 35 |
|
| 36 |
The above copyright notice and this permission notice shall be included in all |
| 37 |
copies or substantial portions of the Software. |
| 38 |
|
| 39 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 40 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 41 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 42 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 43 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 44 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 45 |
SOFTWARE. |
| 46 |
|
| 47 |
*/ |
| 48 |
|
| 49 |
if ( ! defined( 'ABSPATH' ) ) { |
| 50 |
exit; // Exit if accessed directly |
| 51 |
} |
| 52 |
|
| 53 |
define( 'WC_VIPPS_MAIN_FILE', __FILE__ ); |
| 54 |
|
| 55 |
// Only be active if Woocommerce is active, either on site or network activated IOK 2018-08-29 |
| 56 |
$activeplugins = apply_filters( 'active_plugins', get_option( 'active_plugins' )); |
| 57 |
$activesiteplugins = apply_filters('active_sitewide_plugins', get_site_option('active_sitewide_plugins')); |
| 58 |
if ($activesiteplugins) { |
| 59 |
$activeplugins = array_merge($activeplugins,array_keys($activesiteplugins)); |
| 60 |
} |
| 61 |
|
| 62 |
$woo_active = in_array('woocommerce/woocommerce.php', $activeplugins); |
| 63 |
|
| 64 |
if ($woo_active) { |
| 65 |
/* Load support for the basic payment plugin IOK 2024-09-27 */ |
| 66 |
require_once(dirname(__FILE__) ."/payment/payment.php"); |
| 67 |
|
| 68 |
/* Load support for recurring payments if the stand-alone plugin isn't active IOK 2024-09-27 */ |
| 69 |
/* Moved to a separate file and the action moved to early in plugins_loaded so we can try to do this as gracefully as possible. |
| 70 |
This will also handle the activation and deactivation code for the recurring features. IOK 2024-12-04 */ |
| 71 |
require_once(dirname(__FILE__) . "/recurring/maybe_load.php"); |
| 72 |
} |
| 73 |
|
| 74 |
// Declare our support for the HPOS feature IOK 2022-12-07 |
| 75 |
add_action( 'before_woocommerce_init', function() { |
| 76 |
if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { |
| 77 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', WC_VIPPS_MAIN_FILE, true ); |
| 78 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', WC_VIPPS_MAIN_FILE, true ); |
| 79 |
} |
| 80 |
}); |
| 81 |
|