Giter VIP home page Giter VIP logo

wordpress-webmention's Introduction

Webmention

Contributors: pfefferle, dshanske
Donate link: https://notiz.blog/donate/
Tags: webmention, pingback, trackback, linkback, indieweb
Requires at least: 4.9
Tested up to: 6.5
Stable tag: 5.2.6
Requires PHP: 5.6
License: MIT
License URI: https://opensource.org/licenses/MIT

Enable conversation across the web.

Description

When you link to a website you can send it a Webmention to notify it and then that website may display your post as a comment, like, or other response, and presto, you’re having a conversation from one site to another!

A Webmention is a notification that one URL links to another. Sending a Webmention is not limited to blog posts, and can be used for additional kinds of content and responses as well.

For example, a response can be an RSVP to an event, an indication that someone "likes" another post, a "bookmark" of another post, and many others. Webmention enables these interactions to happen across different websites, enabling a distributed social web.

The Webmention plugin supports the Webmention protocol, giving you support for sending and receiving Webmentions. It offers a simple built in presentation.

Frequently Asked Questions

What are Webmentions?

Webmention is a simple way to automatically notify any URL when you link to it on your site. From the receivers perpective, it's a way to request notification when other sites link to it.

That Sounds Like a Pingback or a Trackback

Webmention is an update/replacement for Pingback or Trackback. Unlike the older protocols, the specification is recommended by the W3C as well as an active community of individuals using it on their sites.

How can I send and receive Webmentions?

On the Settings --> Discussion Page in WordPress:

  • On the Webmention Settings page, decide which post types you want to enable Webmentions for. By default, posts and pages.
  • Set a page to redirect homepage mentions to. This will automatically enable Webmentions for that page.
  • If you want to enable a Webmention form in the comment section, check the box.

You can use the send_webmention($source, $target) function and pass a source and a target or you can fire an action like do_action('send_webmention', $source, $target).

How do I support Webmentions for my custom post type?

When declaring your custom post type, add post type support for Webmentions by either including it in your register_post_type entry. This can also be added in the Webmention settings.

How do I send/receive Webmentions for attachments?

You can enable receiving Webmentions for attachments in Webmention settings. You can enable sending Webmentions for media links in the settings. Please note that most receivers of Webmentions do not support receiving them to image, audio, and video files. In order to support receiving them on WordPress, Webmention endpoint headers would have to be added at the webserver level.

How can I handle Webmentions to my Homepage or Archive Pages?

Webmentions should be allowed on all URLs of a blog, however WordPress does not support this as only posts can have comments attached to them. The plugin currently handles only Webmentions on posts and allows you to set a page to receive homepage mentions.

Even though it is not done automatically, it is very simple to add support for archives and URLs on your site by providing a post/page to show collect mentions. The plugin provides a simple filter for that.

In the below example, if there is no page returned it will send mentions to a catch-all post. You can also have unique posts per URL.

function handle_other_webmentions($id, $target) {
  // do nothing if id is set
  if ($id) {
    return $id;
  }

  // return "default" id if plugin can't find a post/page
  return 9247;
}
add_filter("webmention_post_id", "handle_other_webmentions", 10, 2);

Will a caching plugin affect my ability to use this?

The URL for the Webmention endpoint, which you can view in the source of your pages, should be excluded from any server or plugin caching.

As Webmention uses the REST API endpoint system, most up to date caching plugins should exclude it by default.

Why does this plugin have settings about avatars?

Webmentions have the ability to act as rich comments. This includes showing avatars. If there is an avatar discovered, the URL for it will be stored. This can either be reflect something from the media library or a URL of a file. If the file is broken, it will store a local copy of the default gravatar image.

There are no Webmention headers on some pages of my site

Webmention headers are only shown if Webmentions are available for that particular URL. If you want to show it regardless, you can add below to your wp-config.php file.

define( 'WEBMENTION_ALWAYS_SHOW_HEADERS', 1 );

How do I customize the display of my webmentions?

This plugin includes several enhancements to the built-in WordPress commenting system to allow for enhancement, while allowing existing methods to offer customization. It customizes the classic defaults for WordPress to account for webmentions by using a custom comment walker that minimally changes to defaults. By default, many themes provide a custom callback to the wp_list_comments function. This plugin adds several enhancements to that. For one, the custom callbacks argument is usually a string with the function name. We enhance it to behave as normal in that case, but if an array is passed, to allow specific callbacks per the key of the array, or the 'all' key as a default. This means each comment type, which would be each webmention type or otherwise, can have its own custom callback.

It introduces a new version of the default function for html5 comments, adding correct microformats2 markup, and for webmentions, a proper site citation, e.g. Bob @ Example.Com as well as a hook, webmention_comment_metadata which offers a comment object as the sole argument, to add arbitrary metadata. This would be overridden by any custom comment rendering done by themes.

There is an option within the plugin to show webmentions not determined to be replies or comments inline, or to display them separately as avatar only lists. The wp_list_comments function is overridden to allow for the avatar_only option, which will render this, with a second option of overlay to overlay an icon reflecting the reaction type. Reactions are webmention types such as like, which there is no textual component to it. If you opt to display them as comments, the text will read that the author likes this post.

While not all display options can be settings, we are looking to provide some simple options which could be customized in a theme if needed.

Changelog

Project and support maintained on github at pfefferle/wordpress-webmention.

5.2.6

  • Fix null reference to comment_parent

5.2.5

  • Comment Walker was calling regular not html5 version of comment function when falling back.

5.2.4

  • Fix fatal PHP error

5.2.3

5.2.2

  • Improve fallback handling to avoid "Anonymous" as post author

5.2.1

  • Fix issue where built in comment types were rejected

5.2.0

  • Do not bypass the spam filters
  • Support Source Update Notifications
  • Add in experimental Avatar Store

5.1.9

  • Replace comment_link only for Webmentions and only in the frontend

5.1.8

  • Replace comment_link only for Webmentions that have a source

5.1.7

  • Fix fatal error in WP parser

5.1.6

  • Allow variable to be null.

5.1.5

  • Bring back overflow option for facepile this time using the details tag
  • Add html link discovery for finding WordPress REST API
  • Load author page to find name/photo when only the URL is provided
  • Fix timezone issue where times were not properly converted into website time
  • Introduce webmentions_open function which determines if webmentions are open for a post. Currently a wrapper around pings_open
  • Misc minor fixes

5.1.4

  • Fixed: avoid enqueuing Webmention's CSS stylesheet when it is not needed.
  • Fixed: threaded comments support.
  • Added: client URL validation.

5.1.3

  • Fix timezone issue causes exception

5.1.2

  • Remove built-in WordPress filtering in favor of plugin filtering of incoming webmentions.
  • If content is long and type is a mention, try to use the summary or name insteasd of full content as the display.
  • Fix issue where meta was overriding mf2
  • Improve JSON-LD handler

5.1.1

  • Several Parser/Handler fixes
  • Remove unnecessary loading of comments.php
  • Some Tool updates

5.1.0

  • Add mf2 author migration
  • Include spam and trash statuses for dupe check
  • Update tests and make u-url attrib optional for post-type discovery
  • Update dupe check
  • Set created at time only for new comments
  • Allow refreshing webmentions from the Bulk Actions menu
  • Remove Gravatar Cache
  • A lot of small improvements and fixes

5.0.0

  • Complete rewrite of the codebase
  • Introduce PHP namespaces
  • New parser which will fallback on the WordPress REST API, JSON-LD, or HTML meta tags if Microformats are not sufficient to render a comment.
  • New debugger/test tool for Webmention Parsing under Tools
  • Webmentions are no longer stored as comment type mention, but as custom comment types
  • New simplified presentation code, providing for optional custom templating in future

4.0.9

  • Fix XSS issue

4.0.8

  • Add onerror handling also for srcset ( props @florianbrinkmann for testing )

4.0.7

  • Re-add onerror handling for broken images ( props @snarfed )

4.0.6

  • Updated requirements

4.0.5

  • Remov Webmention_Notification class until proper tested/used

4.0.4

  • Update dependencies
  • Fix WordPress warnings

4.0.3

  • Move comment approve list and auto approve to the wp_allow_comment function called by the wp_new_comment function.
  • Minor fix to avatar function to account for the fact comments have an empty comment type

4.0.2

  • Cache in cases where stored avatar is a gravatar

4.0.1

  • Show Webmention form only if pings_open
  • Show Webmention form also if comments are disabled

4.0.0

  • Add settings for enabling Webmention support by public post type
  • Add setting for disabling sending media links...URLs attached to image, video, or audio tags
  • Switch from sending Webmentions to all URLs in post content to only ones with proper HTML markup
  • Support handling avatars if stored in meta
  • Support serving a local anonymous avatar if no email and cache whether there is a gravatar for a definable period of time
  • Store a Webmention protocol property in comment meta
  • Do not show Webmention headers if URL does not support Webmentions
  • Update Webmention meta template to use separate file which is shown on the edit comment screen
  • Minimum PHP version bumped to 5.4. WordPress currently has a minimum of 5.6 but we support back to version 4.9
  • For compatibility reasons, load a version of is_avatar_comment_type (introduced 5.1) and get_self_link (introduced 5.3) for use in this plugin
  • Improve all settings and template forms ( props @tw2113 )

3.8.11

  • Minor bug fix

3.8.10

  • Always enable Webmentions on basis that using plugin means you want Webmentions instead of using default pingback setting
  • Fix auto approve based on domain

3.8.9

  • Small HTML template changes

3.8.8

  • Added NodeInfo(2) support

3.8.7

  • Fixed default value of webmention_avatars on the settings page

3.8.6

  • Fixed default value of webmention_avatars

3.8.5

  • Set correct default value for the "Show comment form" setting

3.8.4

  • Store vouch property
  • Preliminary vouch support disabled by default. As Vouch is experimental can only be enabled by adding define( 'WEBMENTION_VOUCH', true )

3.8.3

  • Changed setting for avatar to consider null to be the same as yes

3.8.2

  • Fixed PHP issue

3.8.1

  • Updated GDPR text suggestion
  • Fixed old settings links
  • Made Webmention comment-form text customizable (#175)
  • Better handling of wp_add_privacy_policy_content call

Thanks Sebastian Greger

3.8.0

  • Added GDPR recommendation text
  • Implemented help tab
  • Form Improvements
  • Domain allowlist
  • Add avatar settings control
  • Text improvements

Thanks Sebastian Greger, David Shanske and Chris Aldrich

3.7.0

  • Added "threaded comments" support

3.6.0

  • Send delete Webmentions
  • Receive delete Webmentions

3.5.0

  • Added nicer HTML views for non API calls
  • Added german translations (thanks to @deponeWD)
  • Be sure to disable the old webmention-for-comments plugin

3.4.1

  • Add filter to allow setting of Webmention form text
  • Move register settings to init due new default options not being set if admin only
  • Add edit_webmention hook due comment array filtering
  • Display Webmention Meta on Edit Comment page

3.4.0

  • Added settings link
  • Added link to Homepage Webmention page
  • Enable pings for Homepage Webmentions

3.3.0

  • Add setting for homepage mentions (thanks @dshanske)
  • Remove deprecated functions due 4.8 release

3.2.1

  • moved endpoint discovery to functions.php
  • added missing i18n strings
  • removed polyfill

3.2.0

  • Enable option for page support
  • Allow custom post types to declare support for Webmentions as a feature which will enable pings.
  • Remove new meta properties from being added during preprocessing as these are added after Semantic Linkbacks Enhancement.
  • Move new meta properties to being built into Webmention code
  • Store Webmention source in comment meta but fall back to checking comment_author_url if not set.
  • Store Webmention creation time in comment meta as comment time is overridden by Semantic Linkbacks allowing to determine if a comment has been modified.

3.1.1

  • URLEncode/Decode source and target
  • Webmention Comment Type now declares support for avatars
  • Meta keys are now registered for webmention_target_url and webmention_target_fragment
  • Target URL is stored instead of derived from the permalink to ensure permanance
  • Target fragment is stored to support fragmentions. Can also suport comments when reply is to a comment.

3.1.0

3.0.1

  • Show endpoint discovery on every page again, to prevent several problems.

3.0.0

  • Plugin refactored to use API infrastructure.
  • Visiting the endpoint in a web browser now returns a Webmention form.
  • Plugin now compliant with draft specification although remains synchronous.
  • Deprecation of webmention_title and webmention_content filters in favor of a single targeted Webmention comment data filter.
  • webmention_post_send action now fires on all attempts to send a Webmention instead of only successful ones. Allows for logging functions to be added.
  • Supports adding additional parameters when sending Webmentions
  • Fix incompatibility with Ultimate Category Excluder plugin.

2.6.0

  • removed duplicate request for HTML via get_meta_tags
  • refactoring
  • limits to same domain

2.5.0

  • add salmon/crossposting-extension support (props @singpolyma)
  • disable self-pings via settings
  • do not unapprove already-approved Webmention (props @singpolyma)
  • some code improvements

2.4.0

  • switched to WordPress Coding Standard

2.3.4

  • some fixes and improvements

2.3.3

  • added filter for Webmention endpoint (to add/require additional paramaters: #39 or #41)

2.3.2

  • added more params to webmention_post_send (props to @snarfed)
  • removed rescedule of Webmentions (props to @snarfed)

2.3.1

  • use error-code 403 instead of 500 if Pingbacks/Webmentions are disabled for a post (thanks @snarfed)
  • added webmention_comment_parent filter

2.3.0

  • nicer title and content discovery
  • added post-id to webmention_links filter
  • improved publish_post_hook function
  • disabled flood control
  • nicer response value
  • some more filters/actions
  • added a default request "action" to be more flexible and to handle more than mentions on posts and pages
  • a lot of small fixes

2.2.0

  • prevent selfpings
  • added support for https and http
  • optimized some methods

2.1.4

  • fixed pseudo hook

2.1.3

  • fixed some warnings

2.1.2

  • now ready to use in a bundle

2.1.1

  • nicer feedback for the Webmention endpoint

2.1.0

  • nicer title and content discovery
  • added post-id to webmention_links filter
  • improved publish_post_hook function

2.0.1

  • small fixes
  • nicer excerpt extractor

2.0.0

initial release

Installation

Follow the normal instructions for installing WordPress plugins.

Automatic Plugin Installation

To add a WordPress Plugin using the built-in plugin installer:

  1. Go to Plugins > Add New.
  2. Type "webmention" into the Search Plugins box.
  3. Find the WordPress Plugin you wish to install.
    1. Click Details for more information about the Plugin and instructions you may wish to print or save to help setup the Plugin.
    2. Click Install Now to install the WordPress Plugin.
  4. The resulting installation screen will list the installation as successful or note any problems during the install.
  5. If successful, click Activate Plugin to activate it, or Return to Plugin Installer for further actions.

Manual Plugin Installation

There are a few cases when manually installing a WordPress Plugin is appropriate.

  • If you wish to control the placement and the process of installing a WordPress Plugin.
  • If your server does not permit automatic installation of a WordPress Plugin.
  • If you want to try the latest development version.

Installation of a WordPress Plugin manually requires FTP familiarity and the awareness that you may put your site at risk if you install a WordPress Plugin incompatible with the current version or from an unreliable source.

Backup your site completely before proceeding.

To install a WordPress Plugin manually:

  • Download your WordPress Plugin to your desktop.
  • If downloaded as a zip archive, extract the Plugin folder to your desktop.
  • With your FTP program, upload the Plugin folder to the wp-content/plugins folder in your WordPress directory online.
  • Go to Plugins screen and find the newly uploaded Plugin in the list.
  • Click Activate to activate it.

Upgrade Notice

5.0.0

This version is a complete rewrite of the code and a merge of the Semantic Linkbacks plugin. You should uninstall Semantic Linkbacks for this upgrade. Please file upgrade issues via Github.

Warning: Please backup your database before upgrading. This version changes the storage method of Webmentions.

3.0.0

This update brings the plugin into compliance with the draft standard. As a result, some filters and actions have changed. Please check any dependent code before updating.

2.0.0

This plugin doesn't support the microformts stuff mentioned in the IndieWebCamp Wiki. To enable semantic linkbacks you have to use https://github.com/pfefferle/wordpress-semantic-linkbacks

wordpress-webmention's People

Contributors

aaronpk avatar chrisbergr avatar dependabot[bot] avatar deponewd avatar derherrfeldmann avatar dshanske avatar edas avatar edent avatar janboddez avatar jeherve avatar jeremyfelt avatar killerog avatar mlinksva avatar paulrobertlloyd avatar pfefferle avatar samwilson avatar singpolyma avatar snarfed avatar szepeviktor avatar tw2113 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-webmention's Issues

Add native support for exotic webmentions

Follow up to #22.

Support webmentions natively on the following page types:

  • Blog listing (is_home)
  • Archive pages (is_archive)
    • Author
    • Date
    • taxonomies (categories, tags, etc)
    • custom post type full archives

Archives could be considered a single page, even though they can span multiple pages.

Implementation brain storming:

  • Create unlisted custom post type to store mentions against, webmention_exotic?
  • home page post is created on activating the plugin
  • archives, etc have the custom post created on receiving the first web mention
  • Using the standard comment command will need a little work as the first thing it does is check it's on a singular
  • themes would need to be modified to support it, plugin doesn't assume, add_theme_support( 'exotic-webmentions') could be suitable

Reduce the Number of Filters

I think the defaults for the title and content could be better handled off of preprocess_comment to replace the defaults for new comments now that, in an alternate pull request, the source is passed in the comment array.

For existing comments, we can add a similar filter on the update side.

htmlspecialchars() reply content before dislaying?

I sent a comment with <http://example.com>, which is Markdown for linking tags but it disappeared on you blog. I'm guessing you are filtering html. Do you want to consider encoding it instead using htmlspecialchars() (P.S. I haven't done enough research on the security implications of this though) ?

Parse error: syntax error, unexpected T_STRING, expecting

Wordpress 3.5.2

PHP 5.2.17 (cli) (built: Mar 1 2012 16:36:14)

Parse error: syntax error, unexpected T_STRING, expecting
  T_CONSTANT_ENCAPSED_STRING or '(' in 
/home/ozten/ozten.com/wordpress/wp-content/plugins/wordpress-webmention
/webmention.php on line 37

This line 37 is a backslash which I think is a newer PHP namespacing feature, or something.

Any ideas?

Retrieve Self Pings Directly

Is it better to identify self-pings and, instead of retrieving them via HTTP, retrieve them by getting the Post ID and pulling the content directly?

In this proposal, if the handler identifies that the source URL is on the same site, it would call a second function that would generate the comment from the local URL.

Unsure of how this would affect Semantic Linkbacks integration.

matchin links

Hi,

I'm using Markdown instead of HTML in WordPress and thus the webmention plugin does not match the urls in the post automatically.

If

    if (preg_match_all("/<a[^>]+href=.(https?:\/\/[^'\"]+)/i", $post->post_content, $matches)) {
      $links = $matches[1];
    }

was replaces with

    if (preg_match_all('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $post->post_content, $matches)) {
      $links = $matches[0];
    }

in webmention.php # 410 that'd match every url; although I'm not sure that's desirable, that's why I'm posting this as issue, not as pull request.

simplify the plugin

Remove the complete mf2 stuff so it only implements the spec! The mf2 fix should be a separate plugin.

Safe Remote Get, Valid URLs

I was looking at switching wp_remote_get to wp_safe_remote_get for additional reasons of safety.

The difference between the two appears to be that the 'safe' version runs URLs through wp_http_validate_url(https://developer.wordpress.org/reference/functions/wp_http_validate_url/).

This checks to see if the URL is a valid protocol, restricts ports to 80, 443, 8080 and rejects any URL with a :#?[] in it.

PIngbacks on WordPress currently filter the source URL through wp_http_validate_url.

Opening this to discuss if this change makes sense. Do we want to limit in this way?

Verify Target before Source

https://www.w3.org/TR/webmention/

With the release of a draft specification, there are some things that we could adjust in the plugin. For example, retrieval of the remote source occurs before verifying the target is a valid permalink on the site.

Target verification should come before remote retrieval.

User Agent and Headers for Remote Get

Pingback sets the user-agent to, by default, for example: WordPress/4.5;http://www.example.com; verifying pingback from 0.0.0.0.

And it passes the X-Pingback-Forwarded-For header with the remote ip of where the request came from.

$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
    'user-agent' => "$user_agent; verifying pingback from $remote_ip",
    'headers' => array(
        'X-Pingback-Forwarded-For' => $remote_ip,

We should definitely set a user agent as a good citizen, as it defaults to nothing right now. I'm proposing matching the Pingback syntax unless there is some other way to address.

As for the X-Pingback-Forwarded-For, adding this would allow spam filtering by WordPress plugins currently filtering pingbacks, however, I think that could be equally dangerous as Akismet thinks all pingbacks are spam, for example.

Redefine Ping

In order to encourage backward compatibility, suggesting we use wp_list_comments_args to, if someone selects comment type as pings, to change to comments IN an array that includes webmentions.

ignore fragment when looking for target post?

not sure if this is a bug here or in semantic-linkbacks...but i just received a couple webmentions against a target URl with a fragment, https://snarfed.org/2012-09-22_revisiting_why_im_weird_about_privacy#dwork , and the plugin happily accepted them and returned 202, but they never showed up. i can't find them in my wordpress database either. could the fragment have tripped it up, like scheme in #16?

example log for one of the webmentions: https://www.brid.gy/log?start_time=1395694339&key=aglzfmJyaWQtZ3lyTAsSCFJlc3BvbnNlIj50YWc6dHdpdHRlci5jb20sMjAxMzo0NDgxOTgzNDAyMTIwMzU1ODRfZmF2b3JpdGVkX2J5XzM1ODQyNjU5Nww

they were also sent to a different target URL on my site without a fragment, https://snarfed.org/2014-03-24_8564 , and they showed up ok there.

ignore scheme when looking for target post?

i'm seeing some incoming webmentions rejected because wordpress-webmention thinks the target doesn't exist, probably because i recently switched my site from http to https. should it ignore scheme (http vs https) when comparing links?

example from https://www.brid.gy/log?start_time=1392578660&key=aglzfmJyaWQtZ3lyTAsSCFJlc3BvbnNlIj50YWc6dHdpdHRlci5jb20sMjAxMzo0MzI3Mzg2MTgzNDAxNTk0ODhfZmF2b3JpdGVkX2J5XzEwOTQyNzQ5Mww :

{'body': u'Specified target URL not found.', 'code': 'RECEIVER_ERROR', 'request': u'POST http://snarfed.org/w/?webmention=endpoint (with source=https://brid-gy.appspot.com/like/twitter/snarfed_org/432738618340159488/109427493, target=http://snarfed.org/2014-02-09_changed-my-twitter-username)', 'http_status': 404}

i changed my wordpress base url to use https, so
http://snarfed.org/2014-02-09_changed-my-twitter-username is now https://snarfed.org/2014-02-09_changed-my-twitter-username .

invalidate page cache after creating new comment

when someone posts a new comment normally, wordpress invalidates the cached copy of the page, if it exists, so that the next request will fully re-render the page and include the new comment. it looks like wordpress-webmention doesn't do this when it stores a new comment, but it probably should.

i didn't notice this at first because i'm usually logged into my wordpress, and it skips the cache for logged in users by default and always fully renders pages.

Notification mails messed up since 2.4.0

Since the last release, the notification mails sent by Wordpress are compelete messed up. As the blog admin, I get empty mails like this:

Ein neuer Kommentar zum Beitrag „“ wartet auf deine Freigabe

Autor: (IP: , )
E-Mail:
URL:
Kommentar:

while the post author gets mails that contain the entire article in the "Comment:" field ("Kommentar" in the above quote). With the previous version, notifications worked fine.

Improve Verification

Just documenting this as something worth spending time on in future.

pfefferle/wordpress-semantic-linkbacks#44

@singpolyma suggested this for Semantic Linkbacks. "checking if the post_ID we get from url_to_postid on the in-reply-to link matches the local post_ID'

The Webmention specification https://www.w3.org/TR/2016/WD-webmention-20160301/#webmention-verification suggests that the usage of per-media type rules.

The timeout on the source retrieval is set to 100 seconds, as opposed to a recommendation of 5. The specification suggests a redirection limit of 20, where WordPress defaults to 5. It is also recommended to set limit_response_size(set in bytes) to 1MB. None of these are hard-limits in the specification, but something worth reviewing...

Mostly because if there is an error, it advises the Source URL is not found. It does not supply more useful information. For example, the error response code from the retrieval, if any? Was it a 404? Maybe if it is a certain response code, we might want to schedule a retry later, or at least advise detail in the response so the sender can retry...

some webmentions silently dropped

most bridgy webmentions get through to my site ok, but sometimes they get accepted and then silently dropped. wordpress-webmention returns 200, but never stores a comment. a couple examples from bridgy's logs are below.

i'm not sure if wordpress-webmention, semantic-linkbacks, bridgy, or something else in my wordpress is to blame. any ideas? let me know if i can help debug!

"POST /w/?webmention=endpoint HTTP/1.1" 200 None
Sent! {'body': u'WebMention received... Thanks :)', 'request': u'POST http://snarfed.org/w/?webmention=endpoint (with source=https://brid-gy.appspot.com/comment/twitter/snarfed_org/428217998965370881/428223181279612928, target=http://snarfed.org/2014-01-28_language-duct-tape)', 'http_status': 200}

"POST /w/?webmention=endpoint HTTP/1.1" 200 None
Sent! {'body': u'WebMention received... Thanks :)', 'request': u'POST http://snarfed.org/w/?webmention=endpoint (with source=https://brid-gy.appspot.com/like/twitter/snarfed_org/428217998965370881/409, target=http://snarfed.org/2014-01-28_language-duct-tape)', 'http_status': 200}

support pages

it looks like the current code only sends webmentions for links in posts, not pages, right? i write pages often; i'd love to send webmentions for them too!

Comment author must have a previously approved comment

WordPress comment moderation offers a setting, "Comment author must have a previously approved comment." This does not include pingbacks/trackbacks by default due to risk of spam abuse.

Add support to use URLs as a moderation whitelist, as opposed to email address/name as WordPress does by default.

This could be done by adding a filter to pre_comment_approved.

There is also a hook, wp_blacklist_check.which takes a URL argument which could be used in support of URL based moderation.

retries are probably too aggressive

hi @pfefferle! it looks like a recent change (within the last couple months, maybe 85aaab1 ?) made webmention sending retry indefinitely, in a tight loop, even if the webmention endpoint returns a 4xx error, which means retrying usually won't succeed.

we might want to make it only retry a certain number of times, maybe with backoff, and probably not retry at all on 4xx errors.

Webmention sent from WordPress site included text from different post

I just installed the plugin on my WordPress site today and sent a webmention by publishing this post.

The target of my webmention was this post running idno

When the webmention was posted as a comment, the text came from a previous post on EpiphanyDigest instead of the new one I published today. This, of course, made my comment look very spammy since it mentioned some injury attorneys (!).

Have I misunderstood the usage of the plugin, perhaps? I'm happy to provide any additional info as needed for diagnosis.

Thanks!

interaction with ping/trackback

This might be more than one issue:

  • should sending ping/trackbacks be disabled if this plugin activated? (documentation?)
  • wordpress ping/trackbacks keep track of those already sent; ought this be duplicated or reused for webmentions?

Store Webmention Responses in Post Meta

Use case for Bridgy....

"A POST to http://brid.gy/publish/webmention will return 200 OK on success with a JSON response containing at least a url field that points to the silo object that it operated on. For Twitter favorites and Facebook likes and event RSVPs, this is the tweet, post, or event. If a new object was created, e.g. a Facebook post or comment or Twitter tweet, @-reply, or retweet, there will also be an id field with the silo id of that object."

The json response can be extracted and the entire array attached to the post using the add_post_meta function in Wordpress.

This data can then be used by the theme or another plugin to add rel-syndication links.

sends/saves self-webmention

ie, if page links to itself, which I sometimes do, to sections.

I don't immediately see filtering this out in the ping/tackback code, but it must as I've never seen this behavior.

Self Pings

The code used to stop self pings only stops webmentions to the same URL, not to the same site.

Suggesting it should check if the URL includes site_url to avoid this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.