| @@ -8,10 +8,9 @@ | ||
| 8 | 8 | namespace Activitypub; |
| 9 | 9 | |
| 10 | 10 | use Activitypub\Collection\Followers; |
| 11 | 11 | use Activitypub\Collection\Following; |
| 12 | -use Activitypub\Collection\Remote_Posts; | |
| 13 | -use Activitypub\OAuth\Client; | |
| 12 | +use Activitypub\Collection\Posts; | |
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * ActivityPub Class. |
| 17 | 16 | * |
| @@ -42,9 +41,9 @@ | ||
| 42 | 41 | public static function activate( $network_wide ) { |
| 43 | 42 | self::flush_rewrite_rules(); |
| 44 | 43 | Scheduler::register_schedules(); |
| 45 | 44 | |
| 46 | - \add_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ), 5, 3 ); | |
| 45 | + \add_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ), 10, 3 ); | |
| 47 | 46 | Migration::update_comment_counts(); |
| 48 | 47 | |
| 49 | 48 | if ( \is_multisite() && $network_wide && ! \wp_is_large_network() ) { |
| 50 | 49 | $sites = \get_sites( array( 'fields' => 'ids' ) ); |
| @@ -64,9 +63,9 @@ | ||
| 64 | 63 | public static function deactivate( $network_wide ) { |
| 65 | 64 | self::flush_rewrite_rules(); |
| 66 | 65 | Scheduler::deregister_schedules(); |
| 67 | 66 | |
| 68 | - \remove_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ), 5 ); | |
| 67 | + \remove_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ) ); | |
| 69 | 68 | Migration::update_comment_counts( 2000 ); |
| 70 | 69 | |
| 71 | 70 | if ( \is_multisite() && $network_wide && ! \wp_is_large_network() ) { |
| 72 | 71 | $sites = \get_sites( array( 'fields' => 'ids' ) ); |
| @@ -83,13 +82,12 @@ | ||
| 83 | 82 | */ |
| 84 | 83 | public static function uninstall() { |
| 85 | 84 | Scheduler::deregister_schedules(); |
| 86 | 85 | |
| 87 | - \remove_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ), 5 ); | |
| 86 | + \remove_filter( 'pre_wp_update_comment_count_now', array( Comment::class, 'pre_wp_update_comment_count_now' ) ); | |
| 88 | 87 | Migration::update_comment_counts( 2000 ); |
| 89 | 88 | |
| 90 | - Remote_Posts::delete_all(); | |
| 91 | - Client::delete_all(); | |
| 89 | + Posts::delete_all(); | |
| 92 | 90 | |
| 93 | 91 | Options::delete(); |
| 94 | 92 | } |
| 95 | 93 | |
| @@ -292,31 +290,8 @@ | ||
| 292 | 290 | 'sanitize_callback' => 'absint', |
| 293 | 291 | ) |
| 294 | 292 | ); |
| 295 | 293 | \add_filter( 'get_user_option_activitypub_mailer_new_mention', array( self::class, 'user_options_default' ) ); |
| 296 | - | |
| 297 | - \register_meta( | |
| 298 | - 'user', | |
| 299 | - $blog_prefix . 'activitypub_mailer_annual_report', | |
| 300 | - array( | |
| 301 | - 'type' => 'integer', | |
| 302 | - 'description' => 'Send the annual Fediverse Year in Review email.', | |
| 303 | - 'single' => true, | |
| 304 | - 'sanitize_callback' => 'absint', | |
| 305 | - ) | |
| 306 | - ); | |
| 307 | - \add_filter( 'get_user_option_activitypub_mailer_annual_report', array( self::class, 'user_options_default' ) ); | |
| 308 | - | |
| 309 | - \register_meta( | |
| 310 | - 'user', | |
| 311 | - $blog_prefix . 'activitypub_mailer_monthly_report', | |
| 312 | - array( | |
| 313 | - 'type' => 'integer', | |
| 314 | - 'description' => 'Send a monthly Fediverse stats report email.', | |
| 315 | - 'single' => true, | |
| 316 | - 'sanitize_callback' => 'absint', | |
| 317 | - ) | |
| 318 | - ); | |
| 319 | 294 | |
| 320 | 295 | \register_meta( |
| 321 | 296 | 'user', |
| 322 | 297 | 'activitypub_show_welcome_tab', |