diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..46ab074 --- /dev/null +++ b/.distignore @@ -0,0 +1,32 @@ +# A set of files you probably don't want in your WordPress.org distribution +.distignore +.editorconfig +.git +.gitignore +.gitlab-ci.yml +.travis.yml +.DS_Store +Thumbs.db +behat.yml +bin +circle.yml +composer.json +composer.lock +Gruntfile.js +package.json +phpunit.xml +phpunit.xml.dist +multisite.xml +multisite.xml.dist +phpcs.ruleset.xml +LICENSE +wp-cli.local.yml +tests +vendor +node_modules +*.sql +*.tar.gz +*.zip +authors.txt +composer.* +.php-commitizen.php diff --git a/.github/workflows/release-handler.yml b/.github/workflows/release-handler.yml new file mode 100644 index 0000000..6ccd91d --- /dev/null +++ b/.github/workflows/release-handler.yml @@ -0,0 +1,46 @@ +name: Release Handler + +# Action runs when a new release is published. +on: + release: + types: [published] + +jobs: + release-new: + name: Issue new release + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Plugin + run: | + composer install --no-dev --optimize-autoloader + composer run build + + - name: Create release archive + uses: montudor/action-zip@v0.1.0 + with: + args: zip -X -r dist/footnotes-${{ github.event.release.tag_name }}.zip dist + + - name: Upload archive as artifact + uses: actions/upload-artifact@v2 + with: + name: footnotes-${{ github.event.release.tag_name }} + path: dist/footnotes-${{ github.event.release.tag_name }}.zip + + - name: Upload archive to release + uses: JasonEtco/upload-to-release@master + with: + args: dist/footnotes-${{ github.event.release.tag_name }}.zip application/zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + #- name: Deploy release to Wordpress.org + # uses: 10up/action-wordpress-plugin-deploy@stable + # with: + # generate-zip: true + # env: + # SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + # SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} diff --git a/.gitignore b/.gitignore index bff37e1..64eb6cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ .phpdoc/ +vendor/ +dist/ +tmp/ +*.bak authors.txt diff --git a/.php-commitizen.php b/.php-commitizen.php new file mode 100644 index 0000000..70ae02f --- /dev/null +++ b/.php-commitizen.php @@ -0,0 +1,30 @@ + [ + 'lengthMin' => 1, // Min length of the type + 'lengthMax' => 8, // Max length of the type + 'acceptExtra' => false, // Allow adding types not listed in 'values' key + 'values' => ['feat', 'fix', 'refactor', 'style', 'docs', 'chore', 'test', 'perf', 'build', 'ci'], // All the values usable as type + ], + 'scope' => [ + 'lengthMin' => 0, // Min length of the scope + 'lengthMax' => 10, // Max length of the scope + 'acceptExtra' => true, // Allow adding scopes not listed in 'values' key + 'values' => [], // All the values usable as scope + ], + 'description' => [ + 'lengthMin' => 1, // Min length of the description + 'lengthMax' => 44, // Max length of the description + ], + 'subject' => [ + 'lengthMin' => 1, // Min length of the subject + 'lengthMax' => 50, // Max length of the subject + ], + 'body' => [ + 'wrap' => 72, // Wrap the body at 72 characters + ], + 'footer' => [ + 'wrap' => 72, // Wrap the footer at 72 characters + ], +]; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83e6a64..b08e8d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,33 +5,39 @@ request the best chance of being accepted: # Requesting Features/Reporting Bugs -- To request a new feature or to report a bug, create an - [Issue](https://github.com/markcheret/footnotes/issues/new/choose) and choose - the correct template +- To request a new feature or to report a bug, create an [Issue][new-issue] and + choose the correct template # Contributing Code -- **footnotes** uses [GitHub Flow](https://githubflow.github.io/) +- **footnotes** uses [GitHub Flow][github-flow] - branch off of `main` to start developing (`git checkout -b `) - ensure that your new branch has a descriptive name - create a remote copy of your new branch (`git push`) -- create a draft [pull request](https://github.com/markcheret/footnotes/compare) - to merge your branch with `main` — tag any related Issues, and if they are - assigned to a Project board, this will automatically move them into the - ‘In Progress’ bucket +- create a draft [pull request][pull-request] to merge your branch with `main` — + tag any related Issues, and if they are assigned to a Project board, this will + automatically move them into the ‘In Progress’ bucket - when you think you're finished, un-draft your pull request — if the PR is assigned to a Project board, this will automatically move it and any related Issues into the ‘Review in progress’ bucket # Commits -- **footnotes** uses [Conventional Commits](https://www.conventionalcommits.org) +- **footnotes** uses [Conventional Commits][conventional-commits] +- we use [PHP Commitizen][php-commitizen] to automate this - use `composer commit` - keep individual commits as small as possible # Versioning -- **footnotes** uses [Semantic Versioning](https://semver.org/) +- **footnotes** uses [Semantic Versioning][semver] # Translating - Translations are welcome! + +[new-issue]: https://github.com/markcheret/footnotes/issues/new/choose +[github-flow]: https://githubflow.github.io/ +[pull-request]: https://github.com/markcheret/footnotes/compare +[conventional-commits]: https://www.conventionalcommits.org +[php-commitizen]: https://github.com/conventional-commits/php-commitizen +[semver]: https://semver.org/ diff --git a/_tools/build-stylesheets.sh b/_tools/build-stylesheets.sh new file mode 100755 index 0000000..2d14f33 --- /dev/null +++ b/_tools/build-stylesheets.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +# Concatenates, minifies (TODO) and deploys stylesheets for distribution. +# +# 12 unified stylesheets are concatenated out of these files: +# - `dev-common.css` +# - `dev-tooltips.css` +# - `dev-tooltips-alternative.css` +# - `dev-layout-reference-container.css` +# - `dev-layout-entry-content.css` +# - `dev-layout-main-content.css` + +echo "Running $(dirname "$0")/build-stylesheets.sh" + +if [[ $1 == "-c" ]]; then + + echo "Concatenating files and placing in \`css/tmp/\`..." + + mkdir -p ./css/tmp + cat ./css/dev-common.css > ./css/tmp/footnotes-nottbrpl0.css + cat ./css/dev-{common,layout-reference-container}.css > ./css/tmp/footnotes-nottbrpl1.css + cat ./css/dev-{common,layout-entry-content}.css > ./css/tmp/footnotes-nottbrpl2.css + cat ./css/dev-{common,layout-main-content}.css > ./css/tmp/footnotes-nottbrpl3.css + cat ./css/dev-{common,tooltips}.css > ./css/tmp/footnotes-jqttbrpl0.css + cat ./css/dev-{common,tooltips,layout-reference-container}.css > ./css/tmp/footnotes-jqttbrpl1.css + cat ./css/dev-{common,tooltips,layout-entry-content}.css > ./css/tmp/footnotes-jqttbrpl2.css + cat ./css/dev-{common,tooltips,layout-main-content}.css > ./css/tmp/footnotes-jqttbrpl3.css + cat ./css/dev-{common,tooltips,tooltips-alternative}.css > ./css/tmp/footnotes-alttbrpl0.css + cat ./css/dev-{common,tooltips,tooltips-alternative,layout-reference-container}.css > ./css/tmp/footnotes-alttbrpl1.css + cat ./css/dev-{common,tooltips,tooltips-alternative,layout-entry-content}.css > ./css/tmp/footnotes-alttbrpl2.css + cat ./css/dev-{common,tooltips,tooltips-alternative,layout-main-content}.css > ./css/tmp/footnotes-alttbrpl3.css + cat ./css/settings.css > ./css/tmp/settings.css + + echo "Stylesheet concatenation complete." + exit 0 + +elif [[ $1 == "-m" ]]; then + + # TODO: this should automatically minifiy all files, outputting into `.min.css` + # files and deleting the original concatenated `.css` files in `css/tmp/`. + # Once that's done, we can change the `rm -r` command in the deploy step to + # `rmdir`, which will throw us an error if we have any minified files that + # haven't been moved over to `dist/css/` for whatever reason. As it currently + # stands, we have no error checking in place. + echo "Please minify the stylesheets in \`css/tmp/\`, saving them in the same location with the \`.min.css\` file extension." + read -p "Are you ready to continue? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 + exit 0 + +elif [[ $1 == "-d" ]]; then + + # NOTE: I've temporarily replaced the `mv` command + # with `cp` and disabled the `rm` command, so the minified + # files won't be removed from the source directory. + echo "Deploying minified stylesheets to \`dist/css/\`..." + rm -r ./dist + mkdir -p ./dist/css + for f in ./css/tmp/*.min.css; do + filename=$(basename $f .css) + cp $f ./dist/css + #mv $f ./dist/css + echo -e '\t' $filename".css moved." + done + + # NB: We currently distribute both the minified + concatenated and the + # unminified + unconcatenated stylesheets with the Plugin. + echo "Deploying development stylesheets to \`dist/css/\`..." + for f in ./css/dev-*.css; do + filename=$(basename $f .css) + cp $f ./dist/css + #mv $f ./dist/css + echo -e '\t' $filename".css moved." + done + + #echo "Deleting temporary files..." + #rm -r ./css/tmp + echo "All stylesheets added to build." + exit 0 + +else + + echo -e "Concatenates, minifies (TODO) and deploys stylesheets for distribution.\n" + echo -e "12 unified style sheets are concatenated out of these files:\n" + echo "\`dev-common.css\`" + echo "\`dev-tooltips.css\`" + echo "\`dev-tooltips-alternative.css\`" + echo "\`dev-layout-reference-container.css\`" + echo "\`dev-layout-entry-content.css\`" + echo -e "\`dev-layout-main-content.css\`\n" + echo "Command: \`-c\`: Concatenate \`dev-*\` CSS files into temporary directory." + echo "Command: \`-m\`: Minify files (TODO)." + echo "Command: \`-d\`: Deploy minified files to \`dist/css/\` and remove temporary files." + echo "No command, \"--help\", or anything else: Output this help section." + +fi diff --git a/_tools/build.sh b/_tools/build.sh new file mode 100755 index 0000000..aa89c41 --- /dev/null +++ b/_tools/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +echo "Building Plugin..." + +# Moves everything including the style sheets over to `dist/` +echo "Copying directories..." +cp -r -t dist class/ css/ js/ languages/ templates/ +# Among the images, only 2 out of 3 are distributed. +echo "Copying the needed images..." +mkdir dist/img +cp -t dist/img img/fn-wysiwyg.png img/main-menu.png +echo "Copying files..." +cp -t dist features.txt license.txt readme.txt includes.php wpml-config.xml customized-documentation-schema.txt customized-template-stack.txt CONTRIBUTING.md README.md SECURITY.md +echo "Setting production flag..." +sed "s/'PRODUCTION_ENV', false/'PRODUCTION_ENV', true/g" footnotes.php > dist/footnotes.php +echo "Production flag set." + +# TODO: once automatic minification is implemented, this should handle that. +# For now, we shall have to assume that this command is being run on a repo. with +# minimised stylesheet files already in `dist/css/`. +echo "Building stylesheets..." +./_tools/build-stylesheets.sh -c +if [ $? != 0 ]; then echo "Concatenation failed!"; exit 1; fi +./_tools/build-stylesheets.sh -m +if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi +./_tools/build-stylesheets.sh -d +if [ $? != 0 ]; then echo "Deployment failed!"; exit 1; fi +echo "Stylesheet build complete." + +echo "Build complete." +exit 0 diff --git a/_tools/release.sh b/_tools/release.sh new file mode 100755 index 0000000..11d74f0 --- /dev/null +++ b/_tools/release.sh @@ -0,0 +1,246 @@ +#!/bin/bash + +# This is a release helper script aimed at walking maintainers through the +# process of issuing new releases of the Plugin, both to reduce the risk of +# procedural errors and to provide a framework for future incremental +# automation. +# +# Step 1: Ensure the local copy has checked out the `main` branch +# Step 2: Ensure local copy of `main` is up-to-date with remote +# Step 3: Check versioning +# Step 3(a): Get all version declarations +# Step 3(b): Check that all version declarations exists +# Step 3(c)(1): Check that all development versions match +# Step 3(c)(2): Check that all stable versions match +# Step 3(d): Check that the development version is correctly flagged as such +# Step 3(e): Check that the 'Stable Tag' field is set to a stable version +# Step 3(f): Check that the 'Stable Tag' field points to a real tag on the SVN repo. +# Step 3(g): Check that the changelog is up-to-date +# Step 4: Build the Plugin +# Step 5: Update the version to pre-release +# Step 6: Tag the release + +echo "Welcome to the footnotes release helper!" +echo "========================================" + +if [[ $1 == "-c" ]]; then + read -p "You have passed the \`commit\` flag (\`-c\`). Did you mean to do this? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 +fi + +# NB: To run on a branch other than `main`, uncomment this line: +#if false; then + +# Step 1: Ensure the local copy has checked out the `main` branch + +if [[ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]]; then + echo "ERR: You are not on the \`main\` branch, please check it out and re-run this command." + exit 1 +else + echo "- \`main\` branch is checked out." +fi + +# Step 2: Ensure local copy of `main` is up-to-date with remote + +if [[ "$(git status | grep -c 'Your branch is up to date')" != 1 ]]; then + echo "ERR: Your local copy is not up-to-date with the remote, please update it and re-run this command." + exit 1 +else + echo "- Local copy of \`main\` is up-to-date with remote." +fi + +# NB: To run on a branch other than `main`, uncomment this line: +#fi + +# Step 3: Check versioning + +# Step 3(a): Get all version declarations + +# NOTE: I'm not sure why, but if you try to get the root header +# version without piping it through the second `grep` command, +# you'll end up with a list of files before the version +# declaration. + +echo "- Checking versions..." + +STABLE_TAG="$(grep "Stable Tag:" readme.txt)" +ROOT_HEADER_VERSION="$(grep " Version:" footnotes.php | grep -Po " Version: \d+\.\d+(\.\d+)?[a-z]?$")" +JS_VERSION="$(grep "version :" js/wysiwyg-editor.js)" + +# Step 3(b): Check that all version declarations exists + +if [[ -z $STABLE_TAG ]]; then + echo "ERR: No 'Stable Tag' field found in \`readme.txt\`!" + exit 1 +else echo "- 'Stable Tag' field set in \`readme.txt\`." +fi +if [[ -z $ROOT_HEADER_VERSION ]]; then + echo "ERR: No 'Version' field found in \`footnotes.php\` file header!" + exit 1 +else echo "- 'Version' field set in \`footnotes.php\` file header." +fi +if [[ -z $JS_VERSION ]]; then + echo "ERR: No \`version\` variable found in \`js/wysiwyg-editor.js\`!" + exit 1 +else echo "- \`version\` variable set in \`js/wysiwyg-editor.js\`." +fi + +# Step 3(c)(1): Check that all development versions match +# NB: This doesn't currently do anything as there is only one place where the +# development version is listed. + +if [[ "$(echo $JS_VERSION | grep -Poc '\d+\.\d+(\.\d+)?')" != 1 ]]; then + echo "ERR: Development version mismatch!" + echo -e "The following versions were found:\n" + echo -e '\t' $JS_VERSION '\n' + echo "Please ensure that all development versions match and re-run this command." + exit 1 +else echo "- Development versions match." +fi + +# Step 3(c)(2): Check that all stable versions match + +if [[ "$(echo $ROOT_HEADER_VERSION $STABLE_TAG | grep -Poc '\d+\.\d+(\.\d+)?')" != 1 ]]; then + echo "ERR: Stable version mismatch!" + echo -e "The following versions were found:\n" + echo -e '\t' $ROOT_HEADER_VERSION + echo -e '\t' $STABLE_TAG '\n' + echo "Please ensure that all stable versions match and re-run this command." + exit 1 +else echo "- Stable versions match." +fi + +# Step 3(d): Check that the development version is correctly flagged as such + +if [[ "$(echo $JS_VERSION | grep -Poc '\d+d')" != 1 ]]; then + echo "ERR: Development version flag not set!" + echo -e "The following version was found:\n" + echo -e '\t' $JS_VERSION '\n' + echo "Please ensure that the development flag ('d') is set and re-run this command." + exit 1 +else echo "- Development version flag is set." +fi + +DEVELOPMENT_VERSION="$(echo $JS_VERSION | grep -Po '\d+\.\d+(\.\d+)?')" + +echo -e "- Development version:" $DEVELOPMENT_VERSION + +# Step 3(e): Check that the 'Stable Tag' field is set to a stable version + +if [[ "$(echo $STABLE_TAG | grep -Poc '\d+\.\d+(\.\d+)?$')" != 1 ]]; then + echo "ERR: 'Stable Tag' not set to a stable version!" + echo -e "The 'Stable Tag' field is set to the following:\n" + echo -e '\t' $STABLE_TAG '\n' + echo "Please ensure that the 'Stable Tag' field is set to a stable version and re-run this command." + exit 1 +else echo "- 'Stable Tag' field set to stable version." +fi + +STABLE_VERSION="$(echo $STABLE_TAG | grep -Po '\d+\.\d+(\.\d+)?$')" + +echo "- Stable version:" $STABLE_VERSION + +# Step 3(f): Check that the 'Stable Tag' field points to a real tag on the SVN repo. + +echo "- Checking stable tag exists..." +git svn tag --dry-run $STABLE_VERSION &>/dev/null + +if [ $? -ne 1 ]; then + echo "ERR: 'Stable Tag' does not point to an existing tag!" + echo "Please ensure that the 'Stable Tag' field points to an existing stable version and re-run this command." + exit 1 +else echo "- 'Stable Tag' field is set to existing tag." +fi + +# Step 3(g): Check that the changelog is up-to-date + +CHANGELOG_LATEST="$(awk -e '/== Changelog ==/,/= [0-9]+\.[0-9]+(\.[0-9]+)? =/' readme.txt | grep -Po '\d+\.\d+(\.\d+)?')" +if [[ $CHANGELOG_LATEST != $DEVELOPMENT_VERSION ]]; then + echo "ERR: Changelog is not up-to-date!" + echo "Current version is $DEVELOPMENT_VERSION" + echo "Latest version in changelog is $CHANGELOG_LATEST" + echo "Please ensure that the changelog is up-to-date and re-run this command." + exit 1 +else echo "- Changelog is up-to-date." +fi + +echo -e "- Version check complete.\n" + +# Step 4: Build the Plugin + +echo "- Building Plugin..." +composer run build +if [ $? != 0 ]; then echo "Build failed!"; exit 1; fi +echo -e "- Build complete.\n" + +# Step 5: Update the version to pre-release + +echo "- Setting pre-release version flags..." +PRERELEASE_VERSION=$DEVELOPMENT_VERSION'p' +sed -i "s/$JS_VERSION/version : \"$PRERELEASE_VERSION\"/g" dist/js/wysiwyg-editor.js +echo "- Pre-release flags set." + +# Step 6: Tag the release + +echo "- Tagging release..." +git tag -a $DEVELOPMENT_VERSION -m "Pre-release of version $DEVELOPMENT_VERSION" +git push --tags +echo "- Release tagged." + +# Step 7: Push release to SVN repo. + +# Step 7(a): Create a new local copy of the SVN repo. + +echo -e "\nThe helper will now guide you through the steps to push the new release to the WordPress Plugin Directory SVN repository." +echo "For the time being, this part of the process shall remain (mostly) manual." +read -p "Are you ready to continue? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 + +echo "Creating local copy of SVN repo..." +svn checkout https://plugins.svn.wordpress.org/footnotes tmp --depth immediates +svn update --quiet tmp/trunk --set-depth infinity +svn update --quiet tmp/tags/$PRERELEASE_VERSION --set-depth infinity +echo -e "Local copy created.\n" + +# Step 7(b): Update `trunk/` +echo -e "Copying files from \`dist/\` to SVN \`trunk/\`...\n" +rsync -avhic dist/ tmp/trunk/ --delete | grep -v "^\." +read -p "Does the above list of changes look correct? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 +echo -e "Copying complete.\n" + +# Step 7(c): Set a release message + +echo "Getting commit message from changelog..." +CHANGELOG_MESSAGE="$(awk -e "/= $DEVELOPMENT_VERSION =/,/= $STABLE_VERSION =/" readme.txt | grep '^-')" +echo -e "The changelog message for this version is:\n" +echo -e "$CHANGELOG_MESSAGE\n" +read -p "Is this correct? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 +echo -e "Commit message set.\n" + +# Step 7(d): Review + +clear +echo "Let's review before pushing to the SVN..." +echo -e "Here is my current state:\n" +echo "Current version:" +echo -e '\t' $PRERELEASE_VERSION +echo "Stable version:" +echo -e '\t' $STABLE_VERSION '\n' +echo "Commit message:\n" +echo -e "$CHANGELOG_MESSAGE" '\n' +echo -e "Changes made to local \`trunk/\`:\n" +svn stat tmp/trunk/ +echo "" +echo -e "\`readme.txt\` header:\n" +head tmp/trunk/readme.txt +echo "" +read -p "Is this all correct? (Y/N): " CONFIRM && [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]] || exit 1 + +# Step 7(d): Push to remote `trunk/` (provided the flag is set) + +if [[ $1 == "-c" ]]; then + svn ci -m "$CHANGELOG_MESSAGE" +else echo "- Commit flag not set, skipping commit step." +fi + +# Step 8: Cleanup + +rm -rf {dist/,tmp/} diff --git a/_tools/setup.sh b/_tools/setup.sh new file mode 100755 index 0000000..fd4c786 --- /dev/null +++ b/_tools/setup.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cp contrib/pre-commit .git/hooks/pre-commit +chmod +x .git/hooks/pre-commit diff --git a/class/config.php b/class/config.php index 8f02119..35634b4 100644 --- a/class/config.php +++ b/class/config.php @@ -5,9 +5,8 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:56 * - * @since 2.0.4 add Public Plugin name for dashboard heading 2020-11-01T0452+0100 + * @since 2.0.4 add Public Plugin name for dashboard heading */ /** diff --git a/class/convert.php b/class/convert.php index c994d7a..d1da59a 100644 --- a/class/convert.php +++ b/class/convert.php @@ -5,9 +5,8 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:56 * - * @since 2.2.0 add lowercase Roman 2020-12-12T1540+0100 + * @since 2.2.0 add lowercase Roman */ /** @@ -102,7 +101,7 @@ class MCI_Footnotes_Convert { * @return string * * Edited: - * @since 2.2.0 optionally lowercase (code from Latin) 2020-12-12T1538+0100 + * @since 2.2.0 optionally lowercase (code from Latin) */ private static function to_romanic( $p_int_value, $p_bool_upper_case ) { // Table containing all necessary romanic letters. diff --git a/class/hooks.php b/class/hooks.php index 375b5ce..11c76c3 100644 --- a/class/hooks.php +++ b/class/hooks.php @@ -5,7 +5,6 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:56 */ /** diff --git a/class/init.php b/class/init.php index a67233e..342d3c8 100644 --- a/class/init.php +++ b/class/init.php @@ -5,16 +5,15 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:56 * * @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 stylesheet 2020-12-04T2231+0100 + * @since 2.0.3 add versioning of public.css for cache busting + * @since 2.0.4 add jQuery UI from WordPress + * @since 2.1.4 automate passing version number for cache busting + * @since 2.1.4 optionally enqueue an extra stylesheet * * @since 2.5.5 Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution. * @since 2.5.5 Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. @@ -44,7 +43,6 @@ class MCI_Footnotes { * - Bugfix: Templates: optimize template load and processing based on settings, thanks to @misfist code contribution. * * @since 2.4.0 - * @date 2021-01-04T1355+0100 * * @contributor Patrizia Lutz @misfist * @link https://wordpress.org/support/topic/template-override-filter/#post-13864301 @@ -72,7 +70,6 @@ class MCI_Footnotes { * @since 2.4.0 * @contributor Patrizia Lutz @misfist * @var bool - * */ public static $a_bool_alternative_tooltips_enabled = false; @@ -127,7 +124,6 @@ class MCI_Footnotes { * * @contributor @felipelavinz * @link https://github.com/benleyjyc/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 - * @date 2020-02-25 * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 * * @see self::initialize_widgets() @@ -210,10 +206,10 @@ class MCI_Footnotes { * @since 1.5.0 * * @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 stylesheet 2020-12-04T2231+0100 + * @since 2.0.3 add versioning of public.css for cache busting + * @since 2.0.4 add jQuery UI from WordPress + * @since 2.1.4 automate passing version number for cache busting + * @since 2.1.4 optionally enqueue an extra stylesheet */ public function register_public() { @@ -268,12 +264,10 @@ class MCI_Footnotes { * Add versioning. * * @since 2.1.2 - * @date 2020-11-18T2150+0100 * * No '-js' in the handle, is appended automatically. * * Deferring to the footer breaks jQuery tooltip display. - * @date 2021-02-23T1105+0100 */ wp_enqueue_script( 'mci-footnotes-jquery-tools', @@ -304,8 +298,7 @@ class MCI_Footnotes { * * Fetch jQuery UI from cdnjs.cloudflare.com. * @since 2.0.0 - * @date 2020-10-26T1907+0100 - * @contributor @vonpiernik + * @contributor @vonpiernik * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762 * * jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * @since 2.1.2 @@ -313,8 +306,7 @@ class MCI_Footnotes { * - Update: Libraries: Load jQuery UI from WordPress, thanks to @check2020de issue report. * * @since 2.0.4 - * @date 2020-11-01T1902+0100 - * @reporter @check2020de + * @reporter @check2020de * @link https://wordpress.org/support/topic/gdpr-issue-with-jquery/ * @link https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui * @@ -326,14 +318,12 @@ class MCI_Footnotes { wp_enqueue_script( 'jquery-ui-tooltip' ); } - } /** * Enables enqueuing a new-scheme stylesheet. * * @since 2.5.5 - * @date 2021-02-14T1512+0100 * * Enables enqueuing the formatted individual stylesheets if false. * WARNING: This facility is designed for development and must NOT be used in production. @@ -341,7 +331,7 @@ class MCI_Footnotes { * The Boolean may be set at the bottom of the plugin’s main PHP file. * @see footnotes.php */ - if ( true === C_BOOL_CSS_PRODUCTION_MODE ) { + if ( PRODUCTION_ENV ) { /** * Enqueues a minified united external stylesheet in production. @@ -350,7 +340,6 @@ class MCI_Footnotes { * - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. * * @since 2.5.5 - * @date 2021-02-14T1543+0100 * * @contributor @docteurfitness * @link https://wordpress.org/support/topic/simply-speed-optimisation/ @@ -362,10 +351,9 @@ class MCI_Footnotes { * @see class/dashboard/layout.php * * @since 2.0.3 add versioning of public.css for cache busting. - * @date 2020-10-29T1413+0100 * Plugin version number is needed for busting browser caches after each plugin update. + * * @since 2.1.4 automate passing version number for cache busting. - * @date 2020-11-30T0646+0100 * The constant C_STR_FOOTNOTES_VERSION is defined at start of footnotes.php. * * The media scope argument 'all' is the default. @@ -387,11 +375,9 @@ class MCI_Footnotes { $l_str_tooltip_mode_long = 'jquery-tooltips'; } - } else { $l_str_tooltip_mode_short = 'nott'; $l_str_tooltip_mode_long = 'no-tooltips'; - } // Set basic responsive page layout mode for use in stylesheet name. @@ -429,19 +415,54 @@ class MCI_Footnotes { * Enqueues external stylesheets, ONLY in development now. * * @since 2.1.4 optionally enqueue an extra stylesheet. - * @date 2020-12-04T2231+0100 - * + * * This optional layout fix is useful by lack of layout support. */ - wp_enqueue_style( 'mci-footnotes-common', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-common.css' ), array(), C_STR_FOOTNOTES_VERSION ); - wp_enqueue_style( 'mci-footnotes-tooltips', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips.css' ), array(), C_STR_FOOTNOTES_VERSION ); + wp_enqueue_style( + 'mci-footnotes-common', + plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-common.css' ), + array(), + filemtime( + plugin_dir_path( + dirname( __FILE__, 1 ) + ) . 'css/dev-common.css' + ) + ); + wp_enqueue_style( + 'mci-footnotes-tooltips', + plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips.css' ), + array(), + filemtime( + plugin_dir_path( + dirname( __FILE__, 1 ) + ) . 'css/dev-tooltips.css' + ) + ); if ( self::$a_bool_amp_enabled ) { - wp_enqueue_style( 'mci-footnotes-amp', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-amp-tooltips.css' ), array(), C_STR_FOOTNOTES_VERSION ); + wp_enqueue_style( + 'mci-footnotes-amp', + plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-amp-tooltips.css' ), + array(), + filemtime( + plugin_dir_path( + dirname( __FILE__, 1 ) + ) . 'css/dev-amp-tooltips.css' + ) + ); } if ( self::$a_bool_alternative_tooltips_enabled ) { - wp_enqueue_style( 'mci-footnotes-alternative', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ), array(), C_STR_FOOTNOTES_VERSION ); + wp_enqueue_style( + 'mci-footnotes-alternative', + plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ), + array(), + filemtime( + plugin_dir_path( + dirname( __FILE__, 1 ) + ) . 'css/dev-tooltips-alternative.css' + ) + ); } $l_str_page_layout_option = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT ); @@ -452,7 +473,11 @@ class MCI_Footnotes { MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-layout-' . $l_str_page_layout_option . '.css' ), array(), - C_STR_FOOTNOTES_VERSION, + filemtime( + plugin_dir_path( + dirname( __FILE__, 1 ) + ) . 'css/dev-layout-' . $l_str_page_layout_option . '.css' + ), 'all' ); } diff --git a/class/language.php b/class/language.php index fd86a8c..d7064da 100644 --- a/class/language.php +++ b/class/language.php @@ -5,7 +5,6 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 14.09.14 17:47 * * @since 2.0.0 Bugfix: Localization: correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution. * @since 2.1.6 Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report. @@ -37,7 +36,6 @@ class MCI_Footnotes_Language { * - Bugfix: Correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution. * * @since 2.0.0 - * @date 2020-10-26T1609+0100 * * @contributor @matkus2 * @link https://wordpress.org/support/topic/error-missing-parameter-if-using-php-7-1-or-later/ @@ -81,7 +79,6 @@ class MCI_Footnotes_Language { * - Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report. * * @since 2.1.6 - * @date 2020-12-08T1931+0100 * * @reporter @nikelaos * @link https://wordpress.org/support/topic/more-feature-ideas/ diff --git a/class/layout/abstract-engine.php b/class/layout/abstract-engine.php index 6221767..6540ae5 100644 --- a/class/layout/abstract-engine.php +++ b/class/layout/abstract-engine.php @@ -5,12 +5,11 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:56 * - * @since 2.1.2 add versioning of settings.css for cache busting 2020-11-19T1456+0100 - * @since 2.1.4 automate passing version number for cache busting 2020-11-30T0648+0100 - * @since 2.1.4 optional step argument and support for floating in numbox 2020-12-05T0540+0100 - * @since 2.1.6 fix punctuation-related localization issue in dashboard labels 2020-12-08T1547+0100 + * @since 2.1.2 add versioning of settings.css for cache busting + * @since 2.1.4 automate passing version number for cache busting + * @since 2.1.4 optional step argument and support for floating in numbox + * @since 2.1.6 fix punctuation-related localization issue in dashboard labels * * @since 2.5.5 Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. */ @@ -199,7 +198,6 @@ abstract class MCI_Footnotes_Layout_Engine { * - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. * * @since 2.5.5 - * @date 2021-02-14T1928+0100 * * @reporter @docteurfitness * @link https://wordpress.org/support/topic/simply-speed-optimisation/ @@ -211,15 +209,16 @@ abstract class MCI_Footnotes_Layout_Engine { * automated update of version number for cache busting. * No need to use '-styles' in the handle, as '-css' is appended automatically. */ - if ( true === C_BOOL_CSS_PRODUCTION_MODE ) { - - wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.min.css' ), array(), C_STR_FOOTNOTES_VERSION ); - - } else { - - wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.css' ), array(), C_STR_FOOTNOTES_VERSION ); - - } + wp_register_style( + 'mci-footnotes-admin', + plugins_url( 'footnotes/css/settings' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.css' ), + array(), + ( PRODUCTION_ENV ) ? C_STR_PACKAGE_VERSION : filemtime( + plugin_dir_path( + dirname( __FILE__, 2 ) + ) . 'css/settings' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.css' + ) + ); wp_enqueue_style( 'mci-footnotes-admin' ); } @@ -340,7 +339,7 @@ abstract class MCI_Footnotes_Layout_Engine { * @since 1.5.0 * @param string $p_str_setting_key_name Settings Array key name. * @return array Contains Settings ID, Settings Name and Settings Value. - * + * * @since 2.5.11 Remove escapement function. * When refactoring the codebase after 2.5.8, all and every output was escaped. * After noticing that the plugin was broken, all escapement functions were removed. @@ -349,7 +348,7 @@ abstract class MCI_Footnotes_Layout_Engine { * In that process, this instance of esc_attr() was removed too, so the plugin was * broken again. * @link https://github.com/markcheret/footnotes/pull/50/commits/25c3f2f12eb5de1079e9215bf624ec4289b095a5#diff-a8ed6e859c32a18fc10bbbad3b4dd8ce7f43f2378d29471c7638e314ab30f1bdL349-L354 - * + * * @since 2.5.15 To fix it, the data was escaped in add_select_box() instead. * @since 2.6.1 Restore esc_attr() in load_setting(). * @see add_select_box() @@ -362,7 +361,7 @@ abstract class MCI_Footnotes_Layout_Engine { $p_arr_return = array(); $p_arr_return['id'] = sprintf( '%s', $p_str_setting_key_name ); $p_arr_return['name'] = sprintf( '%s', $p_str_setting_key_name ); - $p_arr_return['value'] = esc_attr( MCI_Footnotes_Settings::instance()->get( $p_str_setting_key_name ) ); + $p_arr_return['value'] = MCI_Footnotes_Settings::instance()->get( $p_str_setting_key_name ); return $p_arr_return; } @@ -482,7 +481,7 @@ abstract class MCI_Footnotes_Layout_Engine { * @param string $p_str_setting_name Name of the Settings key to pre select the current value. * @param array $p_arr_options Possible options to be selected. * @return string - * + * * @since 2.5.15 Bugfix: Dashboard: General settings: Footnote start and end short codes: debug select box for shortcodes with pointy brackets. * @since 2.6.1 Restore esc_attr() in load_setting(), remove htmlspecialchars() here. */ @@ -497,7 +496,7 @@ abstract class MCI_Footnotes_Layout_Engine { '', $l_str_value, // Only check for equality, not identity, WRT backlink symbol arrows. - $l_str_value == $l_arr_data['value'] ? 'selected' : '', + $l_str_value === $l_arr_data['value'] ? 'selected' : '', $l_str_caption ); } @@ -555,8 +554,7 @@ abstract class MCI_Footnotes_Layout_Engine { * @param bool $p_bool_deci true if 0.1 steps and floating to string, false if integer (default). * @return string * - * Edited: - * @since 2.1.4 step argument and number_format() to allow decimals 2020-12-03T0631+0100..2020-12-12T1110+0100 + * @since 2.1.4 step argument and number_format() to allow decimals. */ protected function add_num_box( $p_str_setting_name, $p_in_min, $p_int_max, $p_bool_deci = false ) { // Collect data for given settings field. diff --git a/class/layout/diagnostics.php b/class/layout/diagnostics.php index 1a30015..0889af6 100644 --- a/class/layout/diagnostics.php +++ b/class/layout/diagnostics.php @@ -5,7 +5,6 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 14.09.14 14:47 */ /** diff --git a/class/layout/init.php b/class/layout/init.php index c3f505e..39318c9 100644 --- a/class/layout/init.php +++ b/class/layout/init.php @@ -5,7 +5,6 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 12.09.14 10:26 */ /** diff --git a/class/layout/settings.php b/class/layout/settings.php index 40808e5..03ea861 100644 --- a/class/layout/settings.php +++ b/class/layout/settings.php @@ -4,39 +4,38 @@ * * @filesource * @since 1.5.0 - * @date 14.09.14 14:47 * - * @since 2.0.4 restore arrow settings 2020-11-01T0509+0100 - * @since 2.1.0 read-on button label 2020-11-08T2148+0100 - * @since 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100 + * @since 2.0.4 restore arrow settings + * @since 2.1.0 read-on button label + * @since 2.1.1 options for ref container and alternative tooltips * @since 2.1.1 Referrers: superscript becomes optional, thanks to @cwbayer bug report * @since 2.1.2 priority level settings for all other hooks, thanks to @nikelaos * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 - * @since 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100 - * @since 2.1.6 slight UI reordering 2020-12-09T1114+0100 - * @since 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100 - * @since 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100 + * @since 2.1.4 settings for ref container, tooltips and scrolling + * @since 2.1.6 slight UI reordering + * @since 2.1.6 option to disable URL line wrapping + * @since 2.1.6 remove expert mode setting as outdated * @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos * @link https://wordpress.org/support/topic/doesnt-work-with-mailpoet/ - * @since 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100 - * @since 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100 - * @since 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100 - * @since 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1244+0100 - * @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2021+0100 + * @since 2.2.0 add options, redistribute, update strings + * @since 2.2.0 shortcode for reference container custom position + * @since 2.2.2 Custom CSS settings container migration + * @since 2.2.4 move backlink symbol selection under previous tab + * @since 2.2.5 support for Ibid. notation thanks to @meglio * @link https://wordpress.org/support/topic/add-support-for-ibid-notation/ - * @since 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 * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ - * @since 2.2.10 reference container row border option, thanks to @noobishh 2020-12-25T2316+0100 + * @since 2.2.10 reference container row border option, thanks to @noobishh * @link https://wordpress.org/support/topic/borders-25/ * @since 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 - * @since 2.3.0 rename Priority level tab as Scope and priority 2020-12-26T2222+0100 - * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 - * @since 2.3.0 mention op. cit. abbreviation 2020-12-28T2342+0100 - * @since 2.3.0 add settings for hard links, thanks to @psykonevro and @martinneumannat 2020-12-29T1322+0100 + * @since 2.3.0 rename Priority level tab as Scope and priority + * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' + * @since 2.3.0 mention op. cit. abbreviation + * @since 2.3.0 add settings for hard links, thanks to @psykonevro and @martinneumannat * @link https://wordpress.org/support/topic/making-it-amp-compatible/ * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ - * @since 2.4.0 footnote shortcode syntax validation 2021-01-01T0624+0100 + * @since 2.4.0 footnote shortcode syntax validation * @since 2.5.0 Shortcode syntax validation: add more information around the setting, thanks to @andreasra * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ */ @@ -121,7 +120,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * * @since 2.0.4 to reflect changes in meta box label display since WPv5.5 * spans need position:fixed and become unlocalizable - * fix: logo is kept only in the label that doesn’t need to be translated: + * fix: logo is kept only in the label that doesn't need to be translated: * Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5 * @see details in class/config.php * @@ -161,6 +160,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { $l_arr_meta_boxes[] = $this->add_meta_box( 'customcss', 'custom-css-new', __( 'Custom CSS', 'footnotes' ), 'custom_css_new' ); $l_arr_meta_boxes[] = $this->add_meta_box( 'how-to', 'help', __( 'Brief introduction: How to use the plugin', 'footnotes' ), 'help' ); + $l_arr_meta_boxes[] = $this->add_meta_box( 'how-to', 'donate', __( 'Help us to improve our Plugin', 'footnotes' ), 'donate' ); return $l_arr_meta_boxes; @@ -179,13 +179,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // Replace all placeholders. $l_obj_template->replace( array( - // Translators: '%s' is the link text 'AMP-WP' linked to the plugin’s front page on WordPress.org. + // Translators: '%s' is the link text 'AMP-WP' linked to the plugin's front page on WordPress.org. 'description-1-amp' => sprintf( __( 'The official %s plugin is required when this option is enabled.', 'footnotes' ), 'AMP-WP' ), 'label-amp' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE, __( 'Enable AMP compatibility mode:', 'footnotes' ) ), 'amp' => $this->add_checkbox( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ), 'notice-amp' => __( 'This option enables hard links with configurable scroll offset in % viewport height.', 'footnotes' ), // Translators: '%s' is the logogram of the 'Footnotes' plugin. - 'description-2-amp' => sprintf( __( '%s is becoming AMP compatible when this box is checked. Styled tooltips are displayed with fade-in/fade-out effect if enabled, and the reference container expands also on clicking a referrer if it’s collapsed by default.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), + 'description-2-amp' => sprintf( __( '%s is becoming AMP compatible when this box is checked. Styled tooltips are displayed with fade-in/fade-out effect if enabled, and the reference container expands also on clicking a referrer if it\'s collapsed by default.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), ) ); // Display template with replaced placeholders. @@ -200,8 +200,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * @since 1.5.0 * * Completed: - * @since 2.1.4: layout and typography options 2020-11-30T0548+0100 - * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 + * @since 2.1.4: layout and typography options + * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ */ public function reference_container() { @@ -237,7 +237,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { ); // Options for the terminating punctuation after backlinks. // The Unicode name of RIGHT PARENTHESIS was originally more accurate because. - // This character is bidi-mirrored. Let’s use the Unicode 1.0 name. + // This character is bidi-mirrored. Let's use the Unicode 1.0 name. // The wrong names were enforced in spite of Unicode, that subsequently scrambled to correct. $l_arr_terminators = array( 'period' => __( 'FULL STOP', 'footnotes' ), @@ -272,7 +272,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-name' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __( 'Heading:', 'footnotes' ) ), 'name' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME ), - 'label-element' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Heading’s HTML element:', 'footnotes' ) ), + 'label-element' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Heading\'s HTML element:', 'footnotes' ) ), 'element' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, $l_arr_label_element ), 'label-border' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, __( 'Border under the heading:', 'footnotes' ) ), @@ -311,11 +311,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-page-layout' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, __( 'Apply basic responsive page layout:', 'footnotes' ) ), 'page-layout' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_page_layout_options ), - 'notice-page-layout' => __( 'Most themes don’t need this fix.', 'footnotes' ), + 'notice-page-layout' => __( 'Most themes don\'t need this fix.', 'footnotes' ), 'label-url-wrap' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, __( 'Allow URLs to line-wrap anywhere:', 'footnotes' ) ), 'url-wrap' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, $l_arr_enabled ), - 'notice-url-wrap' => __( 'Unicode-conformant browsers don’t need this fix.', 'footnotes' ), + 'notice-url-wrap' => __( 'Unicode-conformant browsers don\'t need this fix.', 'footnotes' ), 'label-symbol' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __( 'Display a backlink symbol:', 'footnotes' ) ), 'symbol-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_enabled ), @@ -347,13 +347,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'width-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, $l_arr_enabled ), 'width-scalar' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR, 0, 500, true ), 'width-unit' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT, $l_arr_width_units ), - 'notice-width' => __( 'Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ), + 'notice-width' => __( 'Absolute width in pixels doesn\'t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ), 'label-max-width' => $this->add_label( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, __( 'Set backlinks column maximum width:', 'footnotes' ) ), 'max-width-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, $l_arr_enabled ), 'max-width-scalar' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR, 0, 500, true ), 'max-width-unit' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT, $l_arr_width_units ), - 'notice-max-width' => __( 'Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ), + 'notice-max-width' => __( 'Absolute width in pixels doesn\'t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ), 'label-line-break' => $this->add_label( MCI_Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, __( 'Stack backlinks when enumerating:', 'footnotes' ) ), 'line-break' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_enabled ), @@ -361,8 +361,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-link' => $this->add_label( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ), 'link' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, $l_arr_enabled ), - 'notice-link' => __( 'The link element is needed to apply the theme’s link color.', 'footnotes' ), - 'description-link' => __( 'If the link element is not desired for styling, a simple span is used instead when the above is set to No.', 'footnotes' ), + 'notice-link' => __( 'The link element is needed to apply the theme\'s link color.', 'footnotes' ), + 'description-link' => __( 'If the link element is not desired for styling, a simple span is used instead when the above is set to No. The link addresses have been removed. Else footnote clicks are logged in the browsing history and make the back button unusable.', 'footnotes' ), ) ); // Display template with replaced placeholders. @@ -376,14 +376,14 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * * @since 1.5.0 * - * Edited heading 2020-12-12T1412+0100 - * @since 2.2.0 start/end short codes: more predefined options 2020-12-12T1412+0100 + * Edited heading + * @since 2.2.0 start/end short codes: more predefined options * @link https://wordpress.org/support/topic/doesnt-work-with-mailpoet/ - * @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100 - * @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2019+0100 + * @since 2.2.0 3 boxes for clarity + * @since 2.2.5 support for Ibid. notation thanks to @meglio * @link https://wordpress.org/support/topic/add-support-for-ibid-notation/ - * @since 2.4.0 added warning about Block Editor escapement disruption 2021-01-02T2324+0100 - * @since 2.4.0 removed the HTML comment tag option 2021-01-02T2325+0100 + * @since 2.4.0 added warning about Block Editor escapement disruption + * @since 2.4.0 removed the HTML comment tag option * @since 2.5.0 Shortcode syntax validation: add more information around the setting, thanks to @andreasra * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ */ @@ -427,7 +427,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // Replace all placeholders. $l_obj_template->replace( array( - 'description-escapement' => __( 'When delimiters with pointy brackets are used, the diverging escapement schemas will be unified before footnotes are processed.', 'footnotes' ), + // Translators: The 2 placeholders are the <ref></ref> and <fn></fn> shortcodes. + 'description-escapement' => sprintf( __( 'The problems with shortcodes with pointy brackets have been solved. We apologize for the longlasting bugs making the %1$s and %2$s shortcodes close to unusable.', 'footnotes' ), '<ref></ref>', '<fn></fn>' ), 'label-short-code-start' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, __( 'Footnote start tag short code:', 'footnotes' ) ), 'short-code-start' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, $l_arr_shortcode_start ), @@ -450,7 +451,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'syntax' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, $l_arr_enable ), 'notice-syntax' => __( 'In the presence of a lone start tag shortcode, a warning displays below the post title.', 'footnotes' ), - 'description-syntax' => __( 'If the start tag short code is ‘((’ or ‘(((’, it will not be reported as unbalanced if the following string contains braces hinting that it is a script.', 'footnotes' ), + 'description-syntax' => __( 'If the start tag short code is \'((\' or \'(((\', it will not be reported as unbalanced if the following string contains braces hinting that it is a script.', 'footnotes' ), ) ); // Display template with replaced placeholders. @@ -474,12 +475,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { ); // Options for the numbering style of the footnotes. $l_arr_counter_style = array( - 'arabic_plain' => __( 'plain Arabic numbers', 'footnotes' ) . $l_str_space . '1, 2, 3, 4, 5, …', - 'arabic_leading' => __( 'zero-padded Arabic numbers', 'footnotes' ) . $l_str_space . '01, 02, 03, 04, 05, …', - 'latin_low' => __( 'lowercase Latin letters', 'footnotes' ) . $l_str_space . 'a, b, c, d, e, …', - 'latin_high' => __( 'uppercase Latin letters', 'footnotes' ) . $l_str_space . 'A, B, C, D, E, …', - 'romanic' => __( 'uppercase Roman numerals', 'footnotes' ) . $l_str_space . 'I, II, III, IV, V, …', - 'roman_low' => __( 'lowercase Roman numerals', 'footnotes' ) . $l_str_space . 'i, ii, iii, iv, v, …', + 'arabic_plain' => __( 'plain Arabic numbers', 'footnotes' ) . $l_str_space . '1, 2, 3, 4, 5, ...', + 'arabic_leading' => __( 'zero-padded Arabic numbers', 'footnotes' ) . $l_str_space . '01, 02, 03, 04, 05, ...', + 'latin_low' => __( 'lowercase Latin letters', 'footnotes' ) . $l_str_space . 'a, b, c, d, e, ...', + 'latin_high' => __( 'uppercase Latin letters', 'footnotes' ) . $l_str_space . 'A, B, C, D, E, ...', + 'romanic' => __( 'uppercase Roman numerals', 'footnotes' ) . $l_str_space . 'I, II, III, IV, V, ...', + 'roman_low' => __( 'lowercase Roman numerals', 'footnotes' ) . $l_str_space . 'i, ii, iii, iv, v, ...', ); // Load template file. @@ -523,34 +524,34 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { $l_obj_template->replace( array( - 'label-scroll-css' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, __( 'CSS-based smooth scrolling:', 'footnotes' ) ), - 'scroll-css' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, $l_arr_enable ), - 'notice-scroll-css' => __( 'May slightly disturb jQuery scrolling and is therefore disabled by default. Works in recent browsers.', 'footnotes' ), + 'label-scroll-css' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, __( 'CSS-based smooth scrolling:', 'footnotes' ) ), + 'scroll-css' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, $l_arr_enable ), + 'notice-scroll-css' => __( 'May slightly disturb jQuery scrolling and is therefore disabled by default. Works in recent browsers.', 'footnotes' ), - 'label-scroll-offset' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __( 'Scroll offset:', 'footnotes' ) ), - 'scroll-offset' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100 ), - 'notice-scroll-offset' => __( 'per cent viewport height from the upper edge', 'footnotes' ), + 'label-scroll-offset' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __( 'Scroll offset:', 'footnotes' ) ), + 'scroll-offset' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100 ), + 'notice-scroll-offset' => __( 'per cent viewport height from the upper edge', 'footnotes' ), - 'label-scroll-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __( 'Scroll duration:', 'footnotes' ) ), - 'scroll-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000 ), - 'notice-scroll-duration' => __( 'milliseconds. If asymmetric scroll durations are enabled, this is the scroll-up duration.', 'footnotes' ), + 'label-scroll-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __( 'Scroll duration:', 'footnotes' ) ), + 'scroll-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000 ), + 'notice-scroll-duration' => __( 'milliseconds. If asymmetric scroll durations are enabled, this is the scroll-up duration.', 'footnotes' ), // Enable scroll duration asymmetricity. - 'label-scroll-asymmetricity' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, __( 'Enable asymmetric scroll durations:', 'footnotes' ) ), - 'scroll-asymmetricity' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, $l_arr_enable ), - 'notice-scroll-asymmetricity' => __( 'With this option enabled, scrolling up may take longer than down, or conversely.', 'footnotes' ), + 'label-scroll-asymmetricity' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, __( 'Enable asymmetric scroll durations:', 'footnotes' ) ), + 'scroll-asymmetricity' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, $l_arr_enable ), + 'notice-scroll-asymmetricity' => __( 'With this option enabled, scrolling up may take longer than down, or conversely.', 'footnotes' ), - 'label-scroll-down-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, __( 'Scroll-down duration:', 'footnotes' ) ), - 'scroll-down-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, 0, 20000 ), - 'notice-scroll-down-duration' => __( 'milliseconds', 'footnotes' ), + 'label-scroll-down-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, __( 'Scroll-down duration:', 'footnotes' ) ), + 'scroll-down-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, 0, 20000 ), + 'notice-scroll-down-duration' => __( 'milliseconds', 'footnotes' ), - 'label-scroll-down-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, __( 'Scroll-down delay:', 'footnotes' ) ), - 'scroll-down-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, 0, 20000 ), - 'notice-scroll-down-delay' => __( 'milliseconds. Useful to see the effect on input elements when referrers without hard links are clicked in form labels.', 'footnotes' ), + 'label-scroll-down-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, __( 'Scroll-down delay:', 'footnotes' ) ), + 'scroll-down-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, 0, 20000 ), + 'notice-scroll-down-delay' => __( 'milliseconds. Useful to see the effect on input elements when referrers without hard links are clicked in form labels.', 'footnotes' ), - 'label-scroll-up-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, __( 'Scroll-up delay:', 'footnotes' ) ), - 'scroll-up-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, 0, 20000 ), - 'notice-scroll-up-delay' => __( 'milliseconds. Less useful than the scroll-down delay.', 'footnotes' ), + 'label-scroll-up-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, __( 'Scroll-up delay:', 'footnotes' ) ), + 'scroll-up-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, 0, 20000 ), + 'notice-scroll-up-delay' => __( 'milliseconds. Less useful than the scroll-down delay.', 'footnotes' ), ) ); @@ -619,8 +620,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * @since 1.5.0 * * Edited: - * @since 2.2.0 position-sensitive placeholders to support more locales 2020-12-11T0432+0100 - * @since 2.2.0 more options 2020-12-11T0432+0100 + * @since 2.2.0 position-sensitive placeholders to support more locales + * @since 2.2.0 more options */ public function love() { // Options for the acknowledgment display in the footer. @@ -641,7 +642,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'text-2' => sprintf( __( 'This website uses the awesome %s plugin.', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ), 'random' => __( 'randomly determined display of either mention', 'footnotes' ), // Translators: 1: Plugin logo.2: heart symbol. - 'no' => sprintf( __( 'no display of any “%1$s %2$s” mention in the footer', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL ), + 'no' => sprintf( __( 'no display of any "%1$s %2$s" mention in the footer', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL ), ); // Load template file. @@ -650,7 +651,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { $l_obj_template->replace( array( // Translators: %s: Footnotes plugin logo. - 'label-love' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world you’re using %s:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ), + 'label-love' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world you\'re using %s:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ), 'love' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, $l_arr_love ), // Translators: %s: Footnotes plugin logo. 'label-no-love' => $this->add_text( sprintf( __( 'Shortcode to inhibit the display of the %s mention on specific pages:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ), @@ -668,11 +669,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * * @since 1.5.0 * - * Edited heading 2020-12-12T1453+0100 + * Edited heading * @since 2.1.1 more settings and notices, thanks to @nikelaos * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13687068 * @link https://wordpress.org/support/topic/jquery-comes-up-in-feed-content/#post-13110879 - * @since 2.2.0 dedicated to the excerpt setting and its notices 2020-12-12T1454+0100 + * @since 2.2.0 dedicated to the excerpt setting and its notices */ public function excerpts() { // Options for options select box. @@ -687,12 +688,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // Replace all placeholders. $l_obj_template->replace( array( - 'label-excerpts' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, __( 'Process footnotes in excerpts:', 'footnotes' ) ), - 'excerpts' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, $l_arr_excerpt_mode ), - 'notice-excerpts' => __( 'If the_excerpt is enabled.', 'footnotes' ), - // Translators: %s: link text 'Advanced Excerpt' linked to the plugin’s WordPress.org front page. + 'label-excerpts' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, __( 'Display footnotes in excerpts:', 'footnotes' ) ), + 'excerpts' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, $l_arr_enabled ), + 'notice-excerpts' => __( 'For this setting to be effective, the hook the_excerpt must be enabled under Scope and priority.', 'footnotes' ), + // Translators: %s: link text 'Advanced Excerpt' linked to the plugin's WordPress.org front page. // Translators: %s: Footnotes plugin logo. - 'description-excerpts' => sprintf( __( 'To not display footnotes in excerpts, the %s plugin generates excerpts on the basis of the posts to be able to remove the footnotes. Else, footnotes may be processed in manual excerpts OR processed based on the posts. — For this setting to be effective, the hook the_excerpt must be enabled under Scope and priority.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), + 'description-excerpts' => sprintf( __( 'Both to display footnotes and to not display footnotes in excerpts, the %s plugin generates excerpts on the basis of the posts to ensure that footnotes are handled and don\'t impact the excerpt length.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), ) ); // Display template with replaced placeholders. @@ -706,9 +707,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * * @since 1.5.0 * - * Edited heading 2020-12-12T1513+0100 + * Edited heading * @since 2.1.1 option for superscript (optionally baseline referrers) - * @since 2.2.0 option for link element moved here 2020-12-12T1514+0100 + * @since 2.2.0 option for link element moved here */ public function superscript() { // Options for Yes/No select box. @@ -732,7 +733,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-normalize' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, __( 'Normalize vertical alignment and font size:', 'footnotes' ) ), 'normalize' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, $l_arr_normalize_superscript ), - 'notice-normalize' => __( 'Most themes don’t need this fix.', 'footnotes' ), + 'notice-normalize' => __( 'Most themes don\'t need this fix.', 'footnotes' ), 'label-before' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __( 'At the start of the footnote referrers:', 'footnotes' ) ), 'before' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE ), @@ -741,7 +742,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'after' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER ), 'label-link' => $this->add_label( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ), - 'notice-link' => __( 'Please find this setting at the end of the reference container settings. The link element is needed to apply the theme’s link color.', 'footnotes' ), + 'notice-link' => __( 'Please find this setting at the end of the reference container settings. The link element is needed to apply the theme\'s link color.', 'footnotes' ), ) ); // Display template with replaced placeholders. @@ -759,7 +760,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // Options for the input label issue solution. $l_arr_issue_solutions = array( 'none' => __( '0. No problem or solved otherwise', 'footnotes' ), - 'move' => __( 'A. Footnotes are moved out and appended after the label’s end (recommended)', 'footnotes' ), + 'move' => __( 'A. Footnotes are moved out and appended after the label\'s end (recommended)', 'footnotes' ), 'disconnect' => __( 'B. Labels with footnotes are disconnected from input element (discouraged)', 'footnotes' ), ); // Load template file. @@ -767,10 +768,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // Replace all placeholders. $l_obj_template->replace( array( - 'description-1-selection' => __( 'Clicking a footnote referrer in an input element label toggles the input except when hard links are enabled. In jQuery mode, the recommended solution is to move footnotes and append them after the label (option A).', 'footnotes' ), + 'description-1-selection' => __( 'Clicking a footnote referrer in an input element label toggles the input except when hard links are enabled. In jQuery mode, the recommended solution is to move footnotes and append them after the label (option A).', 'footnotes' ), 'label-selection' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, __( 'Solve input label issue:', 'footnotes' ) ), 'selection' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, $l_arr_issue_solutions ), - 'description-2-selection' => __( 'Option B is discouraged because disconnecting a label from its input element may compromise accessibility. This option is a last resort in case footnotes must absolutely stay inside the label. (Using jQuery ‘event.stopPropagation’ failed.)', 'footnotes' ), + 'description-2-selection' => __( 'Option B is discouraged because disconnecting a label from its input element may compromise accessibility. This option is a last resort in case footnotes must absolutely stay inside the label. (Using jQuery \'event.stopPropagation\' failed.)', 'footnotes' ), ) ); // Display template with replaced placeholders. @@ -809,7 +810,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'alternative' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_enabled ), 'notice-alternative' => __( 'Intended to work around a configuration-related tooltip outage.', 'footnotes' ), // Translators: %s: Footnotes plugin logo. - 'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes’ internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), + 'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes\' internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.', 'footnotes' ), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ), ) ); @@ -963,7 +964,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // The feature trims back until the last full word. 'notice-max-length' => __( 'No weird cuts.', 'footnotes' ), - 'label-readon' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( '‘Read on’ button label:', 'footnotes' ) ), + 'label-readon' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( '\'Read on\' button label:', 'footnotes' ) ), 'readon' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL ), ) @@ -1053,12 +1054,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __( 'Text color:', 'footnotes' ) ), 'color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR ), // Translators: %s: Clear or leave empty. - 'notice-color' => sprintf( __( 'To use the current theme’s default text color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), + 'notice-color' => sprintf( __( 'To use the current theme\'s default text color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), 'label-background' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND, __( 'Background color:', 'footnotes' ) ), 'background' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND ), // Translators: %s: Clear or leave empty. - 'notice-background' => sprintf( __( 'To use the current theme’s default background color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), + 'notice-background' => sprintf( __( 'To use the current theme\'s default background color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), 'label-border-width' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, __( 'Border width:', 'footnotes' ) ), 'border-width' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true ), @@ -1067,7 +1068,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-border-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR, __( 'Border color:', 'footnotes' ) ), 'border-color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR ), // Translators: %s: Clear or leave empty. - 'notice-border-color' => sprintf( __( 'To use the current theme’s default border color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), + 'notice-border-color' => sprintf( __( 'To use the current theme\'s default border color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), 'label-border-radius' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __( 'Rounded corner radius:', 'footnotes' ) ), 'border-radius' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500 ), @@ -1076,7 +1077,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { 'label-box-shadow-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __( 'Box shadow color:', 'footnotes' ) ), 'box-shadow-color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR ), // Translators: %s: Clear or leave empty. - 'notice-box-shadow-color' => sprintf( __( 'To use the current theme’s default box shadow color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), + 'notice-box-shadow-color' => sprintf( __( 'To use the current theme\'s default box shadow color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ), ) ); @@ -1103,7 +1104,6 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * - Update: Restore arrow settings to customize or disable the now prepended arrow symbol, thanks to @mmallett issue report. * * @since 2.0.4 - * @date 2020-11-02T2115+0100 * * @reporter @mmallett * @link https://wordpress.org/support/topic/mouse-over-broken/#post-13593037 @@ -1139,10 +1139,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * @since 2.1.6 drop localized notices for CSS classes as the number increased to 16 * list directly in the template, as CSS is in English anyway * @see templates/dashboard/customize-css.html - * 2020-12-09T1113+0100 * - * @since 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0506+0100 - * @since 2.3.0 say 'copy-paste' instead of 'cut and paste' since cutting is not needed 2020-12-27T1257+0100 + * @since 2.2.2 migrate Custom CSS to a dedicated tab + * @since 2.3.0 say 'copy-paste' instead of 'cut and paste' since cutting is not needed * @since 2.5.1 mention validity while visible, thanks to @rkupadhya bug report */ public function custom_css() { @@ -1157,7 +1156,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { // phpcs:disable Squiz.PHP.CommentedOutCode.Found // CSS classes are listed in the template. - // Localized notices are dropped to ease translators’ task. + // Localized notices are dropped to ease translators' task. // "label-class-1" => ".footnote_plugin_tooltip_text",. // "class-1" => $this->add_text(__("superscript, Footnotes index", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),. @@ -1244,8 +1243,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * @since 1.5.5 * * Edited: - * @since 2.1.1 priority level setting for the_content 2020-11-16T2152+0100 - * @since 2.1.4 priority level settings for the other hooks 2020-11-19T1421+0100 + * @since 2.1.1 priority level setting for the_content + * @since 2.1.4 priority level settings for the other hooks * * priority level was initially hard-coded default * shows "9223372036854775807" in the numbox @@ -1253,8 +1252,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { * but a numbox cannot be set to empty: * define -1 as PHP_INT_MAX instead * - * @since 2.2.9 removed the warning about the widget text hook 2020-12-25T0348+0100 - * @since 2.2.9 added guidance for the widget text hook 2020-12-25T0353+0100 + * @since 2.2.9 removed the warning about the widget text hook + * @since 2.2.9 added guidance for the widget text hook */ public function lookup_hooks() { // Load template file. @@ -1327,19 +1326,19 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { $l_arr_footnote_ending_tag = $this->load_setting( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ); } $l_str_example = 'Hello' . $l_arr_footnote_starting_tag['value'] . - 'Sed ut perspiciatis, unde omnis iste natus error ' . - 'sit voluptatem accusantium doloremque laudantium, ' . - 'totam rem aperiam eaque ipsa, quae ab illo ' . - 'inventore veritatis et quasi architecto beatae ' . - 'vitae dicta sunt, explicabo. Nemo enim ipsam ' . - 'voluptatem, quia voluptas sit, aspernatur aut ' . - 'odit aut fugit, sed quia consequuntur magni ' . - 'dolores eos, qui ratione voluptatem sequi nesciunt, ' . - 'neque porro quisquam est, qui dolorem ipsum, quia ' . - 'dolor sit amet, consectetur, adipisci velit, sed ' . - 'quia non numquam eius modi tempora incidunt, ut ' . - 'labore et dolore magnam aliquam quaerat voluptatem.' . - $l_arr_footnote_ending_tag['value'] . ' World!'; + 'Sed ut perspiciatis, unde omnis iste natus error ' . + 'sit voluptatem accusantium doloremque laudantium, ' . + 'totam rem aperiam eaque ipsa, quae ab illo ' . + 'inventore veritatis et quasi architecto beatae ' . + 'vitae dicta sunt, explicabo. Nemo enim ipsam ' . + 'voluptatem, quia voluptas sit, aspernatur aut ' . + 'odit aut fugit, sed quia consequuntur magni ' . + 'dolores eos, qui ratione voluptatem sequi nesciunt, ' . + 'neque porro quisquam est, qui dolorem ipsum, quia ' . + 'dolor sit amet, consectetur, adipisci velit, sed ' . + 'quia non numquam eius modi tempora incidunt, ut ' . + 'labore et dolore magnam aliquam quaerat voluptatem.' . + $l_arr_footnote_ending_tag['value'] . ' World!'; // Load template file. $l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'how-to-help' ); @@ -1348,7 +1347,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine { array( 'label-start' => __( 'Start your footnote with the following short code:', 'footnotes' ), 'start' => $l_arr_footnote_starting_tag['value'], - 'label-end' => __( '…and end your footnote with this short code:', 'footnotes' ), + 'label-end' => __( '...and end your footnote with this short code:', 'footnotes' ), 'end' => $l_arr_footnote_ending_tag['value'], 'example-code' => $l_str_example, 'example-string' => '
' . __( 'will be displayed as:', 'footnotes' ), diff --git a/class/settings.php b/class/settings.php index 9535027..3b05d0c 100644 --- a/class/settings.php +++ b/class/settings.php @@ -5,7 +5,6 @@ * @filesource * @package footnotes * @since 1.5.0 - * @date 14.09.14 10:43 * * The constants are ordered by ascending version so their docblocks can replace most of this list. * @since 2.0.0 Update: **symbol for backlinks** removed; hyperlink moved to the reference number. @@ -106,7 +105,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/mouse-over-broken/#post-13593037 * * @since 2.0.4 - * @date 2020-11-02T2115+0100 * @var str */ const C_STR_HYPERLINK_ARROW = 'footnote_inputfield_custom_hyperlink_symbol'; @@ -149,7 +147,6 @@ class MCI_Footnotes_Settings { * - as in English or US American typesetting; * - for better UX thanks to a more button-like appearance; * - for stylistic consistency with the expand-collapse button. - * */ const C_STR_FOOTNOTES_STYLING_BEFORE = 'footnote_inputfield_custom_styling_before'; @@ -291,11 +288,9 @@ class MCI_Footnotes_Settings { * @var str * * @since 2.1.6 This setting removed as irrelevant since priority level settings need permanent visibility. - * @date 2020-12-09T2107+0100 * * Since the removal of the the_post hook, the tab is no danger zone any longer. * All users, not experts only, need to be able to control relative positioning. - * @date 2020-11-06T1342+0100 */ const C_STR_FOOTNOTES_EXPERT_MODE = 'footnote_inputfield_enable_expert_mode'; @@ -425,7 +420,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/offset-x-axis-and-offset-y-axis-does-not-working/ * * @since 2.1.0 - * @date 2020-11-08T2106+0100 * @var str */ const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = 'footnote_inputfield_readon_label'; @@ -439,7 +433,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13632566 * * @since 2.1.1 - * @date 2020-11-11T1817+0100 * @var str * * These alternative tooltips work around a website related jQuery UI @@ -458,7 +451,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/ * * @since 2.1.1 - * @date 2020-11-16T0859+0100 * @var str */ const C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = 'footnotes_inputfield_referrer_superscript_tags'; @@ -472,7 +464,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13671138 * * @since 2.1.1 - * @date 2020-11-16T2021+0100 * @var str */ const C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = 'footnotes_inputfield_reference_container_backlink_symbol_enable'; @@ -509,7 +500,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994 * * @since 2.1.1 - * @date 2020-11-16T2024+0100 * @var str */ const C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = 'footnotes_inputfield_reference_container_backlink_symbol_switch'; @@ -529,7 +519,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345 * * @since 2.0.5 - * @date 2020-11-02T0330+0100 * @link https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter * * - Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report. @@ -538,7 +527,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345 * * @since 2.1.1 - * @date 2020-11-16T0859+0100 * * - Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict, thanks to @marthalindeman bug report. * @@ -546,7 +534,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/code-showing-up-in-references/ * * @since 2.1.6 - * @date 2020-12-10T0447+0100 * * Priority level of the_content and of widget_text as the only relevant * hooks must be less than 99 because social buttons may yield scripts @@ -576,16 +563,14 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 * * @since 2.1.2 - * @date 2020-11-20T0620+0100 * @var int */ - const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_the_title_priority_level'; + const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_the_title_priority_level'; /** * Settings container key for 'widget_title' hook priority level. * * @since 2.1.2 - * @date 2020-11-20T0620+0100 * @var int */ const C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_widget_title_priority_level'; @@ -594,19 +579,17 @@ class MCI_Footnotes_Settings { * Settings container key for 'widget_text' hook priority level. * * @since 2.1.2 - * @date 2020-11-20T0620+0100 * @var int */ - const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_widget_text_priority_level'; + const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_widget_text_priority_level'; /** * Settings container key for 'the_excerpt' hook priority level. * * @since 2.1.2 - * @date 2020-11-20T0620+0100 * @var int */ - const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_the_excerpt_priority_level'; + const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = 'footnote_inputfield_expert_lookup_the_excerpt_priority_level'; /** * Settings container key for the link element option. @@ -635,7 +618,7 @@ class MCI_Footnotes_Settings { * Backlink separators and terminators are often not preferred. * But a choice must be provided along with the ability to customize. */ - const C_STR_BACKLINKS_SEPARATOR_ENABLED = 'footnotes_inputfield_backlinks_separator_enabled'; + const C_STR_BACKLINKS_SEPARATOR_ENABLED = 'footnotes_inputfield_backlinks_separator_enabled'; /** * Settings container key for the backlink separator options. @@ -643,7 +626,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_SEPARATOR_OPTION = 'footnotes_inputfield_backlinks_separator_option'; + const C_STR_BACKLINKS_SEPARATOR_OPTION = 'footnotes_inputfield_backlinks_separator_option'; /** * Settings container key for a custom backlink separator. @@ -651,7 +634,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_SEPARATOR_CUSTOM = 'footnotes_inputfield_backlinks_separator_custom'; + const C_STR_BACKLINKS_SEPARATOR_CUSTOM = 'footnotes_inputfield_backlinks_separator_custom'; /** * Settings container key to enable the presence of a backlink terminator. @@ -667,7 +650,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_TERMINATOR_OPTION = 'footnotes_inputfield_backlinks_terminator_option'; + const C_STR_BACKLINKS_TERMINATOR_OPTION = 'footnotes_inputfield_backlinks_terminator_option'; /** * Settings container key for a custom backlink terminator. @@ -675,7 +658,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_TERMINATOR_CUSTOM = 'footnotes_inputfield_backlinks_terminator_custom'; + const C_STR_BACKLINKS_TERMINATOR_CUSTOM = 'footnotes_inputfield_backlinks_terminator_custom'; /** * Settings container key to enable the backlinks column width. @@ -683,7 +666,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED = 'footnotes_inputfield_backlinks_column_width_enabled'; + const C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED = 'footnotes_inputfield_backlinks_column_width_enabled'; /** * Settings container key for the backlinks column width scalar. @@ -691,7 +674,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var int */ - const C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR = 'footnotes_inputfield_backlinks_column_width_scalar'; + const C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR = 'footnotes_inputfield_backlinks_column_width_scalar'; /** * Settings container key for the backlinks column width unit. @@ -699,7 +682,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_COLUMN_WIDTH_UNIT = 'footnotes_inputfield_backlinks_column_width_unit'; + const C_STR_BACKLINKS_COLUMN_WIDTH_UNIT = 'footnotes_inputfield_backlinks_column_width_unit'; /** * Settings container key to enable a max width for the backlinks column. @@ -715,7 +698,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var int */ - const C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR = 'footnotes_inputfield_backlinks_column_max_width_scalar'; + const C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR = 'footnotes_inputfield_backlinks_column_max_width_scalar'; /** * Settings container key for the backlinks column max width unit. @@ -723,7 +706,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT = 'footnotes_inputfield_backlinks_column_max_width_unit'; + const C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT = 'footnotes_inputfield_backlinks_column_max_width_unit'; /** * Settings container key to enable line breaks between backlinks. @@ -732,13 +715,12 @@ class MCI_Footnotes_Settings { * @var str * Whether a
tag is inserted. */ - const C_STR_BACKLINKS_LINE_BREAKS_ENABLED = 'footnotes_inputfield_backlinks_line_breaks_enabled'; + const C_STR_BACKLINKS_LINE_BREAKS_ENABLED = 'footnotes_inputfield_backlinks_line_breaks_enabled'; /** * Settings container key to enable setting the tooltip font size. * * @since 2.1.4 - * @date 2020-12-04T1023+0100. * @var str * * Tooltip font size reset to legacy by default since 2.1.4; @@ -753,7 +735,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var flo */ - const C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR = 'footnotes_inputfield_mouse_over_box_font_size_scalar'; + const C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR = 'footnotes_inputfield_mouse_over_box_font_size_scalar'; /** * Settings container key for the unit of the tooltip font size. @@ -761,7 +743,7 @@ class MCI_Footnotes_Settings { * @since 2.1.4 * @var str */ - const C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT = 'footnotes_inputfield_mouse_over_box_font_size_unit'; + const C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT = 'footnotes_inputfield_mouse_over_box_font_size_unit'; /** * Settings container key for basic responsive page layout support options. @@ -778,10 +760,9 @@ class MCI_Footnotes_Settings { * - Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ - const C_INT_FOOTNOTES_SCROLL_OFFSET = 'footnotes_inputfield_scroll_offset'; + const C_INT_FOOTNOTES_SCROLL_OFFSET = 'footnotes_inputfield_scroll_offset'; /** * Settings container key for scroll duration. @@ -789,7 +770,6 @@ class MCI_Footnotes_Settings { * - Bugfix: Scroll duration: make configurable to conform to website content and style requirements. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ const C_INT_FOOTNOTES_SCROLL_DURATION = 'footnotes_inputfield_scroll_duration'; @@ -798,34 +778,30 @@ class MCI_Footnotes_Settings { * Settings container key for tooltip display fade-in delay. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ - const C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY = 'footnotes_inputfield_mouse_over_box_fade_in_delay'; + const C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY = 'footnotes_inputfield_mouse_over_box_fade_in_delay'; /** * Settings container key for tooltip display fade-in duration. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ - const C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION = 'footnotes_inputfield_mouse_over_box_fade_in_duration'; + const C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION = 'footnotes_inputfield_mouse_over_box_fade_in_duration'; /** * Settings container key for tooltip display fade-out delay. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ - const C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY = 'footnotes_inputfield_mouse_over_box_fade_out_delay'; + const C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY = 'footnotes_inputfield_mouse_over_box_fade_out_delay'; /** * Settings container key for tooltip display fade-out duration. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * @var int */ const C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION = 'footnotes_inputfield_mouse_over_box_fade_out_duration'; @@ -837,7 +813,6 @@ class MCI_Footnotes_Settings { * Unicode-compliant browsers break URLs at slashes. * * @since 2.1.6 - * @date 2020-12-09T1606+0100 * @var str */ const C_STR_FOOTNOTE_URL_WRAP_ENABLED = 'footnote_inputfield_url_wrap_enabled'; @@ -851,7 +826,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/reference-container-in-elementor/ * * @since 2.2.0 - * @date 2020-12-13T2056+0100 * @var str */ const C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE = 'footnote_inputfield_reference_container_position_shortcode'; @@ -862,7 +836,6 @@ class MCI_Footnotes_Settings { * - Update: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed. * * @since 2.2.2 - * @date 2020-12-15T0520+0100 * @var str */ const C_STR_CUSTOM_CSS_NEW = 'footnote_inputfield_custom_css_new'; @@ -871,13 +844,11 @@ class MCI_Footnotes_Settings { * Settings container key to enable display of legacy Custom CSS metaboxes. * * @since 2.2.2 - * @date 2020-12-15T0520+0100 * @var str * * - Bugfix: Dashboard: Custom CSS: swap migration Boolean, meaning 'show legacy' instead of 'migration complete', due to storage data structure constraints. * * @since 2.3.0 - * @date 2020-12-27T1233+0100 * * The Boolean must be false if its setting is contained in the container to be hidden, * because when saving, all missing constants are emptied, and to_bool() converts empty to false. @@ -888,7 +859,6 @@ class MCI_Footnotes_Settings { * Settings container key for alternative tooltip position. * * @since 2.2.5 - * @date 2020-12-17T0746+0100 * @var str * * Fixed width is for alternative tooltips, cannot reuse max-width nor offsets. @@ -899,7 +869,6 @@ class MCI_Footnotes_Settings { * Settings container key for alternative tooltip x offset. * * @since 2.2.5 - * @date 2020-12-17T0746+0100 * @var int */ const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X = 'footnotes_inputfield_alternative_mouse_over_box_offset_x'; @@ -908,7 +877,6 @@ class MCI_Footnotes_Settings { * Settings container key for alternative tooltip y offset. * * @since 2.2.5 - * @date 2020-12-17T0746+0100 * @var int */ const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y = 'footnotes_inputfield_alternative_mouse_over_box_offset_y'; @@ -917,10 +885,9 @@ class MCI_Footnotes_Settings { * Settings container key for alternative tooltip width. * * @since 2.2.5 - * @date 2020-12-17T0746+0100 * @var int */ - const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH = 'footnotes_inputfield_alternative_mouse_over_box_width'; + const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH = 'footnotes_inputfield_alternative_mouse_over_box_width'; /** @@ -932,10 +899,9 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * * @since 2.2.5 - * @date 2020-12-18T1509+0100 * @var str */ - const C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT = 'footnotes_inputfield_reference_container_label_element'; + const C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT = 'footnotes_inputfield_reference_container_label_element'; /** * Settings container key to enable the reference container label bottom border. @@ -946,7 +912,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * * @since 2.2.5 - * @date 2020-12-18T1509+0100 * @var str */ const C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER = 'footnotes_inputfield_reference_container_label_bottom_border'; @@ -960,7 +925,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/borders-25/ * * @since 2.2.10 - * @date 2020-12-25T2311+0100 * @var str */ const C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE = 'footnotes_inputfield_reference_container_row_borders_enable'; @@ -974,10 +938,9 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var int */ - const C_INT_REFERENCE_CONTAINER_TOP_MARGIN = 'footnotes_inputfield_reference_container_top_margin'; + const C_INT_REFERENCE_CONTAINER_TOP_MARGIN = 'footnotes_inputfield_reference_container_top_margin'; /** * Settings container key for reference container bottom margin. @@ -988,7 +951,6 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var int */ const C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN = 'footnotes_inputfield_reference_container_bottom_margin'; @@ -1005,45 +967,40 @@ class MCI_Footnotes_Settings { * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var str * * When the alternative reference container is enabled, hard links are too. */ - const C_STR_FOOTNOTES_HARD_LINKS_ENABLE = 'footnotes_inputfield_hard_links_enable'; + const C_STR_FOOTNOTES_HARD_LINKS_ENABLE = 'footnotes_inputfield_hard_links_enable'; /** * Settings container key for the fragment ID slug in referrers. * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var str */ - const C_STR_REFERRER_FRAGMENT_ID_SLUG = 'footnotes_inputfield_referrer_fragment_id_slug'; + const C_STR_REFERRER_FRAGMENT_ID_SLUG = 'footnotes_inputfield_referrer_fragment_id_slug'; /** * Settings container key for the fragment ID slug in footnotes. * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var str */ - const C_STR_FOOTNOTE_FRAGMENT_ID_SLUG = 'footnotes_inputfield_footnote_fragment_id_slug'; + const C_STR_FOOTNOTE_FRAGMENT_ID_SLUG = 'footnotes_inputfield_footnote_fragment_id_slug'; /** * Settings container key for the ID separator in fragment IDs. * * @since 2.3.0 - * @date 2020-12-29T0914+0100 * @var str */ - const C_STR_HARD_LINK_IDS_SEPARATOR = 'footnotes_inputfield_hard_link_ids_separator'; + const C_STR_HARD_LINK_IDS_SEPARATOR = 'footnotes_inputfield_hard_link_ids_separator'; /** * Settings container key to enable shortcode syntax validation. * * @since 2.4.0 - * @date 2021-01-01T0616+0100 * @var str */ const C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE = 'footnotes_inputfield_shortcode_syntax_validation_enable'; @@ -1264,7 +1221,7 @@ class MCI_Footnotes_Settings { * @var array * * Edited. - * 2.2.2 added tab for Custom CSS 2020-12-15T0740+0100 + * 2.2.2 added tab for Custom CSS * * These are the storage container names, one per dashboard tab. */ @@ -1286,36 +1243,36 @@ class MCI_Footnotes_Settings { private $a_arr_default = array( // General settings. - 'footnotes_storage' => array( + 'footnotes_storage' => array( // AMP compatibility. - self::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE => '', + self::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE => '', // Footnote start and end short codes. - self::C_STR_FOOTNOTES_SHORT_CODE_START => '((', - self::C_STR_FOOTNOTES_SHORT_CODE_END => '))', - self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '', - self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '', - self::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE => 'yes', + self::C_STR_FOOTNOTES_SHORT_CODE_START => '((', + self::C_STR_FOOTNOTES_SHORT_CODE_END => '))', + self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '', + self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '', + self::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE => 'yes', // Footnotes numbering. - self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain', - self::C_STR_COMBINE_IDENTICAL_FOOTNOTES => 'yes', + self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain', + self::C_STR_COMBINE_IDENTICAL_FOOTNOTES => 'yes', // Scrolling behavior. - self::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING => 'no', - self::C_INT_FOOTNOTES_SCROLL_OFFSET => 20, - self::C_INT_FOOTNOTES_SCROLL_DURATION => 380, - self::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY => 'no', - self::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION => 150, - self::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY => 0, - self::C_INT_FOOTNOTES_SCROLL_UP_DELAY => 0, - self::C_STR_FOOTNOTES_HARD_LINKS_ENABLE => 'no', - self::C_STR_REFERRER_FRAGMENT_ID_SLUG => 'r', - self::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG => 'f', - self::C_STR_HARD_LINK_IDS_SEPARATOR => '+', - self::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE => 'yes', - self::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT => 'Alt+ ←', + self::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING => 'no', + self::C_INT_FOOTNOTES_SCROLL_OFFSET => 20, + self::C_INT_FOOTNOTES_SCROLL_DURATION => 380, + self::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY => 'no', + self::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION => 150, + self::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY => 0, + self::C_INT_FOOTNOTES_SCROLL_UP_DELAY => 0, + self::C_STR_FOOTNOTES_HARD_LINKS_ENABLE => 'no', + self::C_STR_REFERRER_FRAGMENT_ID_SLUG => 'r', + self::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG => 'f', + self::C_STR_HARD_LINK_IDS_SEPARATOR => '+', + self::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE => 'yes', + self::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT => 'Alt+ ←', // Reference container. self::C_STR_REFERENCE_CONTAINER_NAME => 'References', @@ -1359,107 +1316,107 @@ class MCI_Footnotes_Settings { self::C_STR_FOOTNOTES_IN_EXCERPT => 'manual', // Footnotes love. - self::C_STR_FOOTNOTES_LOVE => 'no', + self::C_STR_FOOTNOTES_LOVE => 'no', // Deprecated. - self::C_STR_FOOTNOTES_EXPERT_MODE => 'yes', + self::C_STR_FOOTNOTES_EXPERT_MODE => 'yes', ), // Referrers and tooltips. - 'footnotes_storage_custom' => array( + 'footnotes_storage_custom' => array( // Backlink symbol. - self::C_STR_HYPERLINK_ARROW => '↑', - self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '', + self::C_STR_HYPERLINK_ARROW => '↑', + self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '', // Referrers. - self::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS => 'yes', - self::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT => 'no', - self::C_STR_FOOTNOTES_STYLING_BEFORE => '[', - self::C_STR_FOOTNOTES_STYLING_AFTER => ']', + self::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS => 'yes', + self::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT => 'no', + self::C_STR_FOOTNOTES_STYLING_BEFORE => '[', + self::C_STR_FOOTNOTES_STYLING_AFTER => ']', // Referrers in labels. - self::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION => 'none', + self::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION => 'none', // Tooltips. - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes', - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE => 'no', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE => 'no', // Tooltip position. - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top center', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top center', self::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION => 'top right', - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 0, + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 0, self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X => -50, - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => -7, + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => -7, self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y => 24, // Tooltip dimensions. - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 450, - self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH => 400, + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 450, + self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH => 400, // Tooltip timing. - self::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY => 0, - self::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION => 200, - self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY => 400, - self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION => 200, + self::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY => 0, + self::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION => 200, + self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY => 400, + self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION => 200, // Tooltip truncation. - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'yes', - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 200, - self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'yes', + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 200, + self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading', // Tooltip text. - self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER => '[[/tooltip]]', - self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE => 'no', - self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR => ' — ', + self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER => '[[/tooltip]]', + self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE => 'no', + self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR => ' — ', // Tooltip appearance. - self::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED => 'yes', - self::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR => 13, - self::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT => 'px', + self::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED => 'yes', + self::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR => 13, + self::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT => 'px', - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '#000000', - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#ffffff', - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1, - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99', - self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 0, - self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '#000000', + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#ffffff', + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1, + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99', + self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 0, + self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666', // Your existing Custom CSS code. - self::C_STR_CUSTOM_CSS => '', + self::C_STR_CUSTOM_CSS => '', ), - // Scope and priority - 'footnotes_storage_expert' => array( + // Scope and priority. + 'footnotes_storage_expert' => array( // WordPress hooks with priority level. - self::C_STR_EXPERT_LOOKUP_THE_TITLE => '', - self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, + self::C_STR_EXPERT_LOOKUP_THE_TITLE => '', + self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, - self::C_STR_EXPERT_LOOKUP_THE_CONTENT => 'checked', - self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => 98, + self::C_STR_EXPERT_LOOKUP_THE_CONTENT => 'checked', + self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => 98, - self::C_STR_EXPERT_LOOKUP_THE_EXCERPT => '', - self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX, + self::C_STR_EXPERT_LOOKUP_THE_EXCERPT => '', + self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX, - self::C_STR_EXPERT_LOOKUP_WIDGET_TITLE => '', - self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, + self::C_STR_EXPERT_LOOKUP_WIDGET_TITLE => '', + self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, - self::C_STR_EXPERT_LOOKUP_WIDGET_TEXT => '', - self::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL => 98, + self::C_STR_EXPERT_LOOKUP_WIDGET_TEXT => '', + self::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL => 98, ), // Custom CSS. - 'footnotes_storage_custom_css' => array( + 'footnotes_storage_custom_css' => array( // Your existing Custom CSS code. - self::C_STR_CUSTOM_CSS_LEGACY_ENABLE => 'yes', + self::C_STR_CUSTOM_CSS_LEGACY_ENABLE => 'yes', // Custom CSS. - self::C_STR_CUSTOM_CSS_NEW => '', + self::C_STR_CUSTOM_CSS_NEW => '', ), @@ -1606,7 +1563,6 @@ class MCI_Footnotes_Settings { * @since 2.2.0 this function is not called any longer when deleting the plugin, * to protect user data against loss, since manually updating a plugin is safer * done by deleting and reinstalling (see the warning about database backup). - * 2020-12-13T1353+0100 */ public function clear_all() { // Iterate through each Settings Container. diff --git a/class/task.php b/class/task.php index e4e0ffb..becc14b 100644 --- a/class/task.php +++ b/class/task.php @@ -6,8 +6,6 @@ * @package footnotes * @since 1.5.0 * - * @lastmodified 2021-02-20T0438+0100 - * * @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.5 Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution. @@ -16,7 +14,7 @@ * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility). * @since 2.0.6 Bugfix: Reference container: fix line breaking behavior in footnote number clusters. * @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.0.9 Bugfix: Remove the_post hook. * @since 2.1.0 Adding: Tooltips: Read-on button: Label: configurable instead of localizable, thanks to @rovanov example provision. * @since 2.1.1 Bugfix: Referrers, reference container: 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. @@ -149,7 +147,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * * @since 2.2.9 - * @date 2020-12-25T0338+0100 * @var int Incremented every time after a reference container is inserted. * * This ID disambiguates multiple reference containers in a page @@ -222,7 +219,6 @@ class MCI_Footnotes_Task { * - Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers. * * @since 2.1.4 - * @date 2020-12-05T0538+0100 * * - Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report. * @@ -230,8 +226,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/2-2-6-breaks-all-footnotes/#post-13857922 * * @since 2.4.0 - * @date 2021-01-03T2055+0100 - * @date 2021-01-04T0504+0100 * @var int * * Websites may use high fixed headers not contracting at scroll. @@ -254,8 +248,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/update-2-1-3/#post-13704194 * * @since 2.1.4 - * @date 2020-11-25T1306+0100 - * @date 2020-11-26T1051+0100 * * - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution. * @@ -266,7 +258,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ * * @since 2.3.0 - * @date 2020-12-30T2313+0100 * * Although widely used for that purpose, hyperlinks are disliked for footnote linking. * Browsers may need to be prevented from logging these clicks in the browsing history, @@ -320,7 +311,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/change-tooltip-text/ * * @since 2.5.2 - * @date 2021-01-19T2223+0100 * * Tooltips can display another content than the footnote entry * in the reference container. The trigger is a shortcode in @@ -394,7 +384,6 @@ class MCI_Footnotes_Task { * - Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes. * * @since 2.4.0 - * @date 2021-01-01T0227+0100 * * @var bool * @@ -418,7 +407,7 @@ class MCI_Footnotes_Task { * @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.7 Bugfix: Set priority level back to 10 assuming it is unproblematic. * @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. @@ -468,7 +457,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/#post-13864859 * * @since 2.5.0 - * @date 2021-01-05T1402+0100 * * 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. @@ -485,7 +473,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/footnotes-use-in-popup-maker/ * * @since 2.5.1 - * @date 2021-01-18T2038+0100 */ add_filter( 'pum_popup_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority ); } @@ -570,7 +557,6 @@ class MCI_Footnotes_Task { * - UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook. * * @since 2.1.0 - * @date 2020-11-08T1839+0100 * @accountable @pewgeuges */ @@ -626,7 +612,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/in-line-superscript-ref-rides-to-high/ * * @since 2.5.4 - * @date 2021-02-12T1631+0100 * * Cannot be included in external stylesheet, as it is only optional. * The scope is variable too: referrers only, or all superscript elements. @@ -684,8 +669,7 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * * @since 2.2.5 - * @date 2020-12-18T1447+0100 - */ + */ if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) { echo '.footnote_container_prepare > '; echo MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT ); @@ -701,7 +685,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/borders-25/ * * @since 2.2.10 - * @date 2020-12-25T2304+0100 * Moving this internal CSS to external using `wp_add_inline_style()` is * discouraged, because that screws up support, and it is pointless from * a performance point of view. Moreover, that would cause cache busting @@ -797,7 +780,6 @@ class MCI_Footnotes_Task { * - Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default. * * @since 2.1.4 - * @date 2020-12-03T0954+0100 */ echo ' font-size: '; if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) { @@ -864,12 +846,10 @@ class MCI_Footnotes_Task { * - Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style. * * @since 2.1.4 - * @date 2020-12-06T1320+0100 * * - Update: Tooltips: Alternative tooltips: connect to position/timing settings (for themes not supporting jQuery tooltips). * * @since 2.2.5 - * @date 2020-12-18T1113+0100 */ if ( ! MCI_Footnotes::$a_bool_alternative_tooltips_enabled && ! MCI_Footnotes::$a_bool_amp_enabled ) { @@ -877,6 +857,7 @@ class MCI_Footnotes_Task { * Dimensions of jQuery tooltips. * * Position and timing of jQuery tooltips are script defined. + * * @see templates/public/tooltip.html. */ $l_int_max_width = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH ); @@ -886,7 +867,6 @@ class MCI_Footnotes_Task { echo "}\r\n"; } else { - /* * AMP compatible and alternative tooltips. */ @@ -944,6 +924,7 @@ class MCI_Footnotes_Task { * AMP compatible tooltips. * * To streamline internal CSS, immutable rules are in external stylesheet. + * * @see dev-amp-tooltips.css. */ if ( MCI_Footnotes::$a_bool_amp_enabled ) { @@ -958,12 +939,13 @@ class MCI_Footnotes_Task { echo 'transition-duration: ' . $l_int_fade_in_duration . 'ms;'; echo "}\r\n"; - /** - * Alternative tooltips. - * - * To streamline internal CSS, immutable rules are in external stylesheet. - * @see dev-tooltips-alternative.css. - */ + /** + * Alternative tooltips. + * + * To streamline internal CSS, immutable rules are in external stylesheet. + * + * @see dev-tooltips-alternative.css. + */ } else { echo '.footnote_tooltip.hidden {'; @@ -985,7 +967,6 @@ class MCI_Footnotes_Task { * - Bugfix: Custom CSS: insert new CSS in the public page header element after existing CSS. * * @since 2.2.3 - * @date 2020-12-15T1128+0100 * * Set custom CSS to override settings, not conversely. * Legacy Custom CSS is used until it’s set to disappear after dashboard tab migration. @@ -1025,7 +1006,8 @@ class MCI_Footnotes_Task { document.getElementById(footnote_tooltip_id).classList.add('hidden'); } -get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) { @@ -1092,7 +1073,7 @@ class MCI_Footnotes_Task { * Replaces footnotes in the post/page title. * * @since 1.5.0 - * @param string $p_str_content Title. + * @param string $p_str_content Title. * @return string $p_str_content Title with replaced footnotes. */ public function footnotes_in_title( $p_str_content ) { @@ -1111,7 +1092,7 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/multiple-reference-containers-in-single-post/ * * @since 2.7.0 - * @param string $p_str_content Page/Post content. + * @param string $p_str_content Page/Post content. * @return string $p_str_content Content with replaced footnotes. */ public function footnotes_in_content( $p_str_content ) { @@ -1154,7 +1135,7 @@ class MCI_Footnotes_Task { * Processes existing excerpt or replaces it with a new one generated on the basis of the post. * * @since 1.5.0 - * @param string $p_str_excerpt Excerpt content. + * @param string $p_str_excerpt Excerpt content. * @return string $p_str_excerpt Processed or new excerpt. * @since 2.6.2 Debug No option. * @since 2.6.3 Debug Yes option, the setting becomes fully effective. @@ -1199,7 +1180,7 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/problem-with-footnotes-in-excerpts-of-the-blog-page/ * * @since 2.6.2 - * @param string $p_str_content The post. + * @param string $p_str_content The post. * @return string $p_str_content An excerpt of the post. * Applies full WordPress excerpt processing. * @link https://developer.wordpress.org/reference/functions/wp_trim_excerpt/ @@ -1208,7 +1189,7 @@ class MCI_Footnotes_Task { public function generate_excerpt( $p_str_content ) { // Discard existing excerpt and start on the basis of the post. - $p_str_content = get_the_content( get_the_id() ); + $p_str_content = get_the_content( get_the_id() ); // Get footnote delimiter shortcodes and unify them. $p_str_content = self::unify_delimiters( $p_str_content ); @@ -1228,7 +1209,7 @@ class MCI_Footnotes_Task { $l_int_excerpt_length = (int) _x( '55', 'excerpt_length' ); $l_int_excerpt_length = (int) apply_filters( 'excerpt_length', $l_int_excerpt_length ); - $l_str_excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); + $l_str_excerpt_more = apply_filters( 'excerpt_more', ' […]' ); // Function wp_trim_words() calls wp_strip_all_tags() that wrecks the footnotes. $p_str_content = wp_trim_words( $p_str_content, $l_int_excerpt_length, $l_str_excerpt_more ); @@ -1262,7 +1243,7 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/update-crashed-my-website-3/#post-14259396 * * @since 2.6.4 - * @param string $p_str_content The post. + * @param string $p_str_content The post. * @return string $p_str_content An excerpt of the post. * Does not apply full WordPress excerpt processing. * @see self::generate_excerpt() @@ -1272,7 +1253,7 @@ class MCI_Footnotes_Task { public function generate_excerpt_with_footnotes( $p_str_content ) { // Discard existing excerpt and start on the basis of the post. - $p_str_content = get_the_content( get_the_id() ); + $p_str_content = get_the_content( get_the_id() ); // Get footnote delimiter shortcodes and unify them. $p_str_content = self::unify_delimiters( $p_str_content ); @@ -1289,7 +1270,7 @@ class MCI_Footnotes_Task { $l_int_excerpt_length = (int) apply_filters( 'excerpt_length', $l_int_excerpt_length ); // Prepare the Read-on string. - $l_str_excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); + $l_str_excerpt_more = apply_filters( 'excerpt_more', ' […]' ); // Safeguard the footnotes. preg_match_all( @@ -1300,7 +1281,7 @@ class MCI_Footnotes_Task { // Prevent the footnotes from altering the excerpt: previously hard-coded '5ED84D6'. $l_int_placeholder = '@' . mt_rand( 100000000, 2147483647 ) . '@'; - $p_str_content = preg_replace( + $p_str_content = preg_replace( '#' . self::$a_str_start_tag_regex . '.+?' . self::$a_str_end_tag_regex . '#', $l_int_placeholder, $p_str_content @@ -1308,16 +1289,16 @@ class MCI_Footnotes_Task { // Replace line breaking markup with a separator. $l_str_separator = ' '; - $p_str_content = preg_replace( '#
#', $l_str_separator, $p_str_content ); - $p_str_content = preg_replace( '#
#', $l_str_separator, $p_str_content ); - $p_str_content = preg_replace( '#<(p|li|div)[^>]*>#', $l_str_separator, $p_str_content ); - $p_str_content = preg_replace( '#' . $l_str_separator . '#', '', $p_str_content, 1 ); - $p_str_content = preg_replace( '##', '', $p_str_content ); - $p_str_content = preg_replace( '#[\r\n]#', '', $p_str_content ); + $p_str_content = preg_replace( '#
#', $l_str_separator, $p_str_content ); + $p_str_content = preg_replace( '#
#', $l_str_separator, $p_str_content ); + $p_str_content = preg_replace( '#<(p|li|div)[^>]*>#', $l_str_separator, $p_str_content ); + $p_str_content = preg_replace( '#' . $l_str_separator . '#', '', $p_str_content, 1 ); + $p_str_content = preg_replace( '##', '', $p_str_content ); + $p_str_content = preg_replace( '#[\r\n]#', '', $p_str_content ); // To count words like Advanced Excerpt does it. - $l_arr_tokens = array(); - $l_str_output = ''; + $l_arr_tokens = array(); + $l_str_output = ''; $l_int_counter = 0; // Tokenize into tags and words as in Advanced Excerpt. @@ -1366,7 +1347,7 @@ class MCI_Footnotes_Task { * Replaces footnotes in the widget title. * * @since 1.5.0 - * @param string $p_str_content Widget content. + * @param string $p_str_content Widget content. * @return string $p_str_content Content with replaced footnotes. */ public function footnotes_in_widget_title( $p_str_content ) { @@ -1378,7 +1359,7 @@ class MCI_Footnotes_Task { * Replaces footnotes in the content of the current widget. * * @since 1.5.0 - * @param string $p_str_content Widget content. + * @param string $p_str_content Widget content. * @return string $p_str_content Content with replaced footnotes. */ public function footnotes_in_widget_text( $p_str_content ) { @@ -1411,7 +1392,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/reference-container-in-elementor/ * * @since 2.2.0 - * @date 2020-12-13T2057+0100 * * - Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report. * @@ -1419,7 +1399,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126 * * @since 2.2.5 - * @date 2020-12-18T1434+0100 */ // Append the reference container or insert at shortcode. $l_str_reference_container_position_shortcode = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE ); @@ -1458,6 +1437,8 @@ class MCI_Footnotes_Task { /** * Brings the delimiters and unifies their various HTML escapement schemas. * + * @param string $p_str_content TODO. + * * - Bugfix: Footnote delimiter short codes: fix numbering bug by cross-editor HTML escapement schema unification, thanks to @patrick_here @alifarahani8000 @gova bug reports. * * @reporter @patrick_here @@ -1492,27 +1473,27 @@ class MCI_Footnotes_Task { if ( preg_match( '#[&"\'<>]#', $l_str_starting_tag . $l_str_ending_tag ) ) { - $l_str_harmonized_start_tag = '{[(|fnote_stt|)]}'; - $l_str_harmonized_end_tag = '{[(|fnote_end|)]}'; + $l_str_harmonized_start_tag = '{[(|fnote_stt|)]}'; + $l_str_harmonized_end_tag = '{[(|fnote_end|)]}'; // Harmonize footnotes without escaping any HTML special characters in delimiter shortcodes. // The footnote has been added in the Block Editor code editor (doesn’t work in Classic Editor text mode). $p_str_content = str_replace( $l_str_starting_tag, $l_str_harmonized_start_tag, $p_str_content ); - $p_str_content = str_replace( $l_str_ending_tag , $l_str_harmonized_end_tag , $p_str_content ); + $p_str_content = str_replace( $l_str_ending_tag, $l_str_harmonized_end_tag, $p_str_content ); // Harmonize footnotes while escaping HTML special characters in delimiter shortcodes. // The footnote has been added in the Classic Editor visual mode. $p_str_content = str_replace( htmlspecialchars( $l_str_starting_tag ), $l_str_harmonized_start_tag, $p_str_content ); - $p_str_content = str_replace( htmlspecialchars( $l_str_ending_tag ), $l_str_harmonized_end_tag , $p_str_content ); + $p_str_content = str_replace( htmlspecialchars( $l_str_ending_tag ), $l_str_harmonized_end_tag, $p_str_content ); // Harmonize footnotes while escaping HTML special characters except greater-than sign in delimiter shortcodes. // The footnote has been added in the Block Editor visual mode. $p_str_content = str_replace( str_replace( '>', '>', htmlspecialchars( $l_str_starting_tag ) ), $l_str_harmonized_start_tag, $p_str_content ); - $p_str_content = str_replace( str_replace( '>', '>', htmlspecialchars( $l_str_ending_tag ) ), $l_str_harmonized_end_tag , $p_str_content ); + $p_str_content = str_replace( str_replace( '>', '>', htmlspecialchars( $l_str_ending_tag ) ), $l_str_harmonized_end_tag, $p_str_content ); // Assign the delimiter shortcodes. - self::$a_str_start_tag = $l_str_harmonized_start_tag; - self::$a_str_end_tag = $l_str_harmonized_end_tag; + self::$a_str_start_tag = $l_str_harmonized_start_tag; + self::$a_str_end_tag = $l_str_harmonized_end_tag; // Assign the regex-conformant shortcodes. self::$a_str_start_tag_regex = '\{\[\(\|fnote_stt\|\)\]\}'; @@ -1521,8 +1502,8 @@ class MCI_Footnotes_Task { } else { // Assign the delimiter shortcodes. - self::$a_str_start_tag = $l_str_starting_tag; - self::$a_str_end_tag = $l_str_ending_tag; + self::$a_str_start_tag = $l_str_starting_tag; + self::$a_str_end_tag = $l_str_ending_tag; // Make shortcodes conform to regex syntax. self::$a_str_start_tag_regex = preg_replace( '#([\(\)\{\}\[\]\|\*\.\?\!])#', '\\\\$1', self::$a_str_start_tag ); @@ -1576,7 +1557,6 @@ class MCI_Footnotes_Task { * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ * * @since 2.5.0 - * @date 2021-01-07T0824+0100 * If footnotes short codes are unbalanced, and syntax validation is not disabled, * prepend a warning to the content; displays de facto beneath the post title. */ @@ -1688,12 +1668,12 @@ class MCI_Footnotes_Task { */ if ( 'disconnect' === $l_str_label_issue_solution ) { - $l_str_disconnect_text = 'optionally-disconnected-from-input-field-to-prevent-toggling-while-clicking-footnote-referrer_'; + $l_str_disconnect_text = 'optionally-disconnected-from-input-field-to-prevent-toggling-while-clicking-footnote-referrer_'; $p_str_content = preg_replace( '#(