Compare commits
7 commits
main
...
readme_imp
Author | SHA1 | Date | |
---|---|---|---|
a38fffd938 | |||
17286b4e63 | |||
eafbb940cb | |||
b4036b1457 | |||
91a977dbfd | |||
6f84e9d43e | |||
5a09997928 |
18 changed files with 55 additions and 114 deletions
14
.distignore
14
.distignore
|
@ -1,24 +1,34 @@
|
|||
.distignore
|
||||
.git
|
||||
.gitignore
|
||||
.php_cs
|
||||
.svnignore
|
||||
.wordpress-org
|
||||
.wp-env.json
|
||||
_config.yml
|
||||
_site
|
||||
bin
|
||||
CHANGELOG.md
|
||||
CODE_OF_CONDUCT.md
|
||||
composer.json
|
||||
composer.lock
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
docs
|
||||
docker-compose-test.yml
|
||||
docker-compose.yml
|
||||
FEDERATION.md
|
||||
Gruntfile.js
|
||||
Makefile
|
||||
node_modules
|
||||
package.json
|
||||
npm-debug.log
|
||||
package-lock.json
|
||||
package.json
|
||||
phpcs.xml
|
||||
phpunit.xml
|
||||
phpunit.xml.dist
|
||||
README.md
|
||||
readme.md
|
||||
SECURITY.md
|
||||
src
|
||||
tests
|
||||
vendor
|
|
@ -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-9
|
||||
|
||||
- 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
|
||||
|
|
|
@ -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
23
.gitattributes
vendored
|
@ -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
|
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -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.
|
||||
|
|
13
README.md
13
README.md
|
@ -2,9 +2,9 @@
|
|||
**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
|
||||
**Tested up to:** 6.6
|
||||
**Stable tag:** 0.2.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.
|
||||
|
@ -73,7 +73,6 @@ If you're new to the [ActivityPub plugin](https://wordpress.org/plugins/activity
|
|||
### 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? ###
|
||||
|
||||
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.
|
||||
|
@ -100,10 +99,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 ###
|
||||
|
||||
* Initial release on https://wordpress.org/
|
||||
|
||||
### [0.2.0] 2024-10-29 ###
|
||||
|
||||
* Initial submission to https://wordpress.org/
|
||||
* Initial release on https://wordpress.org/
|
||||
|
|
|
@ -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.2.0
|
||||
* 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
|
||||
|
|
|
@ -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 }')
|
||||
if [ -n "$LATEST_TAG" ]; then
|
||||
PLUGIN_FILE="$PLUGIN_NAME.$LATEST_TAG.zip"
|
||||
else
|
||||
PLUGIN_FILE="$PLUGIN_NAME.zip"
|
||||
fi
|
||||
|
@ -254,12 +248,12 @@ 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
|
||||
# Mec is not installable via wordpress.org, we use our own mirror.
|
||||
install_wp_plugin_mec
|
||||
}
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
);
|
||||
|
|
|
@ -252,7 +252,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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
13
readme.txt
13
readme.txt
|
@ -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.2.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.
|
||||
|
@ -67,7 +67,6 @@ If you're new to the [ActivityPub plugin](https://wordpress.org/plugins/activity
|
|||
= 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? =
|
||||
|
||||
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.
|
||||
|
@ -94,10 +93,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 =
|
||||
|
||||
* Initial release on https://wordpress.org/
|
||||
|
||||
= [0.2.0] 2024-10-29 =
|
||||
|
||||
* Initial submission to https://wordpress.org/
|
||||
* Initial release on https://wordpress.org/
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
@ -84,14 +84,14 @@ 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();
|
||||
|
|
Loading…
Reference in a new issue