@@ -48,7 +48,7 @@ public static function init() {
4848 * @return array the filtered array
4949 */
5050 public static function filter_comment_args ( $ args ) {
51- $ args ['walker ' ] = new Semantic_Linkbacks_Walker_Comment ;
51+ $ args ['walker ' ] = new Semantic_Linkbacks_Walker_Comment () ;
5252 return $ args ;
5353 }
5454
@@ -69,35 +69,35 @@ public static function show_mentions() {
6969 public static function register_meta () {
7070 $ args = array (
7171 'sanitize_callback ' => 'esc_url_raw ' ,
72- 'type ' => 'string ' ,
73- 'description ' => 'Author URL ' ,
74- 'single ' => true ,
75- 'show_in_rest ' => true ,
72+ 'type ' => 'string ' ,
73+ 'description ' => 'Author URL ' ,
74+ 'single ' => true ,
75+ 'show_in_rest ' => true ,
7676 );
7777 register_meta ( 'comment ' , 'semantic_linkbacks_author_url ' , $ args );
7878
7979 $ args = array (
8080 'sanitize_callback ' => 'esc_url_raw ' ,
81- 'type ' => 'string ' ,
82- 'description ' => 'Avatar URL ' ,
83- 'single ' => true ,
84- 'show_in_rest ' => true ,
81+ 'type ' => 'string ' ,
82+ 'description ' => 'Avatar URL ' ,
83+ 'single ' => true ,
84+ 'show_in_rest ' => true ,
8585 );
8686 register_meta ( 'comment ' , 'semantic_linkbacks_avatar ' , $ args );
8787
8888 $ args = array (
8989 'sanitize_callback ' => 'esc_url_raw ' ,
90- 'type ' => 'string ' ,
91- 'description ' => 'Canonical URL ' ,
92- 'single ' => true ,
93- 'show_in_rest ' => true ,
90+ 'type ' => 'string ' ,
91+ 'description ' => 'Canonical URL ' ,
92+ 'single ' => true ,
93+ 'show_in_rest ' => true ,
9494 );
9595 register_meta ( 'comment ' , 'semantic_linkbacks_canonical ' , $ args );
9696
9797 $ args = array (
98- 'type ' => 'string ' ,
99- 'description ' => 'Linkbacks Type ' ,
100- 'single ' => true ,
98+ 'type ' => 'string ' ,
99+ 'description ' => 'Linkbacks Type ' ,
100+ 'single ' => true ,
101101 'show_in_rest ' => true ,
102102 );
103103 register_meta ( 'comment ' , 'semantic_linkbacks_type ' , $ args );
@@ -156,11 +156,11 @@ public static function enhance( $commentdata, $comment = array(), $commentarr =
156156 public static function retrieve ( $ url ) {
157157 global $ wp_version ;
158158 $ user_agent = apply_filters ( 'http_headers_useragent ' , 'WordPress/ ' . $ wp_version . '; ' . get_bloginfo ( 'url ' ) );
159- $ args = array (
160- 'timeout ' => 100 ,
159+ $ args = array (
160+ 'timeout ' => 100 ,
161161 'limit_response_size ' => 1048576 ,
162- 'redirection ' => 20 ,
163- 'user-agent ' => "$ user_agent; verifying linkback " ,
162+ 'redirection ' => 20 ,
163+ 'user-agent ' => "$ user_agent; verifying linkback " ,
164164 );
165165 return wp_safe_remote_get ( $ url , $ args );
166166 }
@@ -189,19 +189,19 @@ public static function update_meta( $comment_id, $commentdata ) {
189189 public static function get_comment_type_excerpts () {
190190 $ strings = array (
191191 // special case. any value that evals to false will be considered standard
192- 'mention ' => __ ( '%1$s mentioned %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
193-
194- 'reply ' => __ ( '%1$s replied to %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
195- 'repost ' => __ ( '%1$s reposted %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
196- 'like ' => __ ( '%1$s liked %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
197- 'favorite ' => __ ( '%1$s favorited %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
198- 'tag ' => __ ( '%1$s tagged %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
199- 'bookmark ' => __ ( '%1$s bookmarked %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
200- 'rsvp:yes ' => __ ( '%1$s is <strong>attending</strong>. ' , 'semantic-linkbacks ' ),
201- 'rsvp:no ' => __ ( '%1$s is <strong>not attending</strong>. ' , 'semantic-linkbacks ' ),
202- 'rsvp:maybe ' => __ ( 'Maybe %1$s will be <strong>attending</strong>. ' , 'semantic-linkbacks ' ),
203- 'rsvp:invited ' => __ ( '%1$s is <strong>invited</strong>. ' , 'semantic-linkbacks ' ),
204- 'rsvp:tracking ' => __ ( '%1$s <strong>tracks</strong> this event. ' , 'semantic-linkbacks ' ),
192+ 'mention ' => __ ( '%1$s mentioned %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
193+
194+ 'reply ' => __ ( '%1$s replied to %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
195+ 'repost ' => __ ( '%1$s reposted %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
196+ 'like ' => __ ( '%1$s liked %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
197+ 'favorite ' => __ ( '%1$s favorited %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
198+ 'tag ' => __ ( '%1$s tagged %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
199+ 'bookmark ' => __ ( '%1$s bookmarked %2$s on <a href="%3$s">%4$s</a>. ' , 'semantic-linkbacks ' ),
200+ 'rsvp:yes ' => __ ( '%1$s is <strong>attending</strong>. ' , 'semantic-linkbacks ' ),
201+ 'rsvp:no ' => __ ( '%1$s is <strong>not attending</strong>. ' , 'semantic-linkbacks ' ),
202+ 'rsvp:maybe ' => __ ( 'Maybe %1$s will be <strong>attending</strong>. ' , 'semantic-linkbacks ' ),
203+ 'rsvp:invited ' => __ ( '%1$s is <strong>invited</strong>. ' , 'semantic-linkbacks ' ),
204+ 'rsvp:tracking ' => __ ( '%1$s <strong>tracks</strong> this event. ' , 'semantic-linkbacks ' ),
205205 );
206206
207207 return $ strings ;
@@ -215,19 +215,19 @@ public static function get_comment_type_excerpts() {
215215 public static function get_comment_type_strings () {
216216 $ strings = array (
217217 // Special case. any value that evals to false will be considered standard
218- 'mention ' => __ ( 'Mention ' , 'semantic-linkbacks ' ),
219-
220- 'reply ' => __ ( 'Reply ' , 'semantic-linkbacks ' ),
221- 'repost ' => __ ( 'Repost ' , 'semantic-linkbacks ' ),
222- 'like ' => __ ( 'Like ' , 'semantic-linkbacks ' ),
223- 'favorite ' => __ ( 'Favorite ' , 'semantic-linkbacks ' ),
224- 'tag ' => __ ( 'Tag ' , 'semantic-linkbacks ' ),
225- 'bookmark ' => __ ( 'Bookmark ' , 'semantic-linkbacks ' ),
226- 'rsvp:yes ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
227- 'rsvp:no ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
228- 'rsvp:invited ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
229- 'rsvp:maybe ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
230- 'rsvp:tracking ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
218+ 'mention ' => __ ( 'Mention ' , 'semantic-linkbacks ' ),
219+
220+ 'reply ' => __ ( 'Reply ' , 'semantic-linkbacks ' ),
221+ 'repost ' => __ ( 'Repost ' , 'semantic-linkbacks ' ),
222+ 'like ' => __ ( 'Like ' , 'semantic-linkbacks ' ),
223+ 'favorite ' => __ ( 'Favorite ' , 'semantic-linkbacks ' ),
224+ 'tag ' => __ ( 'Tag ' , 'semantic-linkbacks ' ),
225+ 'bookmark ' => __ ( 'Bookmark ' , 'semantic-linkbacks ' ),
226+ 'rsvp:yes ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
227+ 'rsvp:no ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
228+ 'rsvp:invited ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
229+ 'rsvp:maybe ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
230+ 'rsvp:tracking ' => __ ( 'RSVP ' , 'semantic-linkbacks ' ),
231231 );
232232
233233 return $ strings ;
@@ -241,17 +241,17 @@ public static function get_comment_type_strings() {
241241 public static function get_post_format_strings () {
242242 $ strings = array (
243243 // Special case. any value that evals to false will be considered standard
244- 'standard ' => __ ( 'this Article ' , 'semantic-linkbacks ' ),
245-
246- 'aside ' => __ ( 'this Aside ' , 'semantic-linkbacks ' ),
247- 'chat ' => __ ( 'this Chat ' , 'semantic-linkbacks ' ),
248- 'gallery ' => __ ( 'this Gallery ' , 'semantic-linkbacks ' ),
249- 'link ' => __ ( 'this Link ' , 'semantic-linkbacks ' ),
250- 'image ' => __ ( 'this Image ' , 'semantic-linkbacks ' ),
251- 'quote ' => __ ( 'this Quote ' , 'semantic-linkbacks ' ),
252- 'status ' => __ ( 'this Status ' , 'semantic-linkbacks ' ),
253- 'video ' => __ ( 'this Video ' , 'semantic-linkbacks ' ),
254- 'audio ' => __ ( 'this Audio ' , 'semantic-linkbacks ' ),
244+ 'standard ' => __ ( 'this Article ' , 'semantic-linkbacks ' ),
245+
246+ 'aside ' => __ ( 'this Aside ' , 'semantic-linkbacks ' ),
247+ 'chat ' => __ ( 'this Chat ' , 'semantic-linkbacks ' ),
248+ 'gallery ' => __ ( 'this Gallery ' , 'semantic-linkbacks ' ),
249+ 'link ' => __ ( 'this Link ' , 'semantic-linkbacks ' ),
250+ 'image ' => __ ( 'this Image ' , 'semantic-linkbacks ' ),
251+ 'quote ' => __ ( 'this Quote ' , 'semantic-linkbacks ' ),
252+ 'status ' => __ ( 'this Status ' , 'semantic-linkbacks ' ),
253+ 'video ' => __ ( 'this Video ' , 'semantic-linkbacks ' ),
254+ 'audio ' => __ ( 'this Audio ' , 'semantic-linkbacks ' ),
255255 );
256256
257257 return $ strings ;
@@ -353,7 +353,7 @@ public static function comment_text_add_cite( $text, $comment = null, $args = ar
353353 return $ text ;
354354 }
355355
356- $ url = self ::get_url ( $ comment );
356+ $ url = self ::get_url ( $ comment );
357357 $ host = parse_url ( $ url , PHP_URL_HOST );
358358
359359 // strip leading www, if any
@@ -410,7 +410,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
410410
411411 // get post type
412412 $ post_formatstrings = self ::get_post_format_strings ();
413- $ post_type = $ post_formatstrings [ $ post_format ];
413+ $ post_type = $ post_formatstrings [ $ post_format ];
414414
415415 $ post_type = apply_filters ( 'semantic_linkbacks_post_type ' , $ post_type , $ comment ->comment_post_ID );
416416
@@ -425,7 +425,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
425425 $ host = preg_replace ( '/^www\./ ' , '' , $ host );
426426
427427 // generate output. use full content if it's small enough, otherwise use excerpt.
428- $ text_len = mb_strlen (html_entity_decode ($ text , ENT_QUOTES ) );
428+ $ text_len = mb_strlen ( html_entity_decode ( $ text , ENT_QUOTES ) );
429429 if ( ! ( 'mention ' == $ semantic_linkbacks_type && $ text_len <= MAX_INLINE_MENTION_LENGTH ) ) {
430430 $ text = sprintf ( $ comment_type_excerpts [ $ semantic_linkbacks_type ], get_comment_author_link ( $ comment ->comment_ID ), $ post_type , $ url , $ host );
431431 }
@@ -483,9 +483,9 @@ public static function pre_get_avatar_data( $args, $id_or_email ) {
483483 $ args ['class ' ] = array ( 'u-photo ' );
484484 } else {
485485 $ args ['class ' ][] = 'u-photo ' ;
486- $ args ['class ' ] = array_unique ( $ args ['class ' ] );
486+ $ args ['class ' ] = array_unique ( $ args ['class ' ] );
487487 }
488- $ args ['url ' ] = $ avatar ;
488+ $ args ['url ' ] = $ avatar ;
489489 $ args ['class ' ][] = 'avatar-semantic-linkbacks ' ;
490490 }
491491
@@ -541,19 +541,19 @@ public static function comment_class( $classes, $class, $comment_id, $post_id )
541541
542542 // "comment type to class" mapper
543543 $ class_mapping = array (
544- 'mention ' => array ( 'h-as-mention ' ),
545-
546- 'reply ' => array ( 'h-as-reply ' ),
547- 'repost ' => array ( 'h-as-repost ' , 'p-repost ' ),
548- 'like ' => array ( 'h-as-like ' , 'p-like ' ),
549- 'favorite ' => array ( 'h-as-favorite ' , 'p-favorite ' ),
550- 'tag ' => array ( 'h-as-tag ' , 'p-tag ' ),
551- 'bookmark ' => array ( 'h-as-bookmark ' , 'p-bookmark ' ),
552- 'rsvp:yes ' => array ( 'h-as-rsvp ' ),
553- 'rsvp:no ' => array ( 'h-as-rsvp ' ),
554- 'rsvp:maybe ' => array ( 'h-as-rsvp ' ),
555- 'rsvp:invited ' => array ( 'h-as-rsvp ' ),
556- 'rsvp:tracking ' => array ( 'h-as-rsvp ' ),
544+ 'mention ' => array ( 'h-as-mention ' ),
545+
546+ 'reply ' => array ( 'h-as-reply ' ),
547+ 'repost ' => array ( 'h-as-repost ' , 'p-repost ' ),
548+ 'like ' => array ( 'h-as-like ' , 'p-like ' ),
549+ 'favorite ' => array ( 'h-as-favorite ' , 'p-favorite ' ),
550+ 'tag ' => array ( 'h-as-tag ' , 'p-tag ' ),
551+ 'bookmark ' => array ( 'h-as-bookmark ' , 'p-bookmark ' ),
552+ 'rsvp:yes ' => array ( 'h-as-rsvp ' ),
553+ 'rsvp:no ' => array ( 'h-as-rsvp ' ),
554+ 'rsvp:maybe ' => array ( 'h-as-rsvp ' ),
555+ 'rsvp:invited ' => array ( 'h-as-rsvp ' ),
556+ 'rsvp:tracking ' => array ( 'h-as-rsvp ' ),
557557 );
558558
559559 $ semantic_linkbacks_type = self ::get_type ( $ comment );
0 commit comments