@@ -52,11 +52,11 @@ public static function add_follower( $user_id, $actor ) {
52
52
return $ id ;
53
53
}
54
54
55
- $ post_meta = get_post_meta ( $ id , 'activitypub_user_id ' , false );
55
+ $ post_meta = get_post_meta ( $ id , '_activitypub_user_id ' , false );
56
56
57
57
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
58
58
if ( is_array ( $ post_meta ) && ! in_array ( $ user_id , $ post_meta ) ) {
59
- add_post_meta ( $ id , 'activitypub_user_id ' , $ user_id );
59
+ add_post_meta ( $ id , '_activitypub_user_id ' , $ user_id );
60
60
wp_cache_delete ( sprintf ( self ::CACHE_KEY_INBOXES , $ user_id ), 'activitypub ' );
61
61
}
62
62
@@ -89,7 +89,7 @@ public static function remove_follower( $user_id, $actor ) {
89
89
*/
90
90
do_action ( 'activitypub_followers_pre_remove_follower ' , $ follower , $ user_id , $ actor );
91
91
92
- return delete_post_meta ( $ follower ->get__id (), 'activitypub_user_id ' , $ user_id );
92
+ return delete_post_meta ( $ follower ->get__id (), '_activitypub_user_id ' , $ user_id );
93
93
}
94
94
95
95
/**
@@ -106,7 +106,7 @@ public static function get_follower( $user_id, $actor ) {
106
106
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
107
107
$ post_id = $ wpdb ->get_var (
108
108
$ wpdb ->prepare (
109
- "SELECT DISTINCT p.ID FROM $ wpdb ->posts p INNER JOIN $ wpdb ->postmeta pm ON p.ID = pm.post_id WHERE p.post_type = %s AND pm.meta_key = 'activitypub_user_id ' AND pm.meta_value = %d AND p.guid = %s " ,
109
+ "SELECT DISTINCT p.ID FROM $ wpdb ->posts p INNER JOIN $ wpdb ->postmeta pm ON p.ID = pm.post_id WHERE p.post_type = %s AND pm.meta_key = '_activitypub_user_id ' AND pm.meta_value = %d AND p.guid = %s " ,
110
110
array (
111
111
esc_sql ( self ::POST_TYPE ),
112
112
esc_sql ( $ user_id ),
@@ -188,7 +188,7 @@ public static function get_followers_with_count( $user_id, $number = -1, $page =
188
188
// phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
189
189
'meta_query ' => array (
190
190
array (
191
- 'key ' => 'activitypub_user_id ' ,
191
+ 'key ' => '_activitypub_user_id ' ,
192
192
'value ' => $ user_id ,
193
193
),
194
194
),
@@ -219,11 +219,11 @@ public static function get_all_followers() {
219
219
'meta_query ' => array (
220
220
'relation ' => 'AND ' ,
221
221
array (
222
- 'key ' => 'activitypub_inbox ' ,
222
+ 'key ' => '_activitypub_inbox ' ,
223
223
'compare ' => 'EXISTS ' ,
224
224
),
225
225
array (
226
- 'key ' => 'activitypub_actor_json ' ,
226
+ 'key ' => '_activitypub_actor_json ' ,
227
227
'compare ' => 'EXISTS ' ,
228
228
),
229
229
),
@@ -247,15 +247,15 @@ public static function count_followers( $user_id ) {
247
247
'meta_query ' => array (
248
248
'relation ' => 'AND ' ,
249
249
array (
250
- 'key ' => 'activitypub_user_id ' ,
250
+ 'key ' => '_activitypub_user_id ' ,
251
251
'value ' => $ user_id ,
252
252
),
253
253
array (
254
- 'key ' => 'activitypub_inbox ' ,
254
+ 'key ' => '_activitypub_inbox ' ,
255
255
'compare ' => 'EXISTS ' ,
256
256
),
257
257
array (
258
- 'key ' => 'activitypub_actor_json ' ,
258
+ 'key ' => '_activitypub_actor_json ' ,
259
259
'compare ' => 'EXISTS ' ,
260
260
),
261
261
),
@@ -290,15 +290,15 @@ public static function get_inboxes( $user_id ) {
290
290
'meta_query ' => array (
291
291
'relation ' => 'AND ' ,
292
292
array (
293
- 'key ' => 'activitypub_inbox ' ,
293
+ 'key ' => '_activitypub_inbox ' ,
294
294
'compare ' => 'EXISTS ' ,
295
295
),
296
296
array (
297
- 'key ' => 'activitypub_user_id ' ,
297
+ 'key ' => '_activitypub_user_id ' ,
298
298
'value ' => $ user_id ,
299
299
),
300
300
array (
301
- 'key ' => 'activitypub_inbox ' ,
301
+ 'key ' => '_activitypub_inbox ' ,
302
302
'value ' => '' ,
303
303
'compare ' => '!= ' ,
304
304
),
@@ -318,7 +318,7 @@ public static function get_inboxes( $user_id ) {
318
318
$ wpdb ->prepare (
319
319
"SELECT DISTINCT meta_value FROM {$ wpdb ->postmeta }
320
320
WHERE post_id IN ( " . implode ( ', ' , array_fill ( 0 , count ( $ posts ), '%d ' ) ) . ")
321
- AND meta_key = 'activitypub_inbox '
321
+ AND meta_key = '_activitypub_inbox '
322
322
AND meta_value IS NOT NULL " ,
323
323
$ posts
324
324
)
@@ -378,24 +378,24 @@ public static function get_faulty_followers( $number = 20 ) {
378
378
'meta_query ' => array (
379
379
'relation ' => 'OR ' ,
380
380
array (
381
- 'key ' => 'activitypub_errors ' ,
381
+ 'key ' => '_activitypub_errors ' ,
382
382
'compare ' => 'EXISTS ' ,
383
383
),
384
384
array (
385
- 'key ' => 'activitypub_inbox ' ,
385
+ 'key ' => '_activitypub_inbox ' ,
386
386
'compare ' => 'NOT EXISTS ' ,
387
387
),
388
388
array (
389
- 'key ' => 'activitypub_actor_json ' ,
389
+ 'key ' => '_activitypub_actor_json ' ,
390
390
'compare ' => 'NOT EXISTS ' ,
391
391
),
392
392
array (
393
- 'key ' => 'activitypub_inbox ' ,
393
+ 'key ' => '_activitypub_inbox ' ,
394
394
'value ' => '' ,
395
395
'compare ' => '= ' ,
396
396
),
397
397
array (
398
- 'key ' => 'activitypub_actor_json ' ,
398
+ 'key ' => '_activitypub_actor_json ' ,
399
399
'value ' => '' ,
400
400
'compare ' => '= ' ,
401
401
),
@@ -437,7 +437,7 @@ public static function add_error( $post_id, $error ) {
437
437
438
438
return add_post_meta (
439
439
$ post_id ,
440
- 'activitypub_errors ' ,
440
+ '_activitypub_errors ' ,
441
441
$ error_message
442
442
);
443
443
}
0 commit comments