Rebase to 2.5.7

This commit is contained in:
Ben Goldsworthy 2021-02-27 08:34:58 +00:00
commit 74ac6f1cad
5 changed files with 33 additions and 12 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
vendor/ vendor/
*.bak *.bak
authors.txt

View file

@ -6,7 +6,7 @@
Featured on [wpmudev](http://premium.wpmudev.org/blog/12-surprisingly-useful-wordpress-plugins-you-dont-know-about/) --- cheers for the review, folks! Featured on [wpmudev](http://premium.wpmudev.org/blog/12-surprisingly-useful-wordpress-plugins-you-dont-know-about/) --- cheers for the review, folks!
**footnotes** aims to be the all-in-one solution for displaying an automatically generated list of references on your Page or Post. The Plugin ships with a set of defaults while also empowering you to control how your footnotes are being displayed. **footnotes** aims to be the all-in-one solution for displaying an automatically generated list of references on your Page or Post. The Plugin ships with a set of current defaults but also empowers you to control how your footnotes are being displayed.
**footnotes** gives you the ability to display well-formatted footnotes on your WordPress Pages and Posts—those footnotes we know from offline publishing. **footnotes** gives you the ability to display well-formatted footnotes on your WordPress Pages and Posts—those footnotes we know from offline publishing.

View file

@ -6,6 +6,8 @@
* @package footnotes * @package footnotes
* @since 1.5.0 * @since 1.5.0
* *
* @lastmodified 2021-02-20T0438+0100
*
* @since 2.0.0 Bugfix: various. * @since 2.0.0 Bugfix: various.
* @since 2.0.4 Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report. * @since 2.0.4 Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
* @since 2.0.5 Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution. * @since 2.0.5 Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.
@ -77,6 +79,7 @@
* @since 2.5.4 Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error. * @since 2.5.4 Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error.
* @since 2.5.5 Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution. * @since 2.5.5 Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
* @since 2.5.6 Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports. * @since 2.5.6 Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
* @since 2.5.7 Bugfix: Process: fix footnote duplication by emptying the footnotes list every time the search algorithm is run on the content, thanks to @inoruhana bug report.
*/ */
// If called directly, abort. // If called directly, abort.
@ -147,7 +150,7 @@ class MCI_Footnotes_Task {
* @link https://wordpress.org/support/topic/reset-footnotes-to-1/ * @link https://wordpress.org/support/topic/reset-footnotes-to-1/
* @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830
* *
* @var int 1; incremented each time after a reference container is inserted * @var int 1; incremented every time after a reference container is inserted
* *
* This ID disambiguates multiple reference containers in a page * This ID disambiguates multiple reference containers in a page
* as they may occur when the widget_text hook is active and the page * as they may occur when the widget_text hook is active and the page
@ -682,6 +685,7 @@ class MCI_Footnotes_Task {
* @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/ * @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/
*/ */
if ( ! MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) { if ( ! MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
echo ".home .footnotes_reference_container { display: none; }\r\n"; echo ".home .footnotes_reference_container { display: none; }\r\n";
} }
@ -752,7 +756,6 @@ class MCI_Footnotes_Task {
echo '.footnote_plugin_index, .footnote_plugin_index_combi {'; echo '.footnote_plugin_index, .footnote_plugin_index_combi {';
if ( $l_bool_column_width_enabled ) { if ( $l_bool_column_width_enabled ) {
$l_int_column_width_scalar = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR ); $l_int_column_width_scalar = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR );
$l_str_column_width_unit = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT ); $l_str_column_width_unit = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT );
@ -770,7 +773,6 @@ class MCI_Footnotes_Task {
} }
if ( $l_bool_column_max_width_enabled ) { if ( $l_bool_column_max_width_enabled ) {
$l_int_column_max_width_scalar = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR ); $l_int_column_max_width_scalar = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
$l_str_column_max_width_unit = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT ); $l_str_column_max_width_unit = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
@ -821,7 +823,6 @@ class MCI_Footnotes_Task {
self::$a_bool_alternative_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) ); self::$a_bool_alternative_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) );
if ( self::$a_bool_tooltips_enabled ) { if ( self::$a_bool_tooltips_enabled ) {
echo '.footnote_tooltip {'; echo '.footnote_tooltip {';
/** /**
@ -914,7 +915,6 @@ class MCI_Footnotes_Task {
printf( ' max-width: %dpx !important;', esc_html( $l_int_max_width ) ); printf( ' max-width: %dpx !important;', esc_html( $l_int_max_width ) );
} }
echo "}\r\n"; echo "}\r\n";
} else { } else {
/* /*
* Alternative tooltips. * Alternative tooltips.
@ -967,7 +967,6 @@ class MCI_Footnotes_Task {
$l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0'; $l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0';
echo ' transition-delay: ' . esc_html( $l_int_fade_out_delay ) . 'ms;'; echo ' transition-delay: ' . esc_html( $l_int_fade_out_delay ) . 'ms;';
echo ' transition-duration: ' . esc_html( $l_int_fade_out_duration ) . 'ms;'; echo ' transition-duration: ' . esc_html( $l_int_fade_out_duration ) . 'ms;';
echo "}\r\n"; echo "}\r\n";
} }
@ -1023,8 +1022,6 @@ class MCI_Footnotes_Task {
} }
</script> </script>
<?php <?php
// End internal script.
}; };
} }
@ -1108,6 +1105,26 @@ class MCI_Footnotes_Task {
* @return string Content with replaced footnotes. * @return string Content with replaced footnotes.
*/ */
public function the_content( $p_str_content ) { public function the_content( $p_str_content ) {
/**
* Empties the footnotes list every time Footnotes is run when the_content hook is called.
*
* - Bugfix: Process: fix footnote duplication by emptying the footnotes list every time the search algorithm is run on the content, thanks to @inoruhana bug report.
*
* @since 2.5.7
*
* @reporter @inoruhana
* @link https://wordpress.org/support/topic/footnote-duplicated-in-the-widget/
*
* Under certain circumstances, footnotes were duplicated, because the footnotes list was
* not emptied every time before the search algorithm was run. That happened eg when both
* the reference container resides in the widget area, and the YOAST SEO plugin is active
* and calls the hook the_content to generate the Open Graph description, while Footnotes
* is set to avoid missing out on the footnotes (in the content) by hooking in as soon as
* the_content is called, whereas at post end Footnotes seems to hook in the_content only
* the time its the blog engine processing the post for display and appending the refs.
*/
self::$a_arr_footnotes = array();
// phpcs:disable WordPress.PHP.YodaConditions.NotYoda // phpcs:disable WordPress.PHP.YodaConditions.NotYoda
// Appends the reference container if set to "post_end". // Appends the reference container if set to "post_end".
return $this->exec( $p_str_content, 'post_end' === MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ); return $this->exec( $p_str_content, 'post_end' === MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) );

View file

@ -4,7 +4,7 @@
* Plugin URI: https://wordpress.org/plugins/footnotes/ * Plugin URI: https://wordpress.org/plugins/footnotes/
* Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. * Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
* Author: Mark Cheret * Author: Mark Cheret
* Version: 2.5.6 * Version: 2.5.7
* Author URI: http://cheret.de/plugins/footnotes-2/ * Author URI: http://cheret.de/plugins/footnotes-2/
* Text Domain: footnotes * Text Domain: footnotes
* Domain Path: /languages * Domain Path: /languages

View file

@ -4,7 +4,7 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen
Requires at least: 3.9 Requires at least: 3.9
Tested up to: 5.6.1 Tested up to: 5.6.1
Requires PHP: 5.6 Requires PHP: 5.6
Stable Tag: 2.5.6 Stable Tag: 2.5.7
License: GPLv3 or later License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -77,6 +77,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog == == Changelog ==
= 2.5.7 =
- Bugfix: Process: fix footnote duplication by emptying the footnotes list every time the search algorithm is run on the content, thanks to @inoruhana bug report.
= 2.5.6 = = 2.5.6 =
- Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports. - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
- Bugfix: Alternative tooltips: shrink width to short content. - Bugfix: Alternative tooltips: shrink width to short content.