development version for urgent bugfix test in response to Forum (2.5.4d1)

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2466893 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-02-02 04:40:41 +00:00
parent b34c0c12ab
commit 6706ba811e
8 changed files with 677 additions and 485 deletions

View file

@ -5,16 +5,17 @@
* @filesource
* @author Stefan Herndler
* @since 1.5.0 12.09.14 10:56
*
*
* Edited:
* 1.6.5 replace deprecated function create_function()
* 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100
* 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
* 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
* 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
* 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100
* @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
*
* Last modified: 2020-12-08T1927+0100
* Last modified: 2021-01-31T0755+0100
*/
@ -40,9 +41,16 @@ class MCI_Footnotes {
*
* @author Stefan Herndler
* @since 1.5.0
*
*
* Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution
* @since 1.6.5
*
* @contributor @felipelavinz
* @source https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
*/
public function run() {
// register language
// register language
MCI_Footnotes_Language::registerHooks();
// register Button hooks
MCI_Footnotes_WYSIWYG::registerHooks();
@ -68,13 +76,26 @@ class MCI_Footnotes {
* @author Stefan Herndler
* @since 1.5.0
*
* Edited for 1.6.5: replaced deprecated function create_function()
*
* Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution
* @since 1.6.5
*
* @contributor @felipelavinz
* @source 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/
*
* @reporter @daliasued
* @bugreport https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853
*
* Contributed by Felipe Lavín Z. Thankfully acknowledged.
*
* create_function() was deprecated in PHP 7.2:
* <https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/>
* See also: <https://wordpress.org/support/topic/deprecated-function-create_function-14/>
* 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
*
* The fix is to move add_action() above into run(),
* and use the bare register_widget() here.
* And declare initializeWidgets() public, not private.
*/
public function initializeWidgets() {
register_widget("MCI_Footnotes_Widget_ReferenceContainer");
@ -107,6 +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
* Updated for v2.0.0 adding jQuery UI
* Updated for v2.0.4 by adding jQuery UI from WordPress following @check2020de:
* <https://wordpress.org/support/topic/gdpr-issue-with-jquery/>
@ -121,7 +143,13 @@ 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 doesnt 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
//*/
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
// enqueue the jQuery plugin registered by WordPress:
@ -134,9 +162,16 @@ class MCI_Footnotes {
wp_enqueue_script( 'jquery-ui-tooltip' );
// enqueue jQuery Tools:
// redacted jQuery.browser, completed minification; added versioning 2020-11-18T2150+0100
// redacted jQuery.browser, completed minification;
// see full header in js/jquery.tools.js
// added versioning 2020-11-18T2150+0100
// not use '-js' in the handle, is appended automatically
wp_enqueue_script('mci-footnotes-jquery-tools', plugins_url('footnotes/js/jquery.tools.min.js'), array(), '1.2.7redacted');
wp_enqueue_script(
'mci-footnotes-jquery-tools',
plugins_url('footnotes/js/jquery.tools.min.js'),
array(),
'1.2.7.redacted.2'
);
// Alternatively, fetch jQuery UI from cdnjs.cloudflare.com:

View file

@ -79,15 +79,10 @@
*
* @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
*
* @edit 2.5.0 Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra 2021-01-07T0824+0100
@ -96,10 +91,7 @@
* @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
* @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/
*
* @edit 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report
* @link https://wordpress.org/support/topic/footnotes-use-in-popup-maker/
*
* @edit 2.5.2 Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report
*
@ -339,8 +331,8 @@ class MCI_Footnotes_Task {
* @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 support the term_description hook, thanks to @vitaefit bug report, thanks to @misfist code contribution
* @edit 2.5.1 support the pum_popup_content hook, thanks to @squatcher 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
*/
public function registerHooks() {
@ -376,7 +368,7 @@ class MCI_Footnotes_Task {
*
* @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
* 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.
*
@ -420,8 +412,8 @@ class MCI_Footnotes_Task {
* HOOK FOR CATEGORY PAGES
*
* Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution
* @datestamp 2021-01-05T1402+0100
* @since 2.5.0
* @datestamp 2021-01-05T1402+0100
*
* @reporter @vitaefit
* @bugreport https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/