Skip to content

Commit

Permalink
Clean up on setup and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Jan 9, 2024
1 parent 9063a6e commit c0b4775
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ label[for="wpt_license_key"] {
font-size: 1.1em;
}

#wpt_settings_page .wpt-has-link {
display: flex;
align-items: center;
gap: 12px;
}

#wpt_settings_page .tabs li {
display: inline;
margin: 0 auto;
Expand Down
8 changes: 5 additions & 3 deletions src/wp-to-twitter-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,18 @@ function wtt_connect_mastodon( $auth = false ) {

$submit = ( ! $auth ) ? '<p class="submit"><input type="submit" name="submit" class="button-primary" value="' . __( 'Connect to Mastodon', 'wp-to-twitter' ) . '" /></p>' : '';
print( '
<h3><span>' . __( 'Connect to Mastodon', 'wp-to-twitter' ) . '</span></h3>
<h3 class="wpt-has-link"><span>' . __( 'Connect to Mastodon', 'wp-to-twitter' ) . '</span> <a href="https://xposterpro.com/connecting-xposter-and-mastodon/" class="button button-secondary">' . __( 'Instructions', 'wp-to-twitter' ) . '</a></h3>
<div class="inside ' . $class . '">
<ol class="wpt-oauth-settings">
<li>' . __( 'Navigate to Preferences > Settings > Development in your Mastodon account.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Click on "New application".', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Name your application.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Add your website URL', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Add the API Scopes for your application. Minimum required permissions are "write:statuses" and "write:media".', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Add the API Scopes for your application. Required permissions are <code>read</code>, <code>write:statuses</code> and <code>write:media</code>.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Submit your application.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Select your application from the list.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Select your application from the list of Your Applications.', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Copy your Access Token', 'wp-to-twitter' ) . '</li>
<li>' . __( 'Add your Mastodon server URL', 'wp-to-twitter' ) . '</li>
' . $form . '
<div class="tokens">
<p>
Expand Down
4 changes: 2 additions & 2 deletions src/wp-to-twitter-oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function wtt_connect_oauth( $auth = false ) {

$submit = ( ! $auth ) ? '<p class="submit"><input type="submit" name="submit" class="button-primary" value="' . __( 'Connect to X.com', 'wp-to-twitter' ) . '" /></p>' : '';
print( '
<h3><span>' . __( 'Connect to X.com', 'wp-to-twitter' ) . '</span></h3>
<h3 class="wpt-has-link"><span>' . __( 'Connect to X.com', 'wp-to-twitter' ) . '</span> <a href="https://xposterpro.com/connecting-xposter-and-x-com/" class="button button-secondary">' . __( 'Instructions', 'wp-to-twitter' ) . '</a></h3>
<div class="inside ' . $class . '">
<ol class="wpt-oauth-settings">
<li>' . __( 'Apply for a <a href="https://developer.twitter.com/en/apply-for-access">Developer Account with X.com</a>', 'wp-to-twitter' ) . '<ul>
Expand All @@ -333,7 +333,7 @@ function wtt_connect_oauth( $auth = false ) {
</ul></li>
<li>' . __( 'Add a new application in <a href="https://developer.twitter.com/en/portal/apps/new">X.com\'s project and app portal</a>', 'wp-to-twitter' ) . '
<ul>
<li>' . __( 'Name your application.', 'wp-to-twitter' ) . '(' . __( 'Your app name cannot include the word "Twitter."', 'wp-to-twitter' ) . ')</li>
<li>' . __( 'Name your application.', 'wp-to-twitter' ) . ' (' . __( 'Your app name cannot include the word "Twitter."', 'wp-to-twitter' ) . ')</li>
<li>' . __( 'Click "Next" to move to the Keys & Tokens step.', 'wp-to-twitter' ) . '</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/wpt-post-to-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function wpt_mastodon_connection( $auth = false, $verify = false ) {
}
}
$mastodon = false;
if ( '' !== $token && '' !== $instance ) {
if ( $token && $instance ) {
$mastodon = new Wpt_Mastodon_Api( $token, $instance );
if ( $verify ) {
$verify = $mastodon->verify();
Expand Down

0 comments on commit c0b4775

Please sign in to comment.