Skip to content
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

Remove Webmention Dependence on Pings #485

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

dshanske
Copy link
Collaborator

This removes webmention receiving being dependent on pings_open. It does allow for checking the presence of a webmentions_closed meta key to close webmentions. If this approach is validated, will move to figure out a UI for this.

For the sending, it moves from using the pung URLs property within the post object to a new temporary storage that will just store what was sent last time, compare it to what is being send this time, and use that to send deleted webmentions.

@dshanske dshanske requested a review from pfefferle July 22, 2024 04:18
@dshanske
Copy link
Collaborator Author

@pfefferle Where are we on this one?

@pfefferle
Copy link
Owner

get_pung will now be updated, but not taken into care for Webmentions, so there might still be the possibility that we send Webmentions for URLs that were already pinged?!?

@pfefferle
Copy link
Owner

I agree that we should not care about the pingback settings, but why change the get_pung code?

$open = false;
} else {
// If the webmentions_closed meta ID has a value then consider webmentions to be open.
$open = get_post_meta( $post->ID, 'webmentions_closed', true );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very misleading! we check for webmentions_closed and write it into $open? 😳

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should be false because we set it only when webmentions are closed?!?

Comment on lines +565 to +566
$open = get_post_meta( $post->ID, 'webmentions_closed', true );
$open = empty( $open ) ? true : false;
Copy link
Owner

@pfefferle pfefferle Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$open = get_post_meta( $post->ID, 'webmentions_closed', true );
$open = empty( $open ) ? true : false;
$closed = (int) get_post_meta( $post->ID, 'webmentions_closed', '0' );
$open = ! (bool) $closed;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't WordPress always transforming booleans into integer-strings when using get_post_meta?

true => '1'
false => '0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants