André Menrath
4aad867d1f
See the results of the poll: https://graz.social/@linos/113214893071983918 Reviewed-on: Event-Federation/wordpress-activitypub-event-bridge#47 Co-authored-by: André Menrath <andre.menrath@posteo.de> Co-committed-by: André Menrath <andre.menrath@posteo.de>
72 lines
2.5 KiB
PHP
72 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: ActivityPub Event Bridge
|
|
* Description: Integrating popular event plugins with the ActivityPub plugin.
|
|
* Plugin URI: https://event-federation.eu/
|
|
* Version: 0.1.0
|
|
* Author: André Menrath
|
|
* Author URI: https://graz.social/@linos
|
|
* Text Domain: activitypub-event-bridge
|
|
* License: AGPL-3.0-or-later
|
|
* License URI: https://www.gnu.org/licenses/agpl-3.0.de.html
|
|
* Requires PHP: 8.1
|
|
*
|
|
* Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.2.2.
|
|
*
|
|
* @package ActivityPub_Event_Bridge
|
|
* @license AGPL-3.0-or-later
|
|
*/
|
|
|
|
// Exit if accessed directly.
|
|
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
|
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_DOMAIN', 'activitypub-event-bridge' );
|
|
define( 'ACTIVITYPUB_EVENT_BRIDGE_ACTIVITYPUB_PLUGIN_MIN_VERSION', '3.2.2' );
|
|
|
|
// Include and register the autoloader class for automatic loading of plugin classes.
|
|
require_once ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_DIR . '/includes/class-autoloader.php';
|
|
ActivityPub_Event_Bridge\Autoloader::register();
|
|
|
|
// Initialize the plugin.
|
|
ActivityPub_Event_Bridge\Setup::get_instance();
|
|
|
|
// BeforeFirstRelease: Remove everything after this after here.
|
|
|
|
/**
|
|
* Add a filter for http_request_host_is_external
|
|
*
|
|
* BeforeFirstRelease: Remove this for release.
|
|
*/
|
|
add_filter( 'http_request_host_is_external', 'activitypub_event_bridge_custom_http_request_host_is_external', 10, 3 );
|
|
|
|
/**
|
|
* Add a filter for http_request_host_is_external
|
|
*
|
|
* BeforeFirstRelease: Remove this for release.
|
|
*
|
|
* @param bool $is_external Whether the request is external.
|
|
*/
|
|
function activitypub_event_bridge_custom_http_request_host_is_external( $is_external ) {
|
|
$is_external = true;
|
|
|
|
return $is_external;
|
|
}
|
|
|
|
/**
|
|
* Don't verify ssl certs for testing.
|
|
*
|
|
* BeforeFirstRelease: Remove this for release.
|
|
*/
|
|
add_filter( 'https_ssl_verify', 'activitypub_event_bridge_dont_verify_local_dev_https', 10, 3 );
|
|
|
|
/**
|
|
* BeforeFirstRelease: remove it.
|
|
*/
|
|
function activitypub_event_bridge_dont_verify_local_dev_https() {
|
|
return false;
|
|
}
|