wordpress-activitypub-event.../activitypub-event-extensions.php

76 lines
2.2 KiB
PHP
Raw Permalink Normal View History

2023-11-24 15:36:51 +01:00
<?php
/**
2024-01-12 18:02:37 +01:00
* Plugin Name: ActivityPub Event Extensions
2024-07-05 15:10:48 +02:00
* Description: Custom ActivityPub Transformers and Integrations for common Event Plugins.
2023-11-24 15:36:51 +01:00
* Plugin URI: https://event-federation.eu/
* Version: 1.0.0
* Author: André Menrath
* Author URI: https://graz.social/@linos
2024-01-12 18:02:37 +01:00
* Text Domain: activitypub-event-extensions
2023-12-04 19:27:57 +01:00
* License: AGPL-3.0-or-later
2023-11-24 15:36:51 +01:00
*
* ActivityPub tested up to: 2.4.0
*
2024-01-12 18:02:37 +01:00
* @package activitypub-event-extensions
2023-12-04 19:27:57 +01:00
* @license AGPL-3.0-or-later
2023-11-24 15:36:51 +01:00
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
2023-11-24 15:36:51 +01:00
define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_VERSION', '1.0.0' );
2024-01-03 19:14:12 +01:00
define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) );
define( 'ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Include and register the autoloader class for automatic loading of plugin classes.
require_once ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . '/includes/class-autoloader.php';
Activitypub_Event_Extensions\Autoloader::register();
// Initialize the plugin.
Activitypub_Event_Extensions\Setup::get_instance();
// For local development purposes: TODO. Remove everything after here.
2024-01-03 19:31:01 +01:00
/**
* Add a filter for http_request_host_is_external
*
* TODO: Remove this for release.
2024-01-03 19:31:01 +01:00
*
* @todo This filter is temporary code needed to do local testing.
*/
add_filter( 'http_request_host_is_external', 'custom_http_request_host_is_external', 10, 3 );
/**
* Add a filter for http_request_host_is_external
*
* TODO: Remove this for release.
*
* @todo This filter is temporary code needed to do local testing.
*/
2024-01-03 19:31:01 +01:00
function custom_http_request_host_is_external( $is_external, $host, $url ) {
$is_external = true;
2024-01-03 19:31:01 +01:00
return $is_external;
}
2024-01-03 19:31:01 +01:00
/**
* Don't verify ssl certs for testing.
*
* TODO: Remove this for release.
2024-01-03 19:31:01 +01:00
*
* @todo This filter is temporary code needed to do local testing.
*/
add_filter( 'https_ssl_verify', 'dont_verify_local_dev_https', 10, 3 );
2024-01-03 19:31:01 +01:00
function dont_verify_local_dev_https( $url ) {
return false;
}