Skip to content

Commit

Permalink
feat: release 5.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Kobzarev committed Jun 2, 2024
1 parent eaf9a44 commit 26f9863
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 93 deletions.
134 changes: 44 additions & 90 deletions admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,15 @@ public function register_setting(): void {
add_settings_field(
$this->options_prefix . 'include',
__( 'Include', $this->plugin_name ),
[ $this, 'include_cb' ],
[ $this, 'textarea_cb' ],
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'settings_include_exclude_section',
''
[
'name' => $this->options_prefix . 'inclusion_list',
'id' => $this->options_prefix . 'inclusion_list',
'value' => $this->options->inclusion_list,
'description' => __( 'Enter URLs you wish to be masked. One URL per line. All other URLs will be ignored.', $this->plugin_name ),
]
);

register_setting(
Expand All @@ -995,22 +1000,55 @@ public function register_setting(): void {
add_settings_field(
$this->options_prefix . 'exclude',
__( 'Exclude', $this->plugin_name ),
[ $this, 'exclude_cb' ],
[ $this, 'textarea_cb' ],
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'settings_include_exclude_section',
''
[
'name' => $this->options_prefix . 'exclusion_list',
'id' => $this->options_prefix . 'exclusion_list',
'value' => $this->options->exclusion_list,
'description' => __( 'Enter URLs you wish to exclude from being masked. One URL per line. Javascript, Magnet, Mailto, Skype and Tel links are all excluded by default. To exclude a full protocol, just add a line for that prefix - for example, "ftp://".', $this->plugin_name ),
]
);

register_setting(
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'exclusion_list'
);

add_settings_field(
$this->options_prefix . 'skip_auth',
'',
[ $this, 'checkbox_cb' ],
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'settings_include_exclude_section',
[
'name' => $this->options_prefix . 'skip_auth',
'id' => $this->options_prefix . 'skip_auth',
'value' => $this->options->skip_auth,
'title' => __( 'Do Not Mask Links When User Logged In (may conflict with caching plugins)', $this->plugin_name ),
]
);

register_setting(
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'skip_auth'
);

add_settings_field(
$this->options_prefix . 'skip_follow',
'',
[ $this, 'checkbox_cb' ],
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'settings_include_exclude_section',
[
'name' => $this->options_prefix . 'skip_follow',
'id' => $this->options_prefix . 'skip_follow',
'value' => $this->options->skip_follow,
'title' => __( 'Do Not Mask Follow Links', $this->plugin_name ),
]
);

register_setting(
$this->plugin_name . '-settings-include-exclude',
$this->options_prefix . 'skip_follow'
Expand Down Expand Up @@ -1348,9 +1386,9 @@ public function textarea_cb( $data ): void {
<textarea
name="<?php echo esc_attr( $data['name'] ); ?>"
id="<?php echo esc_attr( $data['id'] ); ?>"
cols="50"
cols="<?php echo esc_attr( $data['cols'] ?? 50 ); ?>"
class="large-text"
rows="10"><?php echo esc_textarea( $data['value'] ); ?></textarea>
rows="<?php echo esc_attr( $data['rows'] ?? 10 ); ?>"><?php echo esc_textarea( $data['value'] ); ?></textarea>
<?php if ( ! empty( $data['description'] ) ) : ?>
<p class="description">
<?php echo wp_kses_post( $data['description'] ); ?>
Expand Down Expand Up @@ -2014,90 +2052,6 @@ public function plugins_cb(): void {
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}

/**
* Render the inclusion settings section.
*
* @since 4.2.0
*/
public function include_cb(): void {
?>
<fieldset>
<label for="<?php echo esc_attr( $this->options_prefix . 'inclusion_list' ); ?>">
<?php
esc_html_e(
'Enter URLs you wish to be masked. One URL per line. All other URLs will be ignored.',
$this->plugin_name
);
?>
</label>
<br>
<label>
<textarea
class="large-text code" rows="10" cols="50"
name="<?php echo esc_attr( $this->options_prefix . 'inclusion_list' ); ?>"
id="<?php echo esc_attr( $this->options_prefix . 'inclusion_list' ); ?>">
<?php echo esc_attr( $this->options->inclusion_list ); ?>
</textarea>
</label>
</fieldset>
<?php
}

/**
* Render the exclusion settings section.
*
* @since 4.0.0
*/
public function exclude_cb(): void {
?>
<fieldset>
<label for="<?php echo esc_attr( $this->options_prefix . 'exclusion_list' ); ?>">
<?php
esc_html_e(
'Enter URLs you wish to exclude from being masked. One URL per line.
Javascript, Magnet, Mailto, Skype and Tel links are all excluded by default.
To exclude a full protocol, just add a line for that prefix - for example,
"ftp://".',
$this->plugin_name
);
?>
</label>
<br>
<label>
<textarea
class="large-text code" rows="10" cols="50"
name="<?php echo esc_attr( $this->options_prefix . 'exclusion_list' ); ?>"
id="<?php echo esc_attr( $this->options_prefix . 'exclusion_list' ); ?>">
<?php echo esc_attr( $this->options->exclusion_list ); ?>
</textarea>
</label>
<br>
<label>
<input
type="checkbox"
name="<?php echo esc_attr( $this->options_prefix . 'skip_follow' ); ?>"
id="<?php echo esc_attr( $this->options_prefix . 'skip_follow' ); ?>"
value="1"
<?php checked( $this->options->skip_follow ); ?> />
<?php esc_html_e( 'Do Not Mask Follow Links', $this->plugin_name ); ?>
</label>
<br>
<label>
<input
type="checkbox"
name="<?php echo esc_attr( $this->options_prefix . 'skip_auth' ); ?>"
id="<?php echo esc_attr( $this->options_prefix . 'skip_auth' ); ?>"
value="1"
<?php checked( $this->options->skip_auth ); ?> />
<?php esc_html_e( 'Do Not Mask Links When User Logged In', $this->plugin_name ); ?>
</label>
<p class="description">
<?php esc_html_e( 'May conflict with caching plugins.', $this->plugin_name ); ?>
</p>
</fieldset>
<?php
}

/**
* Render the SEO hide settings section.
*
Expand Down
4 changes: 2 additions & 2 deletions mihdan-no-external-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: No External Links
* Plugin URI: https://wordpress.org/plugins/mihdan-no-external-links/
* Description: Convert external links into internal links, site wide or post/page specific. Add NoFollow, Click logging, and more...
* Version: 5.1.3
* Version: 5.1.4
* Author: Mikhail Kobzarev
* Author URI: https://www.kobzarev.com/
* License: GPL-2.0+
Expand All @@ -28,7 +28,7 @@
}

const MIHDAN_NO_EXTERNAL_LINKS_DIR = __DIR__;
const MIHDAN_NO_EXTERNAL_LINKS_VERSION = '5.1.3';
const MIHDAN_NO_EXTERNAL_LINKS_VERSION = '5.1.4';
const MIHDAN_NO_EXTERNAL_LINKS_SLUG = 'mihdan-no-external-links';

define( 'MIHDAN_NO_EXTERNAL_LINKS_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: mihdan, kaggdesign
Tags: seo, seo-hide, links, posts, comments
Requires at least: 5.7.4
Tested up to: 6.5
Stable tag: 5.1.3
Stable tag: 5.1.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -63,6 +63,9 @@ No External Links **does not** make any changes to your database, it just proces

== Changelog ==

= 5.1.4 (02.06.2024) =
* Fixed error of saving include/exclude sections

= 5.1.3 (21.05.2024) =
* Fixed error of decoding links hidden with SeoHide
* Fixed a fatal error related to the `Mihdan_NoExternalLinks_Database` class
Expand Down

0 comments on commit 26f9863

Please sign in to comment.