Skip to content

Commit

Permalink
Merge pull request #7 from over-engineer/next
Browse files Browse the repository at this point in the history
1.1.1 - Add ko-fi donation link to readme.txt and settings page
  • Loading branch information
over-engineer authored Apr 15, 2023
2 parents 509f2a9 + e28566c commit 41fd42f
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 5 deletions.
Binary file modified .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# Link Verification for Mastodon

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/over-engineer/link-verification-for-mastodon/deploy-to-plugin-repository)](https://github.com/over-engineer/link-verification-for-mastodon/actions/workflows/deploy.yml)
[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/link-verification-for-mastodon)](https://wordpress.org/plugins/link-verification-for-mastodon/)
[![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/link-verification-for-mastodon)](https://wordpress.org/plugins/link-verification-for-mastodon/)
[![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/stars/link-verification-for-mastodon)](https://wordpress.org/plugins/link-verification-for-mastodon/)
Expand Down
74 changes: 74 additions & 0 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace OverEngineer\Mastodon\LinkVerification\Admin;

use const OverEngineer\Mastodon\LinkVerification\VERSION;

if ( ! defined( 'ABSPATH' ) ) {
die( 'Forbidden' );
}
Expand Down Expand Up @@ -115,5 +117,77 @@ function options_page() {
<?php
}

/**
* Check if the current page is the plugin settings page.
*
* @return bool
*/
function is_plugin_settings_page() {
if ( ! is_admin() ) {
return false;
}

$screen = get_current_screen();

if ( empty( $screen ) ) {
return false;
}

return $screen->id === 'settings_page_link-verification-for-mastodon';
}

/**
* Add a donation link to the left side of the admin footer.
*
* @param string $text The existing footer text.
*
* @return string The modified footer text including the donation link.
*/
function admin_footer_donation( $text ) {
if ( ! is_plugin_settings_page() ) {
return $text;
}

return sprintf(
'<span id="overengineer-link-verification-footer">%s</span>',
sprintf(
/* translators: 1: Developer username, 2: Donation link. */
__( 'Developed with ❤️ by %1$s | Want to support me? %2$s', 'link-verification-for-mastodon' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( 'https://fosstodon.org/@overengineer' ),
esc_html( '@overengineer' )
),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( 'https://ko-fi.com/overengineer' ),
esc_html__( 'Buy me a coffee ☕', 'link-verification-for-mastodon' )
)
)
);
}

/**
* Add plugin version to the right side of the admin footer.
*
* @param string $content The existing content.
*
* @return string The modified content including the plugin version.
*/
function admin_footer_version( $content ) {
if ( ! is_plugin_settings_page() ) {
return $content;
}

return sprintf(
/* translators: Plugin version. */
__( 'Version %s', 'link-verification-for-mastodon' ),
esc_html( VERSION )
);
}

add_action( 'admin_menu', 'OverEngineer\Mastodon\LinkVerification\Admin\add_admin_menu' );
add_action( 'admin_init', 'OverEngineer\Mastodon\LinkVerification\Admin\settings_init' );

add_filter( 'admin_footer_text', 'OverEngineer\Mastodon\LinkVerification\Admin\admin_footer_donation' );
add_filter( 'update_footer', 'OverEngineer\Mastodon\LinkVerification\Admin\admin_footer_version', 11 );
4 changes: 2 additions & 2 deletions link-verification-for-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Link Verification for Mastodon
* Plugin URI: https://over-engineer.com/projects/link-verification-for-mastodon
* Description: A WordPress plugin to quickly verify a link on your Mastodon profile.
* Version: 1.1.0
* Version: 1.1.1
* Author: overengineer
* Author URI: https://over-engineer.com/
* Text Domain: link-verification-for-mastodon
Expand Down Expand Up @@ -48,7 +48,7 @@ final class Plugin {
/**
* @var string Plugin version number.
*/
private $version = '1.1.0';
private $version = '1.1.1';

/**
* @return void
Expand Down
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Plugin URI: https://over-engineer.com/projects/link-verification-for-mastodon
Contributors: overengineer
Tags: mastodon, fediverse, social
Requires at least: 4.4
Tested up to: 6.1
Tested up to: 6.2
Requires PHP: 5.6.20
Stable Tag: 1.1.0
Stable Tag: 1.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -54,12 +54,20 @@ Yes, you can. Just enter all usernames separated by a comma.

If you have spotted any bugs, or would like to request additional features from the plugin, please [file an issue](https://github.com/over-engineer/link-verification-for-mastodon/issues).

= How can I support the developer of this plugin? =

Supporting me is 100% optional. The plugin is free and will always be free. However, if you’d like to support me, it would mean the world to me and help me to keep creating useful plugins. If you’d like to contribute, please consider [buying me a coffee](https://ko-fi.com/overengineer)! ❤️

== Screenshots ==

1. Plugin settings

== Changelog ==

= 1.1.1: April 15, 2023 =

* Add donation link to readme.txt and the plugin’s settings page

= 1.1.0: February 26, 2023 =

* Add support for multiple Mastodon usernames
Expand Down

0 comments on commit 41fd42f

Please sign in to comment.