• Resolved JCV

    (@psykonevro)


    Hi,

    This is definitely a great plugin, thanks for developing it!

    I noticed that AMP plugin complains about footnotes not being AMP compatible.

    Would be great if you can do something about it!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor pewgeuges

    (@pewgeuges)

    Hi @psykonevro

    Thank you for your appreciation, and for drawing our attention on AMP. After trying hard to make some sense of the concept, I must confess that I’m unable to take action. That may be due to my status and level; I’ve only joined in recently as a maintenance programmer (not plugin author as WordPress decided to mislabel any plugin committer; that issue has been reported on Meta Trac: https://meta.trac.wordpress.org/ticket/5553#ticket), and I never really used WordPress earlier than this year.

    I noticed that AMP plugin complains about footnotes not being AMP compatible.

    It seems like there were two different AMP plugins. I’ve tried them both. Which one are you quoting?

    One of them, authored by the AMP project, lists plugins, among which Footnotes, and proposes to disable them while it’s still unable to produce the least accusation against any of them. The status of Footnotes as well as of all other plugins in the list is:

    “No validation errors yet detected.”

    May you please post the exact message you get, because I’m unable to reproduce it although I’ve run the test in a live sandbox hosted on powerful servers (powered with 100% renewable energy).

    More precisely, with respect to the theme and the Footnotes plugin, this AMP plugin proposes to switch to a damaged page format where the design is destroyed and the functionality is completely pulled down. I can figure out that such pages load faster, but not, to what avail.

    Reading your blog posts takes much more time than loading them even without AMP, and I think it’s worth the waiting. So my current suggestion based on ignorance is that instead of compromising your website’s quality, you just uninstall any AMP plugin.

    Having said that, I take the subject very seriously. It raises much concern. At Footnootes I see a problem with wasteful code as the tooltip script is inserted in extenso at each instance instead of being centralized like the scroll script. But obviously there was no other way to get these jQuery tooltips to work. If you are interested in lean tooltips and zero script libraries loaded specifically for footnotes, then I’d suggest to enable alternative tooltips, in Footnotes’ dashboard > Referrers and tooltips > Tooltips > Display alternative tooltips. Currently tooltips although enabled seem inhibited. Some themes inhibit jQuery tooltips, but in OceanWP they work fine. Perhaps the issue is with site caching. The caching plugin that may be used seems to disable loading the libraries needed for the tooltips to show up.

    Thanks again for bringing up all these issues. I’m looking forward to additional information, and I’m hoping that your website will get fixed in the process.

    Best regards.

    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: clarify my status and level; my problem is not to be a maintenance programmer, but to ignore many aspects of WordPress; sorry for that
    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: “current suggestion” instead of “current advice”, given I’m not in a position to give advice!
    Plugin Contributor pewgeuges

    (@pewgeuges)

    @psykonevro

    Sorry, I forgot about an earlier request https://wordpress.org/support/topic/making-it-amp-compatible/ that was met by versions 2.0.0 through 2.0.3. The 2.0.0 version I came up with had hard links, and therefore met the requirement for being AMP compatible. 

    But on user request https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/ the hard links were removed for 2.0.4. Essentially that was about fixing a usability flaw normally to be fixed in the browsers. But small projects like Footnotes are more versatile, so the blame is first put on them, and it’s up to them to work out a solution.

    Actually there is no comprehensive solution on Footnotes’ side alone. What we can do is absolutely to reinstate the hard links. Without hard links, footnotes cannot be shared! I’m in the habits of sharing URLs with fragment identifiers. Some of them point to footnotes, e.g. on Wikipedia. Footnotes without hyperlinks threaten usability and reflect badly on any serious website. That’s why I perceived badly the lack of hard links in Footnotes, and added them in the wake of fixing some other bugs. Actually those bugs caused Footnotes to lose some credit, and I couldn’t figure out that the lack of hard links was design.

    Rather than on Footnotes or on browsers, the blame may be put on internet surfers. Links should be opened in a new tab, both to be able to easily refer to the previous page without reloading it from the browser’s cache, and to be able to skip the usage of the back button, just closing the new tab once done, no matter how many footnotes are logged in the browsing history. It’s as simple as holding the Control key down while clicking on a link, and setting up the search engine to open results in a new tab.

    Footnotes are by no means using the only fragment identifiers in a page. Most of the time, those targets are headings! And nobody would think about depriving them of hard links. Clicking back and forth between the table of contents and the subheadings may be equally considered cluttering the browsing history. But nobody seems to care, only footnotes are scapegoated.

    Sadly we must support compromising usability and fostering bad practice. Therefore the hard links shall become only an option. I’d suggest that it will default to Yes, and require an explicit user action for those hard links to be missing.

    Many thanks, @psykonevro, for requesting AMP compatibility i.e. the presence of hard links in footnote referrers and backlinks. I’m often slow in getting the point. See this post early this morning as a striking example how stupid I can be https://wordpress.org/support/topic/no-footnotes-anymore/#post-13813233

    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: and setting up the search engine to open results in a new tab
    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: uppercase AMP keyword tag
    • This reply was modified 3 years, 4 months ago by pewgeuges.
    Thread Starter JCV

    (@psykonevro)

    You made fun of my long blogs, but seems like you write a lot too 🙂

    I installed the official AMP wordpress plugin:
    https://en-gb.wordpress.org/plugins/amp/

    I was wondering, with regards to your last message, would it be possible to detect if AMP is activated (catching the amp in the URL) and then remove hard links from the page? In other words, inhibiting footnotes plugin if amp is active?

    I’ve no idea what are the rules for amp pages. But it’s extremely fast, which gives obviously a better ranking for websites. So I guess it’s doom to become very popular: most big newspapers have already adopted AMP. But I love to use footnotes, which helps me shrink my loooong blogs 🙂

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @psykonevro

    Sorry please: I’m far from making fun—although the wording may end up funny—, and I much appreciate long blog posts in general, and yours in particular. My apologies for the misunderstanding. I only wished to put loading time into perspective, make it relative and thought it may not matter, until later I found out that Google provided figures: 22 seconds without AMP, less than a second with AMP. That is news for me, since when testing on a mobile device, all pages loaded almost instantly, without AMP and with footnotes from the Footnotes plugin. I still can’t seem to grasp the problem. The actions we can take are based on reports and requests, trying to meet expectations and requirements.

    would it be possible to detect if AMP is activated (catching the amp in the URL) and then remove hard links from the page?

    I don’t know if that is possible. With AMP, the only working links seem to be the hard links, as soft links are disabled, and the reference container cannot expand any more; for AMP it shouldn’t be collapsed by default, and with hard links present in the page, the footnote referrers and backlinks would keep working.

    In other words, inhibiting footnotes plugin if amp is active?

    If Footnotes plugin is disabled, footnotes would show inline, compromising the very concept. Long footnotes would disrupt the reading. I hoped that the website would serve AMP versions if requested, but the only point I understand is that to be AMP compatible, a page must have hard links.

    I’ve no idea what are the rules for amp pages.

    Neither do I, until yesterday in Footnotes’ support forum’s third list page I found https://wordpress.org/support/topic/making-it-amp-compatible/ where I’ve thankfully learned that the only AMP compatibility requirement for Footnotes is to have hard links.

    But I love to use footnotes, which helps me shrink my loooong blogs 🙂

    Again I see no problem, the less as you’re using tables of contents. These have hard links. Hitting back button brings back to the TOC. Perhaps could we just hit the back button instead of clicking on back links in the footnotes list? That would eliminate the problem alleged to request the removal of the hard links in Footnotes. I think that the problem at this point was that readers of pages using Footnotes plugin were in the habits of clicking on back links because these had been the only way back to the footnote referrer. Adding hard links in Footnotes—as used in other footnotes plugins—disrupted user experience. Causing such disruptions should indeed be avoided.

    But the main mistake I made when reverting the addition of hard links was to forget about the previous user request on August 12, where @martinneumannat provided the Footnotes project with the code needed to add hard links. I must confess that I almost completely ignored @martinneumannat’s request, both because when I started using WordPress and Footnotes earlier this year, I just customized the plugin and documented those changes, and because when I started browsing the forum I was so busy with responding in more recent threads and fixing more bugs that I missed out on earlier threads, although I vaguely remember having seen the title and assessed it as addressed. Hard links were so obvious to me that I couldn’t even understand why their presence needed to be requested (instead of being in the plugin from the beginning on).

    When the removal of the hard links was requested, I felt bad about executing the order issued by the user. Making them optional would have been the way to go. Yet at that point I still ignored how new settings are added… although I deleted an existing one (the backlink symbol selection)! I’m sorry for being so unprofessional. I’m trying to do a better job.

    Thank you for your help and incentive to make Footnotes AMP compatible! And to improve its usefulness in the process.

    • This reply was modified 3 years, 4 months ago by pewgeuges.
    • This reply was modified 3 years, 4 months ago by pewgeuges.
    Plugin Contributor pewgeuges

    (@pewgeuges)

    @psykonevro

    Thank you for the info about which plugin you are using. I just went through the setup and was given the option to re-enable all invalid elements, among which things like the “onclick” attribute, and when lean tooltips are enabled, the “onmouseover” and “onmouseout” along with the very small script firing up the tooltips:

    
    <script content="text/javascript">
        function footnoteTooltipShow(footnoteTooltipId) {
            document.getElementById(footnoteTooltipId).classList.remove('hidden');
            document.getElementById(footnoteTooltipId).classList.add('shown');
        }
        function footnoteTooltipHide(footnoteTooltipId) {
            document.getElementById(footnoteTooltipId).classList.remove('shown');
            document.getElementById(footnoteTooltipId).classList.add('hidden');
        }
    </script>
    

    Even that bit of JavaScript is forbidden in AMP.

    Also, now, Footnotes is having a validation error: “invalid inline script”. In comparison, Elementor has 22 validation errors, all about invalid scripts, script elements and inline script.

    For Footnotes, AMP boils down to not having tooltips, and needing hard links to scroll back and forth (more accurately: forth and back). For that sake, we could also add an option to have those basic tooltips displaying the “title” attribute of a hovered element.

    If I fix it by bulk-keeping and marking as reviewed all “invalid” instances, the page won’t be AMP compatible any more:

    AMP is disabled because some invalid markup has been kept. To enable AMP to be served, either mark the invalid markup as “removed” or provide an AMP-compatible fix that eliminates the invalid markup from being generated in the first place.

    Okay, if that’s our roadmap, and it meets user demands, we’ll try and hopefully make a better plugin — the other way around. Because it would be irresponsible to not provide the needed features now that so many writers are stuck with WordPress.

    Beside that, the tooltips are still not working on your website. It’s not the theme (some themes disable Footnotes’ jQuery tooltips, and some even disable CSS transitions). That poses the question whether tooltips are desired at all. If not, best is to disable them in Footnotes’ dashboard’s Referrers and tooltips tab > Tooltips > Display tooltips. That avoids loading as many instances of the not AMP compatible inline tooltip script. Some other footnotes plugins use basic tooltips as browsers display them by default (with content loaded as value of the “title” attribute). Are you interested in these basic tooltips?

    Plus: Before heading into AMP, please read also this:

    https://www.polemicdigital.com/google-amp-go-to-hell/

    After all, we on Footnotes can weaponize AMP to reinstate hard links… These don’t hinder scroll animation.

    Thanks!

    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: completed parenthetical, was: “(some themes disable tooltips)”
    • This reply was modified 3 years, 4 months ago by pewgeuges. Reason: Added Plus
    • This reply was modified 3 years, 4 months ago by pewgeuges.
    • This reply was modified 3 years, 4 months ago by pewgeuges.
    Plugin Contributor martinneumannat

    (@martinneumannat)

    Yes basically the AMP specification means no Javascript. By the way, Elementor is not compatible with AMP for that very reason. The solution that I suggested was adding the hard links in order to not to depend on Javascript. The AMP plugin will actually remove the javascript by default and you probably will be fine, if the links are there. The way I proposed it, the links are really just a fallback if you want to use AMP, or if for any other reason Javascript is not enabled.

    If you want to go a step further, you can query whether the request is for an AMP page, and depending on that serve already a template that has Javascript stripped off. This way there will be no validation errors. Here the documentation of the function you need to use:
    https://amp-wp.org/reference/function/amp_is_request/

    Now the newest AMP specification allows even for a limited subset of Javascript. o if you dig deeper into that, you may find out that you can even implement the tooltip in AMP, but that will probably require some deeper studies into the subject.

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @martinneumannat

    Many thanks, also for your initial request, that I’d respond to once done with re-adding the hard links. Sorry for removing them since 2.0.4 (reverting to the pre-2.0.0 status).

    I’m glad that now the point of disabling JS is established. Indeed with JS enabled, scroll animation works, and without JS, hard links work. What I missed out by that time is on implementing the offset in CSS. The scroll offset is important as many websites have fixed headers, so disabling JS destroys UX: footnotes are hidden behind the header, referrers too, unless we manage to get a scroll offset with CSS.

    The tooltip implementation the AMP way seems impossible until support for Element.classList.add and Element.classList.remove is added, see just opened issue https://github.com/ampproject/worker-dom/issues/1015 Currently only Element.classList is allowed, or I’m missing something.

    The few lines of JavaScript quoted above are forbidden unless we use this: https://amp.dev/documentation/components/amp-script/

    Thanks for the amp_is_request() to be used; this adds a 1800 extra lines of PHP, to no avail since the onmouseover and onmouseout attributes are prohibited anyway, leaving no chance.

    I think the AMP approach is missing the point. Including those few innocuous snippets in the chase seems somewhat overkill.

    Plugin Contributor pewgeuges

    (@pewgeuges)

    @psykonevro @martinneumannat

    The added optional hard links seem to work in the preview of 2.3.0 now available at https://downloads.wordpress.org/plugin/footnotes.zip

    An essential part of the challenge was to get the scroll offset, or footnotes and referrers would hide behind fixed headers and even the WordPress admin bar. The hard link offset is pure HTML-CSS. Hopefully AMP plugin will keep the external style rules; as of the number in screen height percent it is configurable and in inline CSS like other style settings.

    The failure is in making table cells clickable, because enclosing table cells in a link element is prohibited, unlike what is allowed for divs, and tweaks using block display and width/height did not work. Hopefully that will be a minor UX issue, unlike the offset that is very important for usability, else visitors would need to agree to systematically scroll up, and be worried at first sight when used to JavaScript conveniences, and the link target is nowhere in sight. Either way, depriving websites of scroll offset is detrimental.

    Assuming that scroll offset can only be achieved by script use is a current misconception, leading to simply skip the issue when relying on hard links. I myself did the same in v2.0.0, considering a suboptimal solution better than no functionality at all.

    • This reply was modified 3 years, 3 months ago by pewgeuges.
    • This reply was modified 3 years, 3 months ago by pewgeuges.
    • This reply was modified 3 years, 3 months ago by pewgeuges.
    • This reply was modified 3 years, 3 months ago by pewgeuges.
    Plugin Contributor pewgeuges

    (@pewgeuges)

    @psykonevro @martinneumannat

    After releasing 2.3.0 with an option to enable hard links for AMP compatibility (https://wordpress.org/support/topic/making-it-amp-compatible/#post-13851902), we’d need to underscore how hard it is for footnotes and tooltips to become AMP compatible. While the scrolling and its offset are feasible, the styled tooltips with hyperlinks in them, and a hyperlinked Read-on button, seem impossible without at least a bit of JavaScript including the prohibited (by AMP) onmouseover and onmouseout events. The issue I opened on GitHub to get support for adding and removing classes is still unanswered (https://github.com/ampproject/worker-dom/issues/1015). What can be done with CSS, including colorful transitioning tooltips (https://stackoverflow.com/questions/2011142/how-to-change-the-style-of-the-title-attribute-inside-an-anchor-tag), seems deprived of the ability to have clickable elements, giving an incomplete idea of the footnote text unless HTML markup is shown in the plain text.

    Moreover, on smartphones the jQuery tooltips don’t adapt to the screen edge, unlike what is seen on desktop, at least in Chrome (needs to test in Brave and Opera for Android, that are also able to load fully fledged pages by AJAX, where Chrome, Edge and Firefox are failing). As a consequence, on smartphones we’d better ditch tooltips, so that AMP dumbed-down pages are expected to be just fine with Footnotes 2.3.0.

    The shortcode balance validation feature and some announced styling settings are not present yet; hopefully they will be in one of the next releases. This one really needed to become available before this evening when many writers may have time to check out Footnotes’ new 2.3.0 under COVID lockdown.

    Many thanks for your requests and cooperation! Stay safe and happy Holidays.

    Edit: The extra templates should probably be shipped with a future version along with the request function needed prior to loading them. Thank you for linking this resource. Hopefully meanwhile the AMP plugin can make the necessary changes as of removing JavaScript, assisting Footnotes while I’m unsure whether the needed time will be available.

    • This reply was modified 3 years, 3 months ago by pewgeuges.
    Thread Starter JCV

    (@psykonevro)

    Many thanks for your hardwork on this. I use a lot footnotes plugin, so I appreciate what you’ve done.

    I wish you a happy new year!

    Plugin Contributor pewgeuges

    (@pewgeuges)

    Thank you!

    The global brainstorming depends on everybody putting their knowledge on the table. WordPress with footnotes capability is key in this process.

    Safe and healthy new year!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Footnotes is not AMP compatible’ is closed to new replies.