' );
\defined( 'ACTIVITYPUB_CUSTOM_POST_CONTENT' ) || \define( 'ACTIVITYPUB_CUSTOM_POST_CONTENT', "%title%
\n\n%content%\n\n%hashtags%
\n\n%shortlink%
" );
-
- \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
+ \define( 'ACTIVITYPUB_PLUGIN', __FILE__ );
+ \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
\define( 'ACTIVITYPUB_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) );
diff --git a/includes/class-admin.php b/includes/class-admin.php
index bf54a66..2dadd9b 100644
--- a/includes/class-admin.php
+++ b/includes/class-admin.php
@@ -232,8 +232,8 @@ class Admin {
wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), '1.0.0' );
wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false );
}
-
- if ( 'edit-comments.php' === $hook_suffix || 'tools_page_activitypub_tools' === $hook_suffix ) {
+
+ if ( 'edit-comments.php' === $hook_suffix || 'tools_page_activitypub_tools' === $hook_suffix ) {
\wp_enqueue_script(
'activitypub_actions',
\plugin_dir_url( ACTIVITYPUB_PLUGIN ) . '/assets/js/activitypub.js',
diff --git a/includes/functions.php b/includes/functions.php
index 3e357a6..8fa21c6 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -373,7 +373,7 @@ function url_to_authorid( $url ) {
* @return int post_id
*/
function url_to_postid( $in_replyto_url ) {
- if ( !empty( $in_replyto_url ) ) {
+ if ( ! empty( $in_replyto_url ) ) {
$tentative_postid = \url_to_postid( $in_replyto_url );
if ( is_null( $tentative_postid ) ) {
$post_types = \get_option( 'activitypub_support_post_types', array( 'post', 'page' ) );
@@ -431,7 +431,7 @@ function url_to_commentid( $in_replyto_url ) {
'type' => 'activitypub',
'meta_query' => array(
array(
- 'key' => 'source_url', //$object['object']['id']
+ 'key' => 'source_url', // $object['object']['id']
'value' => $in_replyto_url,
),
),
diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php
index 470744b..ec37784 100644
--- a/includes/rest/class-inbox.php
+++ b/includes/rest/class-inbox.php
@@ -490,9 +490,9 @@ class Inbox {
//found a local comment id
$commentdata = \get_comment( $object_comment_id, ARRAY_A );
- $commentdata['comment_author'] = \esc_attr( $meta['name'] ? $meta['name'] : $meta['preferredUsername'] );
+ $commentdata['comment_author'] = \esc_attr( $meta['name'] ? $meta['name'] : $meta['preferredUsername'] );
$commentdata['comment_content'] = \wp_filter_kses( $object['object']['content'] );
- $commentdata['comment_meta']['avatar_url'] = \esc_url_raw($meta['icon']['url']);
+ $commentdata['comment_meta']['avatar_url'] = \esc_url_raw( $meta['icon']['url'] );
$commentdata['comment_meta']['ap_published'] = \wp_date( 'Y-m-d H:i:s', strtotime( $object['object']['published'] ) );
$commentdata['comment_meta']['ap_last_modified'] = $object['object']['updated'];
$commentdata['comment_meta']['ap_object'] = \serialize( $object );
diff --git a/includes/table/migrate-list.php b/includes/table/migrate-list.php
index bf9fea6..701aaa1 100644
--- a/includes/table/migrate-list.php
+++ b/includes/table/migrate-list.php
@@ -40,21 +40,13 @@ class Migrate_List extends \WP_List_Table {
$post_status_var = get_query_var( 'comments' );
$view_count = count( $view_slugs );
for ( $x = 0; $x < $view_count; $x++ ) {
- $class = ( $post_status_var == $view_slugs[ $x ][1] ) ? ' class="current"' : '';
+ $class = ( $post_status_var === $view_slugs[ $x ][1] ) ? ' class="current"' : '';
$post_status_temp = $view_slugs[ $x ][1];
- if ( $post_status_temp != '' ) {
+ if ( ! empty( $post_status_temp ) ) {
$post_status_temp = '&comments=' . $view_slugs[ $x ][1];
}
$views[ $view_slugs[ $x ][0] ] = sprintf(
- __(
- '' .
- $view_slugs[ $x ][2] .
- ' (%d)'
- ),
+ '' . $view_slugs[ $x ][2] . ' (%s)',
$view_slugs[ $x ][3]
);
}
@@ -137,7 +129,7 @@ class Migrate_List extends \WP_List_Table {
public function single_row( $item ) {
$inline_styles = ( $item['comments'] > 0 ) ? 'warning' : ''; ?>
- single_row_columns( $item ); ?>
+ single_row_columns( $item ); ?>