updated plugin Event Bridge for ActivityPub version 1.3.0

This commit is contained in:
2026-06-03 21:28:57 +00:00
committed by Gitium
parent 1f3438440f
commit f2d6714572
84 changed files with 1721 additions and 1361 deletions

View File

@ -12,7 +12,7 @@
namespace Event_Bridge_For_ActivityPub\Admin;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
\defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Webfinger;
use Event_Bridge_For_ActivityPub\ActivityPub\Model\Event_Source;
@ -69,7 +69,7 @@ class Settings_Page {
* @return void
*/
public static function maybe_add_event_source() {
if ( ! isset( $_POST['event_bridge_for_activitypub_add_event_source'] ) ) {
if ( ! \array_key_exists( '_wpnonce', $_REQUEST ) ) {
return;
}
@ -78,11 +78,15 @@ class Settings_Page {
return;
}
if ( ! isset( $_POST['event_bridge_for_activitypub_add_event_source'] ) ) {
return;
}
if ( ! \current_user_can( 'manage_options' ) ) {
return;
}
$event_source = \sanitize_text_field( $_POST['event_bridge_for_activitypub_add_event_source'] );
$event_source = \sanitize_text_field( \wp_unslash( $_POST['event_bridge_for_activitypub_add_event_source'] ) );
$actor_url = false;
$url = \wp_parse_url( $event_source );
@ -203,13 +207,13 @@ class Settings_Page {
private static function get_event_terms( $event_plugin ): array {
$taxonomy = $event_plugin::get_event_category_taxonomy();
if ( $taxonomy ) {
$event_terms = get_terms(
$event_terms = \get_terms(
array(
'taxonomy' => $taxonomy,
'hide_empty' => true,
)
);
return ! is_wp_error( $event_terms ) ? $event_terms : array();
return ! \is_wp_error( $event_terms ) ? $event_terms : array();
} else {
return array();
}