@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | * @global $wp_version |
| 25 | 25 | * @return void |
| 26 | 26 | */ |
| 27 | -function give_install( $network_wide = false ) { |
|
| 27 | +function give_install($network_wide = false) { |
|
| 28 | 28 | |
| 29 | 29 | global $wpdb; |
| 30 | 30 | |
| 31 | - if ( is_multisite() && $network_wide ) { |
|
| 31 | + if (is_multisite() && $network_wide) { |
|
| 32 | 32 | |
| 33 | - foreach ( $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs LIMIT 100" ) as $blog_id ) { |
|
| 33 | + foreach ($wpdb->get_col("SELECT blog_id FROM $wpdb->blogs LIMIT 100") as $blog_id) { |
|
| 34 | 34 | |
| 35 | - switch_to_blog( $blog_id ); |
|
| 35 | + switch_to_blog($blog_id); |
|
| 36 | 36 | give_run_install(); |
| 37 | 37 | restore_current_blog(); |
| 38 | 38 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' ); |
|
| 49 | +register_activation_hook(GIVE_PLUGIN_FILE, 'give_install'); |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Run the Give Install process |
@@ -62,25 +62,25 @@ discard block |
||
| 62 | 62 | give_setup_post_types(); |
| 63 | 63 | |
| 64 | 64 | // Clear the permalinks |
| 65 | - flush_rewrite_rules( false ); |
|
| 65 | + flush_rewrite_rules(false); |
|
| 66 | 66 | |
| 67 | 67 | // Add Upgraded From Option |
| 68 | - $current_version = get_option( 'give_version' ); |
|
| 69 | - if ( $current_version ) { |
|
| 70 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
| 68 | + $current_version = get_option('give_version'); |
|
| 69 | + if ($current_version) { |
|
| 70 | + update_option('give_version_upgraded_from', $current_version); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Setup some default options |
| 74 | 74 | $options = array(); |
| 75 | 75 | |
| 76 | 76 | // Checks if the Success Page option exists AND that the page exists |
| 77 | - if ( ! get_post( give_get_option( 'success_page' ) ) ) { |
|
| 77 | + if ( ! get_post(give_get_option('success_page'))) { |
|
| 78 | 78 | |
| 79 | 79 | // Purchase Confirmation (Success) Page |
| 80 | 80 | $success = wp_insert_post( |
| 81 | 81 | array( |
| 82 | - 'post_title' => __( 'Donation Confirmation', 'give' ), |
|
| 83 | - 'post_content' => __( '[give_receipt]', 'give' ), |
|
| 82 | + 'post_title' => __('Donation Confirmation', 'give'), |
|
| 83 | + 'post_content' => __('[give_receipt]', 'give'), |
|
| 84 | 84 | 'post_status' => 'publish', |
| 85 | 85 | 'post_author' => 1, |
| 86 | 86 | 'post_type' => 'page', |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Checks if the Failure Page option exists AND that the page exists |
| 96 | - if ( ! get_post( give_get_option( 'failure_page' ) ) ) { |
|
| 96 | + if ( ! get_post(give_get_option('failure_page'))) { |
|
| 97 | 97 | |
| 98 | 98 | // Failed Purchase Page |
| 99 | 99 | $failed = wp_insert_post( |
| 100 | 100 | array( |
| 101 | - 'post_title' => __( 'Transaction Failed', 'give' ), |
|
| 102 | - 'post_content' => __( 'We\'re sorry, your transaction failed to process. Please try again or contact site support.', 'give' ), |
|
| 101 | + 'post_title' => __('Transaction Failed', 'give'), |
|
| 102 | + 'post_content' => __('We\'re sorry, your transaction failed to process. Please try again or contact site support.', 'give'), |
|
| 103 | 103 | 'post_status' => 'publish', |
| 104 | 104 | 'post_author' => 1, |
| 105 | 105 | 'post_type' => 'page', |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | // Checks if the History Page option exists AND that the page exists |
| 114 | - if ( ! get_post( give_get_option( 'history_page' ) ) ) { |
|
| 114 | + if ( ! get_post(give_get_option('history_page'))) { |
|
| 115 | 115 | // Purchase History (History) Page |
| 116 | 116 | $history = wp_insert_post( |
| 117 | 117 | array( |
| 118 | - 'post_title' => __( 'Donation History', 'give' ), |
|
| 118 | + 'post_title' => __('Donation History', 'give'), |
|
| 119 | 119 | 'post_content' => '[donation_history]', |
| 120 | 120 | 'post_status' => 'publish', |
| 121 | 121 | 'post_author' => 1, |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | //Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency |
| 131 | - if ( empty( $current_version ) ) { |
|
| 131 | + if (empty($current_version)) { |
|
| 132 | 132 | $options['base_country'] = 'US'; |
| 133 | 133 | $options['test_mode'] = 1; |
| 134 | 134 | $options['currency'] = 'USD'; |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | // Populate some default values |
| 148 | - update_option( 'give_settings', array_merge( $give_options, $options ) ); |
|
| 149 | - update_option( 'give_version', GIVE_VERSION ); |
|
| 148 | + update_option('give_settings', array_merge($give_options, $options)); |
|
| 149 | + update_option('give_version', GIVE_VERSION); |
|
| 150 | 150 | |
| 151 | 151 | //Update Version Number |
| 152 | - if ( $current_version ) { |
|
| 153 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
| 152 | + if ($current_version) { |
|
| 153 | + update_option('give_version_upgraded_from', $current_version); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // Create Give roles |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $roles->add_caps(); |
| 160 | 160 | |
| 161 | 161 | $api = new Give_API(); |
| 162 | - update_option( 'give_default_api_version', 'v' . $api->get_version() ); |
|
| 162 | + update_option('give_default_api_version', 'v'.$api->get_version()); |
|
| 163 | 163 | |
| 164 | 164 | // Create the customers database |
| 165 | 165 | @Give()->customers->create_table(); |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | Give()->session->use_php_sessions(); |
| 169 | 169 | |
| 170 | 170 | // Add a temporary option to note that Give pages have been created |
| 171 | - set_transient( '_give_installed', $options, 30 ); |
|
| 171 | + set_transient('_give_installed', $options, 30); |
|
| 172 | 172 | |
| 173 | - if ( ! $current_version ) { |
|
| 173 | + if ( ! $current_version) { |
|
| 174 | 174 | |
| 175 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
| 175 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
| 176 | 176 | |
| 177 | 177 | // When new upgrade routines are added, mark them as complete on fresh install |
| 178 | 178 | $upgrade_routines = array( |
@@ -180,22 +180,22 @@ discard block |
||
| 180 | 180 | 'upgrade_give_offline_status' |
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | - foreach ( $upgrade_routines as $upgrade ) { |
|
| 184 | - give_set_upgrade_complete( $upgrade ); |
|
| 183 | + foreach ($upgrade_routines as $upgrade) { |
|
| 184 | + give_set_upgrade_complete($upgrade); |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // Bail if activating from network, or bulk |
| 189 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
| 189 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | // Add the transient to redirect |
| 194 | - set_transient( '_give_activation_redirect', true, 30 ); |
|
| 194 | + set_transient('_give_activation_redirect', true, 30); |
|
| 195 | 195 | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | -register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' ); |
|
| 198 | +register_activation_hook(GIVE_PLUGIN_FILE, 'give_install'); |
|
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | 201 | * Network Activated New Site Setup |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | * @param int $site_id The Site ID |
| 212 | 212 | * @param array $meta Blog Meta |
| 213 | 213 | */ |
| 214 | -function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { |
|
| 214 | +function on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) { |
|
| 215 | 215 | |
| 216 | - if ( is_plugin_active_for_network( GIVE_PLUGIN_BASENAME ) ) { |
|
| 216 | + if (is_plugin_active_for_network(GIVE_PLUGIN_BASENAME)) { |
|
| 217 | 217 | |
| 218 | - switch_to_blog( $blog_id ); |
|
| 218 | + switch_to_blog($blog_id); |
|
| 219 | 219 | give_install(); |
| 220 | 220 | restore_current_blog(); |
| 221 | 221 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | -add_action( 'wpmu_new_blog', 'on_create_blog', 10, 6 ); |
|
| 226 | +add_action('wpmu_new_blog', 'on_create_blog', 10, 6); |
|
| 227 | 227 | |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | * |
| 237 | 237 | * @return array The tables to drop |
| 238 | 238 | */ |
| 239 | -function give_wpmu_drop_tables( $tables, $blog_id ) { |
|
| 239 | +function give_wpmu_drop_tables($tables, $blog_id) { |
|
| 240 | 240 | |
| 241 | - switch_to_blog( $blog_id ); |
|
| 241 | + switch_to_blog($blog_id); |
|
| 242 | 242 | $customers_db = new Give_DB_Customers(); |
| 243 | - if ( $customers_db->installed() ) { |
|
| 243 | + if ($customers_db->installed()) { |
|
| 244 | 244 | $tables[] = $customers_db->table_name; |
| 245 | 245 | } |
| 246 | 246 | restore_current_blog(); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | -add_filter( 'wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2 ); |
|
| 252 | +add_filter('wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2); |
|
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * Post-installation |
@@ -261,35 +261,35 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | function give_after_install() { |
| 263 | 263 | |
| 264 | - if ( ! is_admin() ) { |
|
| 264 | + if ( ! is_admin()) { |
|
| 265 | 265 | return; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - $give_options = get_transient( '_give_installed' ); |
|
| 269 | - $give_table_check = get_option( '_give_table_check', false ); |
|
| 268 | + $give_options = get_transient('_give_installed'); |
|
| 269 | + $give_table_check = get_option('_give_table_check', false); |
|
| 270 | 270 | |
| 271 | - if ( false === $give_table_check || current_time( 'timestamp' ) > $give_table_check ) { |
|
| 271 | + if (false === $give_table_check || current_time('timestamp') > $give_table_check) { |
|
| 272 | 272 | |
| 273 | - if ( ! @Give()->customers->installed() ) { |
|
| 273 | + if ( ! @Give()->customers->installed()) { |
|
| 274 | 274 | // Create the customers database (this ensures it creates it on multisite instances where it is network activated) |
| 275 | 275 | @Give()->customers->create_table(); |
| 276 | 276 | |
| 277 | - do_action( 'give_after_install', $give_options ); |
|
| 277 | + do_action('give_after_install', $give_options); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - update_option( '_give_table_check', ( current_time( 'timestamp' ) + WEEK_IN_SECONDS ) ); |
|
| 280 | + update_option('_give_table_check', (current_time('timestamp') + WEEK_IN_SECONDS)); |
|
| 281 | 281 | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | // Delete the transient |
| 285 | - if ( false !== $give_options ) { |
|
| 286 | - delete_transient( '_give_installed' ); |
|
| 285 | + if (false !== $give_options) { |
|
| 286 | + delete_transient('_give_installed'); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | -add_action( 'admin_init', 'give_after_install' ); |
|
| 292 | +add_action('admin_init', 'give_after_install'); |
|
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -304,11 +304,11 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | global $wp_roles; |
| 306 | 306 | |
| 307 | - if ( ! is_object( $wp_roles ) ) { |
|
| 307 | + if ( ! is_object($wp_roles)) { |
|
| 308 | 308 | return; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - if ( ! array_key_exists( 'give_manager', $wp_roles->roles ) ) { |
|
| 311 | + if ( ! array_key_exists('give_manager', $wp_roles->roles)) { |
|
| 312 | 312 | |
| 313 | 313 | // Create Give plugin roles |
| 314 | 314 | $roles = new Give_Roles; |
@@ -319,4 +319,4 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | -add_action( 'admin_init', 'give_install_roles_on_network' ); |
|
| 323 | 322 | \ No newline at end of file |
| 323 | +add_action('admin_init', 'give_install_roles_on_network'); |
|
| 324 | 324 | \ No newline at end of file |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | // Exit if accessed directly |
| 43 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 43 | +if ( ! defined('ABSPATH')) {
|
|
| 44 | 44 | exit; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if ( ! class_exists( 'Give' ) ) : |
|
| 47 | +if ( ! class_exists('Give')) :
|
|
| 48 | 48 | /** |
| 49 | 49 | * Main Give Class |
| 50 | 50 | * |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | * @return Give |
| 160 | 160 | */ |
| 161 | 161 | public static function instance() {
|
| 162 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Give ) ) {
|
|
| 162 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Give)) {
|
|
| 163 | 163 | self::$instance = new Give; |
| 164 | 164 | self::$instance->setup_constants(); |
| 165 | 165 | |
| 166 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
| 166 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain'));
|
|
| 167 | 167 | |
| 168 | 168 | self::$instance->includes(); |
| 169 | 169 | self::$instance->roles = new Give_Roles(); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public function __clone() {
|
| 197 | 197 | // Cloning instances of the class is forbidden |
| 198 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
| 198 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
|
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function __wakeup() {
|
| 209 | 209 | // Unserializing instances of the class is forbidden |
| 210 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
| 210 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
|
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -220,33 +220,33 @@ discard block |
||
| 220 | 220 | private function setup_constants() {
|
| 221 | 221 | |
| 222 | 222 | // Plugin version |
| 223 | - if ( ! defined( 'GIVE_VERSION' ) ) {
|
|
| 224 | - define( 'GIVE_VERSION', '1.4.5' ); |
|
| 223 | + if ( ! defined('GIVE_VERSION')) {
|
|
| 224 | + define('GIVE_VERSION', '1.4.5');
|
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // Plugin Folder Path |
| 228 | - if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
|
|
| 229 | - define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
|
| 228 | + if ( ! defined('GIVE_PLUGIN_DIR')) {
|
|
| 229 | + define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | // Plugin Folder URL |
| 233 | - if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
|
|
| 234 | - define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
| 233 | + if ( ! defined('GIVE_PLUGIN_URL')) {
|
|
| 234 | + define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__));
|
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // Plugin Basename aka: "give/give.php" |
| 238 | - if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
|
|
| 239 | - define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
|
| 238 | + if ( ! defined('GIVE_PLUGIN_BASENAME')) {
|
|
| 239 | + define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // Plugin Root File |
| 243 | - if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
|
|
| 244 | - define( 'GIVE_PLUGIN_FILE', __FILE__ ); |
|
| 243 | + if ( ! defined('GIVE_PLUGIN_FILE')) {
|
|
| 244 | + define('GIVE_PLUGIN_FILE', __FILE__);
|
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | // Make sure CAL_GREGORIAN is defined |
| 248 | - if ( ! defined( 'CAL_GREGORIAN' ) ) {
|
|
| 249 | - define( 'CAL_GREGORIAN', 1 ); |
|
| 248 | + if ( ! defined('CAL_GREGORIAN')) {
|
|
| 249 | + define('CAL_GREGORIAN', 1);
|
|
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
@@ -260,107 +260,107 @@ discard block |
||
| 260 | 260 | private function includes() {
|
| 261 | 261 | global $give_options; |
| 262 | 262 | |
| 263 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/register-settings.php'; |
|
| 263 | + require_once GIVE_PLUGIN_DIR.'includes/admin/register-settings.php'; |
|
| 264 | 264 | $give_options = give_get_settings(); |
| 265 | 265 | |
| 266 | - require_once GIVE_PLUGIN_DIR . 'includes/post-types.php'; |
|
| 267 | - require_once GIVE_PLUGIN_DIR . 'includes/scripts.php'; |
|
| 268 | - require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php'; |
|
| 269 | - require_once GIVE_PLUGIN_DIR . 'includes/actions.php'; |
|
| 270 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php'; |
|
| 271 | - |
|
| 272 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; |
|
| 273 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php'; |
|
| 274 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php'; |
|
| 275 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php'; |
|
| 276 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customers.php'; |
|
| 277 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-customer.php'; |
|
| 278 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php'; |
|
| 279 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php'; |
|
| 280 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php'; |
|
| 281 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php'; |
|
| 282 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php'; |
|
| 283 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php'; |
|
| 284 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php'; |
|
| 285 | - |
|
| 286 | - require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php'; |
|
| 287 | - require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php'; |
|
| 288 | - require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php'; |
|
| 289 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php'; |
|
| 290 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php'; |
|
| 291 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php'; |
|
| 292 | - require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php'; |
|
| 293 | - require_once GIVE_PLUGIN_DIR . 'includes/formatting.php'; |
|
| 294 | - require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php'; |
|
| 295 | - require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php'; |
|
| 296 | - require_once GIVE_PLUGIN_DIR . 'includes/process-purchase.php'; |
|
| 297 | - require_once GIVE_PLUGIN_DIR . 'includes/login-register.php'; |
|
| 298 | - require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php'; |
|
| 299 | - require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php'; |
|
| 300 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated-functions.php'; |
|
| 301 | - |
|
| 302 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php'; |
|
| 303 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php'; |
|
| 304 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; |
|
| 305 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; |
|
| 306 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-donators-gravatars.php'; |
|
| 307 | - |
|
| 308 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php'; |
|
| 309 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php'; |
|
| 310 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; |
|
| 311 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php'; |
|
| 312 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php'; |
|
| 313 | - |
|
| 314 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php'; |
|
| 315 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php'; |
|
| 316 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php'; |
|
| 317 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
|
| 318 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
|
| 319 | - |
|
| 320 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
|
| 321 | - |
|
| 322 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php'; |
|
| 323 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php'; |
|
| 324 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php'; |
|
| 325 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-notices.php'; |
|
| 326 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
| 327 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php'; |
|
| 328 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php'; |
|
| 329 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/export-functions.php'; |
|
| 330 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; |
|
| 331 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php'; |
|
| 332 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; |
|
| 333 | - |
|
| 334 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; |
|
| 335 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; |
|
| 336 | - |
|
| 337 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php'; |
|
| 338 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php'; |
|
| 339 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php'; |
|
| 340 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php'; |
|
| 341 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php'; |
|
| 342 | - |
|
| 343 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php'; |
|
| 344 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php'; |
|
| 345 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php'; |
|
| 346 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php'; |
|
| 347 | - |
|
| 348 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
| 349 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php'; |
|
| 350 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php'; |
|
| 351 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
| 352 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php'; |
|
| 353 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php'; |
|
| 354 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
| 355 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
| 356 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
| 357 | - |
|
| 358 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
| 359 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php'; |
|
| 266 | + require_once GIVE_PLUGIN_DIR.'includes/post-types.php'; |
|
| 267 | + require_once GIVE_PLUGIN_DIR.'includes/scripts.php'; |
|
| 268 | + require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php'; |
|
| 269 | + require_once GIVE_PLUGIN_DIR.'includes/actions.php'; |
|
| 270 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php'; |
|
| 271 | + |
|
| 272 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php'; |
|
| 273 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php'; |
|
| 274 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php'; |
|
| 275 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php'; |
|
| 276 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customers.php'; |
|
| 277 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-customer.php'; |
|
| 278 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php'; |
|
| 279 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php'; |
|
| 280 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php'; |
|
| 281 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php'; |
|
| 282 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php'; |
|
| 283 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php'; |
|
| 284 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php'; |
|
| 285 | + |
|
| 286 | + require_once GIVE_PLUGIN_DIR.'includes/country-functions.php'; |
|
| 287 | + require_once GIVE_PLUGIN_DIR.'includes/template-functions.php'; |
|
| 288 | + require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php'; |
|
| 289 | + require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php'; |
|
| 290 | + require_once GIVE_PLUGIN_DIR.'includes/forms/template.php'; |
|
| 291 | + require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php'; |
|
| 292 | + require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php'; |
|
| 293 | + require_once GIVE_PLUGIN_DIR.'includes/formatting.php'; |
|
| 294 | + require_once GIVE_PLUGIN_DIR.'includes/price-functions.php'; |
|
| 295 | + require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php'; |
|
| 296 | + require_once GIVE_PLUGIN_DIR.'includes/process-purchase.php'; |
|
| 297 | + require_once GIVE_PLUGIN_DIR.'includes/login-register.php'; |
|
| 298 | + require_once GIVE_PLUGIN_DIR.'includes/user-functions.php'; |
|
| 299 | + require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php'; |
|
| 300 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated-functions.php'; |
|
| 301 | + |
|
| 302 | + require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php'; |
|
| 303 | + require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php'; |
|
| 304 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php'; |
|
| 305 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php'; |
|
| 306 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-donators-gravatars.php'; |
|
| 307 | + |
|
| 308 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php'; |
|
| 309 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php'; |
|
| 310 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php'; |
|
| 311 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php'; |
|
| 312 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php'; |
|
| 313 | + |
|
| 314 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php'; |
|
| 315 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php'; |
|
| 316 | + require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php'; |
|
| 317 | + require_once GIVE_PLUGIN_DIR.'includes/emails/template.php'; |
|
| 318 | + require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php'; |
|
| 319 | + |
|
| 320 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
|
|
| 321 | + |
|
| 322 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php'; |
|
| 323 | + require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php'; |
|
| 324 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php'; |
|
| 325 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-notices.php'; |
|
| 326 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
| 327 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php'; |
|
| 328 | + require_once GIVE_PLUGIN_DIR.'includes/admin/system-info.php'; |
|
| 329 | + require_once GIVE_PLUGIN_DIR.'includes/admin/export-functions.php'; |
|
| 330 | + require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php'; |
|
| 331 | + require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php'; |
|
| 332 | + require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php'; |
|
| 333 | + |
|
| 334 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php'; |
|
| 335 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php'; |
|
| 336 | + |
|
| 337 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customers.php'; |
|
| 338 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-functions.php'; |
|
| 339 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-actions.php'; |
|
| 340 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php'; |
|
| 341 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php'; |
|
| 342 | + |
|
| 343 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/reports.php'; |
|
| 344 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/pdf-reports.php'; |
|
| 345 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-give-graph.php'; |
|
| 346 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/graphing.php'; |
|
| 347 | + |
|
| 348 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
| 349 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php'; |
|
| 350 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php'; |
|
| 351 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
| 352 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php'; |
|
| 353 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php'; |
|
| 354 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
| 355 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
| 356 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
| 357 | + |
|
| 358 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
| 359 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrades.php'; |
|
| 360 | 360 | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - require_once GIVE_PLUGIN_DIR . 'includes/install.php'; |
|
| 363 | + require_once GIVE_PLUGIN_DIR.'includes/install.php'; |
|
| 364 | 364 | |
| 365 | 365 | } |
| 366 | 366 | |
@@ -373,26 +373,26 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | public function load_textdomain() {
|
| 375 | 375 | // Set filter for Give's languages directory |
| 376 | - $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/'; |
|
| 377 | - $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir ); |
|
| 376 | + $give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/'; |
|
| 377 | + $give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
|
|
| 378 | 378 | |
| 379 | 379 | // Traditional WordPress plugin locale filter |
| 380 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'give' ); |
|
| 381 | - $mofile = sprintf( '%1$s-%2$s.mo', 'give', $locale ); |
|
| 380 | + $locale = apply_filters('plugin_locale', get_locale(), 'give');
|
|
| 381 | + $mofile = sprintf('%1$s-%2$s.mo', 'give', $locale);
|
|
| 382 | 382 | |
| 383 | 383 | // Setup paths to current locale file |
| 384 | - $mofile_local = $give_lang_dir . $mofile; |
|
| 385 | - $mofile_global = WP_LANG_DIR . '/give/' . $mofile; |
|
| 384 | + $mofile_local = $give_lang_dir.$mofile; |
|
| 385 | + $mofile_global = WP_LANG_DIR.'/give/'.$mofile; |
|
| 386 | 386 | |
| 387 | - if ( file_exists( $mofile_global ) ) {
|
|
| 387 | + if (file_exists($mofile_global)) {
|
|
| 388 | 388 | // Look in global /wp-content/languages/give folder |
| 389 | - load_textdomain( 'give', $mofile_global ); |
|
| 390 | - } elseif ( file_exists( $mofile_local ) ) {
|
|
| 389 | + load_textdomain('give', $mofile_global);
|
|
| 390 | + } elseif (file_exists($mofile_local)) {
|
|
| 391 | 391 | // Look in local location from filter `give_languages_directory` |
| 392 | - load_textdomain( 'give', $mofile_local ); |
|
| 392 | + load_textdomain('give', $mofile_local);
|
|
| 393 | 393 | } else {
|
| 394 | 394 | // Load the default language files packaged up w/ Give |
| 395 | - load_plugin_textdomain( 'give', false, $give_lang_dir ); |
|
| 395 | + load_plugin_textdomain('give', false, $give_lang_dir);
|
|
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | } |