| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: HyperPay Payments |
| 5 |
* Description: Hyperpay is the first one stop-shop service company for online merchants in MENA Region.<strong>If you have any question, please <a href="http://www.hyperpay.com/" target="_new">contact Hyperpay</a>.</strong> |
| 6 |
* Version: 1.7 |
| 7 |
* Text Domain: hyperpay-payments |
| 8 |
* Domain Path: /languages |
| 9 |
* Author: Hyperpay Team |
| 10 |
* Author URI: https://www.hyperpay.com |
| 11 |
* Requires at least: 5.3 |
| 12 |
* Requires PHP: 7.1 |
| 13 |
* WC requires at least: 3.0.9 |
| 14 |
* WC tested up to: 6.2.1 |
| 15 |
* |
| 16 |
*/ |
| 17 |
|
| 18 |
|
| 19 |
if (!function_exists('add_settings_error')) { |
| 20 |
require_once ABSPATH . '/wp-admin/includes/template.php'; |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
if (!defined('HYPERPAY_PLUGIN_FILE')) { |
| 25 |
define('HYPERPAY_PLUGIN_FILE', __FILE__); |
| 26 |
} |
| 27 |
|
| 28 |
if (!defined('HYPERPAY_PLUGIN_DIR')) { |
| 29 |
|
| 30 |
define('HYPERPAY_PLUGIN_DIR', untrailingslashit(plugins_url('/', HYPERPAY_PLUGIN_FILE))); |
| 31 |
} |
| 32 |
|
| 33 |
if (!defined('HYPERPAY_ABSPATH')) { |
| 34 |
define('HYPERPAY_ABSPATH', dirname(HYPERPAY_PLUGIN_FILE) . '/'); |
| 35 |
} |
| 36 |
|
| 37 |
if (!class_exists('hyperpay_main', false)) { |
| 38 |
|
| 39 |
include_once dirname(HYPERPAY_PLUGIN_FILE) . '/includes/class-install.php'; |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* load styles |
| 44 |
*/ |
| 45 |
add_action( 'wp_enqueue_scripts', 'hyperpay_load_styles' ); |
| 46 |
|
| 47 |
function hyperpay_load_styles(){ |
| 48 |
|
| 49 |
// wp_enqueue_style('hyperpay_custom_style', HYPERPAY_PLUGIN_DIR . '/assets/css/style.css'); |
| 50 |
|
| 51 |
// if (substr( get_locale(),0 ,2) == 'ar') |
| 52 |
// wp_enqueue_style('hyperpay_custom_style', HYPERPAY_PLUGIN_DIR . '/assets/css/style-rtl.css'); |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
/** |
| 57 |
* Initialize the plugin and its modules. |
| 58 |
*/ |
| 59 |
|
| 60 |
add_action('plugins_loaded', ['hyperpay_main', 'load']); |
| 61 |
|
| 62 |
|
| 63 |
/* |
| 64 |
* Load plugin textdomain. |
| 65 |
*/ |
| 66 |
function hyperpay_plugin_load_textdomain() { |
| 67 |
|
| 68 |
load_plugin_textdomain( 'hyperpay-payments', false, basename( dirname( __FILE__ ) ) . '/languages' ); |
| 69 |
wp_enqueue_style('hyperpay_custom_style', HYPERPAY_PLUGIN_DIR . '/assets/css/style.css'); |
| 70 |
|
| 71 |
if (is_rtl()) |
| 72 |
wp_enqueue_style('hyperpay_custom_style_ar', HYPERPAY_PLUGIN_DIR . '/assets/css/style-rtl.css'); |
| 73 |
} |
| 74 |
|
| 75 |
add_action( 'init', 'hyperpay_plugin_load_textdomain' ); |
| 76 |
|