PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / wpcharitable / connect-callback.php

connect-callback.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/wpcharitable/connect-callback.php

33 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Charitable Connect callback endpoint.
4 *
5 * Called by upgrade.wpcharitable.com to activate or install Pro. This file
6 * loads WordPress and defines CHARITABLE_CONNECT_CALLBACK so the main plugin
7 * can run the actual callback on init at priority -9999, before any redirect
8 * (e.g. to login) runs. That way the upgrade server's request (no cookies)
9 * still gets JSON instead of the login page.
10 *
11 * @package Charitable
12 * @since 1.8.9.6
13 */
14
15 if ( ! defined( 'CHARITABLE_CONNECT_CALLBACK' ) ) {
16 define( 'CHARITABLE_CONNECT_CALLBACK', true );
17 }
18
19 $wp_root = dirname( dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) );
20 if ( ! file_exists( $wp_root . '/wp-load.php' ) ) {
21 header( 'Content-Type: application/json' );
22 echo json_encode( array( 'success' => false, 'data' => array( 'message' => 'WordPress not found.' ) ) );
23 exit;
24 }
25 require_once $wp_root . '/wp-load.php';
26
27 // If Charitable ran the callback on init -9999, execution already exited. Otherwise fallback.
28 if ( ! function_exists( 'charitable' ) || ! class_exists( 'Charitable_Admin_Connect' ) ) {
29 header( 'Content-Type: application/json' );
30 wp_send_json( array( 'success' => false, 'data' => array( 'message' => 'Charitable not loaded.' ) ) );
31 }
32 Charitable_Admin_Connect::get_instance()->process();
33