PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
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
← All changes | includes/constants.php +23 -63 8.2.15.7.0 View file →
@@ -6,26 +6,22 @@
6 6 */
7 7
8 8 // The following constants can be defined in your wp-config.php file to override the default values.
9 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', 500 );
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 -// Backwards compatibility: map old ACTIVITYPUB_DISABLE_SIDELOADING to ACTIVITYPUB_DISABLE_REMOTE_CACHE.
24 -if ( ! defined( 'ACTIVITYPUB_DISABLE_REMOTE_CACHE' ) && defined( 'ACTIVITYPUB_DISABLE_SIDELOADING' ) ) {
25 - define( 'ACTIVITYPUB_DISABLE_REMOTE_CACHE', ACTIVITYPUB_DISABLE_SIDELOADING );
26 -}
27 -defined( 'ACTIVITYPUB_DISABLE_REMOTE_CACHE' ) || define( 'ACTIVITYPUB_DISABLE_REMOTE_CACHE', false );
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_SHOW_PLUGIN_RECOMMENDATIONS' ) || \define( 'ACTIVITYPUB_SHOW_PLUGIN_RECOMMENDATIONS', true );
14 +\defined( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS' ) || \define( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS', 3 );
15 +\defined( 'ACTIVITYPUB_HASHTAGS_REGEXP' ) || \define( 'ACTIVITYPUB_HASHTAGS_REGEXP', '(?:(?<=\s)|(?<=<p>)|(?<=<br>)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' );
16 +\defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9\._-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' );
17 +\defined( 'ACTIVITYPUB_URL_REGEXP' ) || \define( 'ACTIVITYPUB_URL_REGEXP', '(https?:|www\.)\S+[\w\/]' );
18 +\defined( 'ACTIVITYPUB_CUSTOM_POST_CONTENT' ) || \define( 'ACTIVITYPUB_CUSTOM_POST_CONTENT', "[ap_title type=\"html\"]\n\n[ap_content]\n\n[ap_hashtags]" );
19 +\defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false );
20 +\defined( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS' ) || \define( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS', false );
21 +\defined( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS' ) || \define( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS', false );
22 +\defined( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE' ) || \define( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE', 'wordpress-post-format' );
23 +\defined( 'ACTIVITYPUB_OUTBOX_PROCESSING_BATCH_SIZE' ) || \define( 'ACTIVITYPUB_OUTBOX_PROCESSING_BATCH_SIZE', 100 );
28 24
29 25 // The following constants are invariable and define values used throughout the plugin.
30 26
31 27 /*
@@ -32,9 +28,9 @@
32 28 * Mastodon HTML sanitizer.
33 29 *
34 30 * @see https://docs.joinmastodon.org/spec/activitypub/#sanitization
35 31 */
36 -define(
32 +\define(
37 33 'ACTIVITYPUB_MASTODON_HTML_SANITIZER',
38 34 array(
39 35 'p' => array(),
40 36 'span' => array( 'class' => true ),
@@ -65,52 +61,16 @@
65 61 'h4' => array(),
66 62 )
67 63 );
68 64
69 -define( 'ACTIVITYPUB_DATE_TIME_RFC3339', 'Y-m-d\TH:i:s\Z' );
65 +\define( 'ACTIVITYPUB_DATE_TIME_RFC3339', 'Y-m-d\TH:i:s\Z' );
70 66
71 67 // Define Actor-Modes for the plugin.
72 -define( 'ACTIVITYPUB_ACTOR_MODE', 'actor' );
73 -define( 'ACTIVITYPUB_BLOG_MODE', 'blog' );
74 -define( 'ACTIVITYPUB_ACTOR_AND_BLOG_MODE', 'actor_blog' );
68 +\define( 'ACTIVITYPUB_ACTOR_MODE', 'actor' );
69 +\define( 'ACTIVITYPUB_BLOG_MODE', 'blog' );
70 +\define( 'ACTIVITYPUB_ACTOR_AND_BLOG_MODE', 'actor_blog' );
75 71
76 72 // Post visibility constants.
77 -define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC', '' );
78 -define( 'ACTIVITYPUB_CONTENT_VISIBILITY_QUIET_PUBLIC', 'quiet_public' );
79 -define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PRIVATE', 'private' );
80 -define( 'ACTIVITYPUB_CONTENT_VISIBILITY_LOCAL', 'local' );
81 -
82 -// Object state constants (stored in activitypub_status meta).
83 -define( 'ACTIVITYPUB_OBJECT_STATE_PENDING', 'pending' );
84 -define( 'ACTIVITYPUB_OBJECT_STATE_FEDERATED', 'federated' );
85 -define( 'ACTIVITYPUB_OBJECT_STATE_FAILED', 'failed' );
86 -define( 'ACTIVITYPUB_OBJECT_STATE_DELETED', 'deleted' );
87 -
88 -// Interaction policy constants.
89 -define( 'ACTIVITYPUB_INTERACTION_POLICY_ANYONE', 'anyone' );
90 -define( 'ACTIVITYPUB_INTERACTION_POLICY_FOLLOWERS', 'followers' );
91 -define( 'ACTIVITYPUB_INTERACTION_POLICY_ME', 'me' );
92 -
93 -// Identifiers that mark an Activity as Public.
94 -define(
95 - 'ACTIVITYPUB_PUBLIC_AUDIENCE_IDENTIFIERS',
96 - array(
97 - 'https://www.w3.org/ns/activitystreams#Public',
98 - 'as:Public',
99 - 'Public', // For backwards compatibility.
100 - )
101 -);
102 -
103 -/*
104 - * HTTP error codes that indicate temporary/retriable failures.
105 - *
106 - * These errors suggest the server may recover quickly, so they get
107 - * shorter cache durations and qualify for automatic retries.
108 - *
109 - * @see https://github.com/tfredrich/RestApiTutorial.com/blob/master/content/advanced/responses/retries.md
110 - */
111 -define( 'ACTIVITYPUB_RETRY_ERROR_CODES', array( 408, 429, 500, 502, 503, 504 ) );
112 -
113 -// Default purge retention periods (in days).
114 -define( 'ACTIVITYPUB_OUTBOX_PURGE_DAYS', 180 );
115 -define( 'ACTIVITYPUB_INBOX_PURGE_DAYS', 180 );
116 -define( 'ACTIVITYPUB_AP_POST_PURGE_DAYS', 30 );
73 +\define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC', '' );
74 +\define( 'ACTIVITYPUB_CONTENT_VISIBILITY_QUIET_PUBLIC', 'quiet_public' );
75 +\define( 'ACTIVITYPUB_CONTENT_VISIBILITY_PRIVATE', 'private' );
76 +\define( 'ACTIVITYPUB_CONTENT_VISIBILITY_LOCAL', 'local' );