Changeset 3035452
- Timestamp:
- 02/14/2024 08:11:00 AM (2 years ago)
- Location:
- indieblocks
- Files:
-
- 2 added
- 24 edited
- 1 copied
-
tags/0.12.0 (copied) (copied from indieblocks/trunk)
-
tags/0.12.0/assets/remove-extra-margin.css (added)
-
tags/0.12.0/includes/class-location.php (modified) (4 diffs)
-
tags/0.12.0/includes/class-parser.php (modified) (1 diff)
-
tags/0.12.0/includes/class-plugin.php (modified) (1 diff)
-
tags/0.12.0/includes/class-theme-mf2.php (modified) (1 diff)
-
tags/0.12.0/includes/class-webmention-parser.php (modified) (1 diff)
-
tags/0.12.0/includes/class-webmention-receiver.php (modified) (12 diffs)
-
tags/0.12.0/includes/class-webmention-sender.php (modified) (12 diffs)
-
tags/0.12.0/includes/class-webmention.php (modified) (1 diff)
-
tags/0.12.0/includes/functions.php (modified) (2 diffs)
-
tags/0.12.0/indieblocks.php (modified) (1 diff)
-
tags/0.12.0/languages/indieblocks.pot (modified) (13 diffs)
-
tags/0.12.0/readme.txt (modified) (2 diffs)
-
trunk/assets/remove-extra-margin.css (added)
-
trunk/includes/class-location.php (modified) (4 diffs)
-
trunk/includes/class-parser.php (modified) (1 diff)
-
trunk/includes/class-plugin.php (modified) (1 diff)
-
trunk/includes/class-theme-mf2.php (modified) (1 diff)
-
trunk/includes/class-webmention-parser.php (modified) (1 diff)
-
trunk/includes/class-webmention-receiver.php (modified) (12 diffs)
-
trunk/includes/class-webmention-sender.php (modified) (12 diffs)
-
trunk/includes/class-webmention.php (modified) (1 diff)
-
trunk/includes/functions.php (modified) (2 diffs)
-
trunk/indieblocks.php (modified) (1 diff)
-
trunk/languages/indieblocks.pot (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indieblocks/tags/0.12.0/includes/class-location.php
r2993569 r3035452 229 229 230 230 if ( is_wp_error( $response ) || empty( $response['body'] ) ) { 231 error_log( "Failed to retrieve address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log231 debug_log( "[IndieBlocks/Location] Failed to retrieve address data for {$lat}, {$lon}" ); 232 232 return ''; 233 233 } … … 236 236 237 237 if ( empty( $location ) ) { 238 error_log( "Failed to decode address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log238 debug_log( "[IndieBlocks/Location] Failed to decode address data for {$lat}, {$lon}" ); 239 239 return ''; 240 240 } … … 280 280 281 281 if ( is_wp_error( $response ) || empty( $response['body'] ) ) { 282 error_log( "Failed to retrieve weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log282 debug_log( "[IndieBlocks/Location] Failed to retrieve weather data for {$lat}, {$lon}" ); 283 283 return array(); 284 284 } … … 287 287 288 288 if ( empty( $weather ) ) { 289 error_log( "Failed to decode weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log289 debug_log( "[IndieBlocks/Location] Failed to decode weather data for {$lat}, {$lon}" ); 290 290 return array(); 291 291 } -
indieblocks/tags/0.12.0/includes/class-parser.php
r3019557 r3035452 63 63 // Could not find a cached version. Download page. 64 64 $response = remote_get( $this->url ); 65 $content = wp_remote_retrieve_body( $response ); 65 $content = ''; 66 67 $code = wp_remote_retrieve_response_code( $response ); 68 69 if ( is_wp_error( $response ) ) { 70 // The remote server returned a (client or server) error. 71 debug_log( '[IndieBlocks] The server at ' . esc_url_raw( $this->url ) . ' responded with the following error: ' . $response->get_error_message() . '.' ); 72 } elseif ( '' === $code || $code >= 400 ) { 73 // The remote server returned a (client or server) error. 74 debug_log( '[IndieBlocks] The server at ' . esc_url_raw( $this->url ) . " responded with the following HTTP status code: $code." ); 75 } else { 76 $content = wp_remote_retrieve_body( $response ); 77 } 66 78 set_transient( 'indieblocks:html:' . $hash, $content, 3600 ); // Cache, even if empty. 67 79 } else { -
indieblocks/tags/0.12.0/includes/class-plugin.php
r3019557 r3035452 12 12 * Plugin version. 13 13 */ 14 const PLUGIN_VERSION = '0.1 1.1';14 const PLUGIN_VERSION = '0.12.0'; 15 15 16 16 /** -
indieblocks/tags/0.12.0/includes/class-theme-mf2.php
r3002715 r3035452 325 325 } elseif ( ! empty( $options['hide_titles'] ) ) { 326 326 $processor->add_class( 'screen-reader-text' ); 327 // I'd use `wp_add_inline_style()` but that just adds the styles 328 // over and over again for each block. 329 wp_enqueue_style( 330 'indieblocks-remove-extra-margin', 331 plugins_url( '/assets/remove-extra-margin.css', __DIR__ ), 332 array(), 333 Plugin::PLUGIN_VERSION, 334 false 335 ); 327 336 } 328 337 } -
indieblocks/tags/0.12.0/includes/class-webmention-parser.php
r3019557 r3035452 21 21 */ 22 22 public static function parse_microformats( &$commentdata, $html, $source, $target ) { 23 if ( preg_match( '~/\?c=\d+$~', $source ) ) { 24 $response = wp_remote_head( 25 esc_url_raw( $source ), 26 array( 27 'timeout' => 11, 28 'limit_response_size' => 1048576, 29 'user-agent' => get_user_agent(), 30 ) 31 ); 32 33 $url = ( (array) wp_remote_retrieve_header( $response, 'location' ) )[0]; 34 if ( ! empty( $url ) && false !== filter_var( $url, FILTER_VALIDATE_URL ) ) { 35 // If we were forwarded, use the (first) destination URL. If the 36 // source URL was for a WordPress comment, it _should_ forward 37 // to a URL that ends in a "comment fragment" instead. 38 $source = $url; 39 } 40 } 41 23 42 $parser = new Parser( $source ); 24 43 $parser->parse( $html ); -
indieblocks/tags/0.12.0/includes/class-webmention-receiver.php
r3019557 r3035452 30 30 * Stores incoming webmentions and that's about it. 31 31 * 32 * @param WP_REST_Request $request API request.33 * @return WP_REST_Response API response.32 * @param \WP_REST_Request $request API request. 33 * @return \WP_REST_Response API response. 34 34 */ 35 35 public static function store_webmention( $request ) { 36 error_log( '[Indieblocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log36 debug_log( '[IndieBlocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) ); 37 37 38 38 // Verify source nor target are invalid URLs. 39 39 if ( empty( $request['source'] ) || ! wp_http_validate_url( $request['source'] ) || empty( $request['target'] ) || ! wp_http_validate_url( $request['target'] ) ) { 40 error_log( '[Indieblocks/Webmention] Invalid source or target.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log40 debug_log( '[IndieBlocks/Webmention] Invalid source or target.' ); 41 41 return new \WP_Error( 'invalid_request', 'Invalid source or target', array( 'status' => 400 ) ); 42 42 } … … 54 54 if ( empty( $post ) || 'publish' !== get_post_status( $post->ID ) ) { 55 55 // Not found. 56 error_log( '[Indieblocks/Webmention] Target post not found.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log56 debug_log( '[IndieBlocks/Webmention] Target post not found.' ); 57 57 return new \WP_Error( 'not_found', 'Not found', array( 'status' => 404 ) ); 58 58 } 59 59 60 60 if ( ! webmentions_open( $post ) ) { 61 error_log( "[Indieblocks/Webmention] Webmentions closed for the post with ID {$post->ID}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log61 debug_log( "[IndieBlocks/Webmention] Webmentions closed for the post with ID {$post->ID}." ); 62 62 return new \WP_Error( 'invalid_request', 'Invalid target', array( 'status' => 400 ) ); 63 63 } … … 83 83 84 84 if ( false !== $num_rows ) { 85 error_log( '[Indieblocks/Webmention] Stored mention for later processing.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log85 debug_log( '[IndieBlocks/Webmention] Stored mention for later processing.' ); 86 86 87 87 // Create an empty REST response and add an 'Accepted' status code. … … 92 92 } 93 93 94 error_log( '[Indieblocks/Webmention] Could not insert mention into database.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log94 debug_log( '[IndieBlocks/Webmention] Could not insert mention into database.' ); 95 95 return new \WP_Error( 'server_error', 'Internal server error', array( 'status' => 500 ) ); 96 96 } … … 149 149 150 150 // Fetch source HTML. 151 error_log( "[Indieblocks/Webmention] Fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log151 debug_log( "[IndieBlocks/Webmention] Fetching the page at {$webmention->source}." ); 152 152 $response = remote_get( $webmention->source ); 153 153 154 154 if ( is_wp_error( $response ) ) { 155 error_log( "[Indieblocks/Webmention] Something went wrong fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log156 157 155 // Something went wrong. 158 error_log( $response->get_error_message() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log156 debug_log( "[IndieBlocks/Webmention] Something went wrong fetching the page at {$webmention->source}:" . $response->get_error_message() . '.' ); 159 157 continue; 160 158 } … … 164 162 $comment_id = reset( $comments ); 165 163 166 error_log( "[Indieblocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log164 debug_log( "[IndieBlocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); 167 165 168 166 if ( in_array( wp_remote_retrieve_response_code( $response ), array( 404, 410 ), true ) ) { … … 180 178 ); 181 179 } else { 182 error_log( "[Indieblocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log180 debug_log( "[IndieBlocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' ); 183 181 } 184 182 … … 196 194 197 195 if ( false === stripos( $html, preg_replace( "~#$fragment$~", '', $target ) ) ) { // Strip fragment when comparing. 198 debug_log( "[Indie blocks/Webmention] The page at {$webmention->source} does not seem to mention our target URL ($target)." );196 debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} does not seem to mention our target URL ($target)." ); 199 197 200 198 // Target URL not (or no longer) mentioned by source. Mark webmention as processed. … … 214 212 } 215 213 216 error_log( "[Indieblocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log214 debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." ); 217 215 218 216 // Grab source domain. … … 264 262 } 265 263 266 error_log( "[Indieblocks/Webmention] Updating comment {$comment_id}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log264 debug_log( "[IndieBlocks/Webmention] Updating comment {$comment_id}." ); 267 265 $result = wp_update_comment( $commentdata, true ); 268 266 } else { 269 error_log( '[Indieblocks/Webmention] Creating new comment.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log267 debug_log( '[IndieBlocks/Webmention] Creating new comment.' ); 270 268 $result = wp_new_comment( $commentdata, true ); 271 269 } … … 275 273 if ( is_wp_error( $result ) ) { 276 274 // For troubleshooting. 277 error_log( print_r( $result, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log,WordPress.PHP.DevelopmentFunctions.error_log_print_r275 debug_log( $result ); 278 276 279 277 if ( in_array( 'comment_duplicate', $result->get_error_codes(), true ) ) { … … 296 294 ); 297 295 298 error_log( "[Indieblocks/Webmention] And we're done parsing this particular mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log 299 296 debug_log( "[IndieBlocks/Webmention] And we're done parsing this particular mention." ); 300 297 } 301 298 } -
indieblocks/tags/0.12.0/includes/class-webmention-sender.php
r3019557 r3035452 85 85 } 86 86 87 $urls = array_unique( $urls ); // For `array_search()` to work more reliably. 88 89 if ( ! empty( $obj->comment_post_ID ) ) { 90 // Prevent direct replies mentioning the post they're ... already 91 // replying to. This should still allow mentions being sent to the 92 // site itself, without sending one for each and every comment. 93 $key = array_search( get_permalink( $obj->comment_post_ID ), $urls, true ); 94 95 if ( false !== $key ) { 96 unset( $urls[ $key ] ); 97 } 98 } 99 87 100 if ( empty( $urls ) ) { 88 101 // Nothing to do. Bail. … … 90 103 } 91 104 92 $urls = array_unique( $urls );93 105 $schedule = false; 94 106 … … 117 129 // Schedule sending out the actual webmentions. 118 130 if ( $obj instanceof \WP_Post ) { 119 debug_log( "[Indie blocks/Webmention] Scheduling webmention for post {$obj->ID}." );131 debug_log( "[IndieBlocks/Webmention] Scheduling webmention for post {$obj->ID}." ); 120 132 } else { 121 debug_log( "[Indie blocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );133 debug_log( "[IndieBlocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." ); 122 134 } 123 135 … … 141 153 if ( 'publish' !== $obj->post_status ) { 142 154 // Do not send webmention on delete/unpublish, for now. 143 debug_log( '[Indie blocks/Webmention] Post ' . $obj->ID . ' is not published.' );155 debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is not published.' ); 144 156 return; 145 157 } … … 147 159 if ( ! in_array( $obj->post_type, Webmention::get_supported_post_types(), true ) ) { 148 160 // This post type doesn't support Webmention. 149 debug_log( '[Indie blocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );161 debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' ); 150 162 return; 151 163 } 152 164 } elseif ( '1' !== $obj->comment_approved ) { 153 debug_log( '[Indie blocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );165 debug_log( '[IndieBlocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." ); 154 166 return; 155 167 } … … 184 196 if ( empty( $urls ) ) { 185 197 // One or more links must've been removed. Nothing to do. Bail. 186 debug_log( '[Indie blocks/Webmention] No outgoing URLs found.' );198 debug_log( '[IndieBlocks/Webmention] No outgoing URLs found.' ); 187 199 return; 188 200 } … … 205 217 if ( empty( $endpoint ) || false === wp_http_validate_url( $endpoint ) ) { 206 218 // Skip. 207 debug_log( '[Indie blocks/Webmention] Could not find a Webmention endpoint for target ' . esc_url_raw( $url ) . '.' );219 debug_log( '[IndieBlocks/Webmention] Could not find a Webmention endpoint for target ' . esc_url_raw( $url ) . '.' ); 208 220 continue; 209 221 } … … 219 231 // we could store a hash of the post content, too, and use that 220 232 // to send webmentions on actual updates. 221 debug_log( '[Indie blocks/Webmention] Previously sent webmention for target ' . esc_url_raw( $url ) . '. Skipping.' );233 debug_log( '[IndieBlocks/Webmention] Previously sent webmention for target ' . esc_url_raw( $url ) . '. Skipping.' ); 222 234 continue; 223 235 } … … 229 241 if ( $retries >= 3 ) { 230 242 // Stop here. 231 debug_log( '[Indie blocks/Webmention] Sending webmention to ' . esc_url_raw( $url ) . ' failed 3 times before. Not trying again.' );243 debug_log( '[IndieBlocks/Webmention] Sending webmention to ' . esc_url_raw( $url ) . ' failed 3 times before. Not trying again.' ); 232 244 continue; 233 245 } … … 258 270 if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) >= 500 ) { 259 271 // Something went wrong. 260 debug_log( '[Indieblocks/Webmention] Error trying to send a webmention to ' . esc_url_raw( $endpoint ) . ': ' . $response->get_error_message() ); 272 if ( is_wp_error( $response ) ) { 273 debug_log( '[IndieBlocks/Webmention] Error trying to send a webmention to ' . esc_url_raw( $endpoint ) . ': ' . $response->get_error_message() . '.' ); 274 } 261 275 debug_log( $response ); 262 276 263 277 $webmention[ $hash ]['retries'] = $retries + 1; 264 265 278 update_meta( $obj, '_indieblocks_webmention', $webmention ); 266 279 … … 275 288 $webmention[ $hash ]['code'] = wp_remote_retrieve_response_code( $response ); 276 289 277 debug_log( '[Indie blocks/Webmention] Sent webmention to ' . esc_url_raw( $endpoint ) . '. Response code: ' . wp_remote_retrieve_response_code( $response ) . '.' );290 debug_log( '[IndieBlocks/Webmention] Sent webmention to ' . esc_url_raw( $endpoint ) . '. Response code: ' . wp_remote_retrieve_response_code( $response ) . '.' ); 278 291 } 279 292 … … 322 335 if ( ! empty( $endpoint ) ) { 323 336 // We've previously established the endpoint for this web page. 324 debug_log( '[Indie blocks/Webmention] Found endpoint (' . esc_url_raw( $endpoint ) . ') for ' . esc_url_raw( $url ) . ' in cache.' );337 debug_log( '[IndieBlocks/Webmention] Found endpoint (' . esc_url_raw( $endpoint ) . ') for ' . esc_url_raw( $url ) . ' in cache.' ); 325 338 return $endpoint; 326 339 } -
indieblocks/tags/0.12.0/includes/class-webmention.php
r3019557 r3035452 176 176 * @todo: Use some kind of "comment taxonomy" instead? 177 177 * 178 * @param WP_Comment_Query $query Comment count.178 * @param WP_Comment_Query $query Comment count. 179 179 */ 180 180 public static function comment_query( $query ) { -
indieblocks/tags/0.12.0/includes/functions.php
r3019557 r3035452 71 71 * Wrapper around `wp_remote_get()`. 72 72 * 73 * @param string $url URL to fetch.74 * @param bool $json Whether to accept (only) JSON.75 * @return WP_Response|WP_Error Response.73 * @param string $url URL to fetch. 74 * @param bool $json Whether to accept (only) JSON. 75 * @return \WP_Response|\WP_Error Response. 76 76 */ 77 77 function remote_get( $url, $json = false ) { … … 97 97 * Wrapper around `wp_remote_post()`. 98 98 * 99 * @param string $url URL to fetch.100 * @param bool $json Whether to accept (only) JSON.101 * @param array $args Arguments for `wp_remote_post()`.102 * @return WP_Response|WP_Error Response.99 * @param string $url URL to fetch. 100 * @param bool $json Whether to accept (only) JSON. 101 * @param array $args Arguments for `wp_remote_post()`. 102 * @return \WP_Response|\WP_Error Response. 103 103 */ 104 104 function remote_post( $url, $json = false, $args = array() ) { -
indieblocks/tags/0.12.0/indieblocks.php
r3019557 r3035452 9 9 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 10 * Text Domain: indieblocks 11 * Version: 0.1 1.111 * Version: 0.12.0 12 12 * Requires at least: 6.2 13 13 * GitHub Plugin URI: https://github.com/janboddez/indieblocks -
indieblocks/tags/0.12.0/languages/indieblocks.pot
r3002715 r3035452 1 # Copyright (C) 202 3Jan Boddez1 # Copyright (C) 2024 Jan Boddez 2 2 # This file is distributed under the GNU General Public License v3. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: IndieBlocks 0.1 0.0\n"5 "Project-Id-Version: IndieBlocks 0.12.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieblocks\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 3-11-26T22:12:55+01:00\n"12 "POT-Creation-Date: 2024-02-11T11:50:00+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.9.0\n" … … 96 96 97 97 #. translators: %1$s: Link to the "liked" page. %2$s: Author of the "liked" page. 98 #: includes/class-micropub-compat.php:2 7698 #: includes/class-micropub-compat.php:280 99 99 #: assets/common.js:13 100 100 msgid "Likes %1$s by %2$s." … … 102 102 103 103 #. translators: %s: Link to the "liked" page. 104 #: includes/class-micropub-compat.php: 299105 #: includes/class-micropub-compat.php:31 4104 #: includes/class-micropub-compat.php:303 105 #: includes/class-micropub-compat.php:318 106 106 #: assets/common.js:24 107 107 #: blocks/context/block.js:22 … … 110 110 111 111 #. translators: %1$s: Link to the bookmarked page. %2$s: Author of the bookmarked page. 112 #: includes/class-micropub-compat.php:3 39112 #: includes/class-micropub-compat.php:343 113 113 #: assets/common.js:11 114 114 msgid "Bookmarked %1$s by %2$s." … … 116 116 117 117 #. translators: %s: Link to the bookmarked page. 118 #: includes/class-micropub-compat.php:36 2119 #: includes/class-micropub-compat.php:3 77118 #: includes/class-micropub-compat.php:366 119 #: includes/class-micropub-compat.php:381 120 120 #: assets/common.js:22 121 121 #: blocks/context/block.js:20 … … 125 125 126 126 #. translators: %1$s: Link to the page being replied to. %2$s: Author of the page being replied to. 127 #: includes/class-micropub-compat.php:40 2127 #: includes/class-micropub-compat.php:406 128 128 #: assets/common.js:15 129 129 msgid "In reply to %1$s by %2$s." … … 131 131 132 132 #. translators: %s: Link to the page being replied to. 133 #: includes/class-micropub-compat.php:42 5134 #: includes/class-micropub-compat.php:44 0133 #: includes/class-micropub-compat.php:429 134 #: includes/class-micropub-compat.php:444 135 135 #: assets/common.js:26 136 136 #: blocks/context/block.js:24 … … 140 140 141 141 #. translators: %1$s: Link to the "page" being reposted. %2$s: Author of the "page" being reposted. 142 #: includes/class-micropub-compat.php:46 5142 #: includes/class-micropub-compat.php:469 143 143 #: assets/common.js:17 144 144 msgid "Reposted %1$s by %2$s." … … 146 146 147 147 #. translators: %s: Link to the "page" being reposted. 148 #: includes/class-micropub-compat.php:4 88149 #: includes/class-micropub-compat.php:50 3148 #: includes/class-micropub-compat.php:492 149 #: includes/class-micropub-compat.php:507 150 150 #: assets/common.js:28 151 151 #: blocks/context/block.js:26 … … 165 165 #: includes/class-options-handler.php:376 166 166 #: includes/class-options-handler.php:479 167 #: includes/class-webmention-receiver.php:304 168 #: includes/class-webmention-sender.php:416 167 #: includes/class-webmention-receiver.php:316 168 #: includes/class-webmention-sender.php:444 169 #: includes/class-webmention-sender.php:463 169 170 msgid "Webmention" 170 171 msgstr "" … … 532 533 msgstr "" 533 534 534 #: includes/class-webmention-parser.php: 80535 #: includes/class-webmention-parser.php:118 535 536 msgid "… bookmarked this!" 536 537 msgstr "" 537 538 538 #: includes/class-webmention-parser.php: 85539 #: includes/class-webmention-parser.php:123 539 540 msgid "… liked this!" 540 541 msgstr "" 541 542 542 #: includes/class-webmention-parser.php: 89543 #: includes/class-webmention-parser.php:127 543 544 msgid "… reposted this!" 544 545 msgstr "" 545 546 546 #: includes/class-webmention-parser.php: 93547 #: includes/class-webmention-parser.php:131 547 548 msgid "… (wants to) read this!" 548 549 msgstr "" 549 550 550 #: includes/class-webmention-receiver.php:2 29551 #: includes/class-webmention-receiver.php:232 551 552 msgid "… commented on this." 552 553 msgstr "" 553 554 554 #: includes/class-webmention-receiver.php:3 23555 #: includes/class-webmention-receiver.php:335 555 556 msgid "Source" 556 557 msgstr "" 557 558 558 #: includes/class-webmention-receiver.php:3 26559 #: includes/class-webmention-receiver.php:338 559 560 #: blocks/context/block.js:67 560 561 msgid "Type" 561 562 msgstr "" 562 563 563 #: includes/class-webmention-receiver.php:3 30564 #: includes/class-webmention-receiver.php:342 564 565 msgid "Avatar" 565 566 msgstr "" 566 567 567 #: includes/class-webmention-receiver.php:3 34568 #: includes/class-webmention-receiver.php:346 568 569 msgid "Delete" 569 570 msgstr "" 570 571 571 #: includes/class-webmention-receiver.php:364 572 #: includes/class-webmention-sender.php:483 572 #: includes/class-webmention-receiver.php:384 573 573 msgid "Missing or invalid nonce." 574 574 msgstr "" 575 575 576 #: includes/class-webmention-receiver.php:3 70576 #: includes/class-webmention-receiver.php:390 577 577 msgid "Invalid comment ID." 578 578 msgstr "" 579 579 580 #: includes/class-webmention-receiver.php:378 581 #: includes/class-webmention-sender.php:497 580 #: includes/class-webmention-receiver.php:398 581 #: includes/class-webmention-sender.php:570 582 #: includes/class-webmention-sender.php:585 582 583 msgid "Insufficient rights." 583 584 msgstr "" 584 585 585 586 #. translators: 1: Webmention endpoint 2: Date sent 586 #: includes/class-webmention-sender.php: 448587 #: includes/class-webmention-sender.php:502 587 588 msgid "Sent to %1$s on %2$s. Response code: %3$d." 588 589 msgstr "" 589 590 590 591 #. translators: 1: Webmention endpoint 2: Date sent 591 #: includes/class-webmention-sender.php: 448592 #: includes/class-webmention-sender.php:502 592 593 msgid "M j, Y \\a\\t H:i" 593 594 msgstr "" 594 595 595 596 #. translators: Webmention endpoint 596 #: includes/class-webmention-sender.php: 451597 #: includes/class-webmention-sender.php:505 597 598 msgid "Could not send webmention to %s." 598 599 msgstr "" 599 600 600 601 #. translators: Webmention endpoint 601 #: includes/class-webmention-sender.php: 454602 #: includes/class-webmention-sender.php:508 602 603 msgid "Could not send webmention to %s. Trying again soon." 603 604 msgstr "" 604 605 605 #: includes/class-webmention-sender.php:464 606 #: includes/class-webmention-sender.php:518 607 #: includes/class-webmention-sender.php:526 606 608 msgid "Resend" 607 609 msgstr "" 608 610 609 #: includes/class-webmention-sender.php: 468610 #: includes/class-webmention.php:15 2611 #: includes/class-webmention-sender.php:523 612 #: includes/class-webmention.php:154 611 613 msgid "Webmention scheduled." 612 614 msgstr "" 613 615 614 #: includes/class-webmention-sender.php: 470616 #: includes/class-webmention-sender.php:530 615 617 msgid "No endpoints found." 616 618 msgstr "" 617 619 618 #: includes/class-webmention-sender.php:489 619 msgid "Invalid post ID." 620 #: includes/class-webmention-sender.php:543 621 msgid "Missing nonce." 622 msgstr "" 623 624 #: includes/class-webmention-sender.php:549 625 msgid "Missing webmention type." 626 msgstr "" 627 628 #: includes/class-webmention-sender.php:555 629 msgid "Invalid nonce." 630 msgstr "" 631 632 #: includes/class-webmention-sender.php:561 633 msgid "Invalid object ID." 620 634 msgstr "" 621 635 … … 719 733 msgstr "" 720 734 721 #: blocks/facepile/block.js:1 9735 #: blocks/facepile/block.js:18 722 736 msgid "Contains the blocks to display Webmention “likes,” “reposts,” etc. as a so-called facepile." 723 737 msgstr "" 724 738 725 #: blocks/facepile/block.js:2 8739 #: blocks/facepile/block.js:24 726 740 msgid "Likes, Bookmarks, and Reposts" 727 741 msgstr "" -
indieblocks/tags/0.12.0/readme.txt
r3019557 r3035452 3 3 Tags: blocks, gutenberg, indieweb, notes, likes, microblog, microblogging, micropub, fse, site editor, webmention, syndication 4 4 Tested up to: 6.4 5 Stable tag: 0.1 1.15 Stable tag: 0.12.0 6 6 License: GNU General Public License v3.0 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 36 36 37 37 == Changelog == 38 = 0.12.0 = 39 Improve comment mentions, remove margin "below" hidden note and like titles. 40 38 41 = 0.11.0 = 39 42 Improve avatar deletion, add meta box for outgoing "comment mentions," hide meta boxes if empty. -
indieblocks/trunk/includes/class-location.php
r2993569 r3035452 229 229 230 230 if ( is_wp_error( $response ) || empty( $response['body'] ) ) { 231 error_log( "Failed to retrieve address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log231 debug_log( "[IndieBlocks/Location] Failed to retrieve address data for {$lat}, {$lon}" ); 232 232 return ''; 233 233 } … … 236 236 237 237 if ( empty( $location ) ) { 238 error_log( "Failed to decode address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log238 debug_log( "[IndieBlocks/Location] Failed to decode address data for {$lat}, {$lon}" ); 239 239 return ''; 240 240 } … … 280 280 281 281 if ( is_wp_error( $response ) || empty( $response['body'] ) ) { 282 error_log( "Failed to retrieve weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log282 debug_log( "[IndieBlocks/Location] Failed to retrieve weather data for {$lat}, {$lon}" ); 283 283 return array(); 284 284 } … … 287 287 288 288 if ( empty( $weather ) ) { 289 error_log( "Failed to decode weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log289 debug_log( "[IndieBlocks/Location] Failed to decode weather data for {$lat}, {$lon}" ); 290 290 return array(); 291 291 } -
indieblocks/trunk/includes/class-parser.php
r3019557 r3035452 63 63 // Could not find a cached version. Download page. 64 64 $response = remote_get( $this->url ); 65 $content = wp_remote_retrieve_body( $response ); 65 $content = ''; 66 67 $code = wp_remote_retrieve_response_code( $response ); 68 69 if ( is_wp_error( $response ) ) { 70 // The remote server returned a (client or server) error. 71 debug_log( '[IndieBlocks] The server at ' . esc_url_raw( $this->url ) . ' responded with the following error: ' . $response->get_error_message() . '.' ); 72 } elseif ( '' === $code || $code >= 400 ) { 73 // The remote server returned a (client or server) error. 74 debug_log( '[IndieBlocks] The server at ' . esc_url_raw( $this->url ) . " responded with the following HTTP status code: $code." ); 75 } else { 76 $content = wp_remote_retrieve_body( $response ); 77 } 66 78 set_transient( 'indieblocks:html:' . $hash, $content, 3600 ); // Cache, even if empty. 67 79 } else { -
indieblocks/trunk/includes/class-plugin.php
r3019557 r3035452 12 12 * Plugin version. 13 13 */ 14 const PLUGIN_VERSION = '0.1 1.1';14 const PLUGIN_VERSION = '0.12.0'; 15 15 16 16 /** -
indieblocks/trunk/includes/class-theme-mf2.php
r3002715 r3035452 325 325 } elseif ( ! empty( $options['hide_titles'] ) ) { 326 326 $processor->add_class( 'screen-reader-text' ); 327 // I'd use `wp_add_inline_style()` but that just adds the styles 328 // over and over again for each block. 329 wp_enqueue_style( 330 'indieblocks-remove-extra-margin', 331 plugins_url( '/assets/remove-extra-margin.css', __DIR__ ), 332 array(), 333 Plugin::PLUGIN_VERSION, 334 false 335 ); 327 336 } 328 337 } -
indieblocks/trunk/includes/class-webmention-parser.php
r3019557 r3035452 21 21 */ 22 22 public static function parse_microformats( &$commentdata, $html, $source, $target ) { 23 if ( preg_match( '~/\?c=\d+$~', $source ) ) { 24 $response = wp_remote_head( 25 esc_url_raw( $source ), 26 array( 27 'timeout' => 11, 28 'limit_response_size' => 1048576, 29 'user-agent' => get_user_agent(), 30 ) 31 ); 32 33 $url = ( (array) wp_remote_retrieve_header( $response, 'location' ) )[0]; 34 if ( ! empty( $url ) && false !== filter_var( $url, FILTER_VALIDATE_URL ) ) { 35 // If we were forwarded, use the (first) destination URL. If the 36 // source URL was for a WordPress comment, it _should_ forward 37 // to a URL that ends in a "comment fragment" instead. 38 $source = $url; 39 } 40 } 41 23 42 $parser = new Parser( $source ); 24 43 $parser->parse( $html ); -
indieblocks/trunk/includes/class-webmention-receiver.php
r3019557 r3035452 30 30 * Stores incoming webmentions and that's about it. 31 31 * 32 * @param WP_REST_Request $request API request.33 * @return WP_REST_Response API response.32 * @param \WP_REST_Request $request API request. 33 * @return \WP_REST_Response API response. 34 34 */ 35 35 public static function store_webmention( $request ) { 36 error_log( '[Indieblocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log36 debug_log( '[IndieBlocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) ); 37 37 38 38 // Verify source nor target are invalid URLs. 39 39 if ( empty( $request['source'] ) || ! wp_http_validate_url( $request['source'] ) || empty( $request['target'] ) || ! wp_http_validate_url( $request['target'] ) ) { 40 error_log( '[Indieblocks/Webmention] Invalid source or target.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log40 debug_log( '[IndieBlocks/Webmention] Invalid source or target.' ); 41 41 return new \WP_Error( 'invalid_request', 'Invalid source or target', array( 'status' => 400 ) ); 42 42 } … … 54 54 if ( empty( $post ) || 'publish' !== get_post_status( $post->ID ) ) { 55 55 // Not found. 56 error_log( '[Indieblocks/Webmention] Target post not found.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log56 debug_log( '[IndieBlocks/Webmention] Target post not found.' ); 57 57 return new \WP_Error( 'not_found', 'Not found', array( 'status' => 404 ) ); 58 58 } 59 59 60 60 if ( ! webmentions_open( $post ) ) { 61 error_log( "[Indieblocks/Webmention] Webmentions closed for the post with ID {$post->ID}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log61 debug_log( "[IndieBlocks/Webmention] Webmentions closed for the post with ID {$post->ID}." ); 62 62 return new \WP_Error( 'invalid_request', 'Invalid target', array( 'status' => 400 ) ); 63 63 } … … 83 83 84 84 if ( false !== $num_rows ) { 85 error_log( '[Indieblocks/Webmention] Stored mention for later processing.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log85 debug_log( '[IndieBlocks/Webmention] Stored mention for later processing.' ); 86 86 87 87 // Create an empty REST response and add an 'Accepted' status code. … … 92 92 } 93 93 94 error_log( '[Indieblocks/Webmention] Could not insert mention into database.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log94 debug_log( '[IndieBlocks/Webmention] Could not insert mention into database.' ); 95 95 return new \WP_Error( 'server_error', 'Internal server error', array( 'status' => 500 ) ); 96 96 } … … 149 149 150 150 // Fetch source HTML. 151 error_log( "[Indieblocks/Webmention] Fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log151 debug_log( "[IndieBlocks/Webmention] Fetching the page at {$webmention->source}." ); 152 152 $response = remote_get( $webmention->source ); 153 153 154 154 if ( is_wp_error( $response ) ) { 155 error_log( "[Indieblocks/Webmention] Something went wrong fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log156 157 155 // Something went wrong. 158 error_log( $response->get_error_message() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log156 debug_log( "[IndieBlocks/Webmention] Something went wrong fetching the page at {$webmention->source}:" . $response->get_error_message() . '.' ); 159 157 continue; 160 158 } … … 164 162 $comment_id = reset( $comments ); 165 163 166 error_log( "[Indieblocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log164 debug_log( "[IndieBlocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); 167 165 168 166 if ( in_array( wp_remote_retrieve_response_code( $response ), array( 404, 410 ), true ) ) { … … 180 178 ); 181 179 } else { 182 error_log( "[Indieblocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log180 debug_log( "[IndieBlocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' ); 183 181 } 184 182 … … 196 194 197 195 if ( false === stripos( $html, preg_replace( "~#$fragment$~", '', $target ) ) ) { // Strip fragment when comparing. 198 debug_log( "[Indie blocks/Webmention] The page at {$webmention->source} does not seem to mention our target URL ($target)." );196 debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} does not seem to mention our target URL ($target)." ); 199 197 200 198 // Target URL not (or no longer) mentioned by source. Mark webmention as processed. … … 214 212 } 215 213 216 error_log( "[Indieblocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log214 debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." ); 217 215 218 216 // Grab source domain. … … 264 262 } 265 263 266 error_log( "[Indieblocks/Webmention] Updating comment {$comment_id}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log264 debug_log( "[IndieBlocks/Webmention] Updating comment {$comment_id}." ); 267 265 $result = wp_update_comment( $commentdata, true ); 268 266 } else { 269 error_log( '[Indieblocks/Webmention] Creating new comment.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log267 debug_log( '[IndieBlocks/Webmention] Creating new comment.' ); 270 268 $result = wp_new_comment( $commentdata, true ); 271 269 } … … 275 273 if ( is_wp_error( $result ) ) { 276 274 // For troubleshooting. 277 error_log( print_r( $result, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log,WordPress.PHP.DevelopmentFunctions.error_log_print_r275 debug_log( $result ); 278 276 279 277 if ( in_array( 'comment_duplicate', $result->get_error_codes(), true ) ) { … … 296 294 ); 297 295 298 error_log( "[Indieblocks/Webmention] And we're done parsing this particular mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log 299 296 debug_log( "[IndieBlocks/Webmention] And we're done parsing this particular mention." ); 300 297 } 301 298 } -
indieblocks/trunk/includes/class-webmention-sender.php
r3019557 r3035452 85 85 } 86 86 87 $urls = array_unique( $urls ); // For `array_search()` to work more reliably. 88 89 if ( ! empty( $obj->comment_post_ID ) ) { 90 // Prevent direct replies mentioning the post they're ... already 91 // replying to. This should still allow mentions being sent to the 92 // site itself, without sending one for each and every comment. 93 $key = array_search( get_permalink( $obj->comment_post_ID ), $urls, true ); 94 95 if ( false !== $key ) { 96 unset( $urls[ $key ] ); 97 } 98 } 99 87 100 if ( empty( $urls ) ) { 88 101 // Nothing to do. Bail. … … 90 103 } 91 104 92 $urls = array_unique( $urls );93 105 $schedule = false; 94 106 … … 117 129 // Schedule sending out the actual webmentions. 118 130 if ( $obj instanceof \WP_Post ) { 119 debug_log( "[Indie blocks/Webmention] Scheduling webmention for post {$obj->ID}." );131 debug_log( "[IndieBlocks/Webmention] Scheduling webmention for post {$obj->ID}." ); 120 132 } else { 121 debug_log( "[Indie blocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );133 debug_log( "[IndieBlocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." ); 122 134 } 123 135 … … 141 153 if ( 'publish' !== $obj->post_status ) { 142 154 // Do not send webmention on delete/unpublish, for now. 143 debug_log( '[Indie blocks/Webmention] Post ' . $obj->ID . ' is not published.' );155 debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is not published.' ); 144 156 return; 145 157 } … … 147 159 if ( ! in_array( $obj->post_type, Webmention::get_supported_post_types(), true ) ) { 148 160 // This post type doesn't support Webmention. 149 debug_log( '[Indie blocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );161 debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' ); 150 162 return; 151 163 } 152 164 } elseif ( '1' !== $obj->comment_approved ) { 153 debug_log( '[Indie blocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );165 debug_log( '[IndieBlocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." ); 154 166 return; 155 167 } … … 184 196 if ( empty( $urls ) ) { 185 197 // One or more links must've been removed. Nothing to do. Bail. 186 debug_log( '[Indie blocks/Webmention] No outgoing URLs found.' );198 debug_log( '[IndieBlocks/Webmention] No outgoing URLs found.' ); 187 199 return; 188 200 } … … 205 217 if ( empty( $endpoint ) || false === wp_http_validate_url( $endpoint ) ) { 206 218 // Skip. 207 debug_log( '[Indie blocks/Webmention] Could not find a Webmention endpoint for target ' . esc_url_raw( $url ) . '.' );219 debug_log( '[IndieBlocks/Webmention] Could not find a Webmention endpoint for target ' . esc_url_raw( $url ) . '.' ); 208 220 continue; 209 221 } … … 219 231 // we could store a hash of the post content, too, and use that 220 232 // to send webmentions on actual updates. 221 debug_log( '[Indie blocks/Webmention] Previously sent webmention for target ' . esc_url_raw( $url ) . '. Skipping.' );233 debug_log( '[IndieBlocks/Webmention] Previously sent webmention for target ' . esc_url_raw( $url ) . '. Skipping.' ); 222 234 continue; 223 235 } … … 229 241 if ( $retries >= 3 ) { 230 242 // Stop here. 231 debug_log( '[Indie blocks/Webmention] Sending webmention to ' . esc_url_raw( $url ) . ' failed 3 times before. Not trying again.' );243 debug_log( '[IndieBlocks/Webmention] Sending webmention to ' . esc_url_raw( $url ) . ' failed 3 times before. Not trying again.' ); 232 244 continue; 233 245 } … … 258 270 if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) >= 500 ) { 259 271 // Something went wrong. 260 debug_log( '[Indieblocks/Webmention] Error trying to send a webmention to ' . esc_url_raw( $endpoint ) . ': ' . $response->get_error_message() ); 272 if ( is_wp_error( $response ) ) { 273 debug_log( '[IndieBlocks/Webmention] Error trying to send a webmention to ' . esc_url_raw( $endpoint ) . ': ' . $response->get_error_message() . '.' ); 274 } 261 275 debug_log( $response ); 262 276 263 277 $webmention[ $hash ]['retries'] = $retries + 1; 264 265 278 update_meta( $obj, '_indieblocks_webmention', $webmention ); 266 279 … … 275 288 $webmention[ $hash ]['code'] = wp_remote_retrieve_response_code( $response ); 276 289 277 debug_log( '[Indie blocks/Webmention] Sent webmention to ' . esc_url_raw( $endpoint ) . '. Response code: ' . wp_remote_retrieve_response_code( $response ) . '.' );290 debug_log( '[IndieBlocks/Webmention] Sent webmention to ' . esc_url_raw( $endpoint ) . '. Response code: ' . wp_remote_retrieve_response_code( $response ) . '.' ); 278 291 } 279 292 … … 322 335 if ( ! empty( $endpoint ) ) { 323 336 // We've previously established the endpoint for this web page. 324 debug_log( '[Indie blocks/Webmention] Found endpoint (' . esc_url_raw( $endpoint ) . ') for ' . esc_url_raw( $url ) . ' in cache.' );337 debug_log( '[IndieBlocks/Webmention] Found endpoint (' . esc_url_raw( $endpoint ) . ') for ' . esc_url_raw( $url ) . ' in cache.' ); 325 338 return $endpoint; 326 339 } -
indieblocks/trunk/includes/class-webmention.php
r3019557 r3035452 176 176 * @todo: Use some kind of "comment taxonomy" instead? 177 177 * 178 * @param WP_Comment_Query $query Comment count.178 * @param WP_Comment_Query $query Comment count. 179 179 */ 180 180 public static function comment_query( $query ) { -
indieblocks/trunk/includes/functions.php
r3019557 r3035452 71 71 * Wrapper around `wp_remote_get()`. 72 72 * 73 * @param string $url URL to fetch.74 * @param bool $json Whether to accept (only) JSON.75 * @return WP_Response|WP_Error Response.73 * @param string $url URL to fetch. 74 * @param bool $json Whether to accept (only) JSON. 75 * @return \WP_Response|\WP_Error Response. 76 76 */ 77 77 function remote_get( $url, $json = false ) { … … 97 97 * Wrapper around `wp_remote_post()`. 98 98 * 99 * @param string $url URL to fetch.100 * @param bool $json Whether to accept (only) JSON.101 * @param array $args Arguments for `wp_remote_post()`.102 * @return WP_Response|WP_Error Response.99 * @param string $url URL to fetch. 100 * @param bool $json Whether to accept (only) JSON. 101 * @param array $args Arguments for `wp_remote_post()`. 102 * @return \WP_Response|\WP_Error Response. 103 103 */ 104 104 function remote_post( $url, $json = false, $args = array() ) { -
indieblocks/trunk/indieblocks.php
r3019557 r3035452 9 9 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 10 * Text Domain: indieblocks 11 * Version: 0.1 1.111 * Version: 0.12.0 12 12 * Requires at least: 6.2 13 13 * GitHub Plugin URI: https://github.com/janboddez/indieblocks -
indieblocks/trunk/languages/indieblocks.pot
r3002715 r3035452 1 # Copyright (C) 202 3Jan Boddez1 # Copyright (C) 2024 Jan Boddez 2 2 # This file is distributed under the GNU General Public License v3. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: IndieBlocks 0.1 0.0\n"5 "Project-Id-Version: IndieBlocks 0.12.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieblocks\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 3-11-26T22:12:55+01:00\n"12 "POT-Creation-Date: 2024-02-11T11:50:00+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.9.0\n" … … 96 96 97 97 #. translators: %1$s: Link to the "liked" page. %2$s: Author of the "liked" page. 98 #: includes/class-micropub-compat.php:2 7698 #: includes/class-micropub-compat.php:280 99 99 #: assets/common.js:13 100 100 msgid "Likes %1$s by %2$s." … … 102 102 103 103 #. translators: %s: Link to the "liked" page. 104 #: includes/class-micropub-compat.php: 299105 #: includes/class-micropub-compat.php:31 4104 #: includes/class-micropub-compat.php:303 105 #: includes/class-micropub-compat.php:318 106 106 #: assets/common.js:24 107 107 #: blocks/context/block.js:22 … … 110 110 111 111 #. translators: %1$s: Link to the bookmarked page. %2$s: Author of the bookmarked page. 112 #: includes/class-micropub-compat.php:3 39112 #: includes/class-micropub-compat.php:343 113 113 #: assets/common.js:11 114 114 msgid "Bookmarked %1$s by %2$s." … … 116 116 117 117 #. translators: %s: Link to the bookmarked page. 118 #: includes/class-micropub-compat.php:36 2119 #: includes/class-micropub-compat.php:3 77118 #: includes/class-micropub-compat.php:366 119 #: includes/class-micropub-compat.php:381 120 120 #: assets/common.js:22 121 121 #: blocks/context/block.js:20 … … 125 125 126 126 #. translators: %1$s: Link to the page being replied to. %2$s: Author of the page being replied to. 127 #: includes/class-micropub-compat.php:40 2127 #: includes/class-micropub-compat.php:406 128 128 #: assets/common.js:15 129 129 msgid "In reply to %1$s by %2$s." … … 131 131 132 132 #. translators: %s: Link to the page being replied to. 133 #: includes/class-micropub-compat.php:42 5134 #: includes/class-micropub-compat.php:44 0133 #: includes/class-micropub-compat.php:429 134 #: includes/class-micropub-compat.php:444 135 135 #: assets/common.js:26 136 136 #: blocks/context/block.js:24 … … 140 140 141 141 #. translators: %1$s: Link to the "page" being reposted. %2$s: Author of the "page" being reposted. 142 #: includes/class-micropub-compat.php:46 5142 #: includes/class-micropub-compat.php:469 143 143 #: assets/common.js:17 144 144 msgid "Reposted %1$s by %2$s." … … 146 146 147 147 #. translators: %s: Link to the "page" being reposted. 148 #: includes/class-micropub-compat.php:4 88149 #: includes/class-micropub-compat.php:50 3148 #: includes/class-micropub-compat.php:492 149 #: includes/class-micropub-compat.php:507 150 150 #: assets/common.js:28 151 151 #: blocks/context/block.js:26 … … 165 165 #: includes/class-options-handler.php:376 166 166 #: includes/class-options-handler.php:479 167 #: includes/class-webmention-receiver.php:304 168 #: includes/class-webmention-sender.php:416 167 #: includes/class-webmention-receiver.php:316 168 #: includes/class-webmention-sender.php:444 169 #: includes/class-webmention-sender.php:463 169 170 msgid "Webmention" 170 171 msgstr "" … … 532 533 msgstr "" 533 534 534 #: includes/class-webmention-parser.php: 80535 #: includes/class-webmention-parser.php:118 535 536 msgid "… bookmarked this!" 536 537 msgstr "" 537 538 538 #: includes/class-webmention-parser.php: 85539 #: includes/class-webmention-parser.php:123 539 540 msgid "… liked this!" 540 541 msgstr "" 541 542 542 #: includes/class-webmention-parser.php: 89543 #: includes/class-webmention-parser.php:127 543 544 msgid "… reposted this!" 544 545 msgstr "" 545 546 546 #: includes/class-webmention-parser.php: 93547 #: includes/class-webmention-parser.php:131 547 548 msgid "… (wants to) read this!" 548 549 msgstr "" 549 550 550 #: includes/class-webmention-receiver.php:2 29551 #: includes/class-webmention-receiver.php:232 551 552 msgid "… commented on this." 552 553 msgstr "" 553 554 554 #: includes/class-webmention-receiver.php:3 23555 #: includes/class-webmention-receiver.php:335 555 556 msgid "Source" 556 557 msgstr "" 557 558 558 #: includes/class-webmention-receiver.php:3 26559 #: includes/class-webmention-receiver.php:338 559 560 #: blocks/context/block.js:67 560 561 msgid "Type" 561 562 msgstr "" 562 563 563 #: includes/class-webmention-receiver.php:3 30564 #: includes/class-webmention-receiver.php:342 564 565 msgid "Avatar" 565 566 msgstr "" 566 567 567 #: includes/class-webmention-receiver.php:3 34568 #: includes/class-webmention-receiver.php:346 568 569 msgid "Delete" 569 570 msgstr "" 570 571 571 #: includes/class-webmention-receiver.php:364 572 #: includes/class-webmention-sender.php:483 572 #: includes/class-webmention-receiver.php:384 573 573 msgid "Missing or invalid nonce." 574 574 msgstr "" 575 575 576 #: includes/class-webmention-receiver.php:3 70576 #: includes/class-webmention-receiver.php:390 577 577 msgid "Invalid comment ID." 578 578 msgstr "" 579 579 580 #: includes/class-webmention-receiver.php:378 581 #: includes/class-webmention-sender.php:497 580 #: includes/class-webmention-receiver.php:398 581 #: includes/class-webmention-sender.php:570 582 #: includes/class-webmention-sender.php:585 582 583 msgid "Insufficient rights." 583 584 msgstr "" 584 585 585 586 #. translators: 1: Webmention endpoint 2: Date sent 586 #: includes/class-webmention-sender.php: 448587 #: includes/class-webmention-sender.php:502 587 588 msgid "Sent to %1$s on %2$s. Response code: %3$d." 588 589 msgstr "" 589 590 590 591 #. translators: 1: Webmention endpoint 2: Date sent 591 #: includes/class-webmention-sender.php: 448592 #: includes/class-webmention-sender.php:502 592 593 msgid "M j, Y \\a\\t H:i" 593 594 msgstr "" 594 595 595 596 #. translators: Webmention endpoint 596 #: includes/class-webmention-sender.php: 451597 #: includes/class-webmention-sender.php:505 597 598 msgid "Could not send webmention to %s." 598 599 msgstr "" 599 600 600 601 #. translators: Webmention endpoint 601 #: includes/class-webmention-sender.php: 454602 #: includes/class-webmention-sender.php:508 602 603 msgid "Could not send webmention to %s. Trying again soon." 603 604 msgstr "" 604 605 605 #: includes/class-webmention-sender.php:464 606 #: includes/class-webmention-sender.php:518 607 #: includes/class-webmention-sender.php:526 606 608 msgid "Resend" 607 609 msgstr "" 608 610 609 #: includes/class-webmention-sender.php: 468610 #: includes/class-webmention.php:15 2611 #: includes/class-webmention-sender.php:523 612 #: includes/class-webmention.php:154 611 613 msgid "Webmention scheduled." 612 614 msgstr "" 613 615 614 #: includes/class-webmention-sender.php: 470616 #: includes/class-webmention-sender.php:530 615 617 msgid "No endpoints found." 616 618 msgstr "" 617 619 618 #: includes/class-webmention-sender.php:489 619 msgid "Invalid post ID." 620 #: includes/class-webmention-sender.php:543 621 msgid "Missing nonce." 622 msgstr "" 623 624 #: includes/class-webmention-sender.php:549 625 msgid "Missing webmention type." 626 msgstr "" 627 628 #: includes/class-webmention-sender.php:555 629 msgid "Invalid nonce." 630 msgstr "" 631 632 #: includes/class-webmention-sender.php:561 633 msgid "Invalid object ID." 620 634 msgstr "" 621 635 … … 719 733 msgstr "" 720 734 721 #: blocks/facepile/block.js:1 9735 #: blocks/facepile/block.js:18 722 736 msgid "Contains the blocks to display Webmention “likes,” “reposts,” etc. as a so-called facepile." 723 737 msgstr "" 724 738 725 #: blocks/facepile/block.js:2 8739 #: blocks/facepile/block.js:24 726 740 msgid "Likes, Bookmarks, and Reposts" 727 741 msgstr "" -
indieblocks/trunk/readme.txt
r3019557 r3035452 3 3 Tags: blocks, gutenberg, indieweb, notes, likes, microblog, microblogging, micropub, fse, site editor, webmention, syndication 4 4 Tested up to: 6.4 5 Stable tag: 0.1 1.15 Stable tag: 0.12.0 6 6 License: GNU General Public License v3.0 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 36 36 37 37 == Changelog == 38 = 0.12.0 = 39 Improve comment mentions, remove margin "below" hidden note and like titles. 40 38 41 = 0.11.0 = 39 42 Improve avatar deletion, add meta box for outgoing "comment mentions," hide meta boxes if empty.
Note: See TracChangeset
for help on using the changeset viewer.