-
Notifications
You must be signed in to change notification settings - Fork 81
Delete: Self-Destruct #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pfefferle
wants to merge
11
commits into
trunk
Choose a base branch
from
add/self-destruct
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Delete: Self-Destruct #2046
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c3a65ff
Init
pfefferle 6aedee8
Merge branch 'trunk' into add/self-destruct
pfefferle 473b795
Enhance self_destruct CLI command for user deletion
pfefferle d5e3566
Improve CLI self-destruct messaging and process
pfefferle 6baccc0
Merge branch 'trunk' into add/self-destruct
pfefferle ed88240
Add self-destruct completion notification for ActivityPub
pfefferle 14d363e
Update self-destruct completion hook and logic
pfefferle e60da0b
Update includes/class-cli.php
pfefferle a44cdda
Add changelog
matticbot 68d3f74
Refactor outbox deletion to use Activity object
pfefferle aebbe8a
Merge branch 'trunk' into add/self-destruct
pfefferle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Adds a self-destruct feature to remove a blog from the Fediverse by sending Delete activities to followers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,24 @@ public static function admin_notices() { | |
if ( ! $current_screen ) { | ||
return; | ||
} | ||
|
||
// Check for self-destruct completion notice. | ||
$self_destruct_complete = \get_option( 'activitypub_self_destruct_complete' ); | ||
if ( $self_destruct_complete ) { | ||
// Show the notice only once, then remove it. | ||
\delete_option( 'activitypub_self_destruct_complete' ); | ||
?> | ||
<div class="notice notice-success is-dismissible"> | ||
<p> | ||
<strong><?php esc_html_e( 'ActivityPub Self-Destruct Complete!', 'activitypub' ); ?></strong> | ||
</p> | ||
<p> | ||
<?php esc_html_e( 'All Delete activities have been successfully sent to the Fediverse. Your blog is no longer discoverable via ActivityPub and all followers have been notified of the deletion.', 'activitypub' ); ?> | ||
</p> | ||
</div> | ||
<?php | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this being triggered from CLI, how about sending an email on completion instead? |
||
|
||
if ( 'edit' === $current_screen->base && Extra_Fields::is_extra_fields_post_type( $current_screen->post_type ) ) { | ||
?> | ||
<div class="notice" style="margin: 0; background: none; border: none; box-shadow: none; padding: 15px 0 0 0; font-size: 14px;"> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Any outbox processing should happen in separate threads where this action would not be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea where to put this instead? does it cost too much to add the hook, to be called on every
activitypub_outbox_processing_complete
call?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably not too expensive to put into the Dispatcher, but kind of a bummer given that this will almost never run.
Do we need the notification? Could we give them a CLI command to keep track of the scheduled events manually? Like, tell them to check
wp cron event list XYZ
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This felt like the best UX. We should get sure that this delete is properly processed, because otherwise this could end up in a big inconsistancy that can never be properly cleaned up!?