PluginProbe
ActivityPub / 7.8.4
ActivityPub v7.8.4
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / includes / constants.php

constants.php in ActivityPub 7.8.4, at includes/constants.php

91 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin constants.
4 *
5 * @package Activitypub
6 */
7
8 // The following constants can be defined in your wp-config.php file to override the default values.
9
10 defined( 'ACTIVITYPUB_REST_NAMESPACE' ) || define( 'ACTIVITYPUB_REST_NAMESPACE', 'activitypub/1.0' );
11 defined( 'ACTIVITYPUB_EXCERPT_LENGTH' ) || define( 'ACTIVITYPUB_EXCERPT_LENGTH', 400 );
12 defined( 'ACTIVITYPUB_NOTE_LENGTH' ) || define( 'ACTIVITYPUB_NOTE_LENGTH', 400 );
13 defined( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS' ) || define( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS', 4 );
14 defined( 'ACTIVITYPUB_HASHTAGS_REGEXP' ) || define( 'ACTIVITYPUB_HASHTAGS_REGEXP', '(?:(?<=\s)|(?<=<p>)|(?<=<br>)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' );
15 defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9\._-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' );
16 defined( 'ACTIVITYPUB_URL_REGEXP' ) || define( 'ACTIVITYPUB_URL_REGEXP', '(https?:|www\.)\S+[\w\/]' );
17 defined( 'ACTIVITYPUB_CUSTOM_POST_CONTENT' ) || define( 'ACTIVITYPUB_CUSTOM_POST_CONTENT', "[ap_title type=\"html\"]\n\n[ap_content]\n\n[ap_hashtags]" );
18 defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || define( 'ACTIVITYPUB_DISABLE_REWRITES', false );
19 defined( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS' ) || define( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS', false );
20 defined( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS' ) || define( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS', false );
21 defined( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE' ) || define( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE', 'wordpress-post-format' );
22 defined( 'ACTIVITYPUB_OUTBOX_PROCESSING_BATCH_SIZE' ) || define( 'ACTIVITYPUB_OUTBOX_PROCESSING_BATCH_SIZE', 100 );
23
24 // The following constants are invariable and define values used throughout the plugin.
25
26 /*
27 * Mastodon HTML sanitizer.
28 *
29 * @see https://docs.joinmastodon.org/spec/activitypub/#sanitization
30 */
31 define(
32 'ACTIVITYPUB_MASTODON_HTML_SANITIZER',
33 array(
34 'p' => array(),
35 'span' => array( 'class' => true ),
36 'br' => array(),
37 'a' => array(
38 'href' => true,
39 'rel' => true,
40 'class' => true,
41 ),
42 'del' => array(),
43 'pre' => array(),
44 'code' => array(),
45 'em' => array(),
46 'strong' => array(),
47 'b' => array(),
48 'i' => array(),
49 'u' => array(),
50 'ul' => array(),
51 'ol' => array(
52 'start' => true,
53 'reversed' => true,
54 ),
55 'li' => array( 'value' => true ),
56 'blockquote' => array(),
57 'h1' => array(),
58 'h2' => array(),
59 'h3' => array(),
60 'h4' => array(),
61 )
62 );
63
64 define( 'ACTIVITYPUB_DATE_TIME_RFC3339', 'Y-m-d\TH:i:s\Z' );
65
66 // Define Actor-Modes for the plugin.
67 define( 'ACTIVITYPUB_ACTOR_MODE', 'actor' );
68 define( 'ACTIVITYPUB_BLOG_MODE', 'blog' );
69 define( 'ACTIVITYPUB_ACTOR_AND_BLOG_MODE', 'actor_blog' );
70
71 // Post visibility constants.
72 define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC', '' );
73 define( 'ACTIVITYPUB_CONTENT_VISIBILITY_QUIET_PUBLIC', 'quiet_public' );
74 define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PRIVATE', 'private' );
75 define( 'ACTIVITYPUB_CONTENT_VISIBILITY_LOCAL', 'local' );
76
77 // Interaction policy constants.
78 define( 'ACTIVITYPUB_INTERACTION_POLICY_ANYONE', 'anyone' );
79 define( 'ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS', 'followers' );
80 define( 'ACTIVITYPUB_INTERACTION_POLICY_ME', 'me' );
81
82 // Identifiers that mark an Activity as Public.
83 define(
84 'ACTIVITYPUB_PUBLIC_AUDIENCE_IDENTIFIERS',
85 array(
86 'https://www.w3.org/ns/activitystreams#Public',
87 'as:Public',
88 'Public', // For backwards compatibility.
89 )
90 );
91