Improving detection of active event plugins: use caching and don't use WordPress internal constant WP_PLUGINS_DIR #87

Merged
linos merged 3 commits from plugin_review into main 2024-12-12 23:09:56 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 216665e002 - Show all commits

View file

@ -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' ) );

View file

@ -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' );