Compare commits

..

8 commits

Author SHA1 Message Date
44a5ddc463 wip
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 43s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 53s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 5m31s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 52s
2024-10-27 21:36:52 +01:00
1504b3a23b phpcs
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 45s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 55s
2024-10-26 17:05:58 +02:00
0ac8c8c413 Merge main into mycalendar-init
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 45s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 55s
2024-10-26 16:33:26 +02:00
fdb4f000a3 added static status
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 41s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m5s
2024-10-10 14:44:26 +02:00
2e8d7306bf added location 2024-10-10 14:44:08 +02:00
41363f3fee get schema directly 2024-10-10 14:43:24 +02:00
113d9cadfb fixed naming 2024-10-10 14:41:22 +02:00
82dca423e1 added basic my-calendar transformer 2024-10-07 17:42:31 +02:00
32 changed files with 539 additions and 390 deletions

View file

@ -1,24 +0,0 @@
.distignore
.git
.gitignore
.wordpress-org
.wp-env.json
bin
CHANGELOG.md
CODE_OF_CONDUCT.md
composer.json
composer.lock
docker-compose.yml
Dockerfile
docs
FEDERATION.md
Gruntfile.js
node_modules
package.json
package-lock.json
phpcs.xml
phpunit.xml
README.md
src
tests
vendor

View file

@ -21,8 +21,7 @@ jobs:
MYSQL_ROOT_PASSWORD: root
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
wordpress-version: ['6.7']
php-version: ['8.1', '8.2', '8.3']
name: PHPUnit PHP ${{ matrix.php-version }}
env:
extensions: mysql
@ -38,7 +37,7 @@ jobs:
path: |
${{ env.WP_CORE_DIR }}
${{ env.WP_TESTS_DIR }}
key: cache-wordpress-67-2
key: cache-wordpress-10
- name: Cache Composer
id: cache-composer-phpunit
@ -46,7 +45,7 @@ jobs:
with:
path: |
./vendor/
key: cache-composer-phpunit-2
key: cache-composer-phpunit-1
- name: Setup PHP
uses: https://github.com/shivammathur/setup-php@v2
@ -69,11 +68,11 @@ jobs:
- name: Setup Test Environment
if: steps.cache-wordpress.outputs.cache-hit != 'true'
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wordpress-version }} false false false false
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6 false false false false
- name: Initialize WordPress test database
if: steps.cache-wordpress.outputs.cache-hit != 'false'
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wordpress-version }} false true true true
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6 false true true true
- name: Run Integration tests for The Events Calendar
run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=the_events_calendar

View file

@ -1,16 +0,0 @@
on:
push:
tags: 'v*'
jobs:
upload-release:
runs-on: ubuntu-latest
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/forgejo-release@v2
with:
direction: upload
url: https://code.event-federation.eu
release-notes: ${{ TAG }}
token: ${{ secrets.GITHUB_TOKEN }}

23
.gitattributes vendored
View file

@ -1,23 +0,0 @@
.distignore export-ignore
.forgejo export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.wp-env.json export-ignore
bin export-ignore
CODE_OF_CONDUCT.md export-ignore
composer.json export-ignore
composer.lock export-ignore
docker-compose.yml export-ignore
Dockerfile export-ignore
docs export-ignore
FEDERATION.md export-ignore
Gruntfile.js export-ignore
node_modules export-ignore
package.json export-ignore
package-lock.json export-ignore
phpcs.xml export-ignore
phpunit.xml export-ignore
README.md export-ignore
src export-ignore
tests export-ignore
vendor export-ignore

1
.gitignore vendored
View file

@ -2,4 +2,3 @@ vendor/
composer.lock
.phpunit.result.cache
node_modules/
package-lock.json

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 315 KiB

View file

@ -5,18 +5,8 @@ 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).
## [0.2.1] - 2024-11-16
## [0.1.0] - 2024-10-20
### Added
* Initial release on WordPress.org
### Fixed
* Applied some WordPress best practices
## [0.2.0] - 2024-10-20
### Added
* Initial submission to WordPress.org
* Initial version tag.

View file

@ -1,126 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement via email to
simon@fdpl.io. All complaints will be reviewed and investigated fairly
and as soon as personal time and energy of community leaders permits.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).

View file

@ -1,59 +0,0 @@
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig(
{
checktextdomain: {
options:{
text_domain: 'activitypub-event-bridge',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d'
]
},
files: {
src: [
'**/*.php', // Include all files
'!sass/**', // Exclude sass/
'!node_modules/**', // Exclude node_modules/
'!tests/**', // Exclude tests/
'!vendor/**', // Exclude vendor/
'!build/**', // Exclude build/
'!static/**', // Exclude static resources
],
expand: true
}
},
wp_readme_to_markdown: {
target: {
files: {
'README.md': 'readme.txt'
},
},
options: {
pre_convert: function ( readme ) {
return readme.replace( /\*\*Note\*\*:/g, "> [!NOTE]\n>" );
}
}
}
}
);
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.loadNpmTasks( 'grunt-checktextdomain' );
// Default task(s).
grunt.registerTask( 'default', ['wp_readme_to_markdown', 'checktextdomain'] );
};

View file

@ -1,48 +1,50 @@
# ActivityPub Event Bridge #
**Contributors:** [andremenrath](https://profiles.wordpress.org/andremenrath/)
**Tags:** events, fediverse, activitypub, calendar
**Requires at least:** 6.5
**Tested up to:** 6.7
**Stable tag:** 0.2.1
**Requires PHP:** 7.4
**License:** AGPL-3.0-or-later
**License URI:** https://www.gnu.org/licenses/agpl-3.0.html
# ActivityPub Event Bridge
Contributors: andremenrath
Tags: events, fediverse, activitypub, calendar
Requires at least: 6.5
Tested up to: 6.6
Stable tag: 0.1.0
Requires PHP: 8.1
License: AGPL-3.0-or-later
License URI: https://www.gnu.org/licenses/agpl-3.0.html
Integrating popular event plugins with the ActivityPub plugin.
![Federate your Events, Expand your Reach!](.wordpress-org/banner-1544x500.jpg)
![](.wordpress-org/banner-1544x500.jpg)
## Description ##
## Description
Make your events more discoverable, expand your reach effortlessly while being independent of other (commercial) platforms, and be a part of the growing decentralized web (the Fediverse).
With the ActivityPub Event Bridge Plugin for WordPress, your events can be automatically followed, aggregated and displayed across decentralized platforms like [Mastodon](https://joinmastodon.org) or [Gancio](https://gancio.org), without any extra work.
With the ActivityPub Event Bridge plugin for WordPress, your events can be automatically followed, aggregated and displayed across decentralized platforms like [Mastodon](https://joinmastodon.org) or [Gancio](https://gancio.org), without any extra work.
Forget the hassle of managing multiple social media accounts just to keep your audience informed.
This plugin is not an event managing plugin but an add-on to popular event plugins. It extends their functionality to fully support the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
With the ActivityPub plugin people can follow your website directly and engage with your events just as they would on social media: liking, boosting and even commenting if you enable it.
You retain full ownership of your content. By integrating into your existing setup, it ensures no extra work is needed while enhancing your events' visibility across the web.
### How It Works ###
### How It Works
With the ActivityPub Event Bridge WordPress plugin, sharing your events is effortless and automatic!
Once you create an event on your WordPress site, it is seamlessly shared across the decentralized web using the ActivityPub protocol.
<p align="center">
<img src="./.wordpress-org/event-activitypub-publishing.gif" alt="Logo" width="300"/>
<img src="./.wordpress-org/event-activitypub-publishing.gif" alt="Logo" width="250" />
</p>
Your events can be automatically delivered to platforms that fully support events, such as [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/).
These platforms create public event calendars by pulling in events from various sources, including your website. Any updates you make to your events are synced across these platforms—so you only need to manage your events on your own site, with no extra work required.
<p align="center">
<img src="./.wordpress-org/decentralized-event-calenders.gif" alt="Logo" width="250"/>
<img src="./.wordpress-org/decentralized-event-calenders.gif" alt="Logo" width="250" />
</p>
Even platforms that don't yet fully support events, like [Mastodon](https://joinmastodon.org), will still receive a detailed, well-composed summary of your event.
The Event Federation plugin ensures that users from those platforms are provided with all important information about an event.
### Features for Your WordPress Events and the Fediverse ###
### Features for Your WordPress Events and the Fediverse
**ActivityPub-Enabled Event Sharing:** Your WordPress events are now compatible with the Fediverse, using the ActivityStreams format. This means your events can be easily discovered and followed by users on platforms like Mastodon and other ActivityPub-compatible services.
**ActivityPub-Enabled Event Sharing:** Your WordPress events are not part of the Fediverse and
**Automatic Event Summaries:** When your event is shared on the Fediverse, platforms like Mastodon that don't fully support events will display a brief HTML summary of key details — such as the event's title, start time, and location. This ensures that even if someone can't view the full event on their platform, they still get the important info at a glance, with a link to your WordPress event page.
@ -50,11 +52,11 @@ The Event Federation plugin ensures that users from those platforms are provided
**Event Reminders for Your Followers:** Often, events are planned well in advance. To keep your followers informed right in time, you can set up reminders that are supposed to trigger the events showing up in their timelines right before the event starts. At the moment this reminder is implemented as a self-boost of your original event post. While this feature may behave differently across various platforms, we are working on a more robust solution that will let you schedule dedicated reminder notes that appear in all followers' timelines.
## Installation ##
## Installation
This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/). Additionally, you need to use one of the supported event Plugins.
This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/). Additionally, you need to use one of the supported event plugins. See below.
### Supported Event Plugins ###
### Supported Event plugins
* [The Events Calendar](https://de.wordpress.org/plugins/the-events-calendar/)
* [VS Event List](https://de.wordpress.org/plugins/very-simple-event-list/)
@ -64,46 +66,41 @@ This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/ac
* [Modern Events Calendar Lite](https://webnus.net/modern-events-calendar/)
* [GatherPress](https://gatherpress.org/)
## Configuration ##
## Configuration
If you're new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality.
If youre new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality.
## Frequently Asked Questions ##
## Frequently Asked Questions
### Do I need to install another event plugin to use the Event Federation Plugin? ###
### Do I need to install another event plugin to use the Event Federation plugin?
Yes, this plugin works as an add-on and requires both the ActivityPub plugin and a supported event plugin such as The Events Calendar, VS Event List, or Events Manager to manage your events. It just fills the missing gap between event plugins and the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
### What platforms can follow my events? ###
### What platforms can follow my events?
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which dont fully support events yet, will display all important information about the events.
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which don't fully support events yet, will display all important information about the events.
### How much extra work is required to maintain my events across the decentralized Web? ###
### How much extra work is required to maintain my events across the decentralized Web?
None! Once the plugin is set up, your events are automatically sent to all connected platforms or account that follow you (your Website). Any updates you make to your events are synced without additional effort.
### Can I still use social media to promote my events? ###
### Can I still use social media to promote my events?
Yes, you can still use traditional social media if you wish. However, this plugin helps reduce reliance on commercial platforms by connecting your events to the decentralized Fediverse.
### Will this plugin work if I don't use the ActivityPub plugin? ###
### Will this plugin work if I don't use the ActivityPub plugin?
No, the Event Federation Plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/) to deliver your events across decentralized platforms, so it's essential to have it installed and configured.
No, the Event Federation plugin depends on the ActivityPub plugin to deliver your events across decentralized platforms, so it's essential to have it installed and configured.
### My event plugin is not supported, what can I do? ###
### My event plugin is not supported, what can I do?
If you know about coding have a look at the documentation of how to add your plugin or open an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-bridge/issues), if we can spare some free hours we might add it.
### What if I experience problems? ###
### What if I experience problems?
We're always interested in your feedback. Feel free to reach out to us via [E-Mail](https://event-federation.eu/contact/) or create an [issue](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-bridge/issues).
## Changelog ##
## Changelog
### [0.2.1] 2024-11-16 ###
### [0.1.0] 2024-10-01
* Initial release on https://wordpress.org/
### [0.2.0] 2024-10-29 ###
* Initial submission to https://wordpress.org/
* Initial alpha release on WordPress.org

View file

@ -3,15 +3,15 @@
* Plugin Name: ActivityPub Event Bridge
* Description: Integrating popular event plugins with the ActivityPub plugin.
* Plugin URI: https://event-federation.eu/
* Version: 0.2.1
* Version: 0.1.1
* Author: André Menrath
* Author URI: https://graz.social/@linos
* Text Domain: activitypub-event-bridge
* License: AGPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/agpl-3.0.html
* Requires PHP: 7.4
* License URI: https://www.gnu.org/licenses/agpl-3.0.de.html
* Requires PHP: 8.1
*
* Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 4.2.0.
* Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.3.3.
*
* @package ActivityPub_Event_Bridge
* @license AGPL-3.0-or-later

View file

@ -208,15 +208,9 @@ install_wp_plugin() {
fi
# Get the latest tag.
if [ -z "$2" ]; then
LATEST_TAG=$(svn log https://plugins.svn.wordpress.org/$PLUGIN_NAME/tags --limit 1 | awk 'NR == 4 { print $4 }')
PLUGIN_VERSION=$LATEST_TAG
else
PLUGIN_VERSION=$2
fi
if [ -n "$PLUGIN_VERSION" ]; then
PLUGIN_FILE="$PLUGIN_NAME.$PLUGIN_VERSION.zip"
LATEST_TAG=$(svn log https://plugins.svn.wordpress.org/$PLUGIN_NAME/tags --limit 1 | awk 'NR == 4 { print $4 }' | sed 's/,$//')
if [ -n "$LATEST_TAG" ]; then
PLUGIN_FILE="$PLUGIN_NAME.$LATEST_TAG.zip"
else
PLUGIN_FILE="$PLUGIN_NAME.zip"
fi
@ -254,12 +248,13 @@ install_wp_plugins() {
# Install the one and only ActivityPub plugin (greetings @pfefferle).
install_wp_plugin activitypub
# Install (not-activate) all supported event plugins.
install_wp_plugin the-events-calendar "6.8.1"
install_wp_plugin the-events-calendar
install_wp_plugin very-simple-event-list
install_wp_plugin gatherpress
install_wp_plugin events-manager "6.6.3"
install_wp_plugin wp-event-manager "3.1.45.1"
install_wp_plugin wp-event-solution "4.0.14"
install_wp_plugin events-manager
install_wp_plugin wp-event-manager
install_wp_plugin wp-event-solution
install_wp_plugin my-calendar
# Mec is not installable via wordpress.org, we use our own mirror.
install_wp_plugin_mec
}

View file

@ -4,7 +4,7 @@
"description": "The ActivityPub Event Bridge help for event custom post types to federate properly.",
"type": "wordpress-plugin",
"require": {
"php": ">=7.4.0",
"php": ">=8.1.0",
"composer/installers": "^2.0"
},
"require-dev": {
@ -58,7 +58,7 @@
],
"test-debug": [
"@prepare-test",
"@test-gatherpress"
"@test-my-calendar"
],
"test-vs-event-list": "phpunit --filter=vs_event_list",
"test-the-events-calendar": "phpunit --filter=the_events_calendar",
@ -67,6 +67,7 @@
"test-wp-event-manager": "phpunit --filter=wp_event_manager",
"test-eventin": "phpunit --filter=eventin",
"test-modern-events-calendar-lite": "phpunit --filter=modern_events_calendar_lite",
"test-my-calendar": "phpunit --filter=my_calendar",
"test-all": "phpunit"
}
}

View file

@ -180,7 +180,7 @@ In the pipeline we want to run each event plugins integration tests in a single
To activate/load your plugin add it to the switch statement within the function `_manually_load_plugin()` within `tests/bootstrap.php`.
```php
switch ( $activitypub_event_bridge_integration_filter ) {
switch ( $activitypub_event_extension_integration_filter ) {
...
case 'my_event_plugin':
$plugin_file = 'my-event-plugin/my-event-plugin.php';

16
improvements.md Normal file
View file

@ -0,0 +1,16 @@
Make use of:
https://docs.theeventscalendar.com/reference/classes/tribe__events__api/get_event_terms/
for getting all tags/terms for an event!
```
public static function get_event_terms( $event_id, array $args = array() ) {
$terms = array();
foreach ( get_post_taxonomies( $event_id ) as $taxonomy ) {
$tax_terms = wp_get_object_terms( $event_id, $taxonomy, $args );
$terms[ $taxonomy ] = $tax_terms;
}
return $terms;
}
```

View file

@ -0,0 +1,137 @@
<?php
/**
* ActivityPub Transformer for the WordPress plugin "My Calendar Accessible Event Manager".
*
* @see https://wordpress.org/plugins/my-calendar/
*
* @package Activitypub_Event_Extensions
* @license AGPL-3.0-or-later
*/
namespace ActivityPub_Event_Bridge\Activitypub\Transformer;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use Activitypub\Activity\Extended_Object\Place;
use ActivityPub_Event_Bridge\Activitypub\Transformer\Event as Event_Transformer;
use DateTime;
use DateTimeZone;
/**
* ActivityPub Transformer for events from the WordPress plugin "My Calendar Accessible Event Manager".
*
* @see https://wordpress.org/plugins/my-calendar/
*
* @since 1.0.0
*/
final class My_Calendar extends Event_Transformer {
/**
* Holds the My Calendar post object.
*
* @var object $event Event object.
*/
protected $mc_event;
/**
* Holds the My Calendar Schema object.
*
* @var array JSON/LD Schema for event.
*/
protected $mc_event_schema;
/**
* Extend the constructor, to also set the Event plugins API objects.
*
* This is a special class object form The Events Calendar which
* has a lot of useful functions, we make use of our getter functions.
*
* @param WP_Post $wp_object The WordPress object.
* @param string $wp_taxonomy The taxonomy slug of the event post type.
*/
public function __construct( $wp_object, $wp_taxonomy ) {
parent::__construct( $wp_object, $wp_taxonomy );
$mc_event_id = get_post_meta( $this->wp_object->ID, '_mc_event_id', true );
$this->mc_event = mc_get_event( $mc_event_id );
$this->mc_event_schema = mc_event_schema( $this->mc_event );
}
/**
* Formats time from the plugin to the activitypub standard.
*
* @param string $date_string The plugins string representation for a date without time.
* @param string $time_string The plugins string representation for a time.
*
* @return string
*/
private function convert_time( $date_string, $time_string ): string {
// Create a DateTime object with the given date, time, and timezone.
$datetime = new DateTime( $date_string . ' ' . $time_string );
// Set the timezone for proper formatting.
$datetime->setTimezone( new DateTimeZone( 'UTC' ) );
// Format the DateTime object as 'Y-m-d\TH:i:s\Z'.
$formatted_date = $datetime->format( 'Y-m-d\TH:i:s\Z' );
return $formatted_date;
}
/**
* Get the start time from the events metadata.
*
* @return string The events start date-time.
*/
public function get_start_time(): string {
return $this->convert_time( $this->mc_event->event_begin, $this->mc_event->event_time );
}
/**
* Get the end time from the events metadata.
*
* @return string The events start end-time.
*/
public function get_end_time(): ?string {
return $this->convert_time( $this->mc_event->event_end, $this->mc_event->event_endtime );
}
/**
* Get the event location.
*
* @return Place|null The place/venue if one is set.
*/
public function get_location(): ?Place {
if ( array_key_exists( 'location', $this->mc_event_schema ) && 'Place' === $this->mc_event_schema['location']['@type'] ) {
$mc_place = $this->mc_event_schema['location'];
$place = new Place();
$place->set_name( $mc_place['name'] );
$place->set_url( $mc_place['url'] );
$place->set_address( $mc_place['address'] );
if ( ! empty( $mc_place['geo'] ) ) {
$place->set_latitude( $mc_place['geo']['latitude'] );
$place->set_longitude( $mc_place['geo']['longitude'] );
}
return $place;
}
return null;
}
/**
* Get status of the event
*
* @return string status of the event
*/
public function get_status(): ?string {
return 'CONFIRMED'; // My Calendar doesn't implement canceled events.
}
/**
* Extract the external participation url.
*
* @return ?string The external participation URL.
*/
public function get_external_participation_url(): ?string {
return $this->mc_event->event_tickets ? $this->mc_event->event_tickets : null;
}
}

View file

@ -121,9 +121,9 @@ final class The_Events_Calendar extends Event {
/**
* Get the event location.
*
* @return ?Place The place/venue if one is set.
* @return Place|array The place/venue if one is set.
*/
public function get_location(): ?Place {
public function get_location(): Place|null {
// Get short handle for the venues.
$venues = $this->tribe_event->venues;

View file

@ -47,7 +47,7 @@ class Health_Check {
*/
public static function test_event_transformation() {
$result = array(
'label' => \__( 'Transformation of Events to a valid ActivityStreams representation.', 'activitypub-event-bridge' ),
'label' => \__( 'Transformation of Events to a valid ActivityStreams representation.', 'activitypub' ),
'status' => 'good',
'badge' => array(
'label' => \__( 'ActivityPub Event Bridge', 'activitypub-event-bridge' ),
@ -172,7 +172,7 @@ class Health_Check {
'label' => __( 'ActivityPub Event Bridge', 'activitypub-event-bridge' ),
'fields' => array(
'plugin_version' => array(
'label' => __( 'Plugin Version', 'activitypub-event-bridge' ),
'label' => __( 'Plugin Version', 'activitypub' ),
'value' => ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION,
'private' => true,
),

View file

@ -44,7 +44,7 @@ class Settings {
'activitypub_event_bridge_default_event_category',
array(
'type' => 'string',
'description' => \__( 'Define your own custom post template', 'activitypub-event-bridge' ),
'description' => \__( 'Define your own custom post template', 'activitypub' ),
'show_in_rest' => true,
'default' => self::DEFAULT_EVENT_CATEGORY,
'sanitize_callback' => array( self::class, 'sanitize_mapped_event_category' ),
@ -56,7 +56,7 @@ class Settings {
'activitypub_event_bridge_event_category_mappings',
array(
'type' => 'array',
'description' => \__( 'Define your own custom post template', 'activitypub-event-bridge' ),
'description' => \__( 'Define your own custom post template', 'activitypub' ),
'default' => array(),
'sanitize_callback' => array( self::class, 'sanitize_event_category_mappings' ),
)
@ -67,7 +67,7 @@ class Settings {
'activitypub_event_bridge_initially_activated',
array(
'type' => 'boolean',
'description' => \__( 'Whether the plugin just got activated for the first time.', 'activitypub-event-bridge' ),
'description' => \__( 'Whether the plugin just got activated for the first time.', 'activitypub' ),
'default' => 1,
)
);

View file

@ -129,6 +129,7 @@ class Setup {
'\ActivityPub_Event_Bridge\Plugins\GatherPress',
'\ActivityPub_Event_Bridge\Plugins\The_Events_Calendar',
'\ActivityPub_Event_Bridge\Plugins\VS_Event_List',
'\ActivityPub_Event_Bridge\Plugins\My_Calendar',
'\ActivityPub_Event_Bridge\Plugins\WP_Event_Manager',
'\ActivityPub_Event_Bridge\Plugins\Eventin',
'\ActivityPub_Event_Bridge\Plugins\Modern_Events_Calendar_Lite',
@ -252,7 +253,7 @@ class Setup {
*
* @return \Activitypub\Transformer\Base|null
*/
public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): \Activitypub\Transformer\Base {
public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): \Activitypub\Transformer\Base|null {
// If the current WordPress object is not a post (e.g., a WP_Comment), don't change the transformer.
if ( 'WP_Post' !== $object_class ) {
return $transformer;

View file

@ -38,7 +38,7 @@ final class Modern_Events_Calendar_Lite extends Event_plugin {
*/
public static function get_post_type(): string {
// See MEC_feature_events->get_main_post_type().
return 'mec-events';
return apply_filters( 'mec_post_type_name', 'mec-events' ); // phpcs:ignore
}
/**

View file

@ -0,0 +1,63 @@
<?php
/**
* My Calendar.
*
* Defines all the necessary meta information for the WordPress event plugin
* "My Calendar".
*
* @link https://wordpress.org/plugins/my-calendar/
* @package Activitypub_Event_Extensions
* @since 1.0.0
*/
namespace ActivityPub_Event_Bridge\Plugins;
use Activitypub_Event_Extensions\Event_Plugins;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
/**
* Interface for a supported event plugin.
*
* This interface defines which information is necessary for a supported event plugin.
*
* @since 1.0.0
*/
final class My_Calendar extends Event_Plugin {
/**
* Returns the full plugin file.
*
* @return string
*/
public static function get_plugin_file(): string {
return 'my-calendar/my-calendar.php';
}
/**
* Returns the event post type of the plugin.
*
* @return string
*/
public static function get_post_type(): string {
return 'mc-events';
}
/**
* Returns the ID of the main settings page of the plugin.
*
* @return string The settings page url.
*/
public static function get_settings_page(): string {
return 'my-calendar-config';
}
/**
* Returns the taxonomy used for the plugin's event categories.
*
* @return string
*/
public static function get_event_category_taxonomy(): string {
return 'mc-event-category';
}
}

View file

@ -1,29 +0,0 @@
{
"name": "activitypub-event-bridge",
"version": "0.1.0",
"author": {
"name": "André Menrath",
"web": "https://graz.social/@linos"
},
"scripts": {
"dev": "wp-scripts start",
"build": "wp-scripts build",
"readme": "grunt wp_readme_to_markdown",
"env-start": "wp-env start && wp-env run cli wp rewrite structure '/%year%/%monthnum%/%postname%/'",
"env-stop": "wp-env stop"
},
"license": "AGPL-3.0",
"bugs": {
"url": "https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-bridge/issues"
},
"devDependencies": {
"@wordpress/env": "^10.10.0",
"@wordpress/scripts": "^30.0.2",
"classnames": "^2.3.2",
"grunt": "^1.1.0",
"grunt-checktextdomain": "^1.0.1",
"grunt-wp-i18n": "^1.0.3",
"grunt-wp-readme-to-markdown": "^2.0.1"
}
}

View file

@ -29,9 +29,6 @@
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Exclude the Grundfile.js. -->
<exclude-pattern>Gruntfile.js</exclude-pattern>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="."/>

View file

@ -2,9 +2,9 @@
Contributors: andremenrath
Tags: events, fediverse, activitypub, calendar
Requires at least: 6.5
Tested up to: 6.7
Stable tag: 0.2.1
Requires PHP: 7.4
Tested up to: 6.6
Stable tag: 0.1.0
Requires PHP: 8.1
License: AGPL-3.0-or-later
License URI: https://www.gnu.org/licenses/agpl-3.0.html
Integrating popular event plugins with the ActivityPub plugin.
@ -31,8 +31,6 @@ These platforms create public event calendars by pulling in events from various
![](./.wordpress-org/decentralized-event-calenders.gif)
Even platforms that don't yet fully support events, like [Mastodon](https://joinmastodon.org), will still receive a detailed, well-composed summary of your event.
The Event Federation plugin ensures that users from those platforms are provided with all important information about an event.
= Features for Your WordPress Events and the Fediverse =
@ -60,17 +58,17 @@ This plugin depends on the [ActivityPub plugin](https://wordpress.org/plugins/ac
== Configuration ==
If you're new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality.
If youre new to the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/), its recommended to spend a few minutes reading through its documentation to familiarize yourself with its setup and functionality.
== Frequently Asked Questions ==
= Do I need to install another event plugin to use the Event Federation Plugin? =
Yes, this plugin works as an add-on and requires both the ActivityPub plugin and a supported event plugin such as The Events Calendar, VS Event List, or Events Manager to manage your events. It just fills the missing gap between event plugins and the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/).
Yes, this plugin works as an add-on and requires both the ActivityPub plugin and a supported event plugin such as The Events Calendar, VS Event List, or Events Manager to manage your events.
= What platforms can follow my events? =
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which don't fully support events yet, will display all important information about the events.
Your events can be followed on platforms that support ActivityPub like [Mobilizon](https://joinmobilizon.org/), [Gancio](https://gancio.org), [Friendica](https://friendi.ca), [Hubzilla](https://hubzilla.org), and [Pleroma](https://pleroma.social/). Even other applications like [Mastodon](https://joinmastodon.org), which dont fully support events yet, will display all important information about the events.
= How much extra work is required to maintain my events across the decentralized Web? =
@ -94,10 +92,6 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma
== Changelog ==
= [0.2.1] 2024-11-16 =
= [0.1.0] 2024-09-01 =
* Initial release on https://wordpress.org/
= [0.2.0] 2024-10-29 =
* Initial submission to https://wordpress.org/
* Initial alpha release on WordPress.org

View file

@ -5,9 +5,6 @@
* @package ActivityPub_Event_Bridge
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
/* @var array $args Template arguments. */
$args = wp_parse_args(
$args,

View file

@ -35,10 +35,10 @@ function _manually_load_plugin() {
require_once $plugin_dir . 'activitypub/activitypub.php';
// Capture the --filter argument.
$activitypub_event_bridge_integration_filter = null;
$activitypub_event_extension_integration_filter = null;
foreach ( $_SERVER['argv'] as $arg ) {
if ( strpos( $arg, '--filter=' ) === 0 ) {
$activitypub_event_bridge_integration_filter = substr( $arg, strlen( '--filter=' ) );
$activitypub_event_extension_integration_filter = substr( $arg, strlen( '--filter=' ) );
break;
}
}
@ -49,7 +49,7 @@ function _manually_load_plugin() {
$plugin_file = null;
// See if we want to run integration tests for a specific event-plugin.
switch ( $activitypub_event_bridge_integration_filter ) {
switch ( $activitypub_event_extension_integration_filter ) {
case 'the_events_calendar':
$plugin_file = 'the-events-calendar/the-events-calendar.php';
break;
@ -71,6 +71,9 @@ function _manually_load_plugin() {
case 'wp_event_manager':
$plugin_file = 'wp-event-manager/wp-event-manager.php';
break;
case 'my_calendar':
$plugin_file = 'my-calendar/my-calendar.php';
break;
}
if ( $plugin_file ) {
@ -84,19 +87,24 @@ function _manually_load_plugin() {
}
// Hot fix that allows using Events Manager within unit tests, because the em_init() is later not run as admin.
if ( 'events_manager' === $activitypub_event_bridge_integration_filter ) {
if ( 'events_manager' === $activitypub_event_extension_integration_filter ) {
require_once $plugin_dir . 'events-manager/em-install.php';
em_create_events_table();
em_create_events_meta_table();
em_create_locations_table();
}
if ( 'modern_events_calendar_lite' === $activitypub_event_bridge_integration_filter ) {
if ( 'modern_events_calendar_lite' === $activitypub_event_extension_integration_filter ) {
require_once $plugin_dir . 'modern-events-calendar-lite/app/libraries/factory.php';
$mec_factory = new MEC_factory();
$mec_factory->install();
}
if ( 'my_calendar' === $activitypub_event_extension_integration_filter ) {
require_once $plugin_dir . 'my-calendar/my-calendar.php';
add_action( 'init', 'mc_default_settings' );
}
// At last manually load our WordPress plugin.
require dirname( __DIR__ ) . '/activitypub-event-bridge.php';
}

View file

@ -0,0 +1,232 @@
<?php
/**
* Test class for My Calendar.
*
* @package ActivityPub_Event_Bridge
*/
/**
* Test class for My Calendar.
*/
class Test_My_Calendar extends WP_UnitTestCase {
/**
* Mockup Event.
*
* @var array
*/
private $mockup_event;
/**
* Mockup Location.
*
* @var array
*/
private $mockup_location;
/**
* Mockup Category.
*
* @var array
*/
private $mockup_category;
/**
* Setup mockup data.
*/
private function setUpMockupEvents() {
$this->mockup_event = array(
// Begin strings.
'event_begin' => date( 'Y-m-d', strtotime( '+10 days' ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'event_end' => date( 'Y-m-d', strtotime( '+10 days', ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'event_title' => 'Demo: Florence Price: Symphony No. 3 in c minor',
'event_desc' => "<p>Florence Price's <a href='https://en.wikipedia.org/wiki/Symphony_No._3_(Price)'>Symphony No. 3</a> was commissioned by the Works Progress Administration's <a href='https://en.wikipedia.org/wiki/Federal_Music_Project'>Federal Music Project</a> during the height of the Great Depression. It was first performed at the Detroit Institute of Arts on November 6, 1940, by the Detroit Civic Orchestra under the conductor Valter Poole.</p><p>The composition is Price's third symphony, following her Symphony in E minor—the first symphony by a black woman to be performed by a major American orchestra—and her lost Symphony No. 2.</p>",
'event_short' => "Florence Price's Symphony No.3 was first performed on November 6th, 1940. It was Ms. Price's third symphony, following her lost Symphony No. 2",
'event_time' => '15:00:00',
'event_endtime' => '16:00:00',
'event_link' => 'https://www.youtube.com/watch?v=1jgJ1OkjnaI&list=OLAK5uy_lKldgbFTYBDa7WN6jf2ubB595wncDU7yc&index=2',
'event_recur' => 'S1',
'event_image' => plugins_url( '/.wordpress-org/banner-772x250.jpg', ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE ),
'event_access' => '',
'event_tickets' => '',
'event_registration' => '',
'event_repeats' => '',
// Begin integers.
'event_author' => wp_get_current_user()->ID,
'event_category' => 1,
'event_link_expires' => 0,
'event_zoom' => 16,
'event_approved' => 1,
'event_host' => wp_get_current_user()->ID,
'event_flagged' => 0,
'event_fifth_week' => 0,
'event_holiday' => 0,
'event_group_id' => 1,
'event_span' => 0,
'event_hide_end' => 0,
// Array: removed before DB insertion.
'event_categories' => array( 1 ),
);
$access = array( 1, 2, 3, 4, 6, 8, 9 );
$this->mockup_location = array(
'location_label' => 'Demo: Minnesota Orchestra',
'location_street' => '1111 Nicollet Mall',
'location_street2' => '',
'location_city' => 'Minneapolis',
'location_state' => 'MN',
'location_postcode' => '55403',
'location_region' => '',
'location_country' => 'United States',
'location_url' => 'https://www.minnesotaorchestra.org',
'location_latitude' => '44.9722',
'location_longitude' => '-93.2749',
'location_zoom' => 16,
'location_phone' => '612-371-5600',
'location_phone2' => '',
'location_access' => serialize( $access ),
);
$this->mockup_category = array(
'category_name' => 'General',
'category_color' => '#243f82',
'category_icon' => 'event.svg',
);
}
/**
* Override the setup function, so that tests don't run if the Events Calendar is not active.
*/
public function set_up() {
parent::set_up();
if ( ! function_exists( 'mc_get_event' ) ) {
self::markTestSkipped( 'My Calendar plugin is not active.' );
}
self::setUpMockupEvents();
// Make sure that ActivityPub support is enabled for The Events Calendar.
$aec = \ActivityPub_Event_Bridge\Setup::get_instance();
$aec->activate_activitypub_support_for_active_event_plugins();
// Delete all posts afterwards.
_delete_all_posts();
}
/**
* Test that the right transformer gets applied.
*/
public function test_transformer_class() {
// We only test for one event plugin being active at the same time,
// even though we support multiple onces in theory.
// But testing all combinations is beyond scope.
$active_event_plugins = \ActivityPub_Event_Bridge\Setup::get_instance()->get_active_event_plugins();
$this->assertEquals( 1, count( $active_event_plugins ) );
// Enable ActivityPub support for the event plugin.
$this->assertContains( 'mc-events', get_option( 'activitypub_support_post_types' ) );
// mc_create_category( $this->mockup_category );
// $location = mc_insert_location( $this->mockup_location );
// $location = apply_filters( 'mc_save_location', $location, $this->mockup_location, $this->mockup_location );
// $event = array( true, false, $this->mockup_event, false, array() );
// $event = my_calendar_save( 'add', $event );
// mc_update_event( 'event_location', (int) $location, $event['event_id'] );
// Insert a category.
mc_create_category(
array(
'category_name' => 'General',
'category_color' => '#243f82',
'category_icon' => 'event.svg',
)
);
// Insert a location.
$access = array( 1, 2, 3, 4, 6, 8, 9 );
$add = array(
'location_label' => 'Demo: Minnesota Orchestra',
'location_street' => '1111 Nicollet Mall',
'location_street2' => '',
'location_city' => 'Minneapolis',
'location_state' => 'MN',
'location_postcode' => '55403',
'location_region' => '',
'location_country' => 'United States',
'location_url' => 'https://www.minnesotaorchestra.org',
'location_latitude' => '44.9722',
'location_longitude' => '-93.2749',
'location_zoom' => 16,
'location_phone' => '612-371-5600',
'location_phone2' => '',
'location_access' => serialize( $access ),
);
$results = mc_insert_location( $add );
/**
* Executed an action when the demo location is saved at installation.
*
* @hook mc_save_location
*
* @param {int|false} $results Result of database insertion. Row ID or false.
* @param {array} $add Array of location parameters to add.
* @param {array} $add Demo location array.
*/
$results = apply_filters( 'mc_save_location', $results, $add, $add );
// Insert an event.
$submit = array(
// Begin strings.
'event_begin' => date( 'Y-m-d', strtotime( '+1 day' ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'event_end' => date( 'Y-m-d', strtotime( '+1 day' ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'event_title' => 'Demo: Florence Price: Symphony No. 3 in c minor',
'event_desc' => "<p>Florence Price's <a href='https://en.wikipedia.org/wiki/Symphony_No._3_(Price)'>Symphony No. 3</a> was commissioned by the Works Progress Administration's <a href='https://en.wikipedia.org/wiki/Federal_Music_Project'>Federal Music Project</a> during the height of the Great Depression. It was first performed at the Detroit Institute of Arts on November 6, 1940, by the Detroit Civic Orchestra under the conductor Valter Poole.</p><p>The composition is Price's third symphony, following her Symphony in E minor—the first symphony by a black woman to be performed by a major American orchestra—and her lost Symphony No. 2.</p>",
'event_short' => "Florence Price's Symphony No.3 was first performed on November 6th, 1940. It was Ms. Price's third symphony, following her lost Symphony No. 2",
'event_time' => '19:30:00',
'event_endtime' => '21:00:00',
'event_link' => 'https://www.youtube.com/watch?v=1jgJ1OkjnaI&list=OLAK5uy_lKldgbFTYBDa7WN6jf2ubB595wncDU7yc&index=2',
'event_recur' => 'S1',
'event_image' => plugins_url( '/images/demo/event.jpg', __FILE__ ),
'event_access' => '',
'event_tickets' => '',
'event_registration' => '',
'event_repeats' => '',
// Begin integers.
'event_author' => wp_get_current_user()->ID,
'event_category' => 1,
'event_link_expires' => 0,
'event_zoom' => 16,
'event_approved' => 1,
'event_host' => wp_get_current_user()->ID,
'event_flagged' => 0,
'event_fifth_week' => 0,
'event_holiday' => 0,
'event_group_id' => 1,
'event_span' => 0,
'event_hide_end' => 0,
// Array: removed before DB insertion.
'event_categories' => array( 1 ),
);
$event = array( true, false, $submit, false, array() );
$response = my_calendar_save( 'add', $event );
$event_id = $response['event_id'];
$r = mc_update_event( 'event_location', (int) $results, $event_id );
$e = mc_get_first_event( $event_id );
$post_id = $e->event_post;
$image = media_sideload_image( plugins_url( '/images/demo/event.jpg', __FILE__ ), $post_id, null, 'id' );
if ( ! is_wp_error( $image ) ) {
set_post_thumbnail( $post_id, $image );
}
$wp_object = get_post( $event['event_post'] );
// Call the transformer Factory.
$transformer = \Activitypub\Transformer\Factory::get_transformer( $wp_object );
// Check that we got the right transformer.
$this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\My_Calendar::class, $transformer );
}
}