Improving detection of active event plugins: use caching and don't use WordPress internal constant WP_PLUGINS_DIR #87
2 changed files with 2 additions and 2 deletions
|
@ -188,7 +188,7 @@ class Setup {
|
|||
* @return void
|
||||
*/
|
||||
public function setup_hooks(): void {
|
||||
$this->detect_active_event_plugins();
|
||||
$this->detect_active_event_plugins();
|
||||
|
||||
register_activation_hook( EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_FILE, array( $this, 'activate' ) );
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ final class EventPrime extends Event_Plugin {
|
|||
* @see https://www.w3.org/wiki/SocialCG/ActivityPub/Primer/Authentication_Authorization#Authorized_fetch
|
||||
* @see https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
||||
*/
|
||||
if ( $activitypub_template && defined( 'ACTIVITYPUB_AUTHORIZED_FETCH') && constant( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) ) {
|
||||
if ( $activitypub_template && defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) && constant( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) ) {
|
||||
$verification = Signature::verify_http_signature( $_SERVER );
|
||||
if ( \is_wp_error( $verification ) ) {
|
||||
header( 'HTTP/1.1 401 Unauthorized' );
|
||||
|
|
Loading…
Reference in a new issue