Skip to content

Commit

Permalink
Rework admin setting page to inform about shortcodes and plugin info
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreycrofte committed Jan 13, 2025
1 parent 43449ee commit 63c30d6
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 48 deletions.
39 changes: 38 additions & 1 deletion assets/css/bluesky-social.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,36 @@
width: 100%;
}

.bluesky-social-integration-admin {
.bluesky-social-integration-admin .container {
--gap: 16px;
display: flex;
flex-wrap: wrap;
gap: var(--gap);
}

.bluesky-social-integration-admin .postbox {
box-sizing: content-box;
padding: 0 var(--gap);
flex-basis: calc(40% - (var(--gap) * 3));
}

.bluesky-social-integration-admin .postbox:first-child {
flex-basis: calc(60% - (var(--gap) * 3));
}

.bluesky-social-integration-admin .postbox .submit {
margin-bottom: 0;
}

@media screen and (max-width: 720px) {
.bluesky-social-integration-admin .postbox.postbox {
flex-basis: 100%;
}
}

.bluesky-social-integration-admin h1 {
font-weight: bold;
margin: 1em 0;
}

.bluesky-social-integration-admin .cache-duration-fields label {
Expand Down Expand Up @@ -50,3 +78,12 @@
.bluesky-social-integration-admin ul ul {
list-style: circle;
}

.bluesky-social-integration-admin .postbox hr {
margin: 2.5em auto 1.5em;
}

.bluesky-social-integration-admin .button {
font-size: 14px;
padding: 4px 16px;
}
105 changes: 65 additions & 40 deletions classes/BlueSky_Plugin_Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,46 +414,71 @@ private function format_time_remaining( $seconds ) {
*/
public function render_settings_page() {
?>
<div class="wrap bluesky-social-integration-admin">
<div class="bluesky-social-integration-options postbox ">
<h1><?php echo esc_html__('Social Integration for BlueSky', 'social-integration-for-bluesky' ); ?></h1>
<form method="post" action="options.php">
<?php
settings_fields('bluesky_settings_group');
do_settings_sections( BLUESKY_PLUGIN_SETTING_PAGENAME );
submit_button();
?>
</form>
</div>

<div class="bluesky-social-integration-shortcodes postbox">
<h2><?php echo esc_html__('About the shortcodes', 'social-integration-for-bluesky'); ?></h2>
<?php // translators: %1$s is the the bluesky profile shortcode, %2$s is the bluesky last posts shortcode. ?>
<p><?php echo sprintf( esc_html__('You can use the following shortcodes to display your BlueSky profile and posts: %1$s and %2$s.', 'social-integration-for-bluesky'), '<code>[bluesky_profile]</code>', '<code>[bluesky_last_posts]</code>'); ?></p>
<ul>
<li>
<?php echo esc_html__('The profile shortcode will display your BlueSky profile card. It uses the following attributes:', 'social-integration-for-bluesky'); ?>
<br>
<ul>
<li><code>displayBanner</code> - <?php echo esc_html__('Whether to display the profile banner. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayAvatar</code> - <?php echo esc_html__('Whether to display the profile avatar. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayCounters</code> - <?php echo esc_html__('Whether to display follower/following counts. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayBio</code> - <?php echo esc_html__('Whether to display the profile bio. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>theme</code> - <?php echo esc_html__('The theme to use for displaying the profile. Options are "light", "dark", and "system". Default is "system".', 'social-integration-for-bluesky'); ?></li>
<li><code>className</code> - <?php echo esc_html__('Additional CSS class to apply to the profile card.', 'social-integration-for-bluesky'); ?></li>
</ul>
</li>
<li>
<?php echo esc_html__('The last posts shortcode will display your last posts feed. It uses the following attributes:', 'social-integration-for-bluesky'); ?>
<br>
<ul>
<li><code>number</code> - <?php echo esc_html__('The number of posts to display. Default is 5.', 'social-integration-for-bluesky'); ?></li>
<li><code>theme</code> - <?php echo esc_html__('The theme to use for displaying the posts. Options are "light", "dark", and "system". Default is "system".', 'social-integration-for-bluesky'); ?></li>
<li><code>displayEmbeds</code> - <?php echo esc_html__('Whether to display embedded media in the posts. Default is true.', 'social-integration-for-bluesky'); ?></li>
</ul>
</li>
</ul>
<p><?php echo esc_html__('You can also use the Gutenberg blocks to display the profile card and posts feed.', 'social-integration-for-bluesky'); ?></p>
<div class="wrap bluesky-social-integration-admin">
<h1><?php echo esc_html__('Social Integration for BlueSky', 'social-integration-for-bluesky' ); ?></h1>

<div class="container">
<div class="bluesky-social-integration-options postbox">
<div class="inside">
<div class="main">
<form method="post" action="options.php">
<?php
settings_fields('bluesky_settings_group');
do_settings_sections( BLUESKY_PLUGIN_SETTING_PAGENAME );
submit_button();
?>
</form>
</div>
</div>
</div>

<div class="bluesky-social-integration-shortcodes postbox">
<div class="inside">
<div class="main">
<h2><?php echo esc_html__('About the shortcodes', 'social-integration-for-bluesky'); ?></h2>
<?php // translators: %1$s is the the bluesky profile shortcode, %2$s is the bluesky last posts shortcode. ?>
<p><?php echo sprintf( esc_html__('You can use the following shortcodes to display your BlueSky profile and posts: %1$s and %2$s.', 'social-integration-for-bluesky'), '<code>[bluesky_profile]</code>', '<code>[bluesky_last_posts]</code>'); ?></p>
<ul>
<li>
<?php echo esc_html__('The profile shortcode will display your BlueSky profile card. It uses the following attributes:', 'social-integration-for-bluesky'); ?>
<br>
<ul>
<li><code>displayBanner</code> - <?php echo esc_html__('Whether to display the profile banner. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayAvatar</code> - <?php echo esc_html__('Whether to display the profile avatar. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayCounters</code> - <?php echo esc_html__('Whether to display follower/following counts. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>displayBio</code> - <?php echo esc_html__('Whether to display the profile bio. Default is true.', 'social-integration-for-bluesky'); ?></li>
<li><code>theme</code> - <?php echo esc_html__('The theme to use for displaying the profile. Options are "light", "dark", and "system". Default is "system".', 'social-integration-for-bluesky'); ?></li>
<li><code>className</code> - <?php echo esc_html__('Additional CSS class to apply to the profile card.', 'social-integration-for-bluesky'); ?></li>
</ul>
</li>
<li>
<?php echo esc_html__('The last posts shortcode will display your last posts feed. It uses the following attributes:', 'social-integration-for-bluesky'); ?>
<br>
<ul>
<li><code>number</code> - <?php echo esc_html__('The number of posts to display. Default is 5.', 'social-integration-for-bluesky'); ?></li>
<li><code>theme</code> - <?php echo esc_html__('The theme to use for displaying the posts. Options are "light", "dark", and "system". Default is "system".', 'social-integration-for-bluesky'); ?></li>
<li><code>displayEmbeds</code> - <?php echo esc_html__('Whether to display embedded media in the posts. Default is true.', 'social-integration-for-bluesky'); ?></li>
</ul>
</li>
</ul>
<p><?php echo esc_html__('You can also use the Gutenberg blocks to display the profile card and posts feed.', 'social-integration-for-bluesky'); ?></p>

<hr>

<h2><?php echo esc_html__('About this plugin', 'social-integration-for-bluesky'); ?></h2>
<?php // translators: %s is the name of the developer. ?>
<p><?php echo sprintf( esc_html__( 'This plugin is written by %s.', 'social-integration-for-bluesky'), '<a href="https://geoffreycrofte.com" target="_blank"><strong>Geoffrey Crofte</strong></a>' ); ?><br><?php echo esc_html__( 'This extension is not an official BlueSky plugin.', 'social-integration-for-bluesky') ?></p>

<?php // translators: %1$s is the link opening tag, %2$s closing link tag. ?>
<p><?php echo sprintf( esc_html__( 'Need help with something? Have a suggestion? %1$sAsk away%2$s.', 'social-integration-for-bluesky'), '<a href="https://wordpress.org/support/plugin/social-integration-for-bluesky/#new-topic-0" target="_blank">', '</a>' ); ?></p>

<?php $title = __('Rate this plugin on WordPress.org', 'social-integration-for-bluesky') ?>

<?php // translators: %1$s is the link opening tag, %2$s closing link tag. ?>
<p><?php echo sprintf( esc_html__( 'Want to support the plugin? %1$sGive a review%2$s', 'social-integration-for-bluesky'), '<a href="https://wordpress.org/support/plugin/social-integration-for-bluesky/reviews/" target="_blank" title="' . esc_attr( $title ) . '">', ' ⭐️⭐️⭐️⭐️⭐️</a>' ); ?></p>
</div>
</div>
</div>
</div>
</div>
<?php
Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: BlueSky, Syndicate, Profile, Feed
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.0.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -102,14 +102,14 @@ No it is not, but it is under evaluation of BlueSky's Team to take part of the d

== Changelog ==

= 1.0.1 =
Adds the proper information about the shortcodes in the setting page, the plugin description and the mini-description.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.1 =
Adds the proper information about the shortcodes in the setting page, the plugin description and the mini-description.

= 1.0.0 =
Initial release. Please backup your site before installing.

Expand Down
6 changes: 3 additions & 3 deletions social-integration-for-bluesky.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
Plugin Name: Social Integration for BlueSky
Description: Integrates BlueSky social features into WordPress including: Post New Articles on BlueSky for you, Shortcode for Profile Card, and Widget to display your last posts.
Version: 1.0.0
Description: Integrates BlueSky social features into WordPress including: Post New Articles on BlueSky for you, Shortcode for Profile Card, and Widget to display your last posts. You can also use shortcodes <code>[bluesky_profile]</code> and <code>[bluesky_last_posts]</code>.
Version: 1.0.1
Requires at least: 5.0
Requires PHP: 7.4
Author: Geoffrey Crofte
Expand All @@ -18,7 +18,7 @@
exit;
}

define( 'BLUESKY_PLUGIN_VERSION', '1.0.0' );
define( 'BLUESKY_PLUGIN_VERSION', '1.0.1' );
define( 'BLUESKY_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'BLUESKY_PLUGIN_FOLDER', plugin_dir_url( __FILE__ ) );
define( 'BLUESKY_PLUGIN_DIRECTORY_NAME', dirname( plugin_basename( __FILE__ ) ) );
Expand Down

0 comments on commit 63c30d6

Please sign in to comment.