diff --git a/class/init.php b/class/init.php index 001e527..25c9778 100644 --- a/class/init.php +++ b/class/init.php @@ -7,13 +7,13 @@ * @since 1.5.0 12.09.14 10:56 * * - * @edit 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution - * @edit 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution - * @edit 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution - * @edit 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 - * @edit 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 - * @edit 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 - * @edit 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 + * @since 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution + * @since 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution + * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution + * @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 + * @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 + * @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 + * @since 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 * * Last modified: 2021-01-31T0755+0100 */ @@ -47,7 +47,7 @@ class MCI_Footnotes { * @since 1.6.5 * * @contributor @felipelavinz - * @source https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 + * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 */ public function run() { // register language @@ -81,14 +81,14 @@ class MCI_Footnotes { * @since 1.6.5 * * @contributor @felipelavinz - * @source https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 + * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 * * @reporter @psykonevro - * @bugreport https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/ - * @bugreport https://wordpress.org/support/topic/deprecated-function-create_function-14/ + * @link https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/ + * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/ * * @reporter @daliasued - * @bugreport https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853 + * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853 * * create_function() was deprecated in PHP 7.2.0 and removed in PHP 8.0.0. * @link https://www.php.net/manual/en/function.create-function.php @@ -128,7 +128,7 @@ class MCI_Footnotes { * @author Stefan Herndler * @since 1.5.0 * - * @edit 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution + * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution * Updated for v2.0.0 adding jQuery UI * Updated for v2.0.4 by adding jQuery UI from WordPress following @check2020de: * @@ -143,12 +143,11 @@ class MCI_Footnotes { // These are only enqueued if the jQuery tooltips are enabled. // If alternative tooltips are enabled, these libraries are not needed. // Scroll animation doesn’t seem to need even jQuery Core or it gets it from elsewhere. - //* @edit 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100 - //* @edit 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 - //* @edit 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 - //* @edit 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 - //* @edit 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 - //*/ + // @since 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100 + // @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 + // @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 + // @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 + // @since 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) { diff --git a/class/task.php b/class/task.php index 5acbe7a..c293667 100644 --- a/class/task.php +++ b/class/task.php @@ -7,95 +7,128 @@ * @since 1.5.0 * * - * @lastmodified 2021-01-26T0752+0100 + * @lastmodified 2021-02-06T0241+0100 * - * @edit 2.0.0 - * @edit 2.0.5 Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution - * @edit 2.0.6 Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution - * @edit 2.0.9 REMOVE the_post HOOK 2020-11-08T1839+0100 - * @edit 2.1.0 Tooltips: Read-on button: Label: configurable instead of localizable - * @edit 2.1.1 Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report - * @edit 2.1.1 Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report - * @edit 2.1.1 Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report - * @edit 2.1.1 Reference container: option to restore 3-column layout (combining identicals turned off) - * @edit 2.1.1 Reference container: option to append symbol (prepended by default) (combining identicals turned off) - * @edit 2.1.1 Dashboard: priority level setting for the_content hook, thanks to @imeson bug report - * @edit 2.1.2 Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report + * @since 2.0.0 Bugfix: Various. + * @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 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts. + * @since 2.0.6 Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution. + * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility). + * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports. + * @since 2.0.9 Bugfix: Remove the_post hook 2020-11-08T1839+0100. + * @since 2.1.0 Add: Tooltips: Read-on button: Label: configurable instead of localizable. + * @since 2.1.1 Bugfix: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report. + * @since 2.1.1 Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report. + * @since 2.1.1 Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report. + * @since 2.1.1 Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution. + * @since 2.1.1 Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback. + * @since 2.1.1 Bugfix: Reference container: option to restore 3-column layout (combining identicals turned off). + * @since 2.1.1 Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report. + * @since 2.1.2 Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report. * - * @edit 2.1.4 fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100 - * @edit 2.1.4 fix issues with link elements by making them optional 2020-11-26T1051+0100 - * @edit 2.1.4 support appending arrow when combining identicals is on 2020-11-26T1633+0100 - * @edit 2.1.4 disable or select backlink separator and terminator 2020-11-28T1048+0100 - * @edit 2.1.4 optional line breaks to stack enumerated backlinks 2020-11-28T1049+0100 - * @edit 2.1.4 ref container column width and tooltip font size settings 2020-12-03T0954+0100 - * @edit 2.1.4 scroll offset and duration settings 2020-12-05T0538+0100 - * @edit 2.1.4 tooltip display duration settings 2020-12-06T1320+0100 + * @since 2.1.4 Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element. + * @datetime 2020-11-25T0837+0100 + * @since 2.1.4 Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues. + * @datetime 2020-11-26T1051+0100 + * @since 2.1.4 Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on. + * @datetime 2020-11-26T1633+0100 + * @since 2.1.4 Bugfix: Reference container: make separating and terminating punctuation optional and configurable. + * @datetime 2020-11-28T1048+0100 + * @since 2.1.4 Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks. + * @datetime 2020-11-28T1049+0100 + * @since 2.1.4 Bugfix: Reference container: fix layout issues by moving backlink column width to settings. + * @since 2.1.4 Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default. + * @datetime 2020-12-03T0954+0100 + * @since 2.1.4 Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers. + * @since 2.1.4 Bugfix: Scroll duration: make configurable to conform to website content and style requirements. + * @datetime 2020-12-05T0538+0100 + * @since 2.1.4 Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style. + * @datetime 2020-12-06T1320+0100 + * @since 2.1.4 Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues. + * @since 2.1.4 Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element. + * @since 2.1.4 Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on. + * @since 2.1.4 Reference container: Backlinks: fix line breaking with respect to separators and terminators. * - * @edit 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21 + * @since 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21 * @link https://wordpress.org/support/topic/2-1-4-breaks-on-my-site-images-dont-show/ * - * @edit 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100 + * @since 2.1.6 option to disable URL line wrapping + * @datetime 2020-12-09T1606+0100 * - * @edit 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100 + * @since 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 + * @datetime 2020-12-09T1921+0100 * @link https://wordpress.org/support/topic/broken-layout-starting-version-2-1-4/ * - * @edit 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe 2020-12-13T2058+0100 + * @since 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe + * @datetime 2020-12-13T2058+0100 * @link https://wordpress.org/support/topic/reference-container-in-elementor/ * - * @edit 2.2.3 custom CSS from new setting in header after legacy 2020-12-15T1128+0100 + * @since 2.2.3 custom CSS from new setting in header after legacy + * @datetime 2020-12-15T1128+0100 * - * @edit 2.2.5 connect alternative tooltips to position and timing settings 2020-12-18T1113+0100 + * @since 2.2.5 connect alternative tooltips to position and timing settings + * @datetime 2020-12-18T1113+0100 * - * @edit 2.2.5 delete unused position shortcode when ref container in widget or footer, thanks to @hamshe 2020-12-18T1437+0100 + * @since 2.2.5 delete unused position shortcode when ref container in widget or footer, thanks to @hamshe + * @datetime 2020-12-18T1437+0100 * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126 * - * @edit 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 + * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer + * @datetime 2020-12-18T1447+0100 * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * - * @edit 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100 + * @since 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 + * @datetime 2020-12-23T0409+0100 * @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/ * - * @edit 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit 2020-12-23T1046+0100 + * @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit + * @datetime 2020-12-23T1046+0100 * @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/ * @link https://wordpress.org/support/topic/footnotes-dont-show-after-update-to-2-2-6/ * - * @edit 2.2.8 URL wrap: correct lookbehind by duplicating it with and without quotation mark class 2020-12-23T1108+0100 + * @since 2.2.8 URL wrap: correct lookbehind by duplicating it with and without quotation mark class + * @datetime 2020-12-23T1108+0100 * - * @edit 2.2.9 URL wrap: account for RFC 2396 allowed characters in parameter names 2020-12-24T1956+0100 + * @since 2.2.9 URL wrap: account for RFC 2396 allowed characters in parameter names + * @datetime 2020-12-24T1956+0100 * @link https://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names * - * @edit 2.2.9 Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report + * @since 2.2.9 Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * - * @edit 2.2.9 URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference 2020-12-25T1251+0100 + * @since 2.2.9 URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference + * @datetime 2020-12-25T1251+0100 * - * @edit 2.2.10 URL wrap: support also file transfer protocol URLs 2020-12-25T2220+0100 + * @since 2.2.10 URL wrap: support also file transfer protocol URLs + * @datetime 2020-12-25T2220+0100 * - * @edit 2.2.10 Reference container: add option for table borders to revert 2.0.0/2.0.1 change made on user request, thanks to @noobishh 2020-12-25T2304+0100 + * @since 2.2.10 Reference container: add option for table borders to revert 2.0.0/2.0.1 change made on user request, thanks to @noobishh + * @datetime 2020-12-25T2304+0100 * @link https://wordpress.org/support/topic/borders-25/ * - * @edit 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report + * @since 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 * - * @edit 2.3.0 optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution - * @edit 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 - * @edit 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 - * @edit 2.4.0 initialize scroll offset variable to 34 as a more robust default, thanks to @lukashuggenberg 2021-01-04T0504+0100 - * @edit 2.4.0 set empty reference container label to NNBSP to make it more robust, thanks to @lukashuggenberg 2021-01-04T0504+0100 - * @edit 2.4.0 Performance: optimize template load and process according to settings, thanks to @misfist code contribution - * @edit 2.4.0 initialize hard link address as empty to fix undefined variable bug, thanks to @a223123131 2021-01-04T1622+0100 + * @since 2.3.0 optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution + * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' + * @datetime 2020-12-27T1243+0100 + * @since 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 + * @since 2.4.0 initialize scroll offset variable to 34 as a more robust default, thanks to @lukashuggenberg 2021-01-04T0504+0100 + * @since 2.4.0 set empty reference container label to NNBSP to make it more robust, thanks to @lukashuggenberg 2021-01-04T0504+0100 + * @since 2.4.0 Performance: optimize template load and process according to settings, thanks to @misfist code contribution + * @since 2.4.0 initialize hard link address as empty to fix undefined variable bug, thanks to @a223123131 2021-01-04T1622+0100 * - * @edit 2.5.0 Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra 2021-01-07T0824+0100 - * @edit 2.5.0 Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra - * @edit 2.5.0 Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra + * @since 2.5.0 Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra 2021-01-07T0824+0100 + * @since 2.5.0 Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra + * @since 2.5.0 Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ * - * @edit 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution - * @edit 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report + * @since 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution + * @since 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report * - * @edit 2.5.2 Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report + * @since 2.5.2 Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report * - * @edit 2.5.3 URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report + * @since 2.5.3 URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report */ // If called directly, abort: @@ -143,19 +176,18 @@ class MCI_Footnotes_Task { /** * INFINITE SCROLL / AUTOLOAD OR ARCHIVE VIEW * - * debug autoload / infinite scroll by adding post ID, thanks to @docteurfitness code contribution + * - Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution + * * @since 2.0.6 - * - * As multiple posts are appended to each other, functions and fragment IDs must be disambiguated. - * - * @contributor @docteurfitness - * @reporter @docteurfitness - * - * @source https://wordpress.org/support/topic/auto-load-post-compatibility-update/#post-13618833 - * @bugreport https://wordpress.org/support/topic/auto-load-post-compatibility-update/ - * * @var int * + * @contributor @docteurfitness + * @link https://wordpress.org/support/topic/auto-load-post-compatibility-update/#post-13618833 + * + * @reporter @docteurfitness + * @link https://wordpress.org/support/topic/auto-load-post-compatibility-update/ + * + * As multiple posts are appended to each other, functions and fragment IDs must be disambiguated. * post ID to make everything unique wrt infinite scroll and archive view: */ public static $a_int_PostId = 0; @@ -163,14 +195,15 @@ class MCI_Footnotes_Task { /** * MULTIPLE REFERENCE CONTAINERS IN CONTENT AND WIDGETS * - * Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report + * - Bugfix: Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report + * * @since 2.2.9 - * @datestamp 2020-12-25T0338+0100 + * @datetime 2020-12-25T0338+0100 * * @reporter @justbecuz * - * @bugreport https://wordpress.org/support/topic/reset-footnotes-to-1/ - * @bugreport https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 + * @link https://wordpress.org/support/topic/reset-footnotes-to-1/ + * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * * @var int incremented each time after a reference container is inserted * @@ -183,13 +216,14 @@ class MCI_Footnotes_Task { /** * TEMPLATE PROCESS OPTIMIZATION * - * Performance: optimize template load and process according to settings, thanks to @misfist code contribution + * - Bugfix: Performance: optimize template load and process according to settings, thanks to @misfist code contribution + * * @since 2.4.0 - * @datestamp 2021-01-04T1355+0100 + * @datetime 2021-01-04T1355+0100 * * @author Patrizia Lutz @misfist * - * @source https://wordpress.org/support/topic/template-override-filter/#post-13864301 + * @link https://wordpress.org/support/topic/template-override-filter/#post-13864301 * @link https://github.com/misfist/footnotes/releases/tag/2.4.0d3 repository * @link https://github.com/misfist/footnotes/compare/2.4.0%E2%80%A62.4.0d3 diff * @@ -204,14 +238,25 @@ class MCI_Footnotes_Task { /** * HARD LINKS FOR AMP * - * Optional hard links in referrers and backlinks for AMP compatibility + * - Bugfix: Optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution. * - * @thanksto @martinneumannat code contribution - * @link https://wordpress.org/support/topic/making-it-amp-compatible/ - * @thanksto @psykonevro bug report - * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ * @since 2.3.0 * @var bool|str|int + * + * @contributor @martinneumannat + * @link https://wordpress.org/support/topic/making-it-amp-compatible/ + * + * @reporter @psykonevro + * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ + * + * The official AMP plugin strips off JavaScript, breaking Footnotes’ + * animated scrolling. + * + * + * @since 2.0.4 remove hard links on user request + * @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/ + * + * @since 2.0.0 add hard links */ public static $a_bool_HardLinksEnable = false; public static $a_str_ReferrerLinkSlug = 'r'; @@ -222,21 +267,23 @@ class MCI_Footnotes_Task { /** * SCROLL OFFSET * - * Optional hard links in referrers and backlinks for AMP compatibility + * @since 2.4.0 + * @datetime 2021-01-03T2055+0100 + * @var int * - * By accident, this variable may not be updated with settings storage. * Websites may use high fixed headers not contracting at scroll. * Scroll offset may now need to get into inline CSS. - * Hence initialize scroll offset to a safety default value 34 right here. - * - * @since 2.4.0 - * @datestamp 2021-01-03T2055+0100 + * Hence it needs to be loaded twice. */ public static $a_int_ScrollOffset = 34; /** * OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS * + * @since 2.3.0 + * @datetime 2020-12-30T2313+0100 + * @var str + * * STYLING: * Link color is preferred for referrers and backlinks. * Setting a global link color is a common feature in WordPress themes. @@ -258,20 +305,16 @@ class MCI_Footnotes_Task { * of the already supported pseudo-classes :link, :hover, :active and :visited that can * still not be used in color names. * - * @since 2.0.0 add the link elements with hard links + * @since 2.0.0 add link elements with hard links * - * @since 2.0.4 remove the hard links on user request + * @since 2.0.4 remove hard links on user request * @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/ * * link elements optional for styling purposes * @since 2.1.4 - * @datestamp 2020-11-25T1306+0100 + * @datetime 2020-11-25T1306+0100 * - * this variable keeps its default value if hard links are enabled - * @since 2.3.0 - * @datestamp 2020-12-30T2313+0100 - * - * @var str + * this variable keeps its default value if hard links are disabled */ public static $a_str_LinkSpan = 'span'; public static $a_str_LinkOpenTag = ''; @@ -280,16 +323,18 @@ class MCI_Footnotes_Task { /** * DEDICATED TOOLTIP TEXT * - * The ability to display dedicated content, thanks to @jbj2199 bug report + * - Bugfix: Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report + * + * @since 2.5.2 + * @datetime 2021-01-19T2223+0100 + * + * @reporter @jbj2199 + * @link https://wordpress.org/support/topic/change-tooltip-text/ * * Tooltips can display another content than the footnote entry * in the reference container. The trigger is a shortcode in * the footnote text separating the tooltip text from the note. - * - * @thanksto @jbj2199 bug report - * @link https://wordpress.org/support/topic/change-tooltip-text/ - * @since 2.5.2 - * @datestamp 2021-01-19T2223+0100 + * That is consistent with what WordPress does for excerpts. */ public static $a_bool_MirrorTooltipText = false; public static $a_str_TooltipShortcode = '[[/tooltip]]'; @@ -298,6 +343,9 @@ class MCI_Footnotes_Task { /** * SYNTAX VALIDATION * + * @since 2.4.0 + * @var bool + * * This part of the algorithm first checks for balanced footnote opening and closing tag * short codes. The first encountered error triggers the display of a warning below the * post title and cancellation of further parsing. @@ -306,9 +354,6 @@ class MCI_Footnotes_Task { * Any compiler or other tool reports syntax errors in the first place. Footnotes’ exception * is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0 * released in urgency to provide AMP compat before 2021. - * - * @since 2.4.0 - * @var bool */ public static $a_bool_SyntaxErrorFlag = true; @@ -324,74 +369,83 @@ class MCI_Footnotes_Task { * @author Stefan Herndler * @since 1.5.0 * - * @edit 2.0.5 Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution - * @edit 2.0.6 Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility) - * @edit 2.0.7 Set priority level back to 10 assuming it is unproblematic 2020-11-06T1344+0100 - * @edit 2.0.8 Priority level back to PHP_INT_MAX (need to get in touch with other plugins) - * @edit 2.0.9 removed the_post hook after its default enabling caused multiple issues - * @edit 2.1.1 Dashboard: priority level setting for the_content hook, thanks to @imeson bug report - * @edit 2.1.2 Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report - * @edit 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution - * @edit 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report + * @since 1.5.4 Add: Hooks: support 'the_post' in response to user request for custom post types. + * @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 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts. + * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility). + * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports. + * @since 2.0.7 Bugfix: Set priority level back to 10 assuming it is unproblematic 2020-11-06T1344+0100. + * @since 2.0.8 Bugfix: Priority level back to PHP_INT_MAX (need to get in touch with other plugins). + * @since 2.1.0 UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook. + * @since 2.1.1 Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report. + * @since 2.1.2 Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report. + * @since 2.5.0 Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution. + * @since 2.5.1 Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report. */ public function registerHooks() { /** * PRIORITY LEVELS * - * Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution + * - 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 - * @datestamp 2020-11-02T0330+0100 + * @datetime 2020-11-02T0330+0100 + * @link https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter * * @contributor @spaceling - * @source https://wordpress.org/support/topic/change-the-position-5/#post-13608594 + * @link https://wordpress.org/support/topic/change-the-position-5/#post-13608594 * * @reporter @june01 - * @bugreport https://wordpress.org/support/topic/change-the-position-5/ + * @link https://wordpress.org/support/topic/change-the-position-5/ * * @reporter @imeson - * @bugreport https://wordpress.org/support/topic/change-the-position-5/#post-13538345 + * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345 + * + * + * - Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report. * - * Dashboard: priority level setting for the_content hook, thanks to @imeson bug report * @since 2.1.1 - * @datestamp 2020-11-17T0254+0100 + * @datetime 2020-11-17T0254+0100 * * @reporter @imeson - * @bugreport https://wordpress.org/support/topic/change-the-position-5/#post-13538345 + * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345 + * + * + * - Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report. * - * Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report * @since 2.1.2 - * @datestamp 2020-11-19T1849+0100 + * @datetime 2020-11-19T1849+0100 * * @reporter @nikelaos - * @bugreport https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 + * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 * - * @link https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter * * Setting the_content priority to 10 instead of PHP_INT_MAX i.e. 9223372036854775807 * makes the footnotes reference container display beneath the post and above other * features added by other plugins, e.g. related post lists and social buttons. * * For YARPP to display related posts below the Footnotes reference container, - * priority needs to be at least 1200. + * priority needs to be at least 1200 (i.e. 0 =< $l_int_TheContentPriority =< 1200). * * PHP_INT_MAX cannot be reset by leaving the number box empty. because browsers * (WebKit) don’t allow it, so we must resort to -1. - * + * @link https://github.com/Modernizr/Modernizr/issues/171 */ + // get values from settings: - $p_int_TheTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL)); - $p_int_TheContentPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL)); - $p_int_TheExcerptPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL)); - $p_int_WidgetTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL)); - $p_int_WidgetTextPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL)); + $l_int_TheTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL)); + $l_int_TheContentPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL)); + $l_int_TheExcerptPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL)); + $l_int_WidgetTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL)); + $l_int_WidgetTextPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL)); // PHP_INT_MAX can be set by -1: - $p_int_TheTitlePriority = ($p_int_TheTitlePriority == -1) ? PHP_INT_MAX : $p_int_TheTitlePriority ; - $p_int_TheContentPriority = ($p_int_TheContentPriority == -1) ? PHP_INT_MAX : $p_int_TheContentPriority ; - $p_int_TheExcerptPriority = ($p_int_TheExcerptPriority == -1) ? PHP_INT_MAX : $p_int_TheExcerptPriority ; - $p_int_WidgetTitlePriority = ($p_int_WidgetTitlePriority == -1) ? PHP_INT_MAX : $p_int_WidgetTitlePriority; - $p_int_WidgetTextPriority = ($p_int_WidgetTextPriority == -1) ? PHP_INT_MAX : $p_int_WidgetTextPriority ; + $l_int_TheTitlePriority = ($l_int_TheTitlePriority == -1) ? PHP_INT_MAX : $l_int_TheTitlePriority ; + $l_int_TheContentPriority = ($l_int_TheContentPriority == -1) ? PHP_INT_MAX : $l_int_TheContentPriority ; + $l_int_TheExcerptPriority = ($l_int_TheExcerptPriority == -1) ? PHP_INT_MAX : $l_int_TheExcerptPriority ; + $l_int_WidgetTitlePriority = ($l_int_WidgetTitlePriority == -1) ? PHP_INT_MAX : $l_int_WidgetTitlePriority; + $l_int_WidgetTextPriority = ($l_int_WidgetTextPriority == -1) ? PHP_INT_MAX : $l_int_WidgetTextPriority ; // append custom css to the header @@ -401,75 +455,124 @@ class MCI_Footnotes_Task { add_filter('wp_footer', array($this, "wp_footer"), PHP_INT_MAX); if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE))) { - add_filter('the_title', array($this, "the_title"), $p_int_TheTitlePriority); + add_filter('the_title', array($this, "the_title"), $l_int_TheTitlePriority); } // configurable priority level for reference container relative positioning; default 98: if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT))) { - add_filter('the_content', array($this, "the_content"), $p_int_TheContentPriority); + add_filter('the_content', array($this, "the_content"), $l_int_TheContentPriority); /** * HOOK FOR CATEGORY PAGES * - * Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution + * -Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution + * * @since 2.5.0 - * @datestamp 2021-01-05T1402+0100 + * @datetime 2021-01-05T1402+0100 * * @reporter @vitaefit - * @bugreport https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/ + * @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/ * * @contributor @misfist - * @source https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/#post-13864859 + * @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/#post-13864859 * * Category pages can have rich HTML content in a term description with article status. * For this to happen, WordPress’ built-in partial HTML blocker needs to be disabled. * @link https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/ */ - add_filter('term_description', array($this, "the_content"), $p_int_TheContentPriority); + add_filter('term_description', array($this, "the_content"), $l_int_TheContentPriority); /** * HOOK FOR POPUP MAKER POPUPS * - * Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report + * - Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report + * * @since 2.5.1 - * @datestamp 2021-01-18T2038+0100 + * @datetime 2021-01-18T2038+0100 * * @reporter @squatcher - * @bugreport https://wordpress.org/support/topic/footnotes-use-in-popup-maker/ + * @link https://wordpress.org/support/topic/footnotes-use-in-popup-maker/ */ - add_filter('pum_popup_content', array($this, "the_content"), $p_int_TheContentPriority); + add_filter('pum_popup_content', array($this, "the_content"), $l_int_TheContentPriority); } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT))) { - add_filter('the_excerpt', array($this, "the_excerpt"), $p_int_TheExcerptPriority); + add_filter('the_excerpt', array($this, "the_excerpt"), $l_int_TheExcerptPriority); } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE))) { - add_filter('widget_title', array($this, "widget_title"), $p_int_WidgetTitlePriority); + add_filter('widget_title', array($this, "widget_title"), $l_int_WidgetTitlePriority); } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT))) { - add_filter('widget_text', array($this, "widget_text"), $p_int_WidgetTextPriority); + add_filter('widget_text', array($this, "widget_text"), $l_int_WidgetTextPriority); } /** * THE the_post HOOK * - * support the_post hook in response to user request for custom post types + * - Add: Hooks: support 'the_post' in response to user request for custom post types. + * * @since 1.5.4 * @accountable @aricura * @link https://wordpress.org/support/topic/doesnt-work-in-custon-post-types/#post-5339110 * - * remove the_post hook after its default enabling caused multiple issues - * @edit 2.0.9 + * + * - Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts. + * + * @since 2.0.5 + * @accountable @pewgeuges + * + * + * - BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports. + * + * @since 2.0.7 * @accountable @pewgeuges - * @datestamp 2020-11-08T1839+0100 * @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13630114 * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13630303 * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13630799 * @link https://wordpress.org/support/topic/no-footnotes-anymore/#post-13813233 + * + * @reporter @spaceling + * @link https://wordpress.org/support/topic/change-the-position-5/#post-13612697 + * + * @reporter @markcheret on behalf of W. Beinert + * @link https://wordpress.org/support/topic/footnotes-now-appear-in-summaries-even-though-this-is-marked-no/ + * + * @reporter @nyamachi + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/ + * + * @reporter @whichgodsaves + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13622694 + * + * @reporter @spiralofhope2 + * @link https://wordpress.org/support/topic/2-0-5-broken/ + * + * @reporter @mmallett + * @link https://wordpress.org/support/topic/2-0-5-broken/#post-13623208 + * + * @reporter @andreasra + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13624091 + * + * @reporter @widecast + * @link https://wordpress.org/support/topic/2-0-5-broken/#post-13626222 + * + * @reporter @ymorin007 + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13627050 + * + * @reporter @markcheret on behalf of L. Smith + * @link https://wordpress.org/support/topic/footnotes-appear-in-random-places-on-academic-website/ + * + * @reporter @tashi1es + * @link https://wordpress.org/support/topic/footnotes-appear-in-random-places-on-academic-website/#post-13630495 + * + * + * - UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook. + * + * @since 2.1.0 + * @datetime 2020-11-08T1839+0100 + * @accountable @pewgeuges */ - // reset stored footnotes when displaying the header self::$a_arr_Footnotes = array(); self::$a_bool_AllowLoveMe = true; @@ -481,11 +584,9 @@ class MCI_Footnotes_Task { * @author Stefan Herndler * @since 1.5.0 * - * @edited * - * @since 2.1.1 Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report - * @since 2.1.1 option to hide ref container from start page - * @since 2.1.1 script for alternative tooltips + * @since 2.1.1 Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report + * @since 2.1.1 Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback. * @since 2.1.3 raise settings priority to override theme style sheets * @since 2.1.4 tootip font size and backlink column width settings * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 @@ -501,10 +602,12 @@ class MCI_Footnotes_Task { /** * REF CONTAINER DISPLAY ON HOME PAGE * - * Reference container: fix start pages by making its display optional - * @thanksto @dragon013 bug report - * @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/ + * - Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report. + * * @since 2.1.1 + * + * @reporter @dragon013 + * @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/ */ if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) { echo ".home .footnotes_reference_container { display: none; }\r\n"; @@ -719,7 +822,7 @@ class MCI_Footnotes_Task { echo "\r\n\r\n"; // alternative tooltip script printed formatted not minified: - if (self::$a_bool_AlternativeTooltipsEnabled) { + if ( self::$a_bool_AlternativeTooltipsEnabled ) { ?> - diff --git a/templates/note-for-developers.txt b/templates/note-for-developers.txt deleted file mode 100644 index 3d9f7c8..0000000 --- a/templates/note-for-developers.txt +++ /dev/null @@ -1,46 +0,0 @@ -note-for-developers.txt -2020-12-19T0609+0100 -Last modified: 2021-01-04T1734+0100 - -Footnotes plugin for WordPress, v2.2.6 and later - -Support for custom templates -‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Since v2.2.6, Footnotes supports custom templates. - -Custom templates may be loaded from a sibling folder 'footnotes-custom' -or since v2.4.0 from a folder 'templates/footnotes/' in the active theme. - -Priority order: - 1. active theme - 2. sibling folder - 3. internal - -See footnotes/class/template.php:67..116 - - -A. Active theme - ‾‾‾‾‾‾‾‾‾‾‾‾ -Please create a folder 'templates/footnotes/' in your child theme and -store all your public custom templates for Footnotes directly therein. - -Existing homonymous templates are loaded instead of their counterparts in -wp-content/plugins/footnotes/templates/public/. - - -B. Sibling folder - ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -Please make a sibling of the "footnotes" folder called 'footnotes-custom' and -the same internal structure and file names as 'footnotes/templates/public/'. - -Example for custom tooltips: - -footnotes-custom -└── templates - └── public - ├── footnote.html - └── tooltip.html - -The timing parameters in the inline jQuery script 'tooltip.html' are already -configurable in the dashboard > Referrers and tooltips > Tooltip timing.