diff --git a/fediembedi-pixelfed-widget.php b/fediembedi-pixelfed-widget.php index 7ee8037..be88df9 100644 --- a/fediembedi-pixelfed-widget.php +++ b/fediembedi-pixelfed-widget.php @@ -33,6 +33,9 @@ class FediEmbedi_Pixelfed extends WP_Widget { $access_token = get_option('fediembedi-pixelfed-token'); $client = new \FediClient($instance_url, $access_token); $cred = $client->verify_credentials($access_token); + if (!$cred){ + return; + } //widget options $show_header = (!empty($instance['show_header'])) ? $instance['show_header'] : ''; @@ -51,6 +54,7 @@ class FediEmbedi_Pixelfed extends WP_Widget { }; $status = $client->getStatus($only_media, $pinned, $exclude_replies, null, null, null, $number, $exclude_reblogs); + $account = $status[0]->account; include(plugin_dir_path(__FILE__) . 'templates/pixelfed.tpl.php' ); echo $args['after_widget']; diff --git a/fediembedi-settings-form.tpl.php b/fediembedi-settings-form.tpl.php index afc59eb..abdcdaa 100644 --- a/fediembedi-settings-form.tpl.php +++ b/fediembedi-settings-form.tpl.php @@ -12,7 +12,7 @@ define("FEDI_PXLFD_CONNECTED",isset($pixelfed_account) && $pixelfed_account !==
">

- +

Visit joinmastodon.org to find an instance.

@@ -39,7 +39,7 @@ define("FEDI_PXLFD_CONNECTED",isset($pixelfed_account) && $pixelfed_account !==
">

- +

Visit pixelfed.org/join to find an instance.

diff --git a/templates/pixelfed.tpl.php b/templates/pixelfed.tpl.php index 59c31dc..0ac3cbb 100644 --- a/templates/pixelfed.tpl.php +++ b/templates/pixelfed.tpl.php @@ -5,8 +5,8 @@
- - account->username; ?> + + username; ?>
@@ -17,20 +17,20 @@
-

account->statuses_count; ?>

+

statuses_count; ?>

-

account->followers_count; ?>

+

followers_count; ?>

-

account->following_count; ?>

+

following_count; ?>

- +