PluginProbe
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management / 1.0.0
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management v1.0.0
1.5.1 1.5.0 1.4.0 1.3.0 trunk 0.0.1 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0
suredonation / suredonation.php

suredonation.php in SureDonation – Donation Forms, Fundraising Campaigns & Donor Management 1.0.0, at suredonation.php

72 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: SureDonation
4 * Plugin URI: https://suredonation.com
5 * Description: A powerful donation management plugin for WordPress with campaign tracking, payment processing, and donor management.
6 * Version: 1.0.0
7 * Author: SureDonation
8 * Text Domain: suredonation
9 * Domain Path: /languages
10 * Requires at least: 6.4
11 * Requires PHP: 7.4
12 * License: GPL v2 or later
13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
14 *
15 * @package SureDonation
16 */
17
18 // Exit if accessed directly.
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit;
21 }
22
23 /**
24 * Define plugin constants.
25 */
26 // Plugin version. Keep in sync with the header above and package.json (drives release tagging).
27 define( 'SUREDONATION_VER', '1.0.0' );
28 define( 'SUREDONATION_FILE', __FILE__ );
29 define( 'SUREDONATION_DIR', plugin_dir_path( __FILE__ ) );
30 define( 'SUREDONATION_URL', plugin_dir_url( __FILE__ ) );
31 define( 'SUREDONATION_BASENAME', plugin_basename( __FILE__ ) );
32 define( 'SUREDONATION_POST_TYPE', 'suredonation_cmpgn' );
33
34 /**
35 * Middleware base URL for payment processing.
36 *
37 * Pre-define this constant in `wp-config.php` or a mu-plugin to point at a
38 * local/staging middleware. The `defined()` guard prevents the production
39 * default from emitting a redefinition warning when an override is in place.
40 */
41 if ( ! defined( 'SUREDONATION_MIDDLEWARE_BASE_URL' ) ) {
42 define( 'SUREDONATION_MIDDLEWARE_BASE_URL', 'https://api.sureforms.com/' );
43 }
44
45 /**
46 * Abilities API constants.
47 */
48 define( 'SUREDONATION_ABILITY_API_NAMESPACE', 'suredonation/' );
49
50 /**
51 * Load the plugin loader.
52 */
53 require_once SUREDONATION_DIR . 'plugin-loader.php';
54
55 /**
56 * Register Abilities API integration (WordPress 6.9+).
57 * Graceful degradation: if Abilities API is not available, the plugin functions normally.
58 */
59 if ( class_exists( 'WP_Ability' ) ) {
60 $suredonation_ai_settings = SureDonation\Inc\Helper::get_suredonation_option( 'ai_settings', [] );
61 if ( is_array( $suredonation_ai_settings ) && ! empty( $suredonation_ai_settings['enable_abilities'] ) ) {
62 $suredonation_ability = new SureDonation\Inc\Abilities\Runtime();
63 add_action( 'wp_abilities_api_categories_init', [ $suredonation_ability, 'register_categories' ] );
64 add_action( 'wp_abilities_api_init', [ $suredonation_ability, 'register' ] );
65
66 // Register dedicated MCP server when enabled and MCP adapter is available.
67 if ( ! empty( $suredonation_ai_settings['mcp_server'] ) && class_exists( 'WP\MCP\Plugin' ) ) {
68 add_action( 'mcp_adapter_init', [ $suredonation_ability, 'register_mcp_server' ] );
69 }
70 }
71 }
72