From a035558e8fe0b041ed01224b4716aa0d14acdab1 Mon Sep 17 00:00:00 2001
From: Lai Power
Date: Tue, 28 Jul 2026 15:03:24 +0000
Subject: [PATCH] deleted plugin `Event Bridge for ActivityPub` version 1.3.0
---
.../.wp-env.test.json | 27 -
.../event-bridge-for-activitypub/CHANGELOG.md | 136 --
.../CONTRIBUTING.md | 44 -
.../event-bridge-for-activitypub/LICENSE | 235 ---
.../event-bridge-for-activitypub-admin.css | 236 ---
.../img/acknowledgement-NGI0Entrust.svg | 121 --
.../assets/img/acknowledgement-NLnet.svg | 1 -
.../assets/img/activitypub.svg | 288 ----
.../assets/img/fediverse.svg | 17 -
.../assets/img/gancio.png | Bin 3576 -> 0 bytes
.../assets/img/mastodon.svg | 10 -
.../assets/img/mobilizon.svg | 1 -
.../js/event-bridge-for-activitypub-admin.js | 34 -
.../build/reminder/block.json | 8 -
.../build/reminder/plugin.asset.php | 1 -
.../build/reminder/plugin.js | 1 -
.../event-bridge-for-activitypub.php | 39 -
.../includes/activitypub/class-handler.php | 35 -
.../collection/class-event-sources.php | 543 ------
.../activitypub/handler/class-accept.php | 76 -
.../activitypub/handler/class-create.php | 113 --
.../activitypub/handler/class-delete.php | 62 -
.../activitypub/handler/class-undo.php | 74 -
.../activitypub/handler/class-update.php | 39 -
.../activitypub/model/class-event-source.php | 373 ----
.../object/class-event-fep-8a8e.php | 101 --
.../activitypub/object/class-place.php | 119 --
.../activitypub/scheduler/class-event.php | 116 --
.../event/class-event-organiser.php | 78 -
.../transformer/event/class-event.php | 683 --------
.../transformer/event/class-eventin.php | 166 --
.../transformer/event/class-eventon.php | 186 --
.../transformer/event/class-eventprime.php | 70 -
.../event/class-events-manager.php | 243 ---
.../transformer/event/class-gatherpress.php | 165 --
.../class-modern-events-calendar-lite.php | 129 --
.../event/class-spiffy-calendar.php | 140 --
.../event/class-the-events-calendar.php | 199 ---
.../transformer/event/class-vs-event-list.php | 115 --
.../event/class-wp-event-manager.php | 160 --
.../place/class-base-post-place.php | 146 --
.../place/class-base-term-place.php | 165 --
.../place/class-event-organiser.php | 89 -
.../transformer/place/class-eventon.php | 197 ---
.../transformer/place/class-eventprime.php | 59 -
.../place/class-events-manager.php | 95 --
.../transformer/place/class-gatherpress.php | 152 --
.../place/class-the-events-calendar.php | 81 -
.../activitypub/transmogrifier/class-base.php | 399 -----
.../transmogrifier/class-gatherpress.php | 207 ---
.../class-the-events-calendar.php | 412 -----
.../transmogrifier/class-vs-event-list.php | 175 --
.../transmogrifier/helper/class-sanitizer.php | 273 ---
...s-the-events-calendar-event-repository.php | 43 -
...e-events-calendar-organizer-repository.php | 43 -
...s-the-events-calendar-venue-repository.php | 67 -
.../class-event-plugin-admin-notices.php | 103 --
.../admin/class-general-admin-notices.php | 152 --
.../includes/admin/class-health-check.php | 204 ---
.../includes/admin/class-settings-page.php | 284 ----
.../includes/admin/class-user-interface.php | 101 --
.../includes/class-autoloader.php | 67 -
.../includes/class-debug.php | 41 -
.../includes/class-event-sources.php | 514 ------
.../includes/class-outbox-parser.php | 277 ---
.../includes/class-preview.php | 40 -
.../includes/class-reminder.php | 192 ---
.../includes/class-settings.php | 262 ---
.../includes/class-setup.php | 650 -------
.../includes/event-categories.php | 50 -
.../integrations/class-event-organiser.php | 115 --
.../class-event-plugin-integration.php | 133 --
.../includes/integrations/class-eventin.php | 75 -
.../includes/integrations/class-eventon.php | 96 --
.../integrations/class-eventprime.php | 172 --
.../integrations/class-events-manager.php | 96 --
.../integrations/class-gatherpress.php | 154 --
.../class-modern-events-calendar-lite.php | 76 -
.../integrations/class-spiffy-calendar.php | 81 -
.../class-the-events-calendar.php | 158 --
.../integrations/class-vs-event-list.php | 119 --
.../integrations/class-wp-event-manager.php | 74 -
.../interface-feature-event-sources.php | 42 -
.../includes/table/class-event-sources.php | 242 ---
.../event-bridge-for-activitypub/readme.txt | 161 --
.../templates/event-preview.php | 1510 -----------------
.../templates/settings/menu.php | 45 -
.../settings/subpages/event-sources.php | 233 ---
.../templates/settings/subpages/settings.php | 227 ---
.../templates/settings/subpages/welcome.php | 246 ---
.../templates/settings/tab.php | 13 -
91 files changed, 14792 deletions(-)
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/.wp-env.test.json
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/CHANGELOG.md
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/CONTRIBUTING.md
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/LICENSE
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/css/event-bridge-for-activitypub-admin.css
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NGI0Entrust.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NLnet.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/activitypub.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/fediverse.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/gancio.png
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/mastodon.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/img/mobilizon.svg
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/assets/js/event-bridge-for-activitypub-admin.js
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/build/reminder/block.json
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.asset.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.js
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/event-bridge-for-activitypub.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/class-handler.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/collection/class-event-sources.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-accept.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-create.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-delete.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-undo.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-update.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/model/class-event-source.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/object/class-event-fep-8a8e.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/object/class-place.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/scheduler/class-event.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event-organiser.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventin.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventon.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventprime.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-events-manager.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-gatherpress.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-modern-events-calendar-lite.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-spiffy-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-the-events-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-vs-event-list.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-wp-event-manager.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-post-place.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-term-place.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-event-organiser.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventon.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventprime.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-events-manager.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-gatherpress.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-the-events-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-base.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-gatherpress.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-the-events-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-vs-event-list.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-sanitizer.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-event-repository.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-organizer-repository.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-venue-repository.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-event-plugin-admin-notices.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-general-admin-notices.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-health-check.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-settings-page.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-user-interface.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-autoloader.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-debug.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-event-sources.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-outbox-parser.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-preview.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-reminder.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-settings.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/class-setup.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/event-categories.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-event-organiser.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-event-plugin-integration.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-eventin.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-eventon.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-eventprime.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-events-manager.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-gatherpress.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-modern-events-calendar-lite.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-spiffy-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-the-events-calendar.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-vs-event-list.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/class-wp-event-manager.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/integrations/interface-feature-event-sources.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/includes/table/class-event-sources.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/readme.txt
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/event-preview.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/settings/menu.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/settings/subpages/event-sources.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/settings/subpages/settings.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/settings/subpages/welcome.php
delete mode 100644 wp-content/plugins/event-bridge-for-activitypub/templates/settings/tab.php
diff --git a/wp-content/plugins/event-bridge-for-activitypub/.wp-env.test.json b/wp-content/plugins/event-bridge-for-activitypub/.wp-env.test.json
deleted file mode 100644
index 08f56d64..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/.wp-env.test.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "core": null,
- "plugins": [
- "https://downloads.wordpress.org/plugin/activitypub.8.3.0.zip",
- "https://downloads.wordpress.org/plugin/the-events-calendar.6.16.2.zip",
- "https://downloads.wordpress.org/plugin/very-simple-event-list.20.0.zip",
- "https://downloads.wordpress.org/plugin/gatherpress.0.33.3.zip",
- "https://downloads.wordpress.org/plugin/eventprime-event-calendar-management.4.3.4.0.zip",
- "https://downloads.wordpress.org/plugin/events-manager.7.2.3.1.zip",
- "https://downloads.wordpress.org/plugin/wp-event-solution.4.1.13.zip",
- "https://downloads.wordpress.org/plugin/event-organiser.3.12.8.zip",
- "https://downloads.wordpress.org/plugin/eventon-lite.2.5.4.zip",
- "https://codeberg.org/Event-Federation/modern-events-calendar-lite/releases/download/v7.27.0/modern-events-calendar-lite.zip",
- "https://downloads.wordpress.org/plugin/spiffy-calendar.5.0.11.zip",
- "wpeventmanager/wp-event-manager#3.3.5",
- "https://downloads.wordpress.org/plugin/plugin-check.1.9.0.zip",
- "."
- ],
- "testsEnvironment": true,
- "config": {
- "WP_DEBUG": true,
- "WP_DEBUG_LOG": true
- },
- "lifecycleScripts": {
- "afterStart": "wp-env run cli wp plugin deactivate --all --exclude=activitypub,event-bridge-for-activitypub"
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/CHANGELOG.md b/wp-content/plugins/event-bridge-for-activitypub/CHANGELOG.md
deleted file mode 100644
index c97f4858..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/CHANGELOG.md
+++ /dev/null
@@ -1,136 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-## [1.3.0] - 2026-05-24
-
-### Added
-
-* Basic support for Spiffy Calendar Plugin
-* Support for WordPress 7
-
-### Changed
-
-* Requires ActivityPub plugin 8.+
-
-### Fixed
-
-* The events calendar integration: remote cached organizers not being public.
-
-## [1.2.4] - 2026-05-17
-
-### Added
-
-* Flag plugin compatible with WordPress 6.9
-
-## [1.2.3] - 2026-05-17
-
-### Added
-
-* ActivityPub `Place` transformer for GatherPress
-
-### Fixed
-
-* Improve timezone detection for Eventin
-* GatherPress place name not uses venue name
-
-### Changed
-
-* Time formatting for EventPrime
-* Time formatting for VS Event List
-* Test up to ActivityPub plugin 8.2.1
-
-## [1.2.2] - 2025-11-21
-
-### Fixed
-
-* Validate event-tag info Events Manager to prevent fatal error
-* timezone issues for Modern Events Calendar Lite
-
-## [1.2.1] - 2025-11-13
-
-### Fixed
-
-* Incoming remote events getting federated
-
-### Added
-
-* Hotfix for Mobilizon group behavior to detect correct event source
-
-## [1.2.0] - 2025-11-12
-
-### Added
-
-* New filter hook for incoming events
-* Store longitude and latitude information for incoming The Events Calendar events
-
-### Changed
-
-* Update to new method how actor JSON is stored
-* Dependency: now requires PHP 8.1+
-* Dependency: now requires the WordPress ActivityPub plugin 7.5+
-
-### Fixed
-
-* Time offset for outgoing GatherPress events
-* Time offset for importing events with The Events Calendar
-
-## [1.1.1] - 2025-06-17
-
-### Added
-
-* Compatibility with ActivityPub plugin 6.0+
-
-### Changed
-
-* Improved scheduling of sending event posts
-
-### Fixed
-
-* Datetime timezone offset for incoming events when using The Events Calendar
-* Accessibility issues in Admin UI
-
-## [1.1.0] - 2025-04-12
-
-### Added
-
-* Basic support for Starter Kits
-
-### Fixed
-
-* Fixed: Uncatched error in following process (issue #145)
-* Fixed: Compatibility with ActivityPub plugin version 5.7.0
-
-## [1.0.0] - 2025-02-11
-
-### Changed
-
-* This plugin now depends on ActivityPub plugin version greater than 5.1.0
-
-### Added
-
-* Support for the EventPrime event plugin
-* Event self-announce feature at configurable time before event starts
-* Blueprint (Preview via WordPress Playground)
-* Event Sources feature: cache and list events from remote ActivityPub profiles on your site
-* Custom ActivityPub preview
-* Admin setting to enforce sending summary of events as plain text
-
-### Fixed
-
-* The Events Calendar date times when using the Gutenberg editor.
-* Improved admin UI for event-category mapping
-
-## [0.3.5] - 2025-01-03
-
-### Fixed
-
-* Images of Acknowledgements in Admin UI
-
-## [0.3.4] - 2024-12-21
-
-* Initial release on WordPress.org
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/CONTRIBUTING.md b/wp-content/plugins/event-bridge-for-activitypub/CONTRIBUTING.md
deleted file mode 100644
index 3f790ce3..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/CONTRIBUTING.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Contributing
-
-Thank you for considering contributing to Event Bridge For ActivityPub WordPress Plugin đ
-
-You can contribute in the following ways:
-
-- Finding and reporting bugs
-- Translating the plugin into various languages
-- Contributing code by fixing bugs or implementing features
-- Improving the documentation
-- Proposing ideas for new features
-
-## Bug reports
-
-Bug reports and feature suggestions must use descriptive and concise titles and be submitted to [Codeberg Issues](https://codeberg.org/Event-Federation/wordpress-event-bridge-for-activitypub/issues) or the [WordPress.org Support Forum](https://wordpress.org/support/plugin/event-bridge-for-activitypub/). Please use the search function to make sure that you are not submitting duplicates, and that a similar report or request has not already been resolved or rejected.
-
-## Translations
-
-You can submit translations via [translate.WordPress.org](https://translate.wordpress.org/projects/wp-plugins/event-bridge-for-activitypub/). These changes are merged by WordPress itself to each plugin installation.
-
-## Pull requests
-
-**Please use clean, concise titles for your pull requests.** Unless the pull request is about refactoring code or other internal tasks, assume that the person reading the pull request title is not a programmer or WordPress developer, but instead a WordPress user, and **try to describe your change or fix from their perspective**. We use commit squashing, so the final commit in the main branch will carry the title of the pull request, and commits from the main branch are fed into the changelog. The changelog is separated into [keepachangelog.com categories](https://keepachangelog.com/en/1.0.0/), and while that spec does not prescribe how the entries ought to be named, for easier sorting, start your pull request titles using one of the verbs "Add", "Change", "Deprecate", "Remove", or "Fix" (present tense).
-
-Example:
-
-| Not ideal | Better |
-| ------------------------------------ | ------------------------------------------------------------- |
-| Fixed NoMethodError in RemovalWorker | Fix nil error when removing statuses caused by race condition |
-
-It is not always possible to phrase every change in such a manner, but it is desired.
-
-**The smaller the set of changes in the pull request is, the quicker it can be reviewed and merged.** Splitting tasks into multiple smaller pull requests is often preferable.
-
-**Pull requests that do not pass automated checks may not be reviewed**. In particular, you need to keep in mind:
-
-- Unit and integration test (PHPUnit)
-- Code style rules (PHP_CodeSniffer)
-- [WordPress plugin guidelines](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/)
-
-## Documentation
-
-- Documentation for users is currently in the README.md and readme.txt files and the admin pages of the plugin (see the `.template/` folder), although this can change if it could be advantageous.
-- Documentation for developers is the the projects [Wiki](https://codeberg.org/Event-Federation/wordpress-event-bridge-for-activitypub/wiki).
diff --git a/wp-content/plugins/event-bridge-for-activitypub/LICENSE b/wp-content/plugins/event-bridge-for-activitypub/LICENSE
deleted file mode 100644
index 241d6f31..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/LICENSE
+++ /dev/null
@@ -1,235 +0,0 @@
-GNU AFFERO GENERAL PUBLIC LICENSE
-Version 3, 19 November 2007
-
-Copyright (C) 2007 Free Software Foundation, Inc.
-
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
-
- Preamble
-
-The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
-
-The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
-
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
-
-Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
-
-A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
-
-The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
-
-An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
-
-The precise terms and conditions for copying, distribution and modification follow.
-
- TERMS AND CONDITIONS
-
-0. Definitions.
-
-"This License" refers to version 3 of the GNU Affero General Public License.
-
-"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
-
-"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
-
-To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
-
-A "covered work" means either the unmodified Program or a work based on the Program.
-
-To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
-
-To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
-
-An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
-
-1. Source Code.
-The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
-
-A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
-
-The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
-
-The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
-
-The Corresponding Source for a work in source code form is that same work.
-
-2. Basic Permissions.
-All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
-
-You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
-
-Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
-
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
-
-When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
-
-4. Conveying Verbatim Copies.
-You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
-
-You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
-
-5. Conveying Modified Source Versions.
-You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
-
-A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
-
-6. Conveying Non-Source Forms.
-You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
-
- d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
-
-A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
-
-A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
-
-"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
-
-If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
-
-The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
-
-Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
-
-7. Additional Terms.
-"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
-
-When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
-
-Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
-
-All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
-
-If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
-
-Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
-
-8. Termination.
-
-You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
-
-However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
-
-Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
-
-9. Acceptance Not Required for Having Copies.
-
-You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
-
-10. Automatic Licensing of Downstream Recipients.
-
-Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
-
-An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
-
-You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
-
-11. Patents.
-
-A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
-
-A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
-
-Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
-
-In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
-
-If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
-
-If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
-
-A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
-
-Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
-
-12. No Surrender of Others' Freedom.
-
-If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
-
-13. Remote Network Interaction; Use with the GNU General Public License.
-
-Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
-
-Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
-
-14. Revised Versions of this License.
-
-The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
-
-If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
-
-Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
-
-15. Disclaimer of Warranty.
-
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. Limitation of Liability.
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-17. Interpretation of Sections 15 and 16.
-
-If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
-
-END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
-
- test
- Copyright (C) 2023 linos
-
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
-If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
-
-You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see .
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/css/event-bridge-for-activitypub-admin.css b/wp-content/plugins/event-bridge-for-activitypub/assets/css/event-bridge-for-activitypub-admin.css
deleted file mode 100644
index da750dba..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/css/event-bridge-for-activitypub-admin.css
+++ /dev/null
@@ -1,236 +0,0 @@
-.settings_page_event-bridge-for-activitypub #wpcontent {
- padding-left: 0;
-}
-
-.event-bridge-for-activitypub-settings-page .box {
- border: 1px solid #c3c4c7;
- background-color: #fff;
- padding: 1em 1.5em;
- margin-bottom: 1.5em;
-}
-
-.event-bridge-for-activitypub-settings-page .logo-center {
- width: 25%;
- margin: 10px 5% 10px 5%;
-}
-
-.event-bridge-for-activitypub-settings-page .box ul.event-bridge-for-activitypub-list {
- margin-left: 0.6em;
-}
-
-.event-bridge-for-activitypub-settings-page .box pre {
- padding: 1rem;
- min-height: 200px;
- box-shadow: none;
- border-radius: 15px;
- border: 1px solid #dfe0e2;
- background-color: #f7f7f7;
-}
-
-.event-bridge-for-activitypub-settings td {
- padding-top: 20px;
- padding-bottom: 20px;
-}
-
-.event-bridge-for-activitypub-settings-header {
- text-align: center;
- margin: 0 0 1rem;
-}
-
-.event-bridge-for-activitypub-settings-title-section {
- display: flex;
- align-items: center;
- justify-content: center;
- clear: both;
- padding-top: 8px;
-}
-
-.event-bridge-for-activitypub-settings-tabs-wrapper {
- display: -ms-inline-grid;
- -ms-grid-columns: auto auto auto auto;
- vertical-align: top;
- display: inline-grid;
- grid-template-columns: auto auto auto auto;
-}
-
-.event-bridge-for-activitypub-settings-tab.active {
- box-shadow: inset 0 -3px #3582c4;
- font-weight: 600;
-}
-
-.event-bridge-for-activitypub-settings-tab {
- display: block;
- text-decoration: none;
- color: inherit;
- padding: .5rem 1rem 1rem;
- margin: 0 1rem;
- transition: box-shadow .5s ease-in-out;
-}
-
-.event-bridge-for-activitypub-settings .box h3 {
- font-size: 1.15em;
- margin-bottom: 0em;
-}
-
-#event_bridge_for_activitypub_initially_activated {
- display: hidden;
-}
-
-/* Accordions for admin pages */
-.event-bridge-for-activitypub-settings-accordion {
- border: 1px solid #c3c4c7;
-}
-
-.event-bridge-for-activitypub-settings-accordion-heading {
- margin: 0;
- border-top: 1px solid #c3c4c7;
- font-size: inherit;
- line-height: inherit;
- font-weight: 600;
- color: inherit;
-}
-
-.event-bridge-for-activitypub-settings-accordion-heading:first-child {
- border-top: none;
-}
-
-.event-bridge-for-activitypub-settings-accordion-panel {
- margin: 0;
- padding: 1em 1.5em;
- background: #fff;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger {
- background: #fff;
- border: 0;
- color: #2c3338;
- cursor: pointer;
- display: flex;
- font-weight: 400;
- margin: 0;
- padding: 1em 3.5em 1em 1.5em;
- min-height: 46px;
- position: relative;
- text-align: left;
- width: 100%;
- align-items: center;
- justify-content: space-between;
- -webkit-user-select: auto;
- user-select: auto;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger {
- color: #2c3338;
- cursor: pointer;
- font-weight: 400;
- text-align: left;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger .title {
- pointer-events: none;
- font-weight: 600;
- flex-grow: 1;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger .icon,
-.event-bridge-for-activitypub-settings-accordion-viewed .icon {
- border: solid #50575e medium;
- border-width: 0 2px 2px 0;
- height: .5rem;
- pointer-events: none;
- position: absolute;
- right: 1.5em;
- top: 50%;
- transform: translateY(-70%) rotate(45deg);
- width: .5rem;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger[aria-expanded="true"] .icon {
- transform: translateY(-30%) rotate(-135deg);
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger:active,
-.event-bridge-for-activitypub-settings-accordion-trigger:hover {
- background: #f6f7f7;
-}
-
-.event-bridge-for-activitypub-settings-accordion-trigger:focus {
- color: #1d2327;
- border: none;
- box-shadow: none;
- outline-offset: -1px;
- outline: 2px solid #2271b1;
- background-color: #f6f7f7;
-}
-
-.event-bridge-for-activitypub-settings-inline-icon {
- width: 1.5em;
- height: 1.5em;
- vertical-align: middle;
- margin: 0 0.3em;
-}
-
-code.event-bridge-for-activitypub-settings-example-url {
- display: block;
- background: rgb(28, 29, 33);
- padding: 8px;
- margin: 10px 0px 10px 0;
- border-radius: 7px;
- color: #d5d5d6;
- overflow-x: auto;
- word-break: break-all;
-}
-
-#event_bridge_for_activitypub_summary_type_custom-details {
- display: none;
-}
-
-#event_bridge_for_activitypub_summary_type_custom-details > details {
- padding: 0.5em;
-}
-
-.event_bridge_for_activitypub-list {
- list-style: disc;
- padding-left: 22px;
-}
-
-.event_bridge_for_activitypub-admin-table-container {
- padding-left: 22px;
-}
-
-.event_bridge_for_activitypub-admin-table-top > h2 {
- display: inline-block;
- font-size: 23px;
- font-weight: 400;
- margin: 0 10px 0 2px;
- padding: 9px 0 4px;
- line-height: 1.3;
-}
-
-.event_bridge_for_activitypub-admin-table-top > a {
- display: inline-block;
-}
-
-.settings_page_event-bridge-for-activitypub .notice-warning {
- background: #fff;
- border: 1px solid #c3c4c7;
- border-left-width: 4px;
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
- margin: 5px 15px 2px;
- padding: 1px 12px;
- border-left-color: #dba617;
-}
-
-.event-bridge-for-activitypub-settings .select-cell::before {
- content: "\21D2";
- margin-right: 8px;
- color: inherit;
-}
-
-ul.event-bridge-for-activitypub-syntax-list {
- list-style: disc;
-}
-
-ul.event-bridge-for-activitypub-syntax-list > li {
- margin: 6px 6px 6px 20px;
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NGI0Entrust.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NGI0Entrust.svg
deleted file mode 100644
index 0d211b38..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NGI0Entrust.svg
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NLnet.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NLnet.svg
deleted file mode 100644
index 7980346a..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/acknowledgement-NLnet.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/activitypub.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/activitypub.svg
deleted file mode 100644
index f56d428f..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/activitypub.svg
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/fediverse.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/fediverse.svg
deleted file mode 100644
index a789df22..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/fediverse.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/gancio.png b/wp-content/plugins/event-bridge-for-activitypub/assets/img/gancio.png
deleted file mode 100644
index d53e1632fbb3fea130105b2cc79c4ccc7a93f296..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 3576
zcmZWsc{CJk+n*sbS!Qe*#!h5}ni>0+buhA&kR>APWE*3WkZtS(IRF3v1Z!q&bA*p1A>
zon`;ga0JJE3@i-*fPXSL_ubi!{*oSMHbBSN0B#@w0HzxNpmiSr
z5X4g-U(`7gK-bQj8Uz0PJ;hyB*+&dJ-pnxs01)r}Tfo548|RKlFcE8s0nY&iU}{47
zw`&Ig04^lf*uXYy@)H%8=4mI;A8q$Z*KdS4@`Ap_K+=zS5_ybU$x1OG9+d^~N#k5!
z7F4_t+uc4MN3Qj3PLnhf8S_3##5H|=+e}NZUTN(#u4n$xt*x!6c5m08{h6k{|77=w
z*+pBac@Ry23o*O)R{lH)S<#$-5TUHXQ>o_^19g*a5Y~7-C3Sf7e5{ol?=#cp<$x>d&9ABL;4LMI!4r=VId2(GXFePphdsEnK@ic+oXp#s!AH9PUAO
zc563FW=3c9-3H4BBze2r04
z{LoxM=cqLQYC*q`xX}{`dKn=R7Q`2Ur_J)7!p&bYEgu}mk~
zw{f3T)#Z0cdh=-d$>w3O5j}?6pRT86jU!CPsD5^m9udr}gKq(YsywqlvxWYeWAo6P
z3pj?gd|GL6+2CQgiTw-C7z%lApLbV$O$WXI9x%@;f!I8^nI9<_HuN%T0{lx)Vjof9
zzWI(Nl4}=4xWw|265D<9Qp58vV`8^Vp$++0aD#l_nW`GE7#I?Yq|NnCSW&rskfBKm
zW~ID&0cjQ5A7r3O9$dLX&Bwe?Z>hg$M3Uqngu{9!u<)-&xzI
z7(Aqtkvv^q1H!6dFBwljaw0?_Pa0%=&&eO((ld2fuM64{qRy}4tQt>2u66V*TYWf1
znx*!EuP{qJ1-L$=+n-0PSG@y=
zR8lXc!62_!nd`e8ym+UD&R7IdAcr%z>w+gn_miu?fk@F>@)^QZU%XG>aC~dO-Fk63
z-`DODA*wgNwx42CGJ{!4V$3&o}8Au{$=&y^$xP0#s^x-RVGt-J6v!C+>HDw!-poPENwItYPXEYO6_gdXGPVh0TVq)pJvJ`t7qcnd
zB-***+u1I-tGQ-l*w|=Ra0WcQzB61Fd|E^E>FW}#L|IN1XF5@8+)z#C_k+wXc8A3;
z2WR8FF|e3BT;YSeSI4&H+KjMUlC0FYYj39e&iGhPrCz(dzlh(j
z=Bp|K(e2a0YKyf0zile0gHD!RobvBh}w_Jl*86GkY1G
zgc!AoQ*4M$sa^FqRv3RFjSGq4A7$FHYsW@sM`DYTPMxHzb$A=W>S+1MOsi&jzN9*Y
zSoR4q1nG&MBx}XTs|o&2qH1Lck~Qv5X`wW4Z7%C*@c858tEwUNseu}c)X
zOW{(Pp-95QY4_tbJ`d&`;{AL4O(pLtIte_caryHkz;UB54-E=RkPms(P`SLT#O<;|
zs!F=Owo{>xc5fxr(G9o}Iy*{ILyfzgW8c0^5lRdKc#$Pq+6P%n7Gxmbl_QL*5UF27
zFO1x>6aSDfpT#FlGNUY~2k48Na~e=f)XE=t$ZNfnj!>g`3?sNPdUf~0D3|oHPYqMk
z(MuBBT&KwP=M^=LAAefpYV_H=Q!emUc^@;KF<}Nzet7Wwfxsvet3c*^g%jQ-uAXLV
zVaF|sR&bPdA*3BAVuBDnA0623;)2Z<$H4LdTlU}87#HX8Nn$i#d0bIjpzSj8YgF#~EdKUk?JtG+!R?uv4UmTzjay#MYa+HZ+*CU(HY>>m3NAB(VR@l=RbjZf
zsRXIq(uYvIyW($r?K9?i_`L=mfkxX`8&)rl6L8*`Pr+QN35jF*KMaz3XL9H7TGXXJ
zOw=LZgqIn^DybW)j?^NPT3^|R7*%gOZd+p>bLIY>pVf=T?YM*{R?9+-!W-G$SUc3T(CjQrWXUV0
zEjj(e*$ye}qgcgvI#o{w%EU=HsF}WFolambJUQLTkYSvs4}lI;ldp*H>JA3n7SJf1
z%#OQdF1zeup_6@%p_J2;r2Ig0juDEPEO~R2)}e!gr-m}w8SV_5!CH3_JZeoEpJz}4
znt2i1UHWjb>Vo4wuNh%VdM=)|L3@n$L=4Le{1YA9oH?29s(>>2aXrPp=zi#&hbw1f
z;#P_6Mcpb%8`h}QqK9`BGNL~-X63C06BOjt06v;2MaIuxi)4BdC5sv^I>*dk*btm(
zZX4y@+*rFhq})E{*3J>kEhL&B*Pj1En6a*9HWdf!`Ox5Ttew@Rg(s;gc9o&JZE0~u
zolr9_EyFUH4I4`sqGx0l*|FCR*iY++@T)J)no%(6a*)(MxD!v5dE{Ui^znx|81W@m
znJ>@u&LDnp-nqI$164Yzz!kW;SrojjVfhQm>Z0EFR=*?OKZZp4
z;Qy)p6$js1Y(y|Mpu6XsM#nSN;>H)1aF1A6#Y&!XwexAFx9Ch}G>VOsdSp^YRkb>_
zTn-!5M-%Pa*?a|QoEm())!D7N#PxY(YGDwIYd~K`h!5~`wxWQme(-D;{ky;D2+Enf#(#p
zpDXF@+nGJFJ3nr?AYOmGGn^B+(>kFS$z9>x&}(TYrJo_r2(o=uqMLnwEY!{8Yu9V_
zPb{09B$vusB8|N5L%O%aRIMdXsu37C=d){m<+_*9B9NNS?VNF>`Mn^PLqH_(+Yq#P
zTk-kRZ3~mJ!_~86x?)~Cej@hu;vL3i+!e2j3@J!K=?!T4tvk8T4*YMH9b5A2>#K%5
zTIWX9;&N9oDg7Q}&xuuK#ZMiFo4Ct#KC+rM9vVSz$W4SIr43!VPoIwB;|=A=qR&19
zPv-Pj3M7sje>KT7%@k2_TI8%eP{GD0@LnPhDJ%qL+&~EEu3f_+C;m|v?))WQ9yd~a
zw@fg(!@cAc6xZw1S{
zmN4uWgX-ipyzNX2%uZ3sX!yDY6n=d#qA)E0(HkcAk+wWAFH#)q9R3HaK<|83>tbDf
zv`)wpF%CpeccPb;2f^zI0B9r{sf0u+p;5MIl$NTBma>Wh5~YPi%JDVc`kz2RkSEUj
z*8dNn|1VJRjl=mUApEz3R~XJ)%MeElx!^^(2RGT1yqJrJ`XcD)jWoeBxg-Ho)D-%fc(rhv*AHqckOi#5<03{{Pi4
z<2?T>zxITx9Ley1R)hHi2H0kbb&
A-v9sr
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/mastodon.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/mastodon.svg
deleted file mode 100644
index 0f8baebf..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/mastodon.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/img/mobilizon.svg b/wp-content/plugins/event-bridge-for-activitypub/assets/img/mobilizon.svg
deleted file mode 100644
index 8b5d57e5..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/img/mobilizon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/wp-content/plugins/event-bridge-for-activitypub/assets/js/event-bridge-for-activitypub-admin.js b/wp-content/plugins/event-bridge-for-activitypub/assets/js/event-bridge-for-activitypub-admin.js
deleted file mode 100644
index 3715707b..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/assets/js/event-bridge-for-activitypub-admin.js
+++ /dev/null
@@ -1,34 +0,0 @@
-jQuery( function( $ ) {
- // Accordion handling in various areas.
- $( '.event-bridge-for-activitypub-settings-accordion' ).on( 'click', '.event-bridge-for-activitypub-settings-accordion-trigger', function() {
- var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
-
- if ( isExpanded ) {
- $( this ).attr( 'aria-expanded', 'false' );
- $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true );
- } else {
- $( this ).attr( 'aria-expanded', 'true' );
- $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
- }
- } );
-
- // Function to toggle visibility of custom details based on selected radio button.
- function toggleCustomDetailsForSummary() {
- if ($("#event_bridge_for_activitypub_summary_type_custom").is(':checked')) {
- $("#event_bridge_for_activitypub_summary_type_custom-details").show();
- } else {
- $("#event_bridge_for_activitypub_summary_type_custom-details").hide();
- }
- }
-
- // Run the toggle function on page load.
- $(document).ready(function() {
- toggleCustomDetailsForSummary(); // Set the correct state on load.
-
- // Listen for changes on the radio buttons
- $("input[name=event_bridge_for_activitypub_summary_type]").change(function() {
- toggleCustomDetailsForSummary(); // Update visibility on change.
- });
- });
-
-} );
diff --git a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/block.json b/wp-content/plugins/event-bridge-for-activitypub/build/reminder/block.json
deleted file mode 100644
index ad2fc046..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/block.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "name": "reminder",
- "title": "Reminder Plugin: not a block, but block.json is very useful.",
- "category": "widgets",
- "icon": "admin-comments",
- "keywords": [],
- "editorScript": "file:./plugin.js"
-}
\ No newline at end of file
diff --git a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.asset.php b/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.asset.php
deleted file mode 100644
index 169666b7..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-i18n', 'wp-plugins'), 'version' => 'd491284dfb7e5078a777');
diff --git a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.js b/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.js
deleted file mode 100644
index cd5cfa27..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/build/reminder/plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{"use strict";const e=window.wp.editor,t=window.wp.plugins,i=window.wp.components,n=window.wp.data,a=window.wp.coreData,r=window.wp.i18n,d=window.ReactJSXRuntime,p=activityPubEventBridge.reminderTypeGap;(0,t.registerPlugin)("event-bridge-for-activitypub-reminder",{render:()=>{const t=(0,n.useSelect)((e=>e("core/editor").getCurrentPostType()),[]),[_,b]=(0,a.useEntityProp)("postType",t,"meta"),u=_?.event_bridge_for_activitypub_reminder_time_gap?_?.event_bridge_for_activitypub_reminder_time_gap:p;return(0,d.jsx)(e.PluginDocumentSettingPanel,{name:"activitypub",title:(0,r.__)("Send reminder before event's start","activitypub"),children:(0,d.jsx)(i.SelectControl,{label:(0,r.__)("Time gap","activitypub"),value:u,options:[{label:(0,r.__)("Disabled","event-bridge-for-activitypub"),value:0},{label:(0,r.__)("6 hours","event-bridge-for-activitypub"),value:21600},{label:(0,r.__)("1 day","event-bridge-for-activitypub"),value:86400},{label:(0,r.__)("3 days","event-bridge-for-activitypub"),value:259200},{label:(0,r.__)("1 week","event-bridge-for-activitypub"),value:604800}],onChange:e=>{b({..._,event_bridge_for_activitypub_reminder_time_gap:e})},__nextHasNoMarginBottom:!0})})}})})();
\ No newline at end of file
diff --git a/wp-content/plugins/event-bridge-for-activitypub/event-bridge-for-activitypub.php b/wp-content/plugins/event-bridge-for-activitypub/event-bridge-for-activitypub.php
deleted file mode 100644
index 678909a5..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/event-bridge-for-activitypub.php
+++ /dev/null
@@ -1,39 +0,0 @@
-NGI0 Entrust Fund, a fund established by NLnet.
- * Plugin URI: https://event-federation.eu/
- * Version: 1.3.0
- * Author: AndrÊ Menrath
- * Author URI: https://graz.social/@linos
- * Text Domain: event-bridge-for-activitypub
- * License: AGPL-3.0-or-later
- * License URI: https://www.gnu.org/licenses/agpl-3.0.html
- * Requires PHP: 8.1
- * Requires Plugins: activitypub
- *
- * Requires at least ActivityPub plugin with version >= 7.5.0. ActivityPub plugin tested up to: 8.3.0.
- *
- * @package Event_Bridge_For_ActivityPub
- * @license AGPL-3.0-or-later
- */
-
-// Exit if accessed directly.
-defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
-
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_DOMAIN', 'event-bridge-for-activitypub' );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_ACTIVITYPUB_PLUGIN_MIN_VERSION', '8.1.0' );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_SUMMARY_TEMPLATE', "[ap_start_time]\n[ap_end_time]\n[ap_location]\n\n[ap_content]" );
-define( 'EVENT_BRIDGE_FOR_ACTIVITYPUB_DEFAULT_SUMMARY_TYPE', 'preset' );
-
-// Include and register the autoloader class for automatic loading of plugin classes.
-require_once EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_DIR . '/includes/class-autoloader.php';
-Event_Bridge_For_ActivityPub\Autoloader::register();
-
-// Initialize the plugin.
-Event_Bridge_For_ActivityPub\Setup::get_instance();
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/class-handler.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/class-handler.php
deleted file mode 100644
index a165686c..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/class-handler.php
+++ /dev/null
@@ -1,35 +0,0 @@
- array(
- 'name' => _x( 'Event Sources', 'post_type plural name', 'event-bridge-for-activitypub' ),
- 'singular_name' => _x( 'Event Source', 'post_type single name', 'event-bridge-for-activitypub' ),
- ),
- 'public' => false,
- 'hierarchical' => false,
- 'rewrite' => false,
- 'query_var' => false,
- 'delete_with_user' => false,
- 'can_export' => true,
- 'supports' => array(),
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_activitypub_actor_id',
- array(
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => 'sanitize_url',
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_activitypub_errors',
- array(
- 'type' => 'string',
- 'single' => false,
- 'sanitize_callback' => function ( $value ) {
- if ( ! is_string( $value ) ) {
- throw new \Exception( 'Error message is no valid string' );
- }
-
- return esc_sql( $value );
- },
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_activitypub_actor_json',
- array(
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => function ( $value ) {
- return sanitize_text_field( $value );
- },
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_activitypub_inbox',
- array(
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => 'sanitize_url',
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_event_bridge_for_activitypub_utilize_announces',
- array(
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => function ( $value ) {
- if ( 'same_origin' === $value ) {
- return 'same_origin';
- }
- return '';
- },
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_event_bridge_for_activitypub_accept_of_follow',
- array(
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => 'sanitize_url',
- )
- );
-
- \register_post_meta(
- self::POST_TYPE,
- '_event_bridge_for_activitypub_event_count',
- array(
- 'type' => 'integer',
- 'single' => true,
- 'sanitize_callback' => 'absint',
- 'default' => '0',
- )
- );
- }
-
- /**
- * Add new Event Source.
- *
- * @param string $actor The Actor URL/ID.
- *
- * @return Event_Source|WP_Error|null The Followed (WP_Post array) or an WP_Error.
- */
- public static function add_event_source( string $actor ) {
- $meta = get_remote_metadata_by_actor( $actor );
-
- if ( Tombstone::exists_in_error( $meta ) ) {
- return $meta;
- }
-
- if ( \is_wp_error( $meta ) ) {
- return $meta;
- }
-
- if ( empty( $meta ) ) {
- return null;
- }
-
- $event_source = new Event_Source();
- $event_source->from_array( $meta );
-
- $post_id = $event_source->save();
-
- if ( \is_wp_error( $post_id ) ) {
- return $post_id;
- }
-
- self::delete_event_source_transients();
-
- self::queue_follow_actor( $actor );
-
- return $event_source;
- }
-
- /**
- * Compose the ActivityPub ID of a follow request.
- *
- * @param string $follower_id The ActivityPub ID of the actor that followers the other one.
- * @param string $followed_id The ActivityPub ID of the followed actor.
- * @return string The `Follow` ID.
- */
- public static function compose_follow_id( string $follower_id, string $followed_id ) {
- return $follower_id . '#follow-' . \preg_replace( '~^https?://~', '', $followed_id );
- }
-
- /**
- * Delete all transients related to the event sources.
- *
- * @return void
- */
- public static function delete_event_source_transients(): void {
- \delete_transient( 'event_bridge_for_activitypub_event_sources' );
- \delete_transient( 'event_bridge_for_activitypub_event_sources_hosts' );
- }
-
- /**
- * Check whether an attachment is set as a featured image of any post.
- *
- * @param string|int $attachment_id The numeric post ID of the attachment.
- * @return bool
- */
- public static function is_attachment_featured_image( string|int $attachment_id ): bool {
- if ( ! is_numeric( $attachment_id ) ) {
- return false;
- }
-
- $args = array(
- 'post_type' => 'any',
- // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
- 'meta_query' => array(
- array(
- 'key' => '_thumbnail_id',
- 'value' => $attachment_id,
- 'compare' => '=',
- ),
- ),
- 'fields' => 'ids', // Only retrieve post IDs for performance.
- 'numberposts' => 1, // We only need one match to confirm.
- );
-
- $posts = \get_posts( $args );
-
- return ! empty( $posts );
- }
-
- /**
- * Delete all posts of an event source.
- *
- * @param int $event_source_post_id The WordPress Post ID of the event source.
- * @return void
- */
- public static function delete_events_by_event_source( int $event_source_post_id ): void {
- global $wpdb;
-
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
- $results = $wpdb->get_results(
- $wpdb->prepare(
- "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s",
- '_event_bridge_for_activitypub_event_source',
- absint( $event_source_post_id )
- )
- );
-
- // If no matching posts are found, return early.
- if ( empty( $results ) ) {
- return;
- }
-
- // Loop through the posts and delete them permanently.
- foreach ( $results as $result ) {
- // Check if the post has a thumbnail.
- $thumbnail_id = \get_post_thumbnail_id( $result->post_id );
-
- if ( $thumbnail_id ) {
- // Remove the thumbnail from the post.
- \delete_post_thumbnail( $result->post_id );
-
- // Delete the attachment (and its files) from the media library.
- if ( self::is_attachment_featured_image( $thumbnail_id ) ) {
- \wp_delete_attachment( $thumbnail_id, true );
- }
- }
-
- \wp_delete_post( $result->post_id, true );
- }
-
- // Clean up the query.
- \wp_reset_postdata();
- }
-
- /**
- * Remove an Event Source (=Followed ActivityPub actor).
- *
- * @param int|string $event_source_post_id The Events Sources Post ID or ActivityPub ID.
- *
- * @return void Post data on success, false or null on failure.
- */
- public static function remove_event_source( int|string $event_source_post_id ): void {
- $event_source = Event_Source::get_by_id( $event_source_post_id );
-
- if ( ! $event_source ) {
- return;
- }
-
- self::delete_events_by_event_source( $event_source->get__id() );
-
- self::delete_event_source_transients();
-
- // Temporary hack.
- $post = \get_post( $event_source->get__id() );
- $post->post_status = 'draft';
-
- if ( $post instanceof WP_Post ) {
- $post = \get_object_vars( $post );
- $post = \wp_slash( $post );
- $post = \wp_update_post( $post );
- }
-
- self::queue_unfollow_actor( $event_source->get_id() );
- }
-
- /**
- * Get all Event-Sources.
- *
- * It returns associative arrays, where the keys are the WordPress post IDs and the values are the ActivityPub IDs.
- * For example:
- * array(
- * 15 => 'https://remote.example/actors/event_organizer1',
- * 19 => 'https://remote2.example/users/johnmastodon',
- * )
- *
- * @return array List of `Event Sources`: =>
- */
- public static function get_event_sources(): array {
- $event_sources = get_transient( 'event_bridge_for_activitypub_event_sources' );
-
- if ( $event_sources && is_array( $event_sources ) ) {
- return $event_sources;
- }
-
- $event_sources = self::get_event_sources_with_count()['actors'];
-
- set_transient( 'event_bridge_for_activitypub_event_sources', $event_sources );
-
- return $event_sources;
- }
-
- /**
- * Get the Event Sources along with a total count for pagination purposes.
- *
- * @param int $number Maximum number of results to return.
- * @param int|null $page Page number.
- * @param array $args The WP_Query arguments.
- *
- * @return array {
- * Data about the event sources.
- *
- * @type array $actors List of `Event Sources`: =>
- * @type int $total Total number of followers.
- * }
- */
- public static function get_event_sources_with_count( int $number = -1, int|null $page = null, array $args = array() ): array {
- $defaults = array(
- 'post_type' => self::POST_TYPE,
- 'posts_per_page' => $number,
- 'paged' => $page,
- 'orderby' => 'ID',
- 'order' => 'DESC',
- 'post_status' => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit' ),
- );
-
- $args = wp_parse_args( $args, $defaults );
- $query = new WP_Query( $args );
- $total = $query->found_posts;
- $actors = array();
-
- foreach ( $query->get_posts() as $post ) {
- $actors[ $post->ID ] = get_post_meta( $post->ID, '_activitypub_actor_id', true );
- }
-
- $event_sources = compact( 'actors', 'total' );
-
- return $event_sources;
- }
-
- /**
- * Queue a hook to run async.
- *
- * @param string $hook The hook name.
- * @param array $args The arguments to pass to the hook.
- * @param string $unqueue_hook Optional a hook to unschedule before queuing.
- * @return bool|WP_Error Whether the hook was queued.
- */
- public static function queue( string $hook, array $args, $unqueue_hook = null ): bool|WP_Error {
- if ( $unqueue_hook ) {
- $hook_timestamp = \wp_next_scheduled( $unqueue_hook, $args );
- if ( $hook_timestamp ) {
- \wp_unschedule_event( $hook_timestamp, $unqueue_hook, $args );
- }
- }
-
- if ( \wp_next_scheduled( $hook, $args ) ) {
- return false;
- }
-
- return \wp_schedule_single_event( \time(), $hook, $args );
- }
-
- /**
- * Prepare to follow an ActivityPub actor via a scheduled event.
- *
- * @param string $actor The ActivityPub actor.
- *
- * @return bool Whether the event was queued.
- */
- public static function queue_follow_actor( string $actor ): bool {
- $queued = self::queue(
- 'event_bridge_for_activitypub_follow',
- array( $actor ),
- 'event_bridge_for_activitypub_unfollow'
- );
-
- if ( \is_wp_error( $queued ) ) {
- return false;
- }
-
- // Following this actor has already been queued.
- if ( false === $queued ) {
- return true;
- }
-
- return $queued;
- }
-
- /**
- * Follow an ActivityPub actor via the Blog user.
- *
- * @param string $actor_id The ID/URL of the Actor.
- */
- public static function activitypub_follow_actor( string $actor_id ): void {
- $actor = Event_Source::get_by_id( $actor_id );
-
- if ( ! $actor ) {
- return;
- }
-
- $inbox = $actor->get_shared_inbox();
- $to = $actor->get_id();
-
- $from_actor = new Blog();
-
- $activity = new \Activitypub\Activity\Activity();
- $activity->set_type( 'Follow' );
- $activity->set_to( array( $to ) );
- $activity->set_actor( $from_actor->get_id() );
- $activity->set_object( $to );
- $activity->set_id( self::compose_follow_id( $from_actor->get_id(), $to ) );
- $activity = $activity->to_json();
- \Activitypub\safe_remote_post( $inbox, $activity, \Activitypub\Collection\Actors::BLOG_USER_ID );
- }
-
- /**
- * Prepare to unfollow an actor via a scheduled event.
- *
- * @param string $actor The ActivityPub actor ID.
- *
- * @return bool|WP_Error Whether the event was queued.
- */
- public static function queue_unfollow_actor( string $actor ): bool|WP_Error {
- $queued = self::queue(
- 'event_bridge_for_activitypub_unfollow',
- array( $actor ),
- 'event_bridge_for_activitypub_follow'
- );
-
- if ( \is_wp_error( $queued ) ) {
- return false;
- }
-
- // Following this actor has already been queued.
- if ( false === $queued ) {
- return true;
- }
-
- return $queued;
- }
-
- /**
- * Unfollow an ActivityPub actor.
- *
- * @param string $actor The ActivityPub ID of the actor to unfollow.
- * @return void
- */
- public static function activitypub_unfollow_actor( string $actor ): void {
- $actor = Event_Source::get_by_id( $actor );
-
- if ( ! $actor ) {
- return;
- }
-
- $inbox = $actor->get_shared_inbox();
- $to = $actor->get_id();
-
- $from_actor = new Blog();
-
- if ( ! $inbox ) {
- return;
- }
-
- $activity = new \Activitypub\Activity\Activity();
- $activity->set_type( 'Undo' );
- $activity->set_to( array( $to ) );
- $activity->set_actor( $from_actor->get_id() );
- $activity->set_object(
- array(
- 'type' => 'Follow',
- 'actor' => $actor,
- 'object' => $to,
- 'id' => self::compose_follow_id( $from_actor->get_id(), $to ),
- )
- );
- $activity->set_id( $from_actor->get_id() . '#unfollow-' . \preg_replace( '~^https?://~', '', $to ) );
- $activity = $activity->to_json();
- \Activitypub\safe_remote_post( $inbox, $activity, \Activitypub\Collection\Actors::BLOG_USER_ID );
-
- $actor->delete();
-
- self::delete_event_source_transients();
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-accept.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-accept.php
deleted file mode 100644
index 4b03d1f8..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-accept.php
+++ /dev/null
@@ -1,76 +0,0 @@
-get_id(), $activity['actor'] );
-
- // Check if the object of the `Accept` is indeed the `Follow` request we sent to that actor.
- if ( object_to_uri( $activity['object'] ) !== $follow_id ) {
- return;
- }
-
- // Save the accept status of the follow request to the event source post.
- \update_post_meta( $event_source_post_id, '_event_bridge_for_activitypub_accept_of_follow', $activity['id'] );
- \wp_update_post(
- array(
- 'ID' => $event_source_post_id,
- 'post_status' => 'publish',
- )
- );
-
- // Trigger the backfilling of events from this actor.
- \do_action( 'event_bridge_for_activitypub_backfill_events', $event_source_post_id );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-create.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-create.php
deleted file mode 100644
index a343796b..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-create.php
+++ /dev/null
@@ -1,113 +0,0 @@
-get_results(
- $wpdb->prepare(
- "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s",
- '_event_bridge_for_activitypub_accept_of_follow',
- $accept_id
- )
- );
-
- // If no event source with that accept ID is found return.
- if ( empty( $results ) ) {
- return;
- }
-
- $post_id = reset( $results )->post_id;
-
- \delete_post_meta( $post_id, '_event_bridge_for_activitypub_accept_of_follow' );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-update.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-update.php
deleted file mode 100644
index 03a572ed..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/handler/class-update.php
+++ /dev/null
@@ -1,39 +0,0 @@
-get_icon();
-
- if ( is_string( $icon ) ) {
- return $icon;
- }
-
- if ( isset( $icon['url'] ) && is_string( $icon['url'] ) ) {
- return $icon['url'];
- }
-
- return '';
- }
-
- /**
- * Return the Post-IDs of all events cached by this event source.
- */
- public static function get_cached_events(): array {
- return array();
- }
-
- /**
- * Getter for URL attribute.
- *
- * @return string The URL.
- */
- public function get_url() {
- if ( $this->url ) {
- return $this->url;
- }
-
- return $this->id;
- }
-
- /**
- * Get the outbox.
- *
- * @return ?string The outbox URL.
- */
- public function get_outbox() {
- if ( $this->outbox ) {
- return $this->outbox;
- }
-
- $actor_json = \get_post_meta( $this->get__id(), '_activitypub_actor_json', true );
-
- if ( ! $actor_json ) {
- return null;
- }
-
- $actor = \json_decode( $actor_json, true );
-
- if ( ! isset( $actor['outbox'] ) ) {
- \do_action( 'event_bridge_for_activitypub_write_log', array( "[ACTIVITYPUB] Did not find outbox URL for actor {$actor}" ) );
- return null;
- }
-
- return $actor['outbox'];
- }
-
- /**
- * Get the Event Source Post ID by the ActivityPub ID.
- *
- * @param string $activitypub_actor_id The ActivityPub actor ID.
- * @return int|false The Event Sources Post ID, if a WordPress Post representing it is found, false otherwise.
- */
- public static function get_post_id_by_activitypub_id( string $activitypub_actor_id ) {
- $event_sources = Event_Sources::get_event_sources();
-
- return array_search( $activitypub_actor_id, $event_sources, true );
- }
-
- /**
- * Get the Event Source by the ActivityPub ID or WordPress Post ID.
- *
- * @param int|string $event_source_id The ActivityPub actor ID as string or the Post ID as int of the Event Source.
- * @return ?Event_Source The Event Sources if it exists, false otherwise.
- */
- public static function get_by_id( int|string $event_source_id ): ?Event_Source {
- $post_id = is_integer( $event_source_id ) ? $event_source_id : self::get_post_id_by_activitypub_id( $event_source_id );
-
- if ( ! $post_id ) {
- return null;
- }
-
- // Get Custom Post.
- $event_source_post = \get_post( $post_id );
-
- if ( ! $event_source_post ) {
- return null;
- }
-
- // Init From Custom Post.
- $event_source = self::init_from_cpt( $event_source_post );
-
- if ( ! $event_source ) {
- return null;
- }
-
- return $event_source;
- }
-
- /**
- * Convert a Custom-Post-Type input to an \Event_Bridge_For_ActivityPub\ActivityPub\Model\Event_Source.
- *
- * @param WP_Post $post The post object.
- * @return ?Event_Source
- */
- public static function init_from_cpt( WP_Post $post ): ?Event_Source {
- if ( Event_Sources::POST_TYPE !== $post->post_type ) {
- return null;
- }
-
- if ( empty( $post->post_content ) ) {
- $actor_json = \get_post_meta( $post->ID, '_activitypub_actor_json', true );
- } else {
- $actor_json = $post->post_content;
- }
-
- $object = static::init_from_json( $actor_json );
-
- if ( \is_wp_error( $object ) ) {
- return null;
- }
-
- $object->set__id( $post->ID );
- $object->set_name( $post->post_title );
- $object->set_summary( $post->post_excerpt );
- $object->set_published( gmdate( 'Y-m-d H:i:s', strtotime( $post->post_date ) ) );
- $object->set_updated( gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) ) );
- $object->set_status( $post->post_status );
- $thumbnail_id = \get_post_thumbnail_id( $post );
- if ( $thumbnail_id ) {
- $object->set_icon(
- array(
- 'type' => 'Image',
- 'url' => \wp_get_attachment_image_url( $thumbnail_id, 'thumbnail', true ),
- )
- );
- }
-
- return $object;
- }
-
- /**
- * Validate the current Event Source ActivityPub actor object.
- *
- * @return boolean True if the verification was successful.
- */
- public function is_valid(): bool {
- // The minimum required attributes.
- $required_attributes = array(
- 'id',
- 'preferredUsername',
- 'inbox',
- 'publicKey',
- 'publicKeyPem',
- );
-
- foreach ( $required_attributes as $attribute ) {
- if ( ! $this->get( $attribute ) ) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Update the post meta.
- */
- protected function get_post_meta_input() {
- $meta_input = array();
- $meta_input['_activitypub_inbox'] = \sanitize_url( $this->get_shared_inbox() );
- $meta_input['_activitypub_actor_json'] = $this->to_json();
- $meta_input['_activitypub_actor_id'] = $this->get_id();
-
- return $meta_input;
- }
-
- /**
- * Get the shared inbox, with a fallback to the inbox.
- *
- * @return string|null The URL to the shared inbox, the inbox or null.
- */
- public function get_shared_inbox() {
- if ( ! empty( $this->get_endpoints()['sharedInbox'] ) ) {
- return $this->get_endpoints()['sharedInbox'];
- } elseif ( ! empty( $this->get_inbox() ) ) {
- return $this->get_inbox();
- }
-
- return null;
- }
-
- /**
- * Save the current Event Source object to Database within custom post type.
- *
- * @return int|WP_Error The post ID or an WP_Error.
- */
- public function save() {
- Event_Sources::delete_event_source_transients();
-
- if ( ! $this->is_valid() ) {
- return new WP_Error( 'activitypub_invalid_follower', __( 'Invalid Follower', 'event-bridge-for-activitypub' ), array( 'status' => 400 ) );
- }
-
- if ( ! $this->get__id() ) {
- global $wpdb;
-
- // phpcs:ignore WordPress.DB.DirectDatabaseQuery
- $post_id = $wpdb->get_var(
- $wpdb->prepare(
- "SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_activitypub_actor_id' AND meta_value=%s",
- esc_sql( $this->get_id() )
- )
- );
-
- if ( $post_id ) {
- $post = get_post( $post_id );
- $this->set__id( $post->ID );
- }
- }
-
- $post_id = $this->get__id();
-
- $args = array(
- 'ID' => $post_id,
- 'post_title' => wp_strip_all_tags( sanitize_text_field( $this->get_name() ) ),
- 'post_author' => 0,
- 'post_type' => Event_Sources::POST_TYPE,
- 'post_name' => esc_url_raw( $this->get_id() ),
- 'post_excerpt' => sanitize_text_field( wp_kses( $this->get_summary(), 'user_description' ) ),
- 'post_status' => 'pending',
- 'meta_input' => $this->get_post_meta_input(),
- );
-
- if ( ! empty( $post_id ) ) {
- // If this is an update, prevent the "added" date from being overwritten by the current date.
- $post = get_post( $post_id );
- $args['post_date'] = $post->post_date;
- $args['post_date_gmt'] = $post->post_date_gmt;
- }
-
- $post_id = \wp_insert_post( $args );
- $this->_id = $post_id;
-
- // Abort if inserting or updating the post didn't work.
-
- // @phpstan-ignore-next-line
- if ( is_wp_error( $post_id ) || 0 === $post_id ) {
- return $post_id;
- }
-
- // Delete old icon.
- // Check if the post has a thumbnail.
- $thumbnail_id = get_post_thumbnail_id( $post_id );
-
- if ( $thumbnail_id ) {
- // Remove the thumbnail from the post.
- delete_post_thumbnail( $post_id );
-
- // Delete the attachment (and its files) from the media library.
- wp_delete_attachment( $thumbnail_id, true );
- }
-
- // Set new icon.
- $icon = $this->get_icon();
-
- if ( isset( $icon['url'] ) ) {
- $image = media_sideload_image( sanitize_url( $icon['url'] ), $post_id, null, 'id' );
- }
- if ( isset( $image ) && ! is_wp_error( $image ) ) {
- set_post_thumbnail( $post_id, $image );
- }
-
- return $post_id;
- }
-
- /**
- * Delete an Event Source and it's profile image.
- */
- public function delete() {
- $post_id = $this->get__id();
-
- if ( ! $post_id ) {
- return false;
- }
-
- $thumbnail_id = get_post_thumbnail_id( $post_id );
-
- if ( $thumbnail_id ) {
- wp_delete_attachment( $thumbnail_id, true );
- }
-
- $result = wp_delete_post( $post_id, false ) ?? false;
-
- if ( $result ) {
- Event_Sources::delete_event_source_transients();
- }
-
- return $result;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/object/class-event-fep-8a8e.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/object/class-event-fep-8a8e.php
deleted file mode 100644
index 43fc8db6..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/object/class-event-fep-8a8e.php
+++ /dev/null
@@ -1,101 +0,0 @@
-= 0.0f, <= 100.0f]
- */
- protected $accuracy;
-
- /**
- * Indicates the altitude of a place. The measurement unit is indicated using the unit's property.
- * If unit is not specified, the default is assumed to be "m" indicating meters.
- *
- * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-altitude
- * @var float xsd:float
- */
- protected $altitude;
-
- /**
- * The latitude of a place.
- *
- * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-latitude
- * @var float xsd:float
- */
- protected $latitude;
-
- /**
- * The longitude of a place.
- *
- * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-longitude
- * @var float xsd:float
- */
- protected $longitude;
-
- /**
- * The radius from the given latitude and longitude for a Place.
- *
- * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-radius
- * @var float
- */
- protected $radius;
-
- /**
- * Specifies the measurement units for the `radius` and `altitude` properties.
- *
- * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-units
- * @var string
- */
- protected $units;
-
- /**
- * The address of the place.
- *
- * @see https://schema.org/PostalAddress
- * @var array|string
- */
- protected $address;
-
- /**
- * External URL/Website of the place/venue.
- *
- * @see https://schema.org/sameAs
- * @var string
- */
- protected $same_as;
-
- /**
- * Telephone number of the place.
- *
- * @see https://schema.org/telephone
- * @var string
- */
- protected $telephone;
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/scheduler/class-event.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/scheduler/class-event.php
deleted file mode 100644
index d8648548..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/scheduler/class-event.php
+++ /dev/null
@@ -1,116 +0,0 @@
-is_event_post_type_of_active_event_plugin( $post->post_type ) ) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Handle post updates and determine the appropriate Activity type.
- *
- * @param int $post_id Post ID.
- * @param \WP_Post $post Post object.
- * @param bool $update Whether this is an existing post being updated.
- * @param null|\WP_Post $post_before Post object before the update.
- */
- public static function maybe_schedule_event_post_activity( $post_id, $post, $update, $post_before ) {
- if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
- return;
- }
-
- if ( ! Setup::get_instance()->is_event_post_type_of_active_event_plugin( $post->post_type ) ) {
- return;
- }
-
- if ( Setup::is_post_disabled( $post ) ) {
- return;
- }
-
- // Bail on bulk edits, unless post author or post status changed.
- if ( isset( $_REQUEST['bulk_edit'] ) && -1 === (int) $_REQUEST['post_author'] && -1 === (int) $_REQUEST['_status'] ) { // phpcs:ignore WordPress
- return;
- }
-
- $new_status = get_post_status( $post );
- $old_status = $post_before ? get_post_status( $post_before ) : null;
-
- switch ( $new_status ) {
- case 'publish':
- $type = $update ? 'Update' : 'Create';
- break;
-
- case 'draft':
- $type = ( 'publish' === $old_status ) ? 'Update' : false;
- break;
-
- case 'trash':
- $type = 'Delete';
- break;
-
- default:
- $type = false;
- }
-
- // Do not send Activities if `$type` is not set or unknown.
- if ( empty( $type ) ) {
- return;
- }
-
- $hook = 'event_bridge_for_activitypub_add_event_post_to_outbox';
- $args = array( $post, $type, $post->post_author );
-
- if ( false === \wp_next_scheduled( $hook, $args ) ) {
- \wp_schedule_single_event( \time() + 10, $hook, $args );
- }
- }
-
- /**
- * Add an event post to the outbox.
- *
- * @param \WP_Post $post The WP_Post object to add to the outbox.
- * @param string $activity_type The type of the Activity.
- * @param integer $user_id The User-ID.
- */
- public static function add_event_post_to_outbox( $post, $activity_type, $user_id ): void {
- $post = get_post( $post->ID );
- add_to_outbox( $post, $activity_type, $user_id );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event-organiser.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event-organiser.php
deleted file mode 100644
index 5cc6688c..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event-organiser.php
+++ /dev/null
@@ -1,78 +0,0 @@
-schedule = \eo_get_event_schedule( $item->ID );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_end_time(): string {
- return $this->schedule['end']->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the start time from the event object.
- */
- public function get_start_time(): string {
- return $this->schedule['start']->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get location from the event object.
- */
- public function get_location(): ?Place {
- $venue = \get_the_terms( $this->item->ID, 'event-venue' );
-
- if ( empty( $venue ) || is_wp_error( $venue ) ) {
- return null;
- }
-
- $venue = array_pop( $venue );
-
- $location_transformer = new Event_Organiser_Location_Transformer( $venue );
- $location = $location_transformer->to_object();
-
- return $location;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event.php
deleted file mode 100644
index 1fb66182..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-event.php
+++ /dev/null
@@ -1,683 +0,0 @@
-item );
- }
-
- /**
- * Set a hardcoded template for the content.
- *
- * This actually disabled templates for the content.
- * Maybe this independent templates for events will be added later.
- */
- protected function get_post_content_template(): string {
- return '[ap_content]';
- }
-
- /**
- * Extend the construction of the Post Transformer to also set the according taxonomy of the event post type.
- *
- * @param \WP_Post $item The WordPress post object (event).
- * @param string $wp_taxonomy The taxonomy slug of the event post type.
- */
- public function __construct( $item, $wp_taxonomy = 'category' ) {
- parent::__construct( $item );
- $this->wp_taxonomy = $wp_taxonomy;
- }
-
- /**
- * Extract the join mode.
- *
- * Currently we don't handle joins, we always mark events as external.
- *
- * @return string
- */
- public function get_join_mode(): ?string {
- return 'external';
- }
-
- /**
- * Extract the external participation url.
- *
- * Currently we don't handle joins, we always mark events as external.
- * We just link back to the events HTML representation on our WordPress site.
- *
- * @return ?string The external participation URL.
- */
- public function get_external_participation_url(): ?string {
- return 'external' === $this->get_join_mode() ? $this->get_url() : null;
- }
-
- /**
- * Set the event category, via the mapping setting.
- *
- * @return ?string
- */
- public function get_category(): ?string {
- if ( is_null( $this->wp_taxonomy ) ) {
- return null;
- }
- $current_category_mapping = \get_option( 'event_bridge_for_activitypub_event_category_mappings', array() );
- $terms = \get_the_terms( $this->item, $this->wp_taxonomy );
-
- // Check if the event has a category set and if that category has a specific mapping return that one.
- if ( ! is_wp_error( $terms ) && $terms && array_key_exists( $terms[0]->slug, $current_category_mapping ) ) {
- return sanitize_text_field( $current_category_mapping[ $terms[0]->slug ] );
- } else {
- // Return the default event category.
- return sanitize_text_field( \get_option( 'event_bridge_for_activitypub_default_event_category', 'MEETING' ) );
- }
- }
-
- /**
- * Retrieves the excerpt text (may be HTML). Used for constructing the summary.
- *
- * @return ?string
- */
- protected function retrieve_excerpt(): ?string {
- if ( $this->item->post_excerpt ) {
- return $this->item->post_excerpt;
- } else {
- return null;
- }
- }
-
- /**
- * Get the start time.
- *
- * This is mandatory and must be implemented in the final event transformer class.
- */
- abstract public function get_start_time(): string;
-
- /**
- * Get the end time.
- *
- * This is not mandatory and therefore just return null by default.
- */
- public function get_end_time(): ?string {
- return null;
- }
-
- /**
- * Get a default for the location.
- *
- * This should be overridden in the actual event transformer.
- *
- * @return array|Place|null
- */
- public function get_location() {
- return null;
- }
-
- /**
- * Default value for the event status.
- */
- public function get_status(): ?string {
- return 'CONFIRMED';
- }
-
- /**
- * Compose a human readable formatted start time.
- */
- protected function format_start_time(): string {
- return $this->format_time( $this->get_start_time() );
- }
-
- /**
- * Compose a human readable formatted end time.
- */
- protected function format_end_time(): string {
- return $this->format_time( $this->get_end_time() );
- }
-
- /**
- * Compose a human readable formatted time.
- *
- * @param ?string $time The time which needs to be formatted.
- */
- protected static function format_time( $time ) {
- if ( null === $time ) {
- return '';
- }
- $start_datetime = new DateTime( $time );
- $start_timestamp = $start_datetime->getTimestamp();
- $datetime_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
- return \wp_date( $datetime_format, $start_timestamp );
- }
-
- /**
- * Generates output for the 'ap_start_time' shortcode.
- *
- * @param ?array $atts The shortcode's attributes.
- * @return string The formatted start date and time of the event.
- */
- public function shortcode_start_time( $atts ) {
- $start_timestamp = $this->get_start_time();
- return $this->generate_time_output( $start_timestamp, $atts, 'đī¸', __( 'Start', 'event-bridge-for-activitypub' ) );
- }
-
- /**
- * Generates output for the 'ap_end_time' shortcode.
- *
- * @param ?array $atts The shortcode's attributes.
- * @return string The formatted end date and time of the event.
- */
- public function shortcode_end_time( $atts ) {
- $end_timestamp = $this->get_end_time();
- return $this->generate_time_output( $end_timestamp, $atts, 'âŗ', __( 'End', 'event-bridge-for-activitypub' ) );
- }
-
- /**
- * Generates the formatted time output for a shortcode.
- *
- * @param string|null $timestamp The timestamp for the event time.
- * @param array $atts The shortcode attributes.
- * @param string $icon The icon to display.
- * @param string $label The label to display (e.g., 'Start', 'End').
- * @return string The formatted date and time, or an empty string if the timestamp is invalid.
- */
- private function generate_time_output( $timestamp, $atts, $icon, $label ): string {
- if ( ! $timestamp ) {
- return '';
- }
-
- $args = shortcode_atts(
- array(
- 'icon' => 'true',
- 'label' => 'true',
- ),
- $atts
- );
-
- $args['icon'] = filter_var( $args['icon'], FILTER_VALIDATE_BOOLEAN );
- $args['label'] = filter_var( $args['label'], FILTER_VALIDATE_BOOLEAN );
-
- $output = array();
-
- if ( $args['icon'] ) {
- $output[] = $icon;
- }
-
- if ( $args['label'] ) {
- $output[] = $label . ':';
- }
-
- $output[] = self::format_time( $timestamp );
-
- return implode( ' ', $output );
- }
-
- /**
- * Generates output for the 'ap_location' shortcode.
- *
- * @param ?array $atts The shortcode's attributes.
- * @return string The formatted location/address of the event.
- */
- public function shortcode_location( $atts ) {
- $args = shortcode_atts(
- array(
- 'icon' => 'true',
- 'label' => 'true',
- 'country' => 'true',
- 'zip' => 'true',
- 'city' => 'true',
- 'street' => 'true',
- ),
- $atts,
- 'ap_location'
- );
-
- // Convert attributes to booleans.
- $args = array_map(
- function ( $value ) {
- return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
- },
- $args
- );
-
- $location = $this->get_location();
- if ( ! $location ) {
- return '';
- }
-
- $output = array();
-
- if ( is_array( $location ) && isset( $location['type'] ) && 'VirtualLocation' === $location['type'] ) {
- if ( $args['icon'] ) {
- $output[] = 'đ';
- }
- if ( $args['label'] && isset( $location['name'] ) ) {
- $output[] = $location['name'] . ':';
- }
- } else {
- if ( $args['icon'] ) {
- $output[] = 'đ';
- }
-
- if ( $args['label'] ) {
- $output[] = esc_html__( 'Location', 'event-bridge-for-activitypub' ) . ':';
- }
- }
-
- $output[] = $this->get_formatted_address( true, $args );
-
- // Join output array into a single string with spaces and return.
- return implode( ' ', array_filter( $output ) );
- }
-
- /**
- * Formats the address based on provided arguments.
- *
- * @param mixed $address The address data, either as a string or an array.
- * @param array $args The arguments for which components to include.
- * @return string The formatted address.
- */
- protected static function format_address( $address, $args = array() ) {
- if ( is_string( $address ) ) {
- return esc_html( $address );
- }
-
- if ( empty( $args ) ) {
- $args = array(
- 'icon' => 'true',
- 'title' => 'true',
- 'country' => 'true',
- 'zip' => 'true',
- 'city' => 'true',
- 'street' => 'true',
- );
- }
-
- if ( is_array( $address ) ) {
- $address_parts = array();
-
- $components = array(
- 'street' => 'streetAddress',
- 'zip' => 'postalCode',
- 'city' => 'addressLocality',
- 'country' => 'addressCountry',
- );
-
- foreach ( $components as $arg_key => $address_key ) {
- if ( $args[ $arg_key ] && ! empty( $address[ $address_key ] ) ) {
- $address_parts[] = esc_html( $address[ $address_key ] );
- }
- }
-
- return implode( ', ', $address_parts );
- }
-
- return '';
- }
-
- /**
- * Format the category using the translation.
- */
- protected function format_categories(): string {
- if ( is_null( $this->wp_taxonomy ) ) {
- return '';
- }
- $categories = array();
-
- // Add the federated category string.
- require_once EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_DIR . '/includes/event-categories.php';
- $federated_category = $this->get_category();
- if ( array_key_exists( $federated_category, EVENT_BRIDGE_FOR_ACTIVITYPUB_EVENT_CATEGORIES ) ) {
- $categories[] = EVENT_BRIDGE_FOR_ACTIVITYPUB_EVENT_CATEGORIES[ $federated_category ];
- }
-
- // Add all category terms.
- $terms = \get_the_terms( $this->item, $this->wp_taxonomy );
- if ( $terms && ! is_wp_error( $terms ) ) {
- foreach ( $terms as $term ) {
- $categories[] = $term->name;
- }
- }
-
- if ( ! empty( $categories ) ) {
- return implode( ' ¡ ', array_unique( $categories ) );
- }
- return '';
- }
-
- /**
- * Register the shortcodes.
- */
- public function register_shortcodes() {
- Shortcodes::register();
- foreach ( array( 'location', 'start_time', 'end_time' ) as $shortcode ) {
- \add_shortcode( 'ap_' . $shortcode, array( $this, 'shortcode_' . $shortcode ) );
- }
- }
-
- /**
- * Register the shortcodes.
- */
- public function unregister_shortcodes() {
- Shortcodes::unregister();
- foreach ( array( 'location', 'start_time', 'end_time' ) as $shortcode ) {
- \remove_shortcode( 'ap_' . $shortcode );
- }
- }
-
- /**
- * Get the summary.
- */
- public function get_summary(): ?string {
- if ( 'preset' === get_option( 'event_bridge_for_activitypub_summary_type', 'preset' ) ) {
- $summary = EVENT_BRIDGE_FOR_ACTIVITYPUB_SUMMARY_TEMPLATE;
- } else {
- $summary = $this->get_event_summary_template();
- }
-
- // It seems that shortcodes are only applied to published posts.
- if ( is_preview() ) {
- $this->item->post_status = 'publish';
- }
-
- // Register our shortcodes just in time.
-
- $this->register_shortcodes();
-
- // Fill in the shortcodes.
- \setup_postdata( $this->item );
- $summary = \do_shortcode( $summary );
- \wp_reset_postdata();
-
- $summary = \wpautop( $summary );
- $summary = \preg_replace( '/[\n\r\t]/', '', $summary );
- $summary = \trim( $summary );
-
- $summary = \apply_filters( 'event_bridge_for_activitypub_the_summary', $summary, $this->item );
-
- // Unregister the shortcodes.
- $this->unregister_shortcodes();
-
- if ( 'plain' === get_option( 'event_bridge_for_activitypub_summary_format', 'html' ) ) {
- $summary = self::strip_html_preserve_linebreaks( $summary );
- }
-
- return $summary;
- }
-
- /**
- * Strip all HTML but preverse some line breaks.
- *
- * @param mixed $content The HTML input.
- * @return string
- */
- private static function strip_html_preserve_linebreaks( $content ): string {
- // Replace with newlines.
- $content = preg_replace( '/ /i', "\n", $content );
-
- // Replace closing
/i', '- ', $content );
- $content = preg_replace( '/<\/li>/i', "\n", $content );
-
- // Remove all remaining HTML tags.
- $content = wp_strip_all_tags( $content );
-
- // Normalize excessive newlines (more than 2 in a row to just 2).
- $content = preg_replace( "/\n{3,}/", "\n\n", $content );
-
- // Trim trailing newlines.
- return trim( $content );
- }
-
- /**
- * Get the address as a string.
- *
- * @param bool $include_location_name Whether to include the locations name.
- * @param array $args The arguments forwarded to format_address.
- *
- * @return string
- */
- public function get_formatted_address( $include_location_name = false, $args = array() ) {
- $location = $this->get_location();
- Shortcodes::register();
-
- if ( $location instanceof Place ) {
- $location_name = $location->get_name();
- $formatted_address = self::format_address( $location->get_address(), $args );
-
- $location_parts = array();
-
- if ( $location_name ) {
- $location_parts[] = $location_name;
- }
-
- if ( $formatted_address ) {
- $location_parts[] = $formatted_address;
- }
-
- if ( ! empty( $location_parts ) ) {
- return implode( ', ', $location_parts );
- }
- } elseif ( is_array( $location ) && isset( $location['type'] ) && 'VirtualLocation' === $location['type'] ) {
- if ( isset( $location['url'] ) ) {
- return $location['url'];
- }
- }
-
- return '';
- }
-
- /**
- * Gets the template to use to generate the summary of the ActivityStreams representation of an event post.
- *
- * @return string The Template.
- */
- protected function get_event_summary_template() {
- $summary = \get_option( 'event_bridge_for_activitypub_custom_summary', EVENT_BRIDGE_FOR_ACTIVITYPUB_SUMMARY_TEMPLATE );
- $template = $summary ?? EVENT_BRIDGE_FOR_ACTIVITYPUB_SUMMARY_TEMPLATE;
-
- return apply_filters( 'event_bridge_for_activitypub_summary_template', $template, $this->item );
- }
-
- /**
- * Get the timezone of the event if known.
- *
- * By default gets the timezone of the WordPress site.
- * This is not to be overwritten by the event transformers. Instead override get_timezone_string.
- * This function does also cache and sanitize the timezone string.
- *
- * @return string|null The timezone string of the event. Or no null if timezone information.
- */
- final public function get_timezone(): ?string {
- // Return cached timezone, if a valid one is known.
- if ( $this->timezone_string ) {
- return $this->timezone_string;
- }
-
- // Return cached failure.
- if ( $this->no_valid_timezone_known ) {
- return null;
- }
-
- // Step 1: Get timezone string.
- $timezone_string = $this->get_timezone_string();
-
- // Step 2: Fallback to site default if child class override returned null or empty string.
- if ( ! $timezone_string ) {
- $timezone_string = $this->get_site_timezone_string();
- }
-
- // Step 3: Reject non-strings early.
- if ( ! \is_string( $timezone_string ) ) {
- $this->no_valid_timezone_known = true;
- return null;
- }
-
- // Step 4: Validate against known timezone identifiers.
- $valid_timezone_strings = \DateTimeZone::listIdentifiers();
-
- if ( \in_array( $timezone_string, $valid_timezone_strings, true ) ) {
- // Cache and return valid timezone identifier string.
- $this->timezone_string = $timezone_string;
- return $this->timezone_string;
- }
-
- // Cache failure.
- $this->no_valid_timezone_known = true;
- return null;
- }
-
- /**
- * Get the timezone string of the event. Will be validated later.
- *
- * This is likely to be overwritten by the actual transformer.
- *
- * @return mixed
- */
- protected function get_timezone_string(): mixed {
- return $this->get_site_timezone_string();
- }
-
- /**
- * Non-overridable fallback method for timezone.
- *
- * Often in WordPress timezone string might be a UTC offset like "+01:00". But this will be sanitized be later in get_timezone().
- *
- * @return string
- */
- final protected function get_site_timezone_string(): string {
- return \wp_timezone_string();
- }
-
-
- /**
- * Remove the permalink shortcode from a WordPress template.
- *
- * This used for the summary template, because the summary usually gets,
- * used when converting a object, where the URL is usually appended anyway.
- *
- * @param string $template The template string.
- * @param WP_Post|WP_Comment $item The item which was used to select the template.
- */
- public static function remove_ap_permalink_from_template( $template, $item ) {
-
- // we could override the template here, to get out custom template from an option.
-
- if ( 'event' === $item->post_type ) {
- $template = str_replace( '[ap_permalink]', '', $template );
- $template = str_replace( '[ap_permalink type="html"]', '', $template );
- }
-
- return $template;
- }
-
- /**
- * Generic function that converts an WP-Event object to an ActivityPub-Event object.
- *
- * @return Event_object|\WP_Error
- */
- public function to_object() {
- $activitypub_object = new Event_Object();
- $activitypub_object = $this->transform_object_properties( $activitypub_object );
-
- // @phpstan-ignore-next-line
- $activitypub_object->set_comments_enabled( $this->get_comments_enabled() );
-
- if ( \is_wp_error( $activitypub_object ) ) {
- return $activitypub_object;
- }
-
- // maybe move the following logic (till end of the function) into getter functions.
-
- $published = \strtotime( $this->item->post_date_gmt );
-
- $activitypub_object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) );
-
- $updated = \strtotime( $this->item->post_modified_gmt );
-
- if ( $updated > $published ) {
- $activitypub_object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) );
- }
-
- $activitypub_object->set_content_map(
- array(
- $this->get_locale() => $this->get_content(),
- )
- );
-
- $activitypub_object->set_to(
- array(
- 'https://www.w3.org/ns/activitystreams#Public',
- $this->get_actor_object()->get_followers(),
- )
- );
-
- // @phpstan-ignore-next-line
- return $activitypub_object;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventin.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventin.php
deleted file mode 100644
index 6d01b302..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventin.php
+++ /dev/null
@@ -1,166 +0,0 @@
-event_model = new Event_Model( $this->item->ID );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_start_time(): string {
- return $this->event_model->get_start_datetime( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_end_time(): string {
- return $this->event_model->get_end_datetime( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the timezone of the event.
- */
- public function get_timezone_string(): string {
- return $this->event_model->get_timezone();
- }
-
- /**
- * Get whether the event is online.
- *
- * @return bool
- */
- public function get_is_online(): bool {
- return 'online' === $this->event_model->__get( 'event_type' ) ? true : false;
- }
-
- /**
- * Maybe add online link to attachments.
- *
- * @return array
- */
- public function get_attachment(): array {
- $attachment = parent::get_attachment();
-
- $location = (array) $this->event_model->__get( 'location' );
-
- // @phpstan-ignore-next-line
- if ( array_key_exists( 'integration', $location ) && array_key_exists( $location['integration'], $location ) ) {
- $online_link = array(
- 'type' => 'Link',
- 'mediaType' => 'text/html',
- 'name' => $location[ $location['integration'] ],
- 'href' => $location[ $location['integration'] ],
- );
- $attachment[] = $online_link;
- }
- return $attachment;
- }
-
- /**
- * Compose the events tags.
- */
- public function get_tag(): ?array {
- // The parent tag function also fetches the mentions.
- $tags = parent::get_tag();
-
- $post_tags = \wp_get_post_terms( $this->item->ID, 'etn_tags' );
- $post_categories = \wp_get_post_terms( $this->item->ID, 'etn_category' );
-
- if ( ! is_wp_error( $post_tags ) && $post_tags ) {
- foreach ( $post_tags as $term ) {
- $tag = array(
- 'type' => 'Hashtag',
- 'href' => \esc_url( \get_tag_link( $term->term_id ) ),
- 'name' => esc_hashtag( $term->name ),
- );
- $tags[] = $tag;
- }
- }
-
- if ( ! is_wp_error( $post_categories ) && $post_categories ) {
- foreach ( $post_categories as $term ) {
- $tag = array(
- 'type' => 'Hashtag',
- 'href' => \esc_url( \get_tag_link( $term->term_id ) ),
- 'name' => esc_hashtag( $term->name ),
- );
- $tags[] = $tag;
- }
- }
-
- if ( empty( $tags ) ) {
- return null;
- }
-
- return $tags;
- }
-
- /**
- * Get the location.
- *
- * @return ?Place
- */
- public function get_location(): ?Place {
- $location = (array) $this->event_model->__get( 'location' );
-
- // @phpstan-ignore-next-line
- if ( ! array_key_exists( 'address', $location ) ) {
- return null;
- }
-
- // @phpstan-ignore-next-line
- $place = new Place();
-
- $address = $location['address'];
-
- $place->set_name( $address );
- $place->set_address( $address );
- $place->set_sensitive( null );
-
- return $place;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventon.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventon.php
deleted file mode 100644
index 0ccd82be..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventon.php
+++ /dev/null
@@ -1,186 +0,0 @@
-wp_taxonomy = $wp_taxonomy;
-
- $this->tax_meta = \get_option( 'evo_tax_meta' );
- }
-
-
- /**
- * Get content.
- */
- public function get_content(): string {
- $subtitle = \get_post_meta( $this->item->ID, 'evcal_subtitle', true );
-
- $content = $subtitle ? $subtitle . ' ' : '';
- $content = $content . parent::get_content();
- return $content;
- }
-
- /**
- * Get the event location(s).
- *
- * @return array|null The Place.
- */
- public function get_location() {
- $location = array();
-
- $terms = \get_the_terms( $this->item->ID, 'event_location' );
-
- // The terms may both contain virtual and physical Locations.
- if ( ! empty( $terms ) ) {
- foreach ( $terms as $term ) {
- $location_transformer = new EventOn_Place_Transformer( $term );
- $location[] = $location_transformer->to_object()->to_array( false );
- }
- }
-
- // Virtual Locations can also be directly int the post meta, not in terms!
- $virtual_url = \get_post_meta( $this->item->ID, '_vir_url', true );
- $virtual_type = \get_post_meta( $this->item->ID, '_vir_type', true );
-
- if ( $virtual_url ) {
- $virtual_location = array(
- 'type' => 'VirtualLocation',
- 'url' => (string) $virtual_url,
- );
- if ( $virtual_type ) {
- $virtual_location['name'] = (string) $virtual_type;
- }
- $location[] = $virtual_location;
- }
-
- // If we only have one location, send object directy, not in array.
- if ( 1 === count( $location ) ) {
- $location = reset( $location );
- } elseif ( empty( $location ) ) {
- return null;
- }
-
- return $location;
- }
-
- /**
- * Get the end time from the events metadata.
- */
- public function get_end_time(): ?string {
- $end_time = \get_post_meta( $this->item->ID, 'evcal_erow', true );
- $timezone = \get_post_meta( $this->item->ID, 'evo_event_timezone', true );
- $timezone = $timezone ? new \DateTimeZone( $timezone ) : null;
-
- if ( is_null( $end_time ) || empty( $end_time ) ) {
- return null;
- }
- return \wp_date( 'Y-m-d\TH:i:sP', (int) $end_time, $timezone );
- }
-
- /**
- * Get timezone
- *
- * @return string
- */
- public function get_timezone_string(): string {
- return \get_post_meta( $this->item->ID, 'evo_event_timezone', true );
- }
-
- /**
- * Get the end time from the events metadata.
- */
- public function get_start_time(): string {
- $start_time = \get_post_meta( $this->item->ID, 'evcal_srow', true );
- $timezone = \get_post_meta( $this->item->ID, 'evo_event_timezone', true );
- $timezone = $timezone ? new \DateTimeZone( $timezone ) : null;
-
- return \wp_date( 'Y-m-d\TH:i:sP', (int) $start_time, $timezone );
- }
-
- /**
- * Get the event link from the events metadata.
- *
- * @return ?array Associated array of an ActivityStreams Link object with the events URL.
- */
- private function get_event_link(): ?array {
- $event_link = \get_post_meta( $this->item->ID, 'event-link', true );
- $event_link_label = \get_post_meta( $this->item->ID, 'event-link-label', true ) ?? 'Event Link';
- if ( $event_link ) {
- return array(
- 'type' => 'Link',
- 'name' => $event_link_label,
- 'href' => \esc_url( $event_link ),
- 'mediaType' => 'text/html',
- );
- }
- return null;
- }
-
- /**
- * Overrides/extends the get_attachments function to also add the event Link.
- *
- * @return array
- */
- protected function get_attachment(): array {
- $attachments = parent::get_attachment();
- if ( count( $attachments ) ) {
- $attachments[0]['type'] = 'Document';
- $attachments[0]['name'] = 'Banner';
- }
- $event_link = $this->get_event_link();
- if ( $event_link ) {
- $attachments[] = $event_link;
- }
- return $attachments;
- }
-
- /**
- * Retrieves the excerpt text (may be HTML). Used for constructing the summary.
- *
- * @return ?string
- */
- protected function retrieve_excerpt(): ?string {
- if ( \get_post_meta( $this->item->ID, 'event-summary', true ) ) {
- return \get_post_meta( $this->item->ID, 'event-summary', true );
- } else {
- return parent::retrieve_excerpt();
- }
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventprime.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventprime.php
deleted file mode 100644
index 1d642ef8..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-eventprime.php
+++ /dev/null
@@ -1,70 +0,0 @@
-wp_object->ID, 'em_end_date', true );
- if ( $timestamp ) {
- return \wp_date( 'Y-m-d\TH:i:sP', $timestamp );
- } else {
- return null;
- }
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_start_time(): string {
- $timestamp = \get_post_meta( $this->wp_object->ID, 'em_start_date', true );
- if ( $timestamp ) {
- return \wp_date( 'Y-m-d\TH:i:sP', $timestamp );
- } else {
- return '';
- }
- }
-
- /**
- * Get location from the event object.
- */
- public function get_location(): ?Place {
- $venue_term_id = \get_post_meta( $this->item->ID, 'em_venue', true );
- if ( ! $venue_term_id ) {
- return null;
- }
-
- $venue = \get_the_terms( $this->item->ID, 'em_venue' );
-
- if ( empty( $venue ) || is_wp_error( $venue ) ) {
- return null;
- }
-
- $venue = array_pop( $venue );
-
- $location_transformer = new EventPrime_Location_Transformer( $venue );
- $location = $location_transformer->to_object();
-
- return $location;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-events-manager.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-events-manager.php
deleted file mode 100644
index a8a74938..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-events-manager.php
+++ /dev/null
@@ -1,243 +0,0 @@
-em_event = new EM_Event( $this->item->ID, 'post_id' );
- }
-
- /**
- * Returns whether the even is online
- *
- * @return bool
- */
- protected function is_online(): bool {
- return \EM_Event_Locations\Event_Locations::is_enabled( 'url' ) && 'url' === $this->em_event->event_location_type;
- }
-
- /**
- * Get the event location.
- *
- * @return array|Place|null The Place.
- */
- public function get_location() {
- if ( $this->is_online() ) {
- $event_location = $this->em_event->event_location->data;
-
- $event_link_url = isset( $event_location['url'] ) ? $event_location['url'] : null;
- $event_link_text = isset( $event_location['text'] ) ? $event_location['text'] : esc_html__( 'Link', 'event-bridge-for-activitypub' );
-
- if ( empty( $event_link_url ) ) {
- return null;
- }
-
- return array(
- 'type' => 'VirtualLocation',
- 'url' => \esc_url( $event_link_url ),
- 'name' => \esc_html( $event_link_text ),
- );
- }
-
- if ( ! \EM_Locations::is_enabled() ) {
- return null;
- }
-
- $em_location = $this->em_event->get_location();
-
- if ( ! isset( $em_location->post_id ) || ! $em_location->post_id ) {
- return null;
- }
-
- $location_transformer = new Events_Manager_Place_Transformer( get_post( $em_location->post_id ) );
- $full_location_object = false;
- $location = $location_transformer->to_object( $full_location_object );
- return $location;
- }
-
- /**
- * Get the start time of the event.
- */
- public function get_start_time(): string {
- return $this->em_event->start()->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time of the event.
- */
- public function get_end_time(): string {
- return $this->em_event->end()->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the timezone. Events calendar also supports "UTC-offset timezones", ActivityPub federation does not.
- *
- * @return string
- */
- public function get_timezone_string(): string {
- return $this->em_event->get_timezone()->getName();
- }
-
- /**
- * Returns the maximum attendee capacity.
- *
- * @return ?int
- */
- public function get_maximum_attendee_capacity() {
- return $this->em_event->event_spaces;
- }
-
- /**
- * Return the remaining attendee capacity
- *
- * @return ?int
- */
- public function get_remaining_attendee_capacity(): ?int {
- $em_bookings_count = $this->get_participant_count();
- $max_bookings = $this->em_event->event_spaces;
-
- if ( $max_bookings && $em_bookings_count ) {
- return $this->em_event->event_spaces - $em_bookings_count;
- }
-
- return null;
- }
-
- /**
- * Returns the current participant count.
- *
- * @return int
- */
- public function get_participant_count(): int {
- $em_bookings = $this->em_event->get_bookings()->get_bookings();
- return count( $em_bookings->bookings );
- }
-
- /**
- * Get the event link as an ActivityPub Link object, but as an associative array.
- *
- * @return array|null
- */
- private function get_event_link_attachment(): ?array {
- if ( $this->is_online() ) {
- $event_location = $this->em_event->event_location->data;
- $event_link_url = isset( $event_location['url'] ) ? $event_location['url'] : null;
- $event_link_text = isset( $event_location['text'] ) ? $event_location['text'] : __( 'Link', 'event-bridge-for-activitypub' );
-
- if ( empty( $event_link_url ) ) {
- return null;
- }
-
- return array(
- 'type' => 'Link',
- 'name' => \esc_html( $event_link_text ),
- 'href' => \esc_url( $event_link_url ),
- 'mediaType' => 'text/html',
- );
- }
-
- return null;
- }
-
- /**
- * Overrides/extends the get_attachments function to also add the event Link.
- */
- protected function get_attachment(): array {
- // Get attachments via parent function.
- $attachments = parent::get_attachment();
-
- // The first attachment is the featured image, make sure it is compatible with Mobilizon.
- if ( count( $attachments ) ) {
- $attachments[0]['type'] = 'Document';
- $attachments[0]['name'] = 'Banner';
- }
-
- $event_link_attachment = $this->get_event_link_attachment();
-
- if ( $event_link_attachment ) {
- $attachments[] = $event_link_attachment;
- }
- return $attachments;
- }
-
- /**
- * Compose the events tags.
- */
- public function get_tag(): array {
- // The parent tag function also fetches the mentions.
- $tags = parent::get_tag();
-
- $post_tags = \wp_get_post_terms( $this->item->ID, 'event-tags' );
-
- if ( \is_wp_error( $post_tags ) ) {
- return $tags;
- }
-
- foreach ( $post_tags as $post_tag ) {
- // @phpstan-ignore-next-line
- if ( $post_tag instanceof \WP_Term ) {
- $tag = array(
- 'type' => 'Hashtag',
- 'href' => \esc_url( \get_tag_link( $post_tag->term_id ) ),
- 'name' => esc_hashtag( $post_tag->name ),
- );
-
- $tags[] = $tag;
- }
- }
-
- return $tags;
- }
-
- /**
- * Get the events title/name.
- *
- * @return string
- */
- protected function get_name(): string {
- return $this->em_event->event_name;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-gatherpress.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-gatherpress.php
deleted file mode 100644
index 75dfd0d0..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-gatherpress.php
+++ /dev/null
@@ -1,165 +0,0 @@
-gp_event = new GatherPress_Event( $item->ID );
- $this->gp_venue = $this->gp_event->get_venue_information();
- }
-
- /**
- * Return the correct type of an Event.
- *
- * @return string
- */
- public function get_type(): string {
- return 'Event';
- }
-
- /**
- * Get the event location.
- *
- * @return Place|array|null A Place object or VirtualLocation.
- */
- public function get_location(): mixed {
- $event_link = $this->gp_event->maybe_get_online_event_link();
- if ( $event_link ) {
- return array(
- 'type' => 'VirtualLocation',
- 'url' => $event_link,
- );
- }
-
- $term = current( (array) get_the_terms( $this->gp_event->event, Venue::TAXONOMY ) );
-
- if ( ! empty( $term ) && is_a( $term, 'WP_Term' ) ) {
- $venue_post = Venue::get_instance()->get_venue_post_from_term_slug( $term->slug );
-
- if ( ! $venue_post ) {
- return null;
- }
- } else {
- return null;
- }
-
- $venue_transformer = new Venue_Transformer( $venue_post );
- $full_location_object = false;
- $location = $venue_transformer->to_object( $full_location_object );
- return $location;
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_end_time(): string {
- return $this->gp_event->get_datetime_end( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_start_time(): string {
- return $this->gp_event->get_datetime_start( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Prevents gatherpress blocks from being rendered for the content.
- *
- * @param mixed $block_content The blocks content.
- * @param mixed $block The block.
- */
- public static function filter_gatherpress_blocks( $block_content, $block ) {
- // Check if the block name starts with 'gatherpress'.
- if ( isset( $block['blockName'] ) && 0 === strpos( $block['blockName'], 'gatherpress/' ) ) {
- return ''; // Skip rendering this block.
- }
-
- return str_replace( '', '', $block_content ); // Return the content for other blocks.
- }
-
- /**
- * Transform to an the Event object.
- *
- * @return Base_Object|WP_Error
- */
- /**
- * Transform to an the Event object.
- *
- * @return Base_Object|WP_Error
- */
- public function to_object(): Base_Object|WP_Error {
- // Apply the filter for preventing the rendering off gatherpress blocks just in time.
- add_filter( 'render_block', array( self::class, 'filter_gatherpress_blocks' ), 10, 2 );
-
- // Transform all properties via getter functions.
- $object = new Event_FEP_8a8e();
- $object = $this->transform_object_properties( $object );
-
- if ( \is_wp_error( $object ) ) {
- return $object;
- }
-
- $this->set_audience( $object );
-
- remove_filter( 'render_block', array( self::class, 'filter_gatherpress_blocks' ) );
-
- // Maybe modify object for content warning.
- $content_warning = get_content_warning( $this->item );
- if ( ! empty( $content_warning ) ) {
- $object->set_sensitive( true );
- $object->set_summary( $content_warning );
- $object->set_summary_map( null );
- $object->set_dcterms( array( 'subject' => $content_warning ) );
- }
-
- return $object;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-modern-events-calendar-lite.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-modern-events-calendar-lite.php
deleted file mode 100644
index 0da29e5b..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-modern-events-calendar-lite.php
+++ /dev/null
@@ -1,129 +0,0 @@
-mec_main = MEC::getInstance( 'app.libraries.main' );
- $this->mec_event = new MEC_Event( $item );
- }
-
- /**
- * Retrieves the content without the plugins rendered shortcodes.
- */
- public function get_content(): string {
- $content = wpautop( $this->item->post_content );
- return $content;
- }
-
- /**
- * Get the end time from the event object.
- *
- * @return string
- */
- public function get_start_time(): string {
- $datetime = $this->mec_event->get_datetime()['start']['datetime'];
- $timezone = $this->get_timezone() ? new \DateTimeZone( $this->get_timezone() ) : null;
- $start_time = new \DateTime( $datetime, $timezone );
- return $start_time->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time from the event object.
- *
- * @return string
- */
- public function get_end_time(): string {
- $datetime = $this->mec_event->get_datetime()['end']['datetime'];
- $timezone = $this->get_timezone() ? new \DateTimeZone( $this->get_timezone() ) : null;
- $end_time = new \DateTime( $datetime, $timezone );
- return $end_time->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the location.
- *
- * @return ?Place
- */
- public function get_location(): ?Place {
- $location_id = $this->mec_main->get_master_location_id( $this->mec_event->ID );
-
- if ( ! $location_id ) {
- return null;
- }
-
- $data = $this->mec_main->get_location_data( $location_id );
-
- $location = new Place();
- $location->set_sensitive( null );
-
- if ( ! empty( $data['address'] ) ) {
- $location->set_address( $data['address'] );
- }
- if ( ! empty( $data['name'] ) ) {
- $location->set_name( $data['name'] );
- }
- if ( ! empty( $data['longitude'] ) ) {
- $location->set_longitude( $data['longitude'] );
- }
- if ( ! empty( $data['latitude'] ) ) {
- $location->set_latitude( $data['latitude'] );
- }
-
- return $location;
- }
-
- /**
- * Get the timezone string of the current event.
- *
- * @return mixed
- */
- public function get_timezone_string(): mixed {
- return \get_post_meta( $this->item->ID, 'mec_timezone', true );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-spiffy-calendar.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-spiffy-calendar.php
deleted file mode 100644
index 9030e739..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-spiffy-calendar.php
+++ /dev/null
@@ -1,140 +0,0 @@
-item->ID, '_spiffy_event_begin', true );
- $start_time = \get_post_meta( $this->item->ID, '_spiffy_event_begin_time', true );
-
- $start_datetime = $this->get_datetime_from_fuzzy_input( $start_date, $start_time );
-
- return $start_datetime->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_end_time(): string {
- $end_date = \get_post_meta( $this->item->ID, '_spiffy_event_end', true );
- $end_time = \get_post_meta( $this->item->ID, '_spiffy_event_end_time', true );
-
- $end_datetime = $this->get_datetime_from_fuzzy_input( $end_date, $end_time );
-
- return $end_datetime->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the location.
- *
- * @return ?Place
- */
- public function get_location(): ?Place {
- $location = \get_post_meta( $this->item->ID, '_spiffy_event_location', true );
-
- if ( ! $location ) {
- return null;
- }
-
- $place = new Place();
- $place->set_address( $location );
- $place->set_name( $location );
- return $place;
- }
-
- /**
- * Overrides/extends the get_attachments function to also add the event Link.
- *
- * @return array
- */
- protected function get_attachment(): array {
- $attachments = parent::get_attachment();
- if ( \count( $attachments ) ) {
- $attachments[0]['type'] = 'Document';
- $attachments[0]['name'] = 'Banner';
- }
- $event_link = $this->get_event_link();
- if ( $event_link ) {
- $attachments[] = $event_link;
- }
- return $attachments;
- }
-
- /**
- * Get the event link from the events metadata.
- *
- * @return array|null Associated array of an ActivityStreams Link object with the event link.
- */
- private function get_event_link(): ?array {
- $event_link = \get_post_meta( $this->item->ID, '_spiffy_event_link', true );
- if ( $event_link ) {
- return array(
- 'type' => 'Link',
- 'name' => __( 'Event Link', 'event-bridge-for-activitypub' ),
- 'href' => \esc_url( $event_link ),
- 'mediaType' => 'text/html',
- );
- }
- return null;
- }
-
- /**
- * Generate the best datetime object of the fuzzy human made data Spiffy Calendar provides.
- *
- * @param string $date The date as 2026-05-18 string.
- * @param string $time Fuzzy time like 14:00, 2pm, 2 PM, noon, midnight, etc.
- * @return DateTimeImmutable
- */
- private function get_datetime_from_fuzzy_input( string $date = '', string $time = '' ): DateTimeImmutable {
- $timezone = new DateTimeZone( $this->get_timezone_string() );
-
- // Normalize fuzzy human time.
- $time = trim( strtolower( $time ) );
-
- $map = array(
- __( 'noon', 'event-bridge-for-activitypub' ) => '12:00',
- __( 'midday', 'event-bridge-for-activitypub' ) => '12:00',
- __( 'midnight', 'event-bridge-for-activitypub' ) => '00:00',
- __( 'morning', 'event-bridge-for-activitypub' ) => '09:00',
- __( 'afternoon', 'event-bridge-for-activitypub' ) => '15:00',
- __( 'evening', 'event-bridge-for-activitypub' ) => '19:00',
- );
-
- $time = $map[ $time ] ?? $time;
-
- $input = trim( "$date $time" );
-
- try {
- $datetime = new DateTimeImmutable( $input, $timezone );
- } catch ( \Throwable $e ) {
- $datetime = new DateTimeImmutable( "$date 00:00", $timezone );
- }
-
- return $datetime;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-the-events-calendar.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-the-events-calendar.php
deleted file mode 100644
index 29480433..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-the-events-calendar.php
+++ /dev/null
@@ -1,199 +0,0 @@
-tribe_event = \tribe_get_event( $item );
- }
-
- /**
- * Get the tags, including also the set categories from The Events Calendar.
- *
- * @return array The array if tags,
- */
- public function get_tag(): array {
- $tags = array();
- $category_ids = tribe_get_event_cat_ids();
- if ( $category_ids ) {
- foreach ( $category_ids as $category_id ) {
- $term = \get_term( $category_id );
- $tag = array(
- 'type' => 'Hashtag',
- 'href' => \esc_url( \get_term_link( $term ) ),
- 'name' => esc_hashtag( $term->name ),
- );
- $tags[] = $tag;
- }
- }
- $tags = array_merge( $tags, parent::get_tag() );
-
- return $tags;
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_end_time(): string {
- $utc_time = get_post_meta( $this->tribe_event->ID, '_EventEndDateUTC', true );
- $timezone = new \DateTimeZone( $this->get_timezone_string() );
- $time = new \DateTime( $utc_time );
- $time->setTimezone( $timezone );
- return $time->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the end time from the event object.
- */
- public function get_start_time(): string {
- $utc_time = get_post_meta( $this->tribe_event->ID, '_EventStartDateUTC', true );
- $timezone = new \DateTimeZone( $this->get_timezone_string() );
- $time = new \DateTime( $utc_time );
- $time->setTimezone( $timezone );
- return $time->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the timezone of the event.
- *
- * @return string The timezone string of the event.
- */
- public function get_timezone_string(): string {
- // @phpstan-ignore-next-line
- return (string) $this->tribe_event->timezone;
- }
-
- /**
- * Get status of the tribe event
- *
- * @return string status of the event
- */
- public function get_status(): string {
- // @phpstan-ignore-next-line
- $event_status = $this->tribe_event->event_status;
-
- if ( 'canceled' === $event_status ) {
- return 'CANCELLED';
- }
-
- if ( 'postponed' === $event_status ) {
- return 'CANCELLED'; // This will be reflected in the cancelled reason.
- }
-
- return 'CONFIRMED';
- }
-
-
- /**
- * Check if the comments are enabled for the current event.
- */
- public function get_comments_enabled(): bool {
- return ( 'open' === $this->tribe_event->comment_status ) ? true : false;
- }
-
- /**
- * Check if the event is an online event.
- *
- * @return false
- */
- public function get_is_online() {
- return false;
- }
-
- /**
- * Get the event location.
- *
- * @return ?Place The place/venue if one is set.
- */
- public function get_location(): ?Place {
- // Get short handle for the venues.
-
- if ( ! \tribe_has_venue( $this->tribe_event->ID ) ) {
- return null;
- }
-
- $venue_id = \tribe_get_venue_id( $this->tribe_event->ID );
- $post = \get_post( $venue_id );
-
- if ( ! $post ) {
- return null;
- }
-
- $location_transformer = new The_Events_Calendar_Location( $post );
- $full_location_object = false;
- $location = $location_transformer->to_object( $full_location_object );
- return $location;
- }
-
- /**
- * Apply the filter for preventing the rendering off The Events Calendar blocks just in time.
- *
- * @return Event_Object
- */
- public function to_object(): Event_Object {
- add_filter( 'render_block', array( self::class, 'filter_tribe_blocks' ), 10, 2 );
- $activitypub_object = parent::to_object();
- remove_filter( 'render_block', array( self::class, 'filter_tribe_blocks' ) );
- return $activitypub_object;
- }
-
- /**
- * Prevents The Events Calendar blocks from being rendered for the content.
- *
- * @param mixed $block_content The blocks content.
- * @param mixed $block The block.
- */
- public static function filter_tribe_blocks( $block_content, $block ) {
- // Check if the block name starts with 'tribe' and is not an exception.
- if ( isset( $block['blockName'] ) && 0 === strpos( $block['blockName'], 'tribe/' ) ) {
- return ''; // Skip rendering this block.
- }
-
- return $block_content; // Return the content for other blocks.
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-vs-event-list.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-vs-event-list.php
deleted file mode 100644
index cd793041..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-vs-event-list.php
+++ /dev/null
@@ -1,115 +0,0 @@
-item->ID, 'event-location', true );
- if ( $address ) {
- $place = new Place();
- $place->set_type( 'Place' );
- $place->set_name( $address );
- $place->set_address( $address );
- return $place;
- } else {
- return null;
- }
- }
-
- /**
- * Get the end time from the events metadata.
- */
- public function get_end_time(): ?string {
- if ( 'yes' === \get_post_meta( $this->item->ID, 'event-hide-end-time', true ) ) {
- return null;
- }
- $end_time = \get_post_meta( $this->item->ID, 'event-date', true );
- if ( is_null( $end_time ) || empty( $end_time ) || 'no' === $end_time ) {
- return null;
- }
- return \wp_date( 'Y-m-d\TH:i:sP', (int) $end_time );
- }
-
- /**
- * Get the end time from the events metadata.
- */
- public function get_start_time(): string {
- $start_time = \get_post_meta( $this->item->ID, 'event-start-date', true );
- return \wp_date( 'Y-m-d\TH:i:sP', (int) $start_time );
- }
-
- /**
- * Get the event link from the events metadata.
- *
- * @return ?array Associated array of an ActivityStreams Link object with the events URL.
- */
- private function get_event_link(): ?array {
- $event_link = \get_post_meta( $this->item->ID, 'event-link', true );
- $event_link_label = \get_post_meta( $this->item->ID, 'event-link-label', true ) ?? 'Event Link';
- if ( $event_link ) {
- return array(
- 'type' => 'Link',
- 'name' => $event_link_label,
- 'href' => \esc_url( $event_link ),
- 'mediaType' => 'text/html',
- );
- }
- return null;
- }
-
- /**
- * Overrides/extends the get_attachments function to also add the event Link.
- *
- * @return array
- */
- protected function get_attachment(): array {
- $attachments = parent::get_attachment();
- if ( count( $attachments ) ) {
- $attachments[0]['type'] = 'Document';
- $attachments[0]['name'] = 'Banner';
- }
- $event_link = $this->get_event_link();
- if ( $event_link ) {
- $attachments[] = $event_link;
- }
- return $attachments;
- }
-
- /**
- * Retrieves the excerpt text (may be HTML). Used for constructing the summary.
- *
- * @return ?string
- */
- protected function retrieve_excerpt(): ?string {
- if ( \get_post_meta( $this->item->ID, 'event-summary', true ) ) {
- return \get_post_meta( $this->item->ID, 'event-summary', true );
- } else {
- return parent::retrieve_excerpt();
- }
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-wp-event-manager.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-wp-event-manager.php
deleted file mode 100644
index 7da0f16f..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/event/class-wp-event-manager.php
+++ /dev/null
@@ -1,160 +0,0 @@
-item->ID, '_event_online', true );
- $is_online = false;
- // Radio buttons.
- if ( 'yes' === $is_online_text ) {
- $is_online = true;
- }
- // Checkbox.
- if ( '1' === $is_online_text ) {
- $is_online = true;
- }
- return $is_online;
- }
-
- /**
- * Get the event location.
- *
- * @return ?Place The Place.
- */
- public function get_location(): ?Place {
- $location_name = \get_post_meta( $this->item->ID, '_event_location', true );
-
- if ( $location_name ) {
- $location = new Place();
- $location->set_name( $location_name );
- $location->set_sensitive( null );
- $location->set_address( $location_name );
-
- return $location;
- }
- return null;
- }
-
- /**
- * Get the end time from the events metadata.
- *
- * @return ?string The events end-datetime if is set, null otherwise.
- */
- public function get_end_time(): ?string {
- $end_date = \get_post_meta( $this->item->ID, '_event_end_date', true );
- if ( ! $end_date ) {
- return null;
- }
-
- $timezone = $this->get_timezone() ? new DateTimeZone( $this->get_timezone() ) : null;
-
- if ( is_numeric( $end_date ) ) {
- $end_date = '@' . $end_date;
- }
-
- $end_datetime = new DateTime( $end_date, $timezone );
-
- return $end_datetime->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get timezone.
- *
- * @return mixed
- */
- public function get_timezone_string(): mixed {
- return \get_post_meta( $this->item->ID, '_event_timezone', true );
- }
-
- /**
- * Get the end time from the events metadata.
- */
- public function get_start_time(): string {
- $start_date = \get_post_meta( $this->item->ID, '_event_start_date', true );
-
- $timezone = $this->get_timezone() ? new DateTimeZone( $this->get_timezone() ) : null;
-
- if ( is_numeric( $start_date ) ) {
- $start_date = '@' . $start_date;
- }
-
- $start_datetime = new DateTime( $start_date, $timezone );
-
- return $start_datetime->format( 'Y-m-d\TH:i:sP' );
- }
-
- /**
- * Get the event link as an ActivityPub Link object, but as an associative array.
- *
- * @return ?array
- */
- private function get_event_link_attachment(): ?array {
- $event_link_url = \get_post_meta( $this->item->ID, '_event_video_url', true );
-
- if ( str_starts_with( $event_link_url, 'http' ) ) {
- return array(
- 'type' => 'Link',
- 'name' => \esc_html__( 'Video URL', 'event-bridge-for-activitypub' ),
- 'href' => \esc_url( $event_link_url ),
- 'mediaType' => 'text/html',
- );
- } else {
- return null;
- }
- }
-
- /**
- * Overrides/extends the get_attachments function to also add the event Link.
- */
- protected function get_attachment() {
- // Get attachments via parent function.
- $attachments = parent::get_attachment();
-
- // The first attachment is the featured image, make sure it is compatible with Mobilizon.
- if ( count( $attachments ) ) {
- $attachments[0]['type'] = 'Document';
- $attachments[0]['name'] = 'Banner';
- }
-
- if ( $this->get_event_link_attachment() ) {
- $attachments[] = $this->get_event_link_attachment();
- }
- return $attachments;
- }
-
- /**
- * Get the events title/name.
- *
- * @return string
- */
- protected function get_name(): string {
- return $this->item->post_title;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-post-place.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-post-place.php
deleted file mode 100644
index 511b48aa..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-post-place.php
+++ /dev/null
@@ -1,146 +0,0 @@
-transform_object_properties( $activitypub_object );
-
- if ( \is_wp_error( $activitypub_object ) ) {
- return $activitypub_object;
- }
-
- if ( ! empty( $activitypub_object->get_content() ) ) {
- $activitypub_object->set_content_map(
- array(
- $this->get_locale() => $this->get_content(),
- )
- );
- }
-
- $updated = \strtotime( $this->item->post_modified_gmt );
-
- $activitypub_object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) );
-
- if ( $full_object ) {
- $published = \strtotime( $this->item->post_date_gmt );
-
- $activitypub_object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) );
-
- $activitypub_object->set_to(
- array(
- 'https://www.w3.org/ns/activitystreams#Public',
- $this->get_actor_object()->get_followers(),
- )
- );
- }
-
- $address = $this->get_address();
-
- if ( $address ) {
- $activitypub_object->set_address( $address );
- }
-
- // @phpstan-ignore-next-line
- return $activitypub_object;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-term-place.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-term-place.php
deleted file mode 100644
index 703758f6..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-base-term-place.php
+++ /dev/null
@@ -1,165 +0,0 @@
-item->term_id;
- }
-
- /**
- * Get the ActivityPub ID of the term.
- *
- * @return string
- */
- public function get_url() {
- return \get_term_link( $this->item );
- }
-
- /**
- * Returns the most unique, resolvable "ID" there currently is for a WordPress term.
- *
- * @return string The "ID"
- */
- public function get_id() {
- /**
- * The first approach was to use the normal query from WordPress, but it contains the slug, which might be edited.
- *
- * \add_query_arg( $this->item->taxonomy, $this->item->slug, \trailingslashit( \home_url() ) );
- *
- * As https://github.com/Automattic/wordpress-activitypub/pull/1272 got merged, now we can definy a real ID.
- */
- return \add_query_arg( 'term_id', $this->item->term_id, \trailingslashit( \home_url() ) );
- }
-
- /**
- * Use Term description as ActivityPub content.
- *
- * @return mixed|string
- */
- public function get_content() {
- return $this->item->description;
- }
-
- /**
- * Returns the name for the ActivityPub Item which is the title of the term.
- *
- * @return string|null The title or null if the object type is `note`.
- */
- protected function get_name() {
- if ( isset( $this->item->name ) && $this->item instanceof \WP_Term ) {
- return \wp_strip_all_tags(
- \html_entity_decode(
- $this->item->name
- )
- );
- }
-
- return null;
- }
-
- /**
- * Generic function that converts an WordPress location object to an ActivityPub-Place object.
- *
- * @return Place_Object|\WP_Error
- */
- public function to_object() {
- $activitypub_object = new Place_Object();
-
- $activitypub_object->set_type( $this->get_type() );
- $activitypub_object->set_id( $this->get_id() );
- $activitypub_object->set_name( $this->get_name() );
- $activitypub_object->set_url( $this->get_url() );
- $activitypub_object->set_content( $this->get_content() );
- $activitypub_object->set_sensitive( $this->get_sensitive() );
-
- $address = $this->get_address();
-
- if ( $address ) {
- $activitypub_object->set_address( $address );
- }
-
- return $activitypub_object;
- }
-
- /**
- * Don't set a media type on Place per default.
- *
- * @return null
- * @phpstan-ignore-next-line
- */
- public function get_media_type() {
- return null;
- }
-
- /**
- * Don't set sensitive per default.
- *
- * @return null|bool
- */
- public function get_sensitive() {
- return null;
- }
-
- /**
- * Don't support replies for Place per default.
- *
- * @return null
- */
- public function get_replies() {
- return null;
- }
-
- /**
- * Don't support tags for Place per default.
- *
- * @return null
- * @phpstan-ignore-next-line
- */
- protected function get_tag() {
- return null;
- }
-
- /**
- * Don't set attrbuted to per default.
- *
- * @return null The attributed to.
- * @phpstan-ignore-next-line
- */
- protected function get_attributed_to() {
- return null;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-event-organiser.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-event-organiser.php
deleted file mode 100644
index adfdaf6e..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-event-organiser.php
+++ /dev/null
@@ -1,89 +0,0 @@
-item->ID );
- return 0.0 !== $longitude ? $longitude : null;
- }
-
- /**
- * Get the latitude.
- *
- * @return float|null
- */
- public function get_latitude() {
- $latitude = \eo_get_venue_lat( $this->item->ID );
- return 0.0 !== $latitude ? $latitude : null;
- }
-
- /**
- * Get the description of the venue as the ActivityPub content.
- *
- * @return string|null
- */
- public function get_content() {
- $description = \eo_get_venue_description( $this->item->term_id );
-
- if ( empty( $description ) ) {
- return null;
- }
-
- return $description;
- }
-
- /**
- * Get the events address.
- *
- * @return ?array The place/venue if one is set, or null if no valid address data exists.
- */
- public function get_address(): ?array {
- $address = \eo_get_venue_address( $this->item->term_id );
-
- // Map the values to a schema.org PostalAddress.
- $postal_address = array(
- 'streetAddress' => isset( $address['address'] ) ? $address['address'] : null,
- 'postalCode' => isset( $address['address'] ) ? $address['postcode'] : null,
- 'addressRegion' => isset( $address['address'] ) ? $address['state'] : null,
- 'addressLocality' => isset( $address['address'] ) ? $address['city'] : null,
- 'addressCountry' => isset( $address['address'] ) ? $address['country'] : null,
- );
-
- // Filter out empty values.
- foreach ( $postal_address as $key => $value ) {
- if ( empty( $value ) ) {
- unset( $postal_address[ $key ] );
- }
- }
-
- // If no valid address data remains, return null.
- if ( empty( $postal_address ) ) {
- return null;
- }
-
- // Add the type.
- $postal_address['type'] = 'PostalAddress';
-
- return $postal_address;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventon.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventon.php
deleted file mode 100644
index 7092945c..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventon.php
+++ /dev/null
@@ -1,197 +0,0 @@
-term_id ] ) ) {
- $this->tax_meta = $evo_tax_meta['event_location'][ $item->term_id ];
- }
- }
-
- /**
- * Generic function that converts an WordPress location object to an ActivityPub-Place object.
- *
- * @return Place_Object|\WP_Error
- */
- public function to_object() {
- $object = parent::to_object();
-
- if ( \is_wp_error( $object ) ) {
- return $object;
- }
-
- $object->set_longitude( $this->get_longitude() );
- $object->set_latitude( $this->get_latitude() );
-
- return $object;
- }
-
- /**
- * Get the type, either Place or VirtualLocation, both is stored in the same taxonomy.
- *
- * @return string
- */
- public function get_type(): string {
- if ( $this->is_virtual_location() ) {
- return 'VirtualLocation';
- }
- return 'Place';
- }
-
- /**
- * Get the longitute.
- *
- * @return float|null
- */
- public function get_longitude(): ?float {
- $longitude = null;
-
- if ( isset( $this->tax_meta['location_lon'] ) ) {
- $longitude = $this->tax_meta['location_lon'];
- }
-
- return $longitude ? (float) $longitude : null;
- }
-
- /**
- * Get the latitude.
- *
- * @return float|null
- */
- public function get_latitude(): ?float {
- $latitude = null;
-
- if ( isset( $this->tax_meta['location_lat'] ) ) {
- $latitude = $this->tax_meta['location_lat'];
- }
-
- return $latitude ? (float) $latitude : null;
- }
-
- /**
- * Get the events address.
- *
- * @return ?array The place/venue if one is set, or null if no valid address data exists.
- */
- public function get_address(): ?array {
-
- if ( $this->is_virtual_location() ) {
- return null;
- }
-
- // Map the values to a schema.org PostalAddress.
- $postal_address = array(
- 'streetAddress' => isset( $this->tax_meta['location_address'] ) ? (string) $this->tax_meta['location_address'] : null,
- 'addressRegion' => isset( $this->tax_meta['location_state'] ) ? (string) $this->tax_meta['location_state'] : null,
- 'addressCountry' => isset( $this->tax_meta['location_country'] ) ? (string) $this->tax_meta['location_country'] : null,
- );
-
- if ( isset( $this->tax_meta['location_city'] ) ) {
- $locality_and_postal_code = $this->parse_city_for_postal_code( $this->tax_meta['location_city'] );
- $postal_address['addressLocality'] = (string) $locality_and_postal_code['addressLocality'];
- $postal_address['postalCode'] = (string) $locality_and_postal_code['postalCode'];
- }
-
- // Filter out empty values.
- foreach ( $postal_address as $key => $value ) {
- if ( empty( $value ) ) {
- unset( $postal_address[ $key ] );
- }
- }
-
- // If no valid address data remains, return null.
- if ( empty( $postal_address ) ) {
- return null;
- }
-
- // Add the type.
- $postal_address = array_merge(
- array(
- 'type' => 'PostalAddress',
- ),
- $postal_address
- );
-
- return $postal_address;
- }
-
- /**
- * Check if this term represents a virtual location.
- *
- * @return bool
- */
- private function is_virtual_location(): bool {
- if ( isset( $this->tax_meta['location_type'] ) && 'virtual' === $this->tax_meta['location_type'] ) {
- return true;
- }
- return false;
- }
-
- /**
- * Parse a string whether it contains a postal code and seperates both.
- *
- * @param string $input The input string of the locality which might contain the postal code too.
- * @return array{addressLocality: string, postalCode: string}
- */
- private function parse_city_for_postal_code( $input ): array {
- $input = trim( $input );
-
- if ( empty( $input ) ) {
- return array(
- 'addressLocality' => '',
- 'postalCode' => '',
- );
- }
-
- $parts = explode( ' ', $input );
- $postal_code = '';
- $locality = array();
-
- foreach ( $parts as $part ) {
- if ( preg_match( '/^\d{4,5}$/', $part ) ) {
- // Match postal codes (assuming 4-5 digit codes).
- $postal_code = $part;
- } else {
- // Assume everything else is part of the name of the city.
- $locality[] = $part;
- }
- }
-
- return array(
- 'addressLocality' => implode( ' ', $locality ),
- 'postalCode' => $postal_code,
- );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventprime.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventprime.php
deleted file mode 100644
index 668b6681..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-eventprime.php
+++ /dev/null
@@ -1,59 +0,0 @@
-ep_get_custom_page_url( 'venues_page', $this->item->term_id, 'venue', 'term' );
-
- if ( \is_wp_error( $url ) ) {
- return null;
- }
- return $url;
- }
-
- /**
- * Get the best "ID" we currently have.
- *
- * @return string|null
- */
- public function get_id() {
- return $this->get_url();
- }
-
- /**
- * Get the event location.
- *
- * @return array|string|null The place/venue if one is set.
- */
- public function get_address() {
- $address = \get_term_meta( $this->item->term_id, 'em_address', true );
- $display_address = \get_term_meta( $this->item->term_id, 'em_display_address_on_frontend', true );
-
- if ( $address && $display_address ) {
- return $address;
- }
-
- return null;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-events-manager.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-events-manager.php
deleted file mode 100644
index dad8fcad..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-events-manager.php
+++ /dev/null
@@ -1,95 +0,0 @@
-post_type ) {
- $this->em_location = em_get_location( $post );
- }
- }
-
- /**
- * Get the name of the location.
- *
- * @return ?string
- */
- public function get_name(): ?string {
- if ( isset( $this->em_location->location_name ) ) {
- return \wp_strip_all_tags(
- \html_entity_decode(
- $this->em_location->location_name
- )
- );
- }
-
- return null;
- }
-
- /**
- * Get the event location.
- *
- * @return ?array The place/venue if one is set.
- */
- public function get_address(): ?array {
- $postal_address = array();
-
- if ( isset( $this->em_location->location_country ) && $this->em_location->location_country ) {
- $postal_address['addressCountry'] = $this->em_location->location_country;
- }
-
- if ( isset( $this->em_location->location_town ) && $this->em_location->location_town ) {
- $postal_address['addressLocality'] = $this->em_location->location_town;
- }
-
- if ( isset( $this->em_location->location_address ) && $this->em_location->location_address ) {
- $postal_address['streetAddress'] = $this->em_location->location_address;
- }
-
- if ( isset( $this->em_location->location_state ) && $this->em_location->location_state ) {
- $postal_address['addressRegion'] = $this->em_location->location_state;
- }
-
- if ( isset( $this->em_location->location_postcode ) && $this->em_location->location_postcode ) {
- $postal_address['postalCode'] = $this->em_location->location_postcode;
- }
-
- if ( ! empty( $postal_address ) ) {
- return array_merge( array( 'type' => 'PostalAddress' ), $postal_address );
- }
-
- return null;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-gatherpress.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-gatherpress.php
deleted file mode 100644
index acd2f5bd..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-gatherpress.php
+++ /dev/null
@@ -1,152 +0,0 @@
-venue_meta = json_decode( get_post_meta( $this->item->ID, 'gatherpress_venue_information', true ) );
- }
-
- /**
- * Return the correct type of an Event.
- *
- * @return string
- */
- public function get_type(): string {
- return 'Place';
- }
-
- /**
- * Get the event location.
- *
- * @return string The name of the venue.
- */
- public function get_name(): string {
- return $this->item->post_title;
- }
-
- /**
- * The full address of the venue.
- *
- * @return string|null
- */
- public function get_address(): ?string {
- return $this->venue_meta->fullAddress ?? null;
- }
-
- /**
- * Latitude of the venue.
- *
- * @return float|null
- */
- public function get_latitude(): ?float {
- return $this->venue_meta->latitude ?? null;
- }
-
- /**
- * Longitude of the venue.
- *
- * @return float|null
- */
- public function get_longitude(): ?float {
- return $this->venue_meta->longitude ?? null;
- }
-
- /**
- * The telephone number of the venue.
- *
- * @return string|null
- */
- public function get_telephone(): ?string {
- return $this->venue_meta->phone_number ?? null;
- }
-
- /**
- * The website of the venue.
- *
- * @return string|null
- */
- public function get_same_as(): ?string {
- return $this->venue_meta->website ?? null;
- }
-
- /**
- * Generic function that converts an WordPress location object to an ActivityPub-Place object.
- *
- * @param bool $full_object bool Return an object with all properties set, or a minimal one as used within an `as:Event`s location.
- * @return Place|\WP_Error
- */
- public function to_object( $full_object = true ): Base_Object|WP_Error {
- $activitypub_object = new Place();
- $activitypub_object = $this->transform_object_properties( $activitypub_object );
-
- if ( \is_wp_error( $activitypub_object ) ) {
- return $activitypub_object;
- }
-
- if ( ! empty( $activitypub_object->get_content() ) ) {
- $activitypub_object->set_content_map(
- array(
- $this->get_locale() => $this->get_content(),
- )
- );
- }
-
- $updated = \strtotime( $this->item->post_modified_gmt );
-
- $activitypub_object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) );
-
- if ( $full_object ) {
- $published = \strtotime( $this->item->post_date_gmt );
-
- $activitypub_object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) );
-
- $activitypub_object->set_to(
- array(
- 'https://www.w3.org/ns/activitystreams#Public',
- $this->get_actor_object()->get_followers(),
- )
- );
- }
-
- // @phpstan-ignore-next-line
- return $activitypub_object;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-the-events-calendar.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-the-events-calendar.php
deleted file mode 100644
index 92219e63..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transformer/place/class-the-events-calendar.php
+++ /dev/null
@@ -1,81 +0,0 @@
-item->ID );
- if ( $country ) {
- $postal_address['addressCountry'] = $country;
- }
-
- $city = \tribe_get_city( $this->item->ID );
- if ( $city ) {
- $postal_address['addressLocality'] = $city;
- }
-
- $province = \tribe_get_province( $this->item->ID );
- if ( $province ) {
- $postal_address['addressRegion'] = $province;
- }
-
- $zip = \tribe_get_zip( $this->item->ID );
- if ( $zip ) {
- $postal_address['postalCode'] = $zip;
- }
-
- $address = \tribe_get_address( $this->item->ID );
- if ( $city ) {
- $postal_address['streetAddress'] = $address;
- }
-
- if ( empty( $postal_address ) ) {
- return null;
- }
-
- $postal_address = array_merge( array( 'type' => 'PostalAddress' ), $postal_address );
-
- return $postal_address;
- }
-
- /**
- * Get the latitude of the place.
- *
- * @return ?float The latitude if it is known.
- */
- public function get_latitude() {
- return tribe_get_coordinates( $this->item->ID )['lat'] ?? null;
- }
-
- /**
- * Get the longitude of the place.
- *
- * @return ?float The longitude if it is known.
- */
- public function get_longitude() {
- return tribe_get_coordinates( $this->item->ID )['lng'] ?? null;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-base.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-base.php
deleted file mode 100644
index f1b2244b..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-base.php
+++ /dev/null
@@ -1,399 +0,0 @@
-get_id();
- $event_source_activitypub_id = \get_the_guid( $event_source_post_id );
-
- if ( $post_id ) {
- \do_action(
- 'event_bridge_for_activitypub_write_log',
- array( "[ACTIVITYPUB] Processed incoming event {$event_activitypub_id} from {$event_source_activitypub_id}" )
- );
- } else {
- \do_action(
- 'event_bridge_for_activitypub_write_log',
- array( "[ACTIVITYPUB] Failed processing incoming event {$event_activitypub_id} from {$event_source_activitypub_id}" )
- );
- }
- }
-
- /**
- * Insert post meta to remember who we received an event from.
- *
- * @param int $post_id The WordPress post ID of the event itself.
- * @param int $event_source_post_id The WordPress post ID of the event source custom post type.
- *
- * @return void
- */
- public static function add_origin_post_meta( $post_id, $event_source_post_id ): void {
- // Use post meta to remember who we received this event from.
- \update_post_meta( $post_id, '_event_bridge_for_activitypub_event_source', absint( $event_source_post_id ) );
- \update_post_meta( $post_id, 'activitypub_content_visibility', defined( 'ACTIVITYPUB_CONTENT_VISIBILITY_LOCAL' ) ? constant( 'ACTIVITYPUB_CONTENT_VISIBILITY_LOCAL' ) : '' );
- }
-
- /**
- * Delete a local event in WordPress that is a cached remote one.
- *
- * @param string $activitypub_event_id The ActivityPub events ID.
- * @return bool|WP_Post|null|WP_Error
- */
- public static function delete( $activitypub_event_id ) {
- $post_id = static::get_post_id_from_activitypub_id( $activitypub_event_id );
-
- if ( ! $post_id ) {
- \do_action(
- 'event_bridge_for_activitypub_write_log',
- array( "[ACTIVITYPUB] Received delete for event that is not cached locally {$activitypub_event_id}" )
- );
- return new WP_Error(
- 'event_bridge_for_activitypub_remote_event_not_found',
- \__( 'Remote event not found in cache', 'event-bridge-for-activitypub' ),
- array( 'status' => 404 )
- );
- }
-
- $thumbnail_id = get_post_thumbnail_id( $post_id );
-
- if ( $thumbnail_id && ! Event_Sources::is_attachment_featured_image( $thumbnail_id ) ) {
- wp_delete_attachment( $thumbnail_id, true );
- }
-
- $result = wp_delete_post( $post_id, true );
-
- if ( $result ) {
- \do_action( 'event_bridge_for_activitypub_write_log', array( "[ACTIVITYPUB] Deleted cached event {$activitypub_event_id}" ) );
- } else {
- \do_action( 'event_bridge_for_activitypub_write_log', array( "[ACTIVITYPUB] Failed deleting cached event {$activitypub_event_id}" ) );
- }
-
- return $result;
- }
-
- /**
- * Format an ActivityStreams xds:datetime to WordPress GMT format.
- *
- * @param string $time_string The ActivityStreams xds:datetime (may include offset).
- * @return string The GMT string in format 'Y-m-d H:i:s'.
- */
- protected static function format_time_string_to_wordpress_gmt( $time_string ): string {
- $datetime = new \DateTime( $time_string );
- $datetime->setTimezone( new \DateTimeZone( 'GMT' ) );
- return $datetime->format( 'Y-m-d H:i:s' );
- }
-
- /**
- * Get WordPress post by ActivityPub object ID using the guid.
- *
- * @param string $activitypub_id The ActivityPub object ID.
- * @return int The WordPress Post ID, 0 if not post with that ActivityPub object ID (by guid) is found.
- */
- protected static function get_post_id_from_activitypub_id( $activitypub_id ): int {
- global $wpdb;
-
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
- return (int) $wpdb->get_var(
- $wpdb->prepare(
- "SELECT ID FROM $wpdb->posts WHERE guid=%s",
- esc_sql( $activitypub_id ),
- )
- );
- }
-
- /**
- * Get the image URL and alt-text of an ActivityPub object.
- *
- * @param mixed $data The ActivityPub object as ann associative array.
- * @return array Array containing the images URL and alt-text.
- */
- private static function extract_image_alt_and_url( $data ): array {
- $image = array(
- 'url' => null,
- 'alt' => null,
- );
-
- // Check whether it is already simple.
- if ( ! $data || is_string( $data ) ) {
- $image['url'] = $data;
- return $image;
- }
-
- if ( ! isset( $data['type'] ) ) {
- return $image;
- }
-
- if ( ! in_array( $data['type'], array( 'Document', 'Image' ), true ) ) {
- return $image;
- }
-
- if ( isset( $data['url'] ) ) {
- $image['url'] = $data['url'];
- } elseif ( isset( $data['id'] ) ) {
- $image['id'] = $data['id'];
- }
-
- if ( isset( $data['name'] ) ) {
- $image['alt'] = $data['name'];
- }
-
- return $image;
- }
-
- /**
- * Returns the URL of the featured image.
- *
- * @param Event $event The ActivityPub event object.
- *
- * @return array
- */
- protected static function get_featured_image( $event ): array {
- // Search for the featured image in the image property.
- $image = $event->get_image();
-
- if ( $image ) {
- return self::extract_image_alt_and_url( $image );
- }
-
- // Fallback attachment.
- $attachment = $event->get_attachment();
-
- // If attachment is an array get the first fitting one.
- if ( is_array( $attachment ) && ! empty( $attachment ) ) {
- $supported_types = array( 'Image', 'Document' );
- $match = null;
-
- foreach ( $attachment as $item ) {
- if ( in_array( $item['type'], $supported_types, true ) ) {
- $match = $item;
- break;
- }
- }
-
- $attachment = $match;
- }
-
- return self::extract_image_alt_and_url( $attachment );
- }
-
- /**
- * Given an image URL return an attachment ID. Image will be side-loaded into the media library if it doesn't exist.
- *
- * Forked from https://gist.github.com/kingkool68/a66d2df7835a8869625282faa78b489a.
- *
- * @param int $post_id The post ID where the image will be set as featured image.
- * @param string $url The image URL to maybe sideload.
- * @uses media_sideload_image
- * @return string|int|WP_Error
- */
- protected static function maybe_sideload_image( $post_id, $url = '' ) {
- global $wpdb;
-
- // Include necessary WordPress file for media handling.
- if ( ! function_exists( 'media_sideload_image' ) ) {
- require_once ABSPATH . 'wp-admin/includes/media.php';
- require_once ABSPATH . 'wp-admin/includes/file.php';
- require_once ABSPATH . 'wp-admin/includes/image.php';
- }
-
- // Check to see if the URL has already been fetched, if so return the attachment ID.
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
- $attachment_id = $wpdb->get_var(
- $wpdb->prepare( "SELECT `post_id` FROM {$wpdb->postmeta} WHERE `meta_key` = '_source_url' AND `meta_value` = %s", $url )
- );
- if ( ! empty( $attachment_id ) ) {
- return $attachment_id;
- }
-
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
- $attachment_id = $wpdb->get_var(
- $wpdb->prepare( "SELECT `ID` FROM {$wpdb->posts} WHERE guid=%s", $url )
- );
- if ( ! empty( $attachment_id ) ) {
- return $attachment_id;
- }
-
- // If the URL doesn't exist, sideload it to the media library.
- return media_sideload_image( $url, $post_id, $url, 'id' );
- }
-
- /**
- * Sideload an image_url set it as featured image and add the alt-text.
- *
- * @param int $post_id The post ID where the image will be set as featured image.
- * @param string $image_url The image URL.
- * @param string $alt_text The alt-text of the image.
- * @return int|WP_Error The attachment ID
- */
- protected static function set_featured_image_with_alt( $post_id, $image_url, $alt_text = '' ) {
- // Maybe sideload the image or get the Attachment ID of an existing one.
- $image_id = self::maybe_sideload_image( $post_id, $image_url );
-
- if ( \is_wp_error( $image_id ) ) {
- // Handle the error.
- return $image_id;
- }
-
- // Set the image as the featured image for the post.
- \set_post_thumbnail( $post_id, $image_id );
-
- // Update the alt text.
- if ( ! empty( $alt_text ) ) {
- \update_post_meta( $image_id, '_wp_attachment_image_alt', $alt_text );
- }
-
- return $image_id; // Return the attachment ID for further use if needed.
- }
-
- /**
- * Convert a PostalAddress to a string.
- *
- * @link https://schema.org/PostalAddress
- *
- * @param array $postal_address The PostalAddress as an associative array.
- * @return string
- */
- private static function postal_address_to_string( $postal_address ): string {
- if ( ! isset( $postal_address['type'] ) || 'PostalAddress' !== $postal_address['type'] ) {
- _doing_it_wrong(
- __METHOD__,
- 'The parameter postal_address must be an associate array like schema.org/PostalAddress.',
- esc_html( EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_VERSION )
- );
- }
-
- $address = array();
- $known_attributes = array(
- 'streetAddress',
- 'postalCode',
- 'addressLocality',
- 'addressState',
- 'addressCountry',
- );
-
- foreach ( $known_attributes as $attribute ) {
- if ( isset( $postal_address[ $attribute ] ) && is_string( $postal_address[ $attribute ] ) ) {
- $address[] = $postal_address[ $attribute ];
- }
- }
-
- $address_string = implode( ' ,', $address );
-
- return $address_string;
- }
-
- /**
- * Convert an address to a string.
- *
- * @param mixed $address The address as an object, string or associative array.
- * @return string
- */
- protected static function address_to_string( $address ): string {
- if ( is_string( $address ) ) {
- return $address;
- }
-
- if ( is_object( $address ) ) {
- $address = (array) $address;
- }
-
- if ( ! is_array( $address ) || ! isset( $address['type'] ) ) {
- return '';
- }
-
- if ( 'PostalAddress' === $address['type'] ) {
- return self::postal_address_to_string( $address );
- }
- return '';
- }
-
- /**
- * Return the number of revisions to keep.
- *
- * @return int The number of revisions to keep.
- */
- public static function revisions_to_keep(): int {
- return 5;
- }
-
- /**
- * Returns the URL of the online event link.
- *
- * @param Event $event The ActivityPub event object.
- *
- * @return ?string
- */
- protected static function get_online_event_link_from_attachments( $event ): ?string {
- $attachments = $event->get_attachment();
-
- if ( ! is_array( $attachments ) || empty( $attachments ) ) {
- return null;
- }
-
- foreach ( $attachments as $attachment ) {
- if ( array_key_exists( 'type', $attachment ) && 'Link' === $attachment['type'] && isset( $attachment['href'] ) ) {
- return $attachment['href'];
- }
- }
-
- return null;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-gatherpress.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-gatherpress.php
deleted file mode 100644
index b9979d00..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-gatherpress.php
+++ /dev/null
@@ -1,207 +0,0 @@
-get_tag();
-
- // Ensure the input is valid.
- if ( empty( $tags_array ) || ! $post_id ) {
- return false;
- }
-
- // Extract and process tag names.
- $tag_names = array();
- foreach ( $tags_array as $tag ) {
- if ( isset( $tag['name'] ) && 'Hashtag' === $tag['type'] ) {
- $tag_names[] = ltrim( $tag['name'], '#' ); // Remove the '#' from the name.
- }
- }
-
- // Add the tags as terms to the post.
- if ( ! empty( $tag_names ) ) {
- \wp_set_object_terms( $post_id, $tag_names, IntegrationsGatherPress::get_event_category_taxonomy(), true );
- }
-
- return true;
- }
-
- /**
- * Add venue.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $post_id The post ID.
- */
- private static function add_venue( $activitypub_event, $post_id ) {
- $location = $activitypub_event->get_location();
-
- if ( ! $location ) {
- return;
- }
-
- if ( $location instanceof Place ) {
- $location = $location->to_array();
- }
-
- if ( ! is_array( $location ) ) {
- return;
- }
-
- if ( ! isset( $location['name'] ) ) {
- return;
- }
-
- // Fallback for Gancio instances.
- if ( 'online' === $location['name'] ) {
- $online_event_link = self::get_online_event_link_from_attachments( $activitypub_event );
- if ( ! $online_event_link ) {
- return;
- }
- \update_post_meta( $post_id, 'gatherpress_online_event_link', \sanitize_url( $online_event_link ) );
- \wp_set_object_terms( $post_id, 'online-event', '_gatherpress_venue', false );
- return;
- }
-
- $venue_instance = \GatherPress\Core\Venue::get_instance();
- $venue_name = \sanitize_title( $location['name'] );
- $venue_slug = $venue_instance->get_venue_term_slug( $venue_name );
- $venue_post = $venue_instance->get_venue_post_from_term_slug( $venue_slug );
-
- if ( ! $venue_post ) {
- $venue_id = \wp_insert_post(
- array(
- 'post_title' => sanitize_text_field( $location['name'] ),
- 'post_type' => 'gatherpress_venue',
- 'post_status' => 'publish',
- )
- );
- } else {
- $venue_id = $venue_post->ID;
- }
-
- $venue_information = array();
-
- $address_string = isset( $location['address'] ) ? self::address_to_string( $location['address'] ) : '';
-
- $venue_information['fullAddress'] = $address_string;
- $venue_information['phone_number'] = '';
- $venue_information['website'] = '';
- $venue_information['permalink'] = '';
-
- $venue_json = \wp_json_encode( $venue_information );
-
- \update_post_meta( $venue_id, 'gatherpress_venue_information', $venue_json );
-
- \wp_set_object_terms( $post_id, $venue_slug, '_gatherpress_venue', false );
- }
-
- /**
- * Save the ActivityPub event object as GatherPress Event.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $event_source_post_id The Post ID of the Event Source that owns the outbox.
- *
- * @return false|int
- */
- protected static function save_event( $activitypub_event, $event_source_post_id ) {
- // Limit this as a safety measure.
- \add_filter( 'wp_revisions_to_keep', array( self::class, 'revisions_to_keep' ) );
-
- $post_id = self::get_post_id_from_activitypub_id( $activitypub_event->get_id() );
-
- $args = array(
- 'post_title' => sanitize_text_field( $activitypub_event->get_name() ),
- 'post_type' => 'gatherpress_event',
- 'post_content' => wp_kses_post( $activitypub_event->get_content() ?? '' ) . '',
- 'post_excerpt' => wp_kses_post( $activitypub_event->get_summary() ?? '' ),
- 'post_status' => 'publish',
- 'guid' => sanitize_url( $activitypub_event->get_id() ),
- );
-
- if ( $activitypub_event->get_published() ) {
- $post_date = self::format_time_string_to_wordpress_gmt( $activitypub_event->get_published() );
- $args['post_date'] = $post_date;
- $args['post_date_gmt'] = $post_date;
- }
-
- if ( $post_id ) {
- // Update existing GatherPress event post.
- $args['ID'] = $post_id;
- \wp_update_post( $args );
- } else {
- // Insert new GatherPress event post.
- $post_id = \wp_insert_post( $args );
- }
-
- // @phpstan-ignore-next-line
- if ( ! $post_id || \is_wp_error( $post_id ) ) {
- return false;
- }
-
- // Insert the dates.
- $gatherpress_event = new GatherPress_Event( $post_id );
- $start_time = $activitypub_event->get_start_time();
- $end_time = $activitypub_event->get_end_time();
- if ( ! $end_time ) {
- $end_time = new DateTime( $start_time );
- $end_time->modify( '+1 hour' );
- $end_time = $end_time->format( 'Y-m-d H:i:s' );
- }
- $params = array(
- 'datetime_start' => $start_time,
- 'datetime_end' => $end_time,
- 'timezone' => $activitypub_event->get_timezone(),
- );
- // Sanitization of the params is done in the save_datetimes function just in time.
- $gatherpress_event->save_datetimes( $params );
-
- // Insert featured image.
- $image = self::get_featured_image( $activitypub_event );
- self::set_featured_image_with_alt( $post_id, $image['url'], $image['alt'] );
-
- // Add hashtags.
- self::add_tags_to_post( $activitypub_event, $post_id );
-
- // Add venue.
- self::add_venue( $activitypub_event, $post_id );
-
- // Limit this as a safety measure.
- \remove_filter( 'wp_revisions_to_keep', array( self::class, 'revisions_to_keep' ) );
-
- return $post_id;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-the-events-calendar.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-the-events-calendar.php
deleted file mode 100644
index aed1863e..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-the-events-calendar.php
+++ /dev/null
@@ -1,412 +0,0 @@
-get_id() );
- $venue_id = self::add_venue( $activitypub_event, $event_source_post_id );
- $organizer_id = self::add_organizer( $activitypub_event );
-
- $args = array(
- 'title' => $activitypub_event->get_name(),
- 'content' => $activitypub_event->get_content() ?? '',
- 'status' => 'publish',
- 'guid' => $activitypub_event->get_id(),
- );
-
- $args = self::enrich_event_args_with_date_info( $args, $activitypub_event );
-
- if ( $venue_id ) {
- $args['venue'] = $venue_id;
- $args['VenueID'] = $venue_id;
- }
-
- if ( $organizer_id ) {
- $args['organizer'] = $organizer_id;
- $args['OrganizerID'] = $organizer_id;
- }
-
- if ( $activitypub_event->get_published() ) {
- $post_date = self::format_time_string_to_wordpress_gmt( $activitypub_event->get_published() );
- $args['post_date'] = $post_date;
- $args['post_date_gmt'] = $post_date;
- }
-
- $tribe_event = new The_Events_Calendar_Event_Repository();
-
- if ( $post_id ) {
- $post = $tribe_event->where( 'id', $post_id )->set_args( $args )->save();
- } else {
- $post = $tribe_event->set_args( $args )->create();
- }
-
- if ( $post instanceof \WP_Post ) {
- $post_id = $post->ID;
- }
-
- if ( ! $post_id ) {
- return false;
- }
-
- // Insert featured image.
- $image = self::get_featured_image( $activitypub_event );
- if ( isset( $image['url'] ) ) {
- self::set_featured_image_with_alt( $post_id, $image['url'], $image['alt'] );
- }
-
- // Add tags.
- self::add_tags_to_post( $activitypub_event, $post_id );
-
- // Remove revision limit.
- remove_filter( 'wp_revisions_to_keep', array( self::class, 'revisions_to_keep' ) );
-
- return $post_id;
- }
-
- /**
- * Enrich event arguments with normalized start date and timezone.
- *
- * @param array $args Existing event arguments.
- * @param Event $activitypub_event The ActivityPub event as associative array.
- * @return array Modified $args array including 'start_date' and 'timezone' and 'duration'.
- */
- private static function enrich_event_args_with_date_info( $args, $activitypub_event ): array {
- $start_time_str = $activitypub_event->get_start_time();
- $timezone_string = $activitypub_event->get_timezone();
-
- $start_time = new \DateTime( $start_time_str );
-
- if ( empty( $timezone_string ) ) {
- $timezone_string = 'UTC';
- }
-
- $start_time->setTimezone( new \DateTimeZone( $timezone_string ) );
-
- $args['timezone'] = $timezone_string;
- $args['start_date'] = $start_time->format( 'Y-m-d H:i:s' );
- $args['duration'] = self::get_duration( $activitypub_event );
-
- return $args;
- }
-
-
- /**
- * Map an ActivityStreams Place to the Events Calendar venue.
- *
- * @param array|Place $location An ActivityPub location as an associative array or Place object.
- * @link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-place
- * @return array
- */
- private static function get_venue_args( $location ): array {
- $args = array(
- 'venue' => $location['name'],
- 'status' => 'publish',
- );
-
- if ( $location instanceof Place ) {
- $location = $location->to_array();
- }
-
- if ( ! isset( $location['address'] ) ) {
- return $args;
- }
-
- if ( is_array( $location['address'] ) ) {
- $mapping = array(
- 'streetAddress' => 'address',
- 'postalCode' => 'zip',
- 'addressLocality' => 'city',
- 'addressState' => 'state',
- 'addressCountry' => 'country',
- 'url' => 'website',
- );
-
- foreach ( $mapping as $postal_address_key => $venue_key ) {
- if ( isset( $location['address'][ $postal_address_key ] ) ) {
- $args[ $venue_key ] = $location['address'][ $postal_address_key ];
- }
- }
- } elseif ( is_string( $location['address'] ) ) {
- // Use the address field for a solely text address.
- $args['address'] = $location['address'];
- }
-
- if ( isset( $location['id'] ) ) {
- $args['guid'] = $location['id'];
- }
-
- if ( isset( $location['latitude'] ) ) {
- $args['latitude'] = $location['latitude'];
- }
-
- if ( isset( $location['longitude'] ) ) {
- $args['longitude'] = $location['longitude'];
- }
-
- return $args;
- }
-
- /**
- * Add venue.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $event_source_post_id The WordPress Post ID of the event source.
- *
- * @return ?int $post_id The venues post ID.
- */
- private static function add_venue( $activitypub_event, $event_source_post_id ): ?int {
- $location = $activitypub_event->get_location();
-
- // Make sure we have a valid location in the right format.
- if ( ! $location ) {
- return null;
- }
-
- if ( $location instanceof Place ) {
- $location = $location->to_array();
- }
-
- if ( ! is_array( $location ) ) {
- return null;
- }
-
- if ( ! isset( $location['name'] ) ) {
- return null;
- }
-
- // Fallback for Gancio instances.
- if ( 'online' === $location['name'] ) {
- return null;
- }
-
- $tribe_venue = new The_Events_Calendar_Venue_Repository();
-
- // If the venue already exists try to find it's post id.
- $post_id = null;
-
- // Search if we already got this venue/place in our database.
- if ( isset( $location['id'] ) ) {
- global $wpdb;
- // phpcs:ignore WordPress.DB.DirectDatabaseQuery
- $post_id = $wpdb->get_var(
- $wpdb->prepare(
- "SELECT ID FROM $wpdb->posts WHERE guid=%s AND post_type=%s",
- $location['id'],
- \Tribe__Events__Venue::POSTTYPE
- )
- );
- if ( $post_id ) {
- $post_id = (int) $post_id;
- }
- }
-
- if ( ! $post_id ) {
- // Try to find a match by searching.
- $results = $tribe_venue->search( $location['name'] )->all();
-
- foreach ( $results as $potential_matching_post_id ) {
- if ( $potential_matching_post_id instanceof \WP_Post ) {
- $potential_matching_post_id = $potential_matching_post_id->ID;
- }
- // Only accept a match for the venue/location if it was received by the same actor.
- if ( \get_post_meta( $potential_matching_post_id, '_event_bridge_for_activitypub_event_source', true ) === $event_source_post_id ) {
- $post_id = $potential_matching_post_id;
- break;
- }
- }
- }
-
- if ( $post_id ) {
- // Update if we found a match.
- $result = $tribe_venue->where( 'id', $post_id )->set_args( self::get_venue_args( $location ) )->save();
- if ( array_key_exists( $post_id, $result ) && $result[ $post_id ] ) {
- return $post_id;
- }
- } else {
- // Create a new venue.
- $post = $tribe_venue->set_args( self::get_venue_args( $location ) )->create();
- if ( $post ) {
- $post_id = $post->ID;
- update_post_meta( $post_id, '_event_bridge_for_activitypub_event_source', $event_source_post_id );
- }
- }
-
- return $post_id;
- }
-
- /**
- * Add organizer.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- *
- * @return int|bool $post_id The organizers post ID.
- */
- private static function add_organizer( $activitypub_event ) {
- // This might likely change, because of FEP-8a8e.
- $actor = $activitypub_event->get_attributed_to();
-
- /**
- * Allow filtering of incoming organizer.
- *
- * @var mixed
- */
- $actor = \apply_filters( 'event_bridge_for_activitypub_remote_organizer', $actor, $activitypub_event );
-
- if ( is_null( $actor ) ) {
- return false;
- }
-
- $actor_id = object_to_uri( $actor );
- $event_source = Event_Source::get_by_id( $actor_id );
-
- // As long as we do not support announces, we expect the attributedTo to be an existing event source.
- if ( ! $event_source ) {
- return false;
- }
-
- // Prepare arguments for inserting/updating the organizer post.
- $args = array(
- 'organizer' => $event_source->get_name(),
- 'description' => $event_source->get_summary(),
- 'website' => $event_source->get_url(),
- 'excerpt' => $event_source->get_summary(),
- 'post_parent' => $event_source->get__id(), // Maybe just use post meta too here.
- 'post_status' => 'publish',
- );
-
- if ( $event_source->get_published() ) {
- $post_date = self::format_time_string_to_wordpress_gmt( $event_source->get_published() );
- $args['post_date'] = $post_date;
- $args['post_date_gmt'] = $post_date;
- }
-
- // Get organizer if it is already present.
- $children = \get_children(
- array(
- 'post_parent' => $event_source->get__id(),
- 'post_type' => \Tribe__Events__Organizer::POSTTYPE,
- ),
- );
-
- if ( count( $children ) ) {
- // Update organizer post.
- $child = array_pop( $children );
- $tribe_organizer_post_ids = \tribe_organizers()->where( 'id', $child->ID )->set_args( $args )->save();
-
- // Fallback to delete duplicates.
- foreach ( $children as $to_delete ) {
- \wp_delete_post( $to_delete->ID, true );
- }
-
- // If updating failed return.
- if ( 1 !== count( $tribe_organizer_post_ids ) || ! reset( $tribe_organizer_post_ids ) ) {
- return false;
- }
-
- $tribe_organizer_post_id = array_key_first( $tribe_organizer_post_ids );
- } else {
- // Create new organizer post.
- $tribe_organizer_post = \tribe_organizers()->set_args( $args )->create();
-
- if ( ! $tribe_organizer_post ) {
- return false;
- }
-
- $tribe_organizer_post_id = $tribe_organizer_post->ID;
-
- // Make a relationship between the event source WP_Post and the organizer WP_Post.
- \update_post_meta( $tribe_organizer_post_id, '_event_bridge_for_activitypub_event_source', true );
- }
-
- // Add the thumbnail of the event source to the organizer.
- if ( \get_post_thumbnail_id( $event_source->get__id() ) ) {
- \set_post_thumbnail( $tribe_organizer_post_id, \get_post_thumbnail_id( $event_source->get__id() ) );
- }
-
- return $tribe_organizer_post_id;
- }
-
- /**
- * Add tags to post.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $post_id The post ID.
- */
- private static function add_tags_to_post( $activitypub_event, $post_id ): bool {
- $tags_array = $activitypub_event->get_tag();
-
- // Ensure the input is valid.
- if ( empty( $tags_array ) || ! $post_id ) {
- return false;
- }
-
- // Extract and process tag names.
- $tag_names = array();
- foreach ( $tags_array as $tag ) {
- if ( isset( $tag['name'] ) && 'Hashtag' === $tag['type'] ) {
- $tag_names[] = ltrim( $tag['name'], '#' ); // Remove the '#' from the name.
- }
- }
-
- // Add the tags as terms to the post.
- if ( ! empty( $tag_names ) ) {
- \wp_set_object_terms( $post_id, $tag_names, 'post_tag', true );
- }
-
- return true;
- }
-
- /**
- * Get the events duration in seconds.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- *
- * @return int
- */
- private static function get_duration( $activitypub_event ): int {
- $end_time = $activitypub_event->get_end_time();
- if ( ! $end_time ) {
- return 2 * HOUR_IN_SECONDS;
- }
- return abs( strtotime( $end_time ) - strtotime( $activitypub_event->get_start_time() ) );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-vs-event-list.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-vs-event-list.php
deleted file mode 100644
index 0c7fc5da..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/class-vs-event-list.php
+++ /dev/null
@@ -1,175 +0,0 @@
-to_array();
- }
-
- // Return empty string when location is not an associative array.
- if ( ! is_array( $location ) || 0 === count( $location ) ) {
- return $location_string;
- }
-
- if ( ! isset( $location['type'] ) || 'Place' !== $location['type'] ) {
- return $location_string;
- }
-
- // Add name of the location.
- if ( isset( $location['name'] ) ) {
- $location_string .= $location['name'];
- }
-
- // Add delimiter between name and address if both are set.
- if ( isset( $location['name'] ) && isset( $location['address'] ) ) {
- $location_string .= ' â ';
- }
-
- // Add address.
- if ( isset( $location['address'] ) ) {
- $location_string .= self::address_to_string( $location['address'] );
- }
- return $location_string;
- }
-
- /**
- * Add tags to post.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $post_id The post ID.
- */
- private static function add_tags_to_post( $activitypub_event, $post_id ) {
- $tags_array = $activitypub_event->get_tag();
-
- // Ensure the input is valid.
- if ( empty( $tags_array ) || ! $post_id ) {
- return false;
- }
-
- // Extract and process tag names.
- $tag_names = array();
- foreach ( $tags_array as $tag ) {
- if ( isset( $tag['name'] ) && 'Hashtag' === $tag['type'] ) {
- $tag_names[] = ltrim( $tag['name'], '#' ); // Remove the '#' from the name.
- }
- }
-
- // Add the tags as terms to the post.
- if ( ! empty( $tag_names ) ) {
- \wp_set_object_terms( $post_id, $tag_names, IntegrationsVS_Event_List::get_event_category_taxonomy(), true );
- }
-
- return true;
- }
-
- /**
- * Save the ActivityPub event object as VS Event List event.
- *
- * @param Event $activitypub_event The ActivityPub event object.
- * @param int $event_source_post_id The Post ID of the Event Source that owns the outbox.
- *
- * @return false|int
- */
- protected static function save_event( $activitypub_event, $event_source_post_id ) {
- // Limit this as a safety measure.
- \add_filter( 'wp_revisions_to_keep', array( self::class, 'revisions_to_keep' ) );
-
- $post_id = self::get_post_id_from_activitypub_id( $activitypub_event->get_id() );
-
- $args = array(
- 'post_title' => $activitypub_event->get_name(),
- 'post_type' => \Event_Bridge_For_ActivityPub\Integrations\VS_Event_List::get_post_type(),
- 'post_content' => $activitypub_event->get_content() ?? '',
- 'post_excerpt' => $activitypub_event->get_summary() ?? '',
- 'post_status' => 'publish',
- 'guid' => $activitypub_event->get_id(),
- 'meta_input' => array(
- 'event-start-date' => \strtotime( $activitypub_event->get_start_time() ),
- 'event-link' => $activitypub_event->get_url() ?? $activitypub_event->get_id(),
- 'event-link-label' => \sanitize_text_field( __( 'Original Website', 'event-bridge-for-activitypub' ) ),
- 'event-link-target' => 'yes', // Open in new window.
- 'event-link-title' => 'no', // Whether to redirect event title to original source.
- 'event-link-image' => 'no', // Whether to redirect events featured image to original source.
- ),
- );
-
- if ( $activitypub_event->get_published() ) {
- $post_date = self::format_time_string_to_wordpress_gmt( $activitypub_event->get_published() );
- $args['post_date'] = $post_date;
- $args['post_date_gmt'] = $post_date;
- }
-
- // Add end time.
- $end_time = $activitypub_event->get_end_time();
- if ( $end_time ) {
- $args['meta_input']['event-date'] = \strtotime( $end_time );
- }
-
- // Maybe add location.
- $location = self::get_location_as_string( $activitypub_event->get_location() );
- if ( $location ) {
- $args['meta_input']['event-location'] = $location;
- }
-
- if ( $post_id ) {
- // Update existing event post.
- $args['ID'] = $post_id;
- $post_id = \wp_update_post( $args );
- } else {
- // Insert new event post.
- $post_id = \wp_insert_post( $args );
- }
-
- // @phpstan-ignore-next-line
- if ( 0 === $post_id || \is_wp_error( $post_id ) ) {
- return false;
- }
-
- // Insert featured image.
- $image = self::get_featured_image( $activitypub_event );
- self::set_featured_image_with_alt( $post_id, $image['url'], $image['alt'] );
-
- // Add hashtags.
- self::add_tags_to_post( $activitypub_event, $post_id );
-
- // Limit this as a safety measure.
- \remove_filter( 'wp_revisions_to_keep', array( self::class, 'revisions_to_keep' ) );
-
- return $post_id;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-sanitizer.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-sanitizer.php
deleted file mode 100644
index b4bb043e..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-sanitizer.php
+++ /dev/null
@@ -1,273 +0,0 @@
- 404 ) );
- }
-
- $event = new Event();
-
- // Straightforward sanitization of all attributes we possible make use of.
- if ( isset( $data['content'] ) ) {
- $event->set_content( \wp_kses_post( $data['content'] ) );
- }
-
- if ( isset( $data['summary'] ) ) {
- $event->set_summary( \wp_kses_post( $data['summary'] ) );
- }
-
- if ( isset( $data['name'] ) ) {
- $event->set_name( \sanitize_text_field( $data['name'] ) );
- }
-
- if ( isset( $data['startTime'] ) ) {
- $event->set_start_time( \sanitize_text_field( $data['startTime'] ) );
- }
-
- if ( isset( $data['endTime'] ) ) {
- $event->set_end_time( \sanitize_text_field( $data['endTime'] ) );
- }
-
- if ( isset( $data['timezone'] ) && in_array( $data['timezone'], \DateTimeZone::listIdentifiers(), true ) ) {
- $event->set_timezone( \sanitize_text_field( $data['timezone'] ) );
- }
-
- if ( isset( $data['published'] ) ) {
- $event->set_published( \sanitize_text_field( $data['published'] ) );
- }
-
- if ( isset( $data['id'] ) ) {
- $event->set_id( \sanitize_url( $data['id'] ) );
- }
-
- if ( isset( $data['url'] ) ) {
- $event->set_url( \sanitize_url( $data['url'] ) );
- }
-
- if ( isset( $data['attributedTo'] ) ) {
- $event->set_attributed_to( self::sanitize_attributed_to( $data['attributedTo'] ) );
- }
-
- if ( isset( $data['location'] ) ) {
- $event->set_location( self::sanitize_place_object_from_array( $data['location'] ) );
- }
-
- if ( isset( $data['attachment'] ) ) {
- $event->set_attachment( self::sanitize_attachment( $data['attachment'] ) );
- }
-
- if ( isset( $data['tag'] ) ) {
- $event->set_tag( self::sanitize_attachment( $data['tag'] ) );
- }
-
- return $event;
- }
-
- /**
- * Sanitize attributedTo.
- *
- * Currently only multiple attributedTo's are not supported.
- *
- * @param mixed $data The object array.
- *
- * @return string
- */
- private static function sanitize_attributed_to( $data ): string {
- if ( is_array( $data ) && self::array_is_list( $data ) ) {
- $data = reset( $data );
- }
-
- return object_to_uri( $data );
- }
-
- /**
- * Sanitize attachments.
- *
- * @param mixed $data The object array.
- *
- * @return ?array
- */
- private static function sanitize_attachment( $data ): ?array {
- if ( ! is_array( $data ) ) {
- return null;
- }
-
- if ( ! self::array_is_list( $data ) ) {
- $data = array( $data );
- }
-
- $attachment = array();
-
- foreach ( $data as $item ) {
- $sanitized_item = array();
-
- // Straightforward sanitization of all attributes we possible make use of.
- if ( isset( $item['name'] ) ) {
- $sanitized_item['name'] = \sanitize_text_field( $item['name'] );
- }
- if ( isset( $item['url'] ) ) {
- $sanitized_item['url'] = \sanitize_url( $item['url'] );
- }
- if ( isset( $item['id'] ) ) {
- $sanitized_item['id'] = \sanitize_url( $item['id'] );
- }
- if ( isset( $item['type'] ) ) {
- $sanitized_item['type'] = \sanitize_text_field( $item['type'] );
- }
- if ( isset( $item['href'] ) ) {
- $sanitized_item['href'] = \sanitize_text_field( $item['href'] );
- }
-
- if ( isset( $sanitized_item['url'] ) || isset( $sanitized_item['href'] ) || isset( $sanitized_item['name'] ) ) {
- $attachment[] = $sanitized_item;
- }
- }
-
- return $attachment;
- }
-
- /**
- * Fallback for PHP version prior to 8.1 for array_is_list.
- *
- * @param array $arr The array to check.
- * @return bool
- */
- private static function array_is_list( $arr ) {
- if ( ! function_exists( 'array_is_list' ) ) {
- if ( array() === $arr ) {
- return true;
- }
- return array_keys( $arr ) === range( 0, count( $arr ) - 1 );
- }
- return array_is_list( $arr );
- }
-
- /**
- * Sanitize an validate a float.
- *
- * @param mixed $value The input value.
- * @return float|null
- */
- private static function validate_and_sanitize_float( $value ) {
- $sanitized = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
- return is_numeric( $sanitized ) ? (float) $sanitized : null;
- }
-
- /**
- * Convert input array to an Location.
- *
- * @param mixed $data The object array.
- *
- * @return ?Place An Object built from the input array or null.
- */
- private static function sanitize_place_object_from_array( $data ): ?Place {
- if ( ! is_array( $data ) ) {
- return null;
- }
-
- // If the array is a list, search for the first item with 'type' === 'Place'.
- if ( self::array_is_list( $data ) ) {
- foreach ( $data as $item ) {
- if ( is_array( $item ) && ( 'Place' === ( $item['type'] ?? null ) ) ) {
- $data = $item;
- break;
- }
- }
- }
-
- if ( ! isset( $data['type'] ) || 'Place' !== $data['type'] ) {
- return null;
- }
-
- $place = new Place();
-
- if ( isset( $data['name'] ) ) {
- $place->set_name( \sanitize_text_field( $data['name'] ) );
- }
-
- if ( isset( $data['id'] ) ) {
- $place->set_id( \sanitize_url( $data['id'] ) );
- }
-
- if ( isset( $data['latitude'] ) ) {
- $place->set_latitude( self::validate_and_sanitize_float( $data['latitude'] ) );
- }
-
- if ( isset( $data['longitude'] ) ) {
- $place->set_longitude( self::validate_and_sanitize_float( $data['longitude'] ) );
- }
-
- if ( isset( $data['url'] ) ) {
- $place->set_url( \sanitize_url( $data['url'] ) );
- }
-
- if ( isset( $data['address'] ) ) {
- if ( is_string( $data['address'] ) ) {
- $place->set_address( \sanitize_text_field( $data['address'] ) );
- }
- if ( is_array( $data['address'] ) && isset( $data['address']['type'] ) && 'PostalAddress' === $data['address']['type'] ) {
- $address = array();
- if ( isset( $data['address']['streetAddress'] ) ) {
- $address['streetAddress'] = \sanitize_text_field( $data['address']['streetAddress'] );
- }
- if ( isset( $data['address']['postalCode'] ) ) {
- $address['postalCode'] = \sanitize_text_field( $data['address']['postalCode'] );
- }
- if ( isset( $data['address']['addressLocality'] ) ) {
- $address['addressLocality'] = \sanitize_text_field( $data['address']['addressLocality'] );
- }
- if ( isset( $data['address']['addressState'] ) ) {
- $address['addressState'] = \sanitize_text_field( $data['address']['addressState'] );
- }
- if ( isset( $data['address']['addressCountry'] ) ) {
- $address['addressCountry'] = \sanitize_text_field( $data['address']['addressCountry'] );
- }
- if ( isset( $data['address']['url'] ) ) {
- $address['url'] = \sanitize_url( $data['address']['url'] );
- }
- $place->set_address( $address );
- }
- }
-
- return $place;
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-event-repository.php b/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-event-repository.php
deleted file mode 100644
index 818e8b39..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/activitypub/transmogrifier/helper/class-the-events-calendar-event-repository.php
+++ /dev/null
@@ -1,43 +0,0 @@
-update_fields_aliases = array_merge(
- $this->update_fields_aliases,
- array(
- 'latitude' => '_VenueLat',
- 'longitude' => '_VenueLng',
- )
- );
-
- $this->add_simple_meta_schema_entry( 'latitude', '_VenueLat' );
- $this->add_simple_meta_schema_entry( 'longitude', '_VenueLng' );
- }
-
- /**
- * Whether the current key can be updated by this repository or not.
- *
- * @since 4.7.19
- *
- * @param string $key The key.
- * @return bool
- */
- protected function can_be_updated( $key ): bool {
- return ! in_array( $key, self::$blocked_keys, true );
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-event-plugin-admin-notices.php b/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-event-plugin-admin-notices.php
deleted file mode 100644
index c7ccd2b8..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-event-plugin-admin-notices.php
+++ /dev/null
@@ -1,103 +0,0 @@
-event_plugin = $event_plugin;
- if ( $this->event_post_type_is_not_activitypub_enabled() ) {
- add_action( 'admin_notices', array( $this, 'admin_notice_activitypub_not_enabled_for_post_type' ), 10, 1 );
- }
- }
-
- /**
- * Check if ActivityPub is enabled for the custom post type of the event plugin.
- *
- * @return bool
- */
- private function event_post_type_is_not_activitypub_enabled(): bool {
- return ! \in_array( $this->event_plugin::get_post_type(), get_option( 'activitypub_support_post_types', array() ), true );
- }
-
- /**
- * Display the admin notices for the plugins.
- *
- * @return void
- */
- public function admin_notice_activitypub_not_enabled_for_post_type(): void {
- if ( $this->event_plugin::is_plugin_page() ) {
- $this->do_admin_notice_post_type_not_activitypub_enabled();
- }
- }
-
- /**
- * Print admin notice that the current post type is not enabled in the ActivityPub plugin.
- *
- * @return void
- */
- private function do_admin_notice_post_type_not_activitypub_enabled(): void {
- $all_plugins = get_plugins();
- $event_plugin_file = $this->event_plugin::get_relative_plugin_file();
- if ( isset( $all_plugins[ $event_plugin_file ]['Name'] ) ) {
- $event_plugin_name = $all_plugins[ $event_plugin_file ]['Name'];
- } elseif ( isset( get_mu_plugins()[ $event_plugin_file ]['Name'] ) ) {
- $event_plugin_name = get_mu_plugins()[ $event_plugin_file ]['Name'];
- } else {
- return;
- }
- $activitypub_plugin_data = get_plugin_data( ACTIVITYPUB_PLUGIN_FILE );
- $notice = \sprintf(
- /* translators: 1: the name of the event plugin a admin notice is shown. 2: The name of the ActivityPub plugin. */
- _x(
- 'You have installed the %1$s plugin, but the event post type of the plugin %2$s is not enabled in the %1$s settings.',
- 'admin notice',
- 'event-bridge-for-activitypub'
- ),
- esc_html( $activitypub_plugin_data['Name'] ),
- esc_html( $event_plugin_name ),
- admin_url( 'options-general.php?page=activitypub&tab=settings' )
- );
- $allowed_html = array(
- 'a' => array(
- 'href' => true,
- 'title' => true,
- ),
- 'b' => array(),
- 'i' => array(),
- );
- echo '
' . \wp_kses( $notice, $allowed_html ) . '
';
- }
-}
diff --git a/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-general-admin-notices.php b/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-general-admin-notices.php
deleted file mode 100644
index 5e7fb343..00000000
--- a/wp-content/plugins/event-bridge-for-activitypub/includes/admin/class-general-admin-notices.php
+++ /dev/null
@@ -1,152 +0,0 @@
- array(
- 'href' => true,
- 'title' => true,
- 'target' => true,
- ),
- 'br',
- 'i',
- );
-
- /**
- * Admin notice when the ActivityPub plugin is not enabled.
- *
- * @return string
- */
- public static function get_admin_notice_activitypub_plugin_not_enabled(): string {
- return \sprintf(
- /* translators: 1: An URL that points to the ActivityPub plugin. */
- _x(
- 'For the Event Bridge for ActivityPub to work, you will need to install and activate the ActivityPub plugin.',
- 'admin notice',
- 'event-bridge-for-activitypub'
- ),
- esc_html( self::ACTIVITYPUB_PLUGIN_URL )
- );
- }
-
- /**
- * Admin notice when the ActivityPub plugin version is too old.
- *
- * @return string
- */
- public static function get_admin_notice_activitypub_plugin_version_too_old(): string {
- return \sprintf(
- /* translators: 1: The name of the ActivityPub plugin. 2: The minimum required version number of the ActivityPub plugin. */
- _x(
- 'Please upgrade your ActivityPub plugin. At least version %2$s is required for the Event Bridge for ActivityPub to work.',
- 'admin notice',
- 'event-bridge-for-activitypub'
- ),
- esc_html( self::ACTIVITYPUB_PLUGIN_URL ),
- esc_html( EVENT_BRIDGE_FOR_ACTIVITYPUB_ACTIVITYPUB_PLUGIN_MIN_VERSION )
- );
- }
-
- /**
- * Warning that no supported event plugin can be found.
- *
- * @return string
- */
- public static function get_admin_notice_no_supported_event_plugin_active(): string {
- return sprintf(
- /* translators: 1: An URL to the list of supported event plugins. */
- _x(
- 'The Plugin Event Bridge for ActivityPub is of no use, because you do not have installed and activated a supported Event Plugin.
- For a list of supported Event Plugins see here.',
- 'admin notice',
- 'event-bridge-for-activitypub'
- ),
- esc_url( self::EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL )
- );
- }
-
- /**
- * Warning to fix status issues first.
- *
- * @return string
- */
- public static function get_admin_notice_status_not_ok(): string {
- return sprintf(
- /* translators: 1: An URL to the list of supported event plugins. */
- _x(
- 'The Plugin Event Bridge for ActivityPub is of no use, because you do not have installed and activated a supported Event Plugin.
- For a list of supported Event Plugins see here.',
- 'admin notice',
- 'event-bridge-for-activitypub'
- ),
- esc_html( self::EVENT_BRIDGE_FOR_ACTIVITYPUB_SUPPORTED_EVENT_PLUGINS_URL )
- );
- }
-
- /**
- * Warning if the plugin is Active and the ActivityPub plugin is not.
- *
- * @return void
- */
- public static function activitypub_plugin_not_enabled(): void {
- $notice = self::get_admin_notice_activitypub_plugin_not_enabled();
- // @phpstan-ignore-next-line
- echo '
' . \wp_kses( $notice, self::ALLOWED_HTML ) . '
';
- }
-
- /**
- * Warning if the plugin is Active and the ActivityPub plugins version is too old.
- *
- * @return void
- */
- public static function activitypub_plugin_version_too_old(): void {
- $notice = self::get_admin_notice_activitypub_plugin_version_too_old();
- // @phpstan-ignore-next-line
- echo '
' . \wp_kses( $notice, self::ALLOWED_HTML ) . '
';
- }
-
- /**
- * Warning when no supported Even Plugin is installed and active.
- *
- * @return void
- */
- public static function no_supported_event_plugin_active(): void {
- $notice = self::get_admin_notice_no_supported_event_plugin_active();
- // @phpstan-ignore-next-line
- echo '