2019-09-28 03:41:19 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Plugin Name: Five For The Future
|
2019-10-01 03:04:49 +03:00
|
|
|
* Plugin URI: https://wordpress.org/five-for-the-future/
|
2019-09-28 03:41:19 +03:00
|
|
|
* Description:
|
|
|
|
* Author: WordPress.org
|
|
|
|
* Author URI: https://wordpress.org
|
|
|
|
* Version: 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace WordPressDotOrg\FiveForTheFuture;
|
2019-10-01 03:04:49 +03:00
|
|
|
|
2019-09-28 03:41:19 +03:00
|
|
|
defined( 'WPINC' ) || die();
|
|
|
|
|
|
|
|
define( __NAMESPACE__ . '\PATH', plugin_dir_path( __FILE__ ) );
|
|
|
|
define( __NAMESPACE__ . '\URL', plugin_dir_url( __FILE__ ) );
|
|
|
|
|
2019-10-01 03:04:49 +03:00
|
|
|
const PREFIX = '5ftf';
|
|
|
|
|
|
|
|
add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
|
|
|
|
|
2019-09-28 03:41:19 +03:00
|
|
|
/**
|
2019-10-24 17:55:45 +03:00
|
|
|
* Include the rest of the plugin.
|
2019-09-28 03:41:19 +03:00
|
|
|
*/
|
|
|
|
function load() {
|
2019-11-07 21:16:12 +02:00
|
|
|
$running_unit_tests = isset( $_SERVER['_'] ) && false !== strpos( $_SERVER['_'], 'phpunit' );
|
|
|
|
|
2019-11-20 17:40:45 +02:00
|
|
|
require_once get_includes_path() . 'authentication.php';
|
2019-10-22 01:43:20 +03:00
|
|
|
require_once get_includes_path() . 'contributor.php';
|
2019-10-25 22:07:09 +03:00
|
|
|
require_once get_includes_path() . 'email.php';
|
2019-11-20 18:01:00 +02:00
|
|
|
require_once get_includes_path() . 'endpoints.php';
|
2019-11-04 21:04:17 +02:00
|
|
|
require_once get_includes_path() . 'miscellaneous.php';
|
2024-05-23 12:32:10 +03:00
|
|
|
require_once get_includes_path() . 'pledge.php';
|
|
|
|
require_once get_includes_path() . 'pledge-form.php';
|
|
|
|
require_once get_includes_path() . 'pledge-meta.php';
|
|
|
|
require_once get_includes_path() . 'reports.php';
|
2019-12-06 18:03:54 +02:00
|
|
|
require_once get_includes_path() . 'stats.php';
|
2024-05-23 12:32:10 +03:00
|
|
|
require_once get_includes_path() . 'xprofile.php';
|
2019-11-07 21:16:12 +02:00
|
|
|
|
|
|
|
// The logger expects things like `$_POST` which aren't set during unit tests.
|
|
|
|
if ( ! $running_unit_tests ) {
|
|
|
|
require_once get_includes_path() . 'pledge-log.php';
|
|
|
|
}
|
2019-10-04 22:35:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shortcut to the assets directory.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function get_assets_path() {
|
|
|
|
return PATH . 'assets/';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shortcut to the assets URL.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function get_assets_url() {
|
|
|
|
return URL . 'assets/';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shortcut to the includes directory.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function get_includes_path() {
|
|
|
|
return PATH . 'includes/';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shortcut to the views directory.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function get_views_path() {
|
|
|
|
return PATH . 'views/';
|
2019-09-28 03:41:19 +03:00
|
|
|
}
|