3bb8217690
- Fixed featured image upload and handling - Added detailed debug logging - Cleaned up fallback image functionality - Updated README.md with new MIT license - Added .gitignore file - Fixed image reposting functionality - Improved error handling and logging - Added proper WordPress coding standards
64 lines
3.3 KiB
PHP
64 lines
3.3 KiB
PHP
<div class="bluesky-post-status">
|
|
<?php wp_nonce_field('bluesky_post_meta_box', 'bluesky_post_meta_box_nonce'); ?>
|
|
<?php if (!empty($status)): ?>
|
|
<p>
|
|
<strong><?php esc_html_e('Status:', 'bluesky-connctor'); ?></strong>
|
|
<?php
|
|
switch ($status) {
|
|
case 'success':
|
|
echo '<span class="bluesky-status-success">' . esc_html__('Posted', 'bluesky-connctor') . '</span>';
|
|
break;
|
|
case 'error':
|
|
echo '<span class="bluesky-status-error">' . esc_html__('Error', 'bluesky-connctor') . '</span>';
|
|
break;
|
|
case 'pending':
|
|
echo '<span class="bluesky-status-pending">' . esc_html__('Publishing...', 'bluesky-connctor') . '</span>';
|
|
break;
|
|
default:
|
|
echo '<span class="bluesky-status-unknown">' . esc_html__('Not Posted', 'bluesky-connctor') . '</span>';
|
|
}
|
|
?>
|
|
</p>
|
|
<?php if ($posted_date): ?>
|
|
<p>
|
|
<strong><?php esc_html_e('Posted:', 'bluesky-connctor'); ?></strong>
|
|
<?php echo esc_html(date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($posted_date))); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
<?php if ($post_id): ?>
|
|
<p>
|
|
<strong><?php esc_html_e('Bluesky Post:', 'bluesky-connctor'); ?></strong>
|
|
<a href="https://bsky.app/profile/<?php echo esc_attr(get_option('bluesky_identifier')); ?>/post/<?php echo esc_attr($post_id); ?>"
|
|
target="_blank" rel="noopener noreferrer">
|
|
<?php esc_html_e('View Post', 'bluesky-connctor'); ?> ↗
|
|
</a>
|
|
</p>
|
|
<?php endif; ?>
|
|
<?php if ($error): ?>
|
|
<p class="bluesky-error-message">
|
|
<strong><?php esc_html_e('Error:', 'bluesky-connctor'); ?></strong>
|
|
<?php echo esc_html($error); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
<div class="bluesky-actions">
|
|
<?php if ($status === 'error' || !$post_id): ?>
|
|
<button type="button" class="button bluesky-retry-post" data-post-id="<?php echo esc_attr($post->ID); ?>"
|
|
data-nonce="<?php echo esc_attr(wp_create_nonce('bluesky_retry_post')); ?>">
|
|
<?php esc_html_e('Retry Post', 'bluesky-connctor'); ?>
|
|
</button>
|
|
<?php else: ?>
|
|
<button type="button" class="button bluesky-repost" data-post-id="<?php echo esc_attr($post->ID); ?>"
|
|
data-nonce="<?php echo esc_attr(wp_create_nonce('bluesky_repost')); ?>">
|
|
<?php esc_html_e('Post Again', 'bluesky-connctor'); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php else: ?>
|
|
<p><?php esc_html_e('This post has not been shared to Bluesky.', 'bluesky-connctor'); ?></p>
|
|
<button type="button" class="button button-primary bluesky-share-post"
|
|
data-post-id="<?php echo esc_attr($post->ID); ?>"
|
|
data-nonce="<?php echo esc_attr(wp_create_nonce('bluesky_share_post')); ?>">
|
|
<?php esc_html_e('Share to Bluesky', 'bluesky-connctor'); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
</div>
|