| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Paytium |
| 5 |
* |
| 6 |
* @package PT |
| 7 |
* @author David de Boer <david@davdeb.com> |
| 8 |
* @license GPL-2.0+ |
| 9 |
* @link https://www.paytium.nl |
| 10 |
* @copyright 2015-2019 David de Boer |
| 11 |
* @copyright Paytium is based on Stripe Checkout by Phil Derksen and Stripe Checkout Companion by Kyle M. Brown |
| 12 |
* @copyright 2014-2015 Phil Derksen for Stripe Checkout |
| 13 |
* @copyright 2014-2015 Kyle M. Brown for Stripe Checkout Companion |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: Paytium |
| 17 |
* Plugin URI: https://www.paytium.nl |
| 18 |
* Description: Paytium, making payments in WordPress even more awesome! |
| 19 |
* Version: 5.0.0 |
| 20 |
* Author: David de Boer |
| 21 |
* Author URI: https://www.paytium.nl |
| 22 |
* License: GPL-2.0+ |
| 23 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 |
* Text Domain: paytium |
| 25 |
* Domain Path: /languages/ |
| 26 |
*/ |
| 27 |
|
| 28 |
// Exit if accessed directly. |
| 29 |
if ( ! defined( 'ABSPATH' ) ) { |
| 30 |
exit; |
| 31 |
} |
| 32 |
|
| 33 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 34 |
|
| 35 |
|
| 36 |
if ( class_exists( 'Paytium' ) ) { |
| 37 |
|
| 38 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 39 |
|
| 40 |
} else { |
| 41 |
|
| 42 |
|
| 43 |
if ( ! defined( 'PT_MAIN_FILE' ) ) { |
| 44 |
define( 'PT_MAIN_FILE', __FILE__ ); |
| 45 |
} |
| 46 |
|
| 47 |
if ( ! defined( 'PT_PATH' ) ) { |
| 48 |
define( 'PT_PATH', plugin_dir_path( __FILE__ ) ); |
| 49 |
} |
| 50 |
|
| 51 |
if ( ! defined( 'PT_URL' ) ) { |
| 52 |
define( 'PT_URL', plugins_url( '', __FILE__ ) . '/' ); |
| 53 |
} |
| 54 |
|
| 55 |
if ( ! defined( 'PT_VERSION' ) ) { |
| 56 |
define( 'PT_VERSION', '5.0.0' ); |
| 57 |
} |
| 58 |
|
| 59 |
if ( ! defined( 'PT_NAME' ) ) { |
| 60 |
define( 'PT_NAME', 'Paytium' ); |
| 61 |
} |
| 62 |
|
| 63 |
if ( ! defined( 'PT_PACKAGE' ) ) { |
| 64 |
define( 'PT_PACKAGE', 'paytium' ); |
| 65 |
} |
| 66 |
|
| 67 |
if ( ! defined( 'PT_WEBSITE_URL' ) ) { |
| 68 |
define( 'PT_WEBSITE_URL', 'https://www.paytium.nl/' ); |
| 69 |
} |
| 70 |
|
| 71 |
/** |
| 72 |
* Registration & activation hook |
| 73 |
*/ |
| 74 |
function install_paytium() { |
| 75 |
|
| 76 |
// Add value to indicate that we should show admin notice for setup wizard. |
| 77 |
update_option( 'pt_show_admin_notice_setup_wizard', 1 ); |
| 78 |
|
| 79 |
// Add value to indicate that we should show admin notice for newsletter. |
| 80 |
update_option( 'pt_show_admin_notice_newsletter', 1 ); |
| 81 |
|
| 82 |
// Add value to indicate that we should show admin notice for extensions. |
| 83 |
update_option( 'pt_show_admin_notice_extensions', 1 ); |
| 84 |
|
| 85 |
// Other options |
| 86 |
update_option( 'paytium_enable_remember', 1 ); |
| 87 |
update_option( 'paytium_uninstall_save_settings', 1 ); |
| 88 |
update_option( 'paytium_always_enqueue', 1 ); |
| 89 |
|
| 90 |
if ( ! function_exists( 'curl_version' ) ) { |
| 91 |
wp_die( sprintf( __( 'You must have the cURL extension enabled in order to run %s. Please enable cURL and try again. <a href="%s">Return to Plugins</a>.', 'paytium' ), |
| 92 |
PT_NAME, get_admin_url( '', 'plugins.php' ) ) ); |
| 93 |
} |
| 94 |
|
| 95 |
// Remove old log file format |
| 96 |
if ( file_exists( plugin_dir_path( __FILE__ ) . 'logs.txt' ) ) { |
| 97 |
unlink( plugin_dir_path( __FILE__ ) . 'logs.txt' ); |
| 98 |
} |
| 99 |
|
| 100 |
} |
| 101 |
|
| 102 |
register_activation_hook( PT_MAIN_FILE, 'install_paytium' ); |
| 103 |
|
| 104 |
/** |
| 105 |
* Load plugin text domain (for translation files) |
| 106 |
*/ |
| 107 |
load_plugin_textdomain( |
| 108 |
'paytium', |
| 109 |
null, |
| 110 |
dirname( plugin_basename( PT_MAIN_FILE ) ) . '/languages/' |
| 111 |
); |
| 112 |
|
| 113 |
/** |
| 114 |
* Get Paytium class. |
| 115 |
*/ |
| 116 |
if ( ! class_exists( 'Paytium' ) ) { |
| 117 |
require_once( PT_PATH . 'class-paytium.php' ); |
| 118 |
} |
| 119 |
|
| 120 |
/** |
| 121 |
* @return Paytium |
| 122 |
*/ |
| 123 |
function Paytium() { |
| 124 |
|
| 125 |
$paytium = Paytium::get_instance(); |
| 126 |
|
| 127 |
require_once( PT_PATH . 'includes/class-shortcode-tracker.php' ); |
| 128 |
Paytium_Shortcode_Tracker::get_instance(); |
| 129 |
|
| 130 |
return $paytium; |
| 131 |
|
| 132 |
} |
| 133 |
|
| 134 |
Paytium(); |
| 135 |
} |
| 136 |
|
| 137 |
|