Plugin Directory

Changeset 3035452


Ignore:
Timestamp:
02/14/2024 08:11:00 AM (2 years ago)
Author:
janboddez
Message:

Update to version 0.12.0 from GitHub

Location:
indieblocks
Files:
2 added
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • indieblocks/tags/0.12.0/includes/class-location.php

    r2993569 r3035452  
    229229
    230230            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_log
     231                debug_log( "[IndieBlocks/Location] Failed to retrieve address data for {$lat}, {$lon}" );
    232232                return '';
    233233            }
     
    236236
    237237            if ( empty( $location ) ) {
    238                 error_log( "Failed to decode address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     238                debug_log( "[IndieBlocks/Location] Failed to decode address data for {$lat}, {$lon}" );
    239239                return '';
    240240            }
     
    280280
    281281            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_log
     282                debug_log( "[IndieBlocks/Location]  Failed to retrieve weather data for {$lat}, {$lon}" );
    283283                return array();
    284284            }
     
    287287
    288288            if ( empty( $weather ) ) {
    289                 error_log( "Failed to decode weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     289                debug_log( "[IndieBlocks/Location]  Failed to decode weather data for {$lat}, {$lon}" );
    290290                return array();
    291291            }
  • indieblocks/tags/0.12.0/includes/class-parser.php

    r3019557 r3035452  
    6363                // Could not find a cached version. Download page.
    6464                $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                }
    6678                set_transient( 'indieblocks:html:' . $hash, $content, 3600 ); // Cache, even if empty.
    6779            } else {
  • indieblocks/tags/0.12.0/includes/class-plugin.php

    r3019557 r3035452  
    1212     * Plugin version.
    1313     */
    14     const PLUGIN_VERSION = '0.11.1';
     14    const PLUGIN_VERSION = '0.12.0';
    1515
    1616    /**
  • indieblocks/tags/0.12.0/includes/class-theme-mf2.php

    r3002715 r3035452  
    325325            } elseif ( ! empty( $options['hide_titles'] ) ) {
    326326                $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                );
    327336            }
    328337        }
  • indieblocks/tags/0.12.0/includes/class-webmention-parser.php

    r3019557 r3035452  
    2121     */
    2222    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
    2342        $parser = new Parser( $source );
    2443        $parser->parse( $html );
  • indieblocks/tags/0.12.0/includes/class-webmention-receiver.php

    r3019557 r3035452  
    3030     * Stores incoming webmentions and that's about it.
    3131     *
    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.
    3434     */
    3535    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_log
     36        debug_log( '[IndieBlocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) );
    3737
    3838        // Verify source nor target are invalid URLs.
    3939        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_log
     40            debug_log( '[IndieBlocks/Webmention] Invalid source or target.' );
    4141            return new \WP_Error( 'invalid_request', 'Invalid source or target', array( 'status' => 400 ) );
    4242        }
     
    5454        if ( empty( $post ) || 'publish' !== get_post_status( $post->ID ) ) {
    5555            // Not found.
    56             error_log( '[Indieblocks/Webmention] Target post not found.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     56            debug_log( '[IndieBlocks/Webmention] Target post not found.' );
    5757            return new \WP_Error( 'not_found', 'Not found', array( 'status' => 404 ) );
    5858        }
    5959
    6060        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_log
     61            debug_log( "[IndieBlocks/Webmention] Webmentions closed for the post with ID {$post->ID}." );
    6262            return new \WP_Error( 'invalid_request', 'Invalid target', array( 'status' => 400 ) );
    6363        }
     
    8383
    8484        if ( false !== $num_rows ) {
    85             error_log( '[Indieblocks/Webmention] Stored mention for later processing.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     85            debug_log( '[IndieBlocks/Webmention] Stored mention for later processing.' );
    8686
    8787            // Create an empty REST response and add an 'Accepted' status code.
     
    9292        }
    9393
    94         error_log( '[Indieblocks/Webmention] Could not insert mention into database.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     94        debug_log( '[IndieBlocks/Webmention] Could not insert mention into database.' );
    9595        return new \WP_Error( 'server_error', 'Internal server error', array( 'status' => 500 ) );
    9696    }
     
    149149
    150150            // Fetch source HTML.
    151             error_log( "[Indieblocks/Webmention] Fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     151            debug_log( "[IndieBlocks/Webmention] Fetching the page at {$webmention->source}." );
    152152            $response = remote_get( $webmention->source );
    153153
    154154            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_log
    156 
    157155                // Something went wrong.
    158                 error_log( $response->get_error_message() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     156                debug_log( "[IndieBlocks/Webmention] Something went wrong fetching the page at {$webmention->source}:" . $response->get_error_message() . '.' );
    159157                continue;
    160158            }
     
    164162                $comment_id = reset( $comments );
    165163
    166                 error_log( "[Indieblocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     164                debug_log( "[IndieBlocks/Webmention] Found an existing comment ({$comment_id}) for this mention." );
    167165
    168166                if ( in_array( wp_remote_retrieve_response_code( $response ), array( 404, 410 ), true ) ) {
     
    180178                        );
    181179                    } 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_log
     180                        debug_log( "[IndieBlocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' );
    183181                    }
    184182
     
    196194
    197195            if ( false === stripos( $html, preg_replace( "~#$fragment$~", '', $target ) ) ) { // Strip fragment when comparing.
    198                 debug_log( "[Indieblocks/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)." );
    199197
    200198                // Target URL not (or no longer) mentioned by source. Mark webmention as processed.
     
    214212            }
    215213
    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_log
     214            debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." );
    217215
    218216            // Grab source domain.
     
    264262                }
    265263
    266                 error_log( "[Indieblocks/Webmention] Updating comment {$comment_id}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     264                debug_log( "[IndieBlocks/Webmention] Updating comment {$comment_id}." );
    267265                $result = wp_update_comment( $commentdata, true );
    268266            } else {
    269                 error_log( '[Indieblocks/Webmention] Creating new comment.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     267                debug_log( '[IndieBlocks/Webmention] Creating new comment.' );
    270268                $result = wp_new_comment( $commentdata, true );
    271269            }
     
    275273            if ( is_wp_error( $result ) ) {
    276274                // For troubleshooting.
    277                 error_log( print_r( $result, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log,WordPress.PHP.DevelopmentFunctions.error_log_print_r
     275                debug_log( $result );
    278276
    279277                if ( in_array( 'comment_duplicate', $result->get_error_codes(), true ) ) {
     
    296294            );
    297295
    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." );
    300297        }
    301298    }
  • indieblocks/tags/0.12.0/includes/class-webmention-sender.php

    r3019557 r3035452  
    8585        }
    8686
     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
    87100        if ( empty( $urls ) ) {
    88101            // Nothing to do. Bail.
     
    90103        }
    91104
    92         $urls     = array_unique( $urls );
    93105        $schedule = false;
    94106
     
    117129                // Schedule sending out the actual webmentions.
    118130                if ( $obj instanceof \WP_Post ) {
    119                     debug_log( "[Indieblocks/Webmention] Scheduling webmention for post {$obj->ID}." );
     131                    debug_log( "[IndieBlocks/Webmention] Scheduling webmention for post {$obj->ID}." );
    120132                } else {
    121                     debug_log( "[Indieblocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );
     133                    debug_log( "[IndieBlocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );
    122134                }
    123135
     
    141153            if ( 'publish' !== $obj->post_status ) {
    142154                // Do not send webmention on delete/unpublish, for now.
    143                 debug_log( '[Indieblocks/Webmention] Post ' . $obj->ID . ' is not published.' );
     155                debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is not published.' );
    144156                return;
    145157            }
     
    147159            if ( ! in_array( $obj->post_type, Webmention::get_supported_post_types(), true ) ) {
    148160                // This post type doesn't support Webmention.
    149                 debug_log( '[Indieblocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );
     161                debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );
    150162                return;
    151163            }
    152164        } elseif ( '1' !== $obj->comment_approved ) {
    153             debug_log( '[Indieblocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );
     165            debug_log( '[IndieBlocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );
    154166            return;
    155167        }
     
    184196        if ( empty( $urls ) ) {
    185197            // One or more links must've been removed. Nothing to do. Bail.
    186             debug_log( '[Indieblocks/Webmention] No outgoing URLs found.' );
     198            debug_log( '[IndieBlocks/Webmention] No outgoing URLs found.' );
    187199            return;
    188200        }
     
    205217            if ( empty( $endpoint ) || false === wp_http_validate_url( $endpoint ) ) {
    206218                // Skip.
    207                 debug_log( '[Indieblocks/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 ) . '.' );
    208220                continue;
    209221            }
     
    219231                // we could store a hash of the post content, too, and use that
    220232                // to send webmentions on actual updates.
    221                 debug_log( '[Indieblocks/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.' );
    222234                continue;
    223235            }
     
    229241            if ( $retries >= 3 ) {
    230242                // Stop here.
    231                 debug_log( '[Indieblocks/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.' );
    232244                continue;
    233245            }
     
    258270            if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) >= 500 ) {
    259271                // 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                }
    261275                debug_log( $response );
    262276
    263277                $webmention[ $hash ]['retries'] = $retries + 1;
    264 
    265278                update_meta( $obj, '_indieblocks_webmention', $webmention );
    266279
     
    275288            $webmention[ $hash ]['code'] = wp_remote_retrieve_response_code( $response );
    276289
    277             debug_log( '[Indieblocks/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 ) . '.' );
    278291        }
    279292
     
    322335        if ( ! empty( $endpoint ) ) {
    323336            // We've previously established the endpoint for this web page.
    324             debug_log( '[Indieblocks/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.' );
    325338            return $endpoint;
    326339        }
  • indieblocks/tags/0.12.0/includes/class-webmention.php

    r3019557 r3035452  
    176176     * @todo: Use some kind of "comment taxonomy" instead?
    177177     *
    178      * @param  WP_Comment_Query $query   Comment count.
     178     * @param  WP_Comment_Query $query Comment count.
    179179     */
    180180    public static function comment_query( $query ) {
  • indieblocks/tags/0.12.0/includes/functions.php

    r3019557 r3035452  
    7171 * Wrapper around `wp_remote_get()`.
    7272 *
    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.
    7676 */
    7777function remote_get( $url, $json = false ) {
     
    9797 * Wrapper around `wp_remote_post()`.
    9898 *
    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.
    103103 */
    104104function remote_post( $url, $json = false, $args = array() ) {
  • indieblocks/tags/0.12.0/indieblocks.php

    r3019557 r3035452  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       indieblocks
    11  * Version:           0.11.1
     11 * Version:           0.12.0
    1212 * Requires at least: 6.2
    1313 * GitHub Plugin URI: https://github.com/janboddez/indieblocks
  • indieblocks/tags/0.12.0/languages/indieblocks.pot

    r3002715 r3035452  
    1 # Copyright (C) 2023 Jan Boddez
     1# Copyright (C) 2024 Jan Boddez
    22# This file is distributed under the GNU General Public License v3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: IndieBlocks 0.10.0\n"
     5"Project-Id-Version: IndieBlocks 0.12.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieblocks\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-11-26T22:12:55+01:00\n"
     12"POT-Creation-Date: 2024-02-11T11:50:00+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    9696
    9797#. translators: %1$s: Link to the "liked" page. %2$s: Author of the "liked" page.
    98 #: includes/class-micropub-compat.php:276
     98#: includes/class-micropub-compat.php:280
    9999#: assets/common.js:13
    100100msgid "Likes %1$s by %2$s."
     
    102102
    103103#. translators: %s: Link to the "liked" page.
    104 #: includes/class-micropub-compat.php:299
    105 #: includes/class-micropub-compat.php:314
     104#: includes/class-micropub-compat.php:303
     105#: includes/class-micropub-compat.php:318
    106106#: assets/common.js:24
    107107#: blocks/context/block.js:22
     
    110110
    111111#. translators: %1$s: Link to the bookmarked page. %2$s: Author of the bookmarked page.
    112 #: includes/class-micropub-compat.php:339
     112#: includes/class-micropub-compat.php:343
    113113#: assets/common.js:11
    114114msgid "Bookmarked %1$s by %2$s."
     
    116116
    117117#. translators: %s: Link to the bookmarked page.
    118 #: includes/class-micropub-compat.php:362
    119 #: includes/class-micropub-compat.php:377
     118#: includes/class-micropub-compat.php:366
     119#: includes/class-micropub-compat.php:381
    120120#: assets/common.js:22
    121121#: blocks/context/block.js:20
     
    125125
    126126#. 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:402
     127#: includes/class-micropub-compat.php:406
    128128#: assets/common.js:15
    129129msgid "In reply to %1$s by %2$s."
     
    131131
    132132#. translators: %s: Link to the page being replied to.
    133 #: includes/class-micropub-compat.php:425
    134 #: includes/class-micropub-compat.php:440
     133#: includes/class-micropub-compat.php:429
     134#: includes/class-micropub-compat.php:444
    135135#: assets/common.js:26
    136136#: blocks/context/block.js:24
     
    140140
    141141#. translators: %1$s: Link to the "page" being reposted. %2$s: Author of the "page" being reposted.
    142 #: includes/class-micropub-compat.php:465
     142#: includes/class-micropub-compat.php:469
    143143#: assets/common.js:17
    144144msgid "Reposted %1$s by %2$s."
     
    146146
    147147#. translators: %s: Link to the "page" being reposted.
    148 #: includes/class-micropub-compat.php:488
    149 #: includes/class-micropub-compat.php:503
     148#: includes/class-micropub-compat.php:492
     149#: includes/class-micropub-compat.php:507
    150150#: assets/common.js:28
    151151#: blocks/context/block.js:26
     
    165165#: includes/class-options-handler.php:376
    166166#: 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
    169170msgid "Webmention"
    170171msgstr ""
     
    532533msgstr ""
    533534
    534 #: includes/class-webmention-parser.php:80
     535#: includes/class-webmention-parser.php:118
    535536msgid "&hellip; bookmarked this!"
    536537msgstr ""
    537538
    538 #: includes/class-webmention-parser.php:85
     539#: includes/class-webmention-parser.php:123
    539540msgid "&hellip; liked this!"
    540541msgstr ""
    541542
    542 #: includes/class-webmention-parser.php:89
     543#: includes/class-webmention-parser.php:127
    543544msgid "&hellip; reposted this!"
    544545msgstr ""
    545546
    546 #: includes/class-webmention-parser.php:93
     547#: includes/class-webmention-parser.php:131
    547548msgid "&hellip; (wants to) read this!"
    548549msgstr ""
    549550
    550 #: includes/class-webmention-receiver.php:229
     551#: includes/class-webmention-receiver.php:232
    551552msgid "&hellip; commented on this."
    552553msgstr ""
    553554
    554 #: includes/class-webmention-receiver.php:323
     555#: includes/class-webmention-receiver.php:335
    555556msgid "Source"
    556557msgstr ""
    557558
    558 #: includes/class-webmention-receiver.php:326
     559#: includes/class-webmention-receiver.php:338
    559560#: blocks/context/block.js:67
    560561msgid "Type"
    561562msgstr ""
    562563
    563 #: includes/class-webmention-receiver.php:330
     564#: includes/class-webmention-receiver.php:342
    564565msgid "Avatar"
    565566msgstr ""
    566567
    567 #: includes/class-webmention-receiver.php:334
     568#: includes/class-webmention-receiver.php:346
    568569msgid "Delete"
    569570msgstr ""
    570571
    571 #: includes/class-webmention-receiver.php:364
    572 #: includes/class-webmention-sender.php:483
     572#: includes/class-webmention-receiver.php:384
    573573msgid "Missing or invalid nonce."
    574574msgstr ""
    575575
    576 #: includes/class-webmention-receiver.php:370
     576#: includes/class-webmention-receiver.php:390
    577577msgid "Invalid comment ID."
    578578msgstr ""
    579579
    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
    582583msgid "Insufficient rights."
    583584msgstr ""
    584585
    585586#. translators: 1: Webmention endpoint 2: Date sent
    586 #: includes/class-webmention-sender.php:448
     587#: includes/class-webmention-sender.php:502
    587588msgid "Sent to %1$s on %2$s. Response code: %3$d."
    588589msgstr ""
    589590
    590591#. translators: 1: Webmention endpoint 2: Date sent
    591 #: includes/class-webmention-sender.php:448
     592#: includes/class-webmention-sender.php:502
    592593msgid "M j, Y \\a\\t H:i"
    593594msgstr ""
    594595
    595596#. translators: Webmention endpoint
    596 #: includes/class-webmention-sender.php:451
     597#: includes/class-webmention-sender.php:505
    597598msgid "Could not send webmention to %s."
    598599msgstr ""
    599600
    600601#. translators: Webmention endpoint
    601 #: includes/class-webmention-sender.php:454
     602#: includes/class-webmention-sender.php:508
    602603msgid "Could not send webmention to %s. Trying again soon."
    603604msgstr ""
    604605
    605 #: includes/class-webmention-sender.php:464
     606#: includes/class-webmention-sender.php:518
     607#: includes/class-webmention-sender.php:526
    606608msgid "Resend"
    607609msgstr ""
    608610
    609 #: includes/class-webmention-sender.php:468
    610 #: includes/class-webmention.php:152
     611#: includes/class-webmention-sender.php:523
     612#: includes/class-webmention.php:154
    611613msgid "Webmention scheduled."
    612614msgstr ""
    613615
    614 #: includes/class-webmention-sender.php:470
     616#: includes/class-webmention-sender.php:530
    615617msgid "No endpoints found."
    616618msgstr ""
    617619
    618 #: includes/class-webmention-sender.php:489
    619 msgid "Invalid post ID."
     620#: includes/class-webmention-sender.php:543
     621msgid "Missing nonce."
     622msgstr ""
     623
     624#: includes/class-webmention-sender.php:549
     625msgid "Missing webmention type."
     626msgstr ""
     627
     628#: includes/class-webmention-sender.php:555
     629msgid "Invalid nonce."
     630msgstr ""
     631
     632#: includes/class-webmention-sender.php:561
     633msgid "Invalid object ID."
    620634msgstr ""
    621635
     
    719733msgstr ""
    720734
    721 #: blocks/facepile/block.js:19
     735#: blocks/facepile/block.js:18
    722736msgid "Contains the blocks to display Webmention “likes,” “reposts,” etc. as a so-called facepile."
    723737msgstr ""
    724738
    725 #: blocks/facepile/block.js:28
     739#: blocks/facepile/block.js:24
    726740msgid "Likes, Bookmarks, and Reposts"
    727741msgstr ""
  • indieblocks/tags/0.12.0/readme.txt

    r3019557 r3035452  
    33Tags: blocks, gutenberg, indieweb, notes, likes, microblog, microblogging, micropub, fse, site editor, webmention, syndication
    44Tested up to: 6.4
    5 Stable tag: 0.11.1
     5Stable tag: 0.12.0
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3636
    3737== Changelog ==
     38= 0.12.0 =
     39Improve comment mentions, remove margin "below" hidden note and like titles.
     40
    3841= 0.11.0 =
    3942Improve avatar deletion, add meta box for outgoing "comment mentions," hide meta boxes if empty.
  • indieblocks/trunk/includes/class-location.php

    r2993569 r3035452  
    229229
    230230            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_log
     231                debug_log( "[IndieBlocks/Location] Failed to retrieve address data for {$lat}, {$lon}" );
    232232                return '';
    233233            }
     
    236236
    237237            if ( empty( $location ) ) {
    238                 error_log( "Failed to decode address data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     238                debug_log( "[IndieBlocks/Location] Failed to decode address data for {$lat}, {$lon}" );
    239239                return '';
    240240            }
     
    280280
    281281            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_log
     282                debug_log( "[IndieBlocks/Location]  Failed to retrieve weather data for {$lat}, {$lon}" );
    283283                return array();
    284284            }
     
    287287
    288288            if ( empty( $weather ) ) {
    289                 error_log( "Failed to decode weather data for {$lat}, {$lon}" ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     289                debug_log( "[IndieBlocks/Location]  Failed to decode weather data for {$lat}, {$lon}" );
    290290                return array();
    291291            }
  • indieblocks/trunk/includes/class-parser.php

    r3019557 r3035452  
    6363                // Could not find a cached version. Download page.
    6464                $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                }
    6678                set_transient( 'indieblocks:html:' . $hash, $content, 3600 ); // Cache, even if empty.
    6779            } else {
  • indieblocks/trunk/includes/class-plugin.php

    r3019557 r3035452  
    1212     * Plugin version.
    1313     */
    14     const PLUGIN_VERSION = '0.11.1';
     14    const PLUGIN_VERSION = '0.12.0';
    1515
    1616    /**
  • indieblocks/trunk/includes/class-theme-mf2.php

    r3002715 r3035452  
    325325            } elseif ( ! empty( $options['hide_titles'] ) ) {
    326326                $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                );
    327336            }
    328337        }
  • indieblocks/trunk/includes/class-webmention-parser.php

    r3019557 r3035452  
    2121     */
    2222    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
    2342        $parser = new Parser( $source );
    2443        $parser->parse( $html );
  • indieblocks/trunk/includes/class-webmention-receiver.php

    r3019557 r3035452  
    3030     * Stores incoming webmentions and that's about it.
    3131     *
    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.
    3434     */
    3535    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_log
     36        debug_log( '[IndieBlocks/Webmention] Got request: ' . wp_json_encode( $request->get_params() ) );
    3737
    3838        // Verify source nor target are invalid URLs.
    3939        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_log
     40            debug_log( '[IndieBlocks/Webmention] Invalid source or target.' );
    4141            return new \WP_Error( 'invalid_request', 'Invalid source or target', array( 'status' => 400 ) );
    4242        }
     
    5454        if ( empty( $post ) || 'publish' !== get_post_status( $post->ID ) ) {
    5555            // Not found.
    56             error_log( '[Indieblocks/Webmention] Target post not found.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     56            debug_log( '[IndieBlocks/Webmention] Target post not found.' );
    5757            return new \WP_Error( 'not_found', 'Not found', array( 'status' => 404 ) );
    5858        }
    5959
    6060        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_log
     61            debug_log( "[IndieBlocks/Webmention] Webmentions closed for the post with ID {$post->ID}." );
    6262            return new \WP_Error( 'invalid_request', 'Invalid target', array( 'status' => 400 ) );
    6363        }
     
    8383
    8484        if ( false !== $num_rows ) {
    85             error_log( '[Indieblocks/Webmention] Stored mention for later processing.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     85            debug_log( '[IndieBlocks/Webmention] Stored mention for later processing.' );
    8686
    8787            // Create an empty REST response and add an 'Accepted' status code.
     
    9292        }
    9393
    94         error_log( '[Indieblocks/Webmention] Could not insert mention into database.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     94        debug_log( '[IndieBlocks/Webmention] Could not insert mention into database.' );
    9595        return new \WP_Error( 'server_error', 'Internal server error', array( 'status' => 500 ) );
    9696    }
     
    149149
    150150            // Fetch source HTML.
    151             error_log( "[Indieblocks/Webmention] Fetching the page at {$webmention->source}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     151            debug_log( "[IndieBlocks/Webmention] Fetching the page at {$webmention->source}." );
    152152            $response = remote_get( $webmention->source );
    153153
    154154            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_log
    156 
    157155                // Something went wrong.
    158                 error_log( $response->get_error_message() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     156                debug_log( "[IndieBlocks/Webmention] Something went wrong fetching the page at {$webmention->source}:" . $response->get_error_message() . '.' );
    159157                continue;
    160158            }
     
    164162                $comment_id = reset( $comments );
    165163
    166                 error_log( "[Indieblocks/Webmention] Found an existing comment ({$comment_id}) for this mention." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     164                debug_log( "[IndieBlocks/Webmention] Found an existing comment ({$comment_id}) for this mention." );
    167165
    168166                if ( in_array( wp_remote_retrieve_response_code( $response ), array( 404, 410 ), true ) ) {
     
    180178                        );
    181179                    } 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_log
     180                        debug_log( "[IndieBlocks/Webmention] Something went wrong deleting comment {$comment_id} for source URL (" . esc_url_raw( $webmention->source ) . '.' );
    183181                    }
    184182
     
    196194
    197195            if ( false === stripos( $html, preg_replace( "~#$fragment$~", '', $target ) ) ) { // Strip fragment when comparing.
    198                 debug_log( "[Indieblocks/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)." );
    199197
    200198                // Target URL not (or no longer) mentioned by source. Mark webmention as processed.
     
    214212            }
    215213
    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_log
     214            debug_log( "[IndieBlocks/Webmention] The page at {$webmention->source} seems to mention our target URL ($target); creating new comment." );
    217215
    218216            // Grab source domain.
     
    264262                }
    265263
    266                 error_log( "[Indieblocks/Webmention] Updating comment {$comment_id}." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     264                debug_log( "[IndieBlocks/Webmention] Updating comment {$comment_id}." );
    267265                $result = wp_update_comment( $commentdata, true );
    268266            } else {
    269                 error_log( '[Indieblocks/Webmention] Creating new comment.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     267                debug_log( '[IndieBlocks/Webmention] Creating new comment.' );
    270268                $result = wp_new_comment( $commentdata, true );
    271269            }
     
    275273            if ( is_wp_error( $result ) ) {
    276274                // For troubleshooting.
    277                 error_log( print_r( $result, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log,WordPress.PHP.DevelopmentFunctions.error_log_print_r
     275                debug_log( $result );
    278276
    279277                if ( in_array( 'comment_duplicate', $result->get_error_codes(), true ) ) {
     
    296294            );
    297295
    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." );
    300297        }
    301298    }
  • indieblocks/trunk/includes/class-webmention-sender.php

    r3019557 r3035452  
    8585        }
    8686
     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
    87100        if ( empty( $urls ) ) {
    88101            // Nothing to do. Bail.
     
    90103        }
    91104
    92         $urls     = array_unique( $urls );
    93105        $schedule = false;
    94106
     
    117129                // Schedule sending out the actual webmentions.
    118130                if ( $obj instanceof \WP_Post ) {
    119                     debug_log( "[Indieblocks/Webmention] Scheduling webmention for post {$obj->ID}." );
     131                    debug_log( "[IndieBlocks/Webmention] Scheduling webmention for post {$obj->ID}." );
    120132                } else {
    121                     debug_log( "[Indieblocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );
     133                    debug_log( "[IndieBlocks/Webmention] Scheduling webmention for comment {$obj->comment_ID}." );
    122134                }
    123135
     
    141153            if ( 'publish' !== $obj->post_status ) {
    142154                // Do not send webmention on delete/unpublish, for now.
    143                 debug_log( '[Indieblocks/Webmention] Post ' . $obj->ID . ' is not published.' );
     155                debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is not published.' );
    144156                return;
    145157            }
     
    147159            if ( ! in_array( $obj->post_type, Webmention::get_supported_post_types(), true ) ) {
    148160                // This post type doesn't support Webmention.
    149                 debug_log( '[Indieblocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );
     161                debug_log( '[IndieBlocks/Webmention] Post ' . $obj->ID . ' is of an unsupported type.' );
    150162                return;
    151163            }
    152164        } elseif ( '1' !== $obj->comment_approved ) {
    153             debug_log( '[Indieblocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );
     165            debug_log( '[IndieBlocks/Webmention] Comment ' . $obj->comment_ID . " isn't approved." );
    154166            return;
    155167        }
     
    184196        if ( empty( $urls ) ) {
    185197            // One or more links must've been removed. Nothing to do. Bail.
    186             debug_log( '[Indieblocks/Webmention] No outgoing URLs found.' );
     198            debug_log( '[IndieBlocks/Webmention] No outgoing URLs found.' );
    187199            return;
    188200        }
     
    205217            if ( empty( $endpoint ) || false === wp_http_validate_url( $endpoint ) ) {
    206218                // Skip.
    207                 debug_log( '[Indieblocks/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 ) . '.' );
    208220                continue;
    209221            }
     
    219231                // we could store a hash of the post content, too, and use that
    220232                // to send webmentions on actual updates.
    221                 debug_log( '[Indieblocks/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.' );
    222234                continue;
    223235            }
     
    229241            if ( $retries >= 3 ) {
    230242                // Stop here.
    231                 debug_log( '[Indieblocks/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.' );
    232244                continue;
    233245            }
     
    258270            if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) >= 500 ) {
    259271                // 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                }
    261275                debug_log( $response );
    262276
    263277                $webmention[ $hash ]['retries'] = $retries + 1;
    264 
    265278                update_meta( $obj, '_indieblocks_webmention', $webmention );
    266279
     
    275288            $webmention[ $hash ]['code'] = wp_remote_retrieve_response_code( $response );
    276289
    277             debug_log( '[Indieblocks/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 ) . '.' );
    278291        }
    279292
     
    322335        if ( ! empty( $endpoint ) ) {
    323336            // We've previously established the endpoint for this web page.
    324             debug_log( '[Indieblocks/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.' );
    325338            return $endpoint;
    326339        }
  • indieblocks/trunk/includes/class-webmention.php

    r3019557 r3035452  
    176176     * @todo: Use some kind of "comment taxonomy" instead?
    177177     *
    178      * @param  WP_Comment_Query $query   Comment count.
     178     * @param  WP_Comment_Query $query Comment count.
    179179     */
    180180    public static function comment_query( $query ) {
  • indieblocks/trunk/includes/functions.php

    r3019557 r3035452  
    7171 * Wrapper around `wp_remote_get()`.
    7272 *
    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.
    7676 */
    7777function remote_get( $url, $json = false ) {
     
    9797 * Wrapper around `wp_remote_post()`.
    9898 *
    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.
    103103 */
    104104function remote_post( $url, $json = false, $args = array() ) {
  • indieblocks/trunk/indieblocks.php

    r3019557 r3035452  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       indieblocks
    11  * Version:           0.11.1
     11 * Version:           0.12.0
    1212 * Requires at least: 6.2
    1313 * GitHub Plugin URI: https://github.com/janboddez/indieblocks
  • indieblocks/trunk/languages/indieblocks.pot

    r3002715 r3035452  
    1 # Copyright (C) 2023 Jan Boddez
     1# Copyright (C) 2024 Jan Boddez
    22# This file is distributed under the GNU General Public License v3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: IndieBlocks 0.10.0\n"
     5"Project-Id-Version: IndieBlocks 0.12.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieblocks\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-11-26T22:12:55+01:00\n"
     12"POT-Creation-Date: 2024-02-11T11:50:00+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    9696
    9797#. translators: %1$s: Link to the "liked" page. %2$s: Author of the "liked" page.
    98 #: includes/class-micropub-compat.php:276
     98#: includes/class-micropub-compat.php:280
    9999#: assets/common.js:13
    100100msgid "Likes %1$s by %2$s."
     
    102102
    103103#. translators: %s: Link to the "liked" page.
    104 #: includes/class-micropub-compat.php:299
    105 #: includes/class-micropub-compat.php:314
     104#: includes/class-micropub-compat.php:303
     105#: includes/class-micropub-compat.php:318
    106106#: assets/common.js:24
    107107#: blocks/context/block.js:22
     
    110110
    111111#. translators: %1$s: Link to the bookmarked page. %2$s: Author of the bookmarked page.
    112 #: includes/class-micropub-compat.php:339
     112#: includes/class-micropub-compat.php:343
    113113#: assets/common.js:11
    114114msgid "Bookmarked %1$s by %2$s."
     
    116116
    117117#. translators: %s: Link to the bookmarked page.
    118 #: includes/class-micropub-compat.php:362
    119 #: includes/class-micropub-compat.php:377
     118#: includes/class-micropub-compat.php:366
     119#: includes/class-micropub-compat.php:381
    120120#: assets/common.js:22
    121121#: blocks/context/block.js:20
     
    125125
    126126#. 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:402
     127#: includes/class-micropub-compat.php:406
    128128#: assets/common.js:15
    129129msgid "In reply to %1$s by %2$s."
     
    131131
    132132#. translators: %s: Link to the page being replied to.
    133 #: includes/class-micropub-compat.php:425
    134 #: includes/class-micropub-compat.php:440
     133#: includes/class-micropub-compat.php:429
     134#: includes/class-micropub-compat.php:444
    135135#: assets/common.js:26
    136136#: blocks/context/block.js:24
     
    140140
    141141#. translators: %1$s: Link to the "page" being reposted. %2$s: Author of the "page" being reposted.
    142 #: includes/class-micropub-compat.php:465
     142#: includes/class-micropub-compat.php:469
    143143#: assets/common.js:17
    144144msgid "Reposted %1$s by %2$s."
     
    146146
    147147#. translators: %s: Link to the "page" being reposted.
    148 #: includes/class-micropub-compat.php:488
    149 #: includes/class-micropub-compat.php:503
     148#: includes/class-micropub-compat.php:492
     149#: includes/class-micropub-compat.php:507
    150150#: assets/common.js:28
    151151#: blocks/context/block.js:26
     
    165165#: includes/class-options-handler.php:376
    166166#: 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
    169170msgid "Webmention"
    170171msgstr ""
     
    532533msgstr ""
    533534
    534 #: includes/class-webmention-parser.php:80
     535#: includes/class-webmention-parser.php:118
    535536msgid "&hellip; bookmarked this!"
    536537msgstr ""
    537538
    538 #: includes/class-webmention-parser.php:85
     539#: includes/class-webmention-parser.php:123
    539540msgid "&hellip; liked this!"
    540541msgstr ""
    541542
    542 #: includes/class-webmention-parser.php:89
     543#: includes/class-webmention-parser.php:127
    543544msgid "&hellip; reposted this!"
    544545msgstr ""
    545546
    546 #: includes/class-webmention-parser.php:93
     547#: includes/class-webmention-parser.php:131
    547548msgid "&hellip; (wants to) read this!"
    548549msgstr ""
    549550
    550 #: includes/class-webmention-receiver.php:229
     551#: includes/class-webmention-receiver.php:232
    551552msgid "&hellip; commented on this."
    552553msgstr ""
    553554
    554 #: includes/class-webmention-receiver.php:323
     555#: includes/class-webmention-receiver.php:335
    555556msgid "Source"
    556557msgstr ""
    557558
    558 #: includes/class-webmention-receiver.php:326
     559#: includes/class-webmention-receiver.php:338
    559560#: blocks/context/block.js:67
    560561msgid "Type"
    561562msgstr ""
    562563
    563 #: includes/class-webmention-receiver.php:330
     564#: includes/class-webmention-receiver.php:342
    564565msgid "Avatar"
    565566msgstr ""
    566567
    567 #: includes/class-webmention-receiver.php:334
     568#: includes/class-webmention-receiver.php:346
    568569msgid "Delete"
    569570msgstr ""
    570571
    571 #: includes/class-webmention-receiver.php:364
    572 #: includes/class-webmention-sender.php:483
     572#: includes/class-webmention-receiver.php:384
    573573msgid "Missing or invalid nonce."
    574574msgstr ""
    575575
    576 #: includes/class-webmention-receiver.php:370
     576#: includes/class-webmention-receiver.php:390
    577577msgid "Invalid comment ID."
    578578msgstr ""
    579579
    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
    582583msgid "Insufficient rights."
    583584msgstr ""
    584585
    585586#. translators: 1: Webmention endpoint 2: Date sent
    586 #: includes/class-webmention-sender.php:448
     587#: includes/class-webmention-sender.php:502
    587588msgid "Sent to %1$s on %2$s. Response code: %3$d."
    588589msgstr ""
    589590
    590591#. translators: 1: Webmention endpoint 2: Date sent
    591 #: includes/class-webmention-sender.php:448
     592#: includes/class-webmention-sender.php:502
    592593msgid "M j, Y \\a\\t H:i"
    593594msgstr ""
    594595
    595596#. translators: Webmention endpoint
    596 #: includes/class-webmention-sender.php:451
     597#: includes/class-webmention-sender.php:505
    597598msgid "Could not send webmention to %s."
    598599msgstr ""
    599600
    600601#. translators: Webmention endpoint
    601 #: includes/class-webmention-sender.php:454
     602#: includes/class-webmention-sender.php:508
    602603msgid "Could not send webmention to %s. Trying again soon."
    603604msgstr ""
    604605
    605 #: includes/class-webmention-sender.php:464
     606#: includes/class-webmention-sender.php:518
     607#: includes/class-webmention-sender.php:526
    606608msgid "Resend"
    607609msgstr ""
    608610
    609 #: includes/class-webmention-sender.php:468
    610 #: includes/class-webmention.php:152
     611#: includes/class-webmention-sender.php:523
     612#: includes/class-webmention.php:154
    611613msgid "Webmention scheduled."
    612614msgstr ""
    613615
    614 #: includes/class-webmention-sender.php:470
     616#: includes/class-webmention-sender.php:530
    615617msgid "No endpoints found."
    616618msgstr ""
    617619
    618 #: includes/class-webmention-sender.php:489
    619 msgid "Invalid post ID."
     620#: includes/class-webmention-sender.php:543
     621msgid "Missing nonce."
     622msgstr ""
     623
     624#: includes/class-webmention-sender.php:549
     625msgid "Missing webmention type."
     626msgstr ""
     627
     628#: includes/class-webmention-sender.php:555
     629msgid "Invalid nonce."
     630msgstr ""
     631
     632#: includes/class-webmention-sender.php:561
     633msgid "Invalid object ID."
    620634msgstr ""
    621635
     
    719733msgstr ""
    720734
    721 #: blocks/facepile/block.js:19
     735#: blocks/facepile/block.js:18
    722736msgid "Contains the blocks to display Webmention “likes,” “reposts,” etc. as a so-called facepile."
    723737msgstr ""
    724738
    725 #: blocks/facepile/block.js:28
     739#: blocks/facepile/block.js:24
    726740msgid "Likes, Bookmarks, and Reposts"
    727741msgstr ""
  • indieblocks/trunk/readme.txt

    r3019557 r3035452  
    33Tags: blocks, gutenberg, indieweb, notes, likes, microblog, microblogging, micropub, fse, site editor, webmention, syndication
    44Tested up to: 6.4
    5 Stable tag: 0.11.1
     5Stable tag: 0.12.0
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3636
    3737== Changelog ==
     38= 0.12.0 =
     39Improve comment mentions, remove margin "below" hidden note and like titles.
     40
    3841= 0.11.0 =
    3942Improve avatar deletion, add meta box for outgoing "comment mentions," hide meta boxes if empty.
Note: See TracChangeset for help on using the changeset viewer.