AMPXF - AMP for Xenforo 2

AMPXF - AMP for Xenforo 2 [Paid] 1.4.9

No permission to buy (€50.00)
Alright, it sort of works with TH styles but the addon makes some assumptions about colours, font sizes etc which in my case break the UX pretty nicely. Other than that it works, no amp errors or other issues aside from those already reported. I've logged a bunch of tickets so will see how much of this is my natural slowness and how much is improvements.

I think some basic styling options would benefit the addon greatly to begin with.

@mazzly good first release.
 
That option removes the span style color=red and what not inline in posts, it won't adjust your base core font.

the plugin inherits styles from core XF less variables,
view template ampcore.less to see.

you may want to add an over-ride style like font-size: .8em if you have them set super large as base fonts in the xf options and have mutlipliers down.
 
there is an option named Remove custom font-colors and -sizes from posts which might help?
That option removes the span style color=red and what not inline in posts, it won't adjust your base core font.
Yes, that option is mostly for some old forum that has previosuly been vb and the content has a bunch of <font style="yada yada"> in it that makes the css go over allowed limit..
Fonts are very very large (my base fonts are large so not sure if it's based on those) so not sure what can be done on this.
This is something that another customer saw also and we fixed.

@ThemeHouse maybe can comment on this:

We've noticed that the normal page has the following style set on the <html>-tag:
1610344265306.webp
I don't really understand why you would inline a rule that sets font-size to be 62.5% there, unless maybe for some accessibility option?


Anyway the fix that the customer did was to change font size values in ACP to be "px" instead of "rem"

I think the "safer" way to do it would be to edit "amp_style_custom.less" to add the same :
html{font-size:62.5%}
rule.. @ichpen can you add that and report back if font sizes start looking correct?

Amp view of Nixfifty Calendar Threads (reported just now) doesn't work.
Yes, this one can be supported, probably without a lot of extra work.


I will likely have a new release out tonight with fixes for various things :)
 
Dear @mazzly, thanks for everything with your add-on.

Just installed and I'm seeing no errors on the error console, just one situation that need your attention.

I'm trying to use (my site) as mobile right now and as a guest, but it looks like AMP haven't already deployed. I have to wait a little to the add-on do the effects?

And, another problem that i should tell about.

I use as my main page the famous Article Management System from @Bob, is a incredible (and very utilized by many websites) to run articles and stuff. Like a Wordpress, but for XenForo.

After installing the add-on, every article that i open i get two errors, as follow:

Code:
ErrorException: Template error: [E_USER_WARNING] Macro public:xa_ams_attachment_macros:attachment_list_item is unknown src/XF/Template/Templater.php:632
Generated by: POLITZ Jan 11, 2021 at 3:08 AM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/usr/share/ngin...', 632, Array)
#1 src/XF/Template/Templater.php(632): trigger_error('Macro public:xa...', 512)
#2 src/XF/Template/Templater.php(745): XF\Template\Templater->getTemplateMacro('public', 'xa_ams_attachme...', 'attachment_list...')
#3 src/addons/MaZ/AMP/XF/Template/Templater.php(77): XF\Template\Templater->callMacro('xa_ams_attachme...', 'attachment_list...', Array, Array, NULL)
#4 internal_data/code_cache/templates/l3/s9/public/xa_ams_article_view.php(598): MaZ\AMP\XF\Template\Templater->callMacro('xa_ams_attachme...', 'attachment_list...', Array, Array)
#5 src/XF/Template/Templater.php(1626): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#6 src/addons/MaZ/AMP/XF/Template/Templater.php(72): XF\Template\Templater->renderTemplate('xa_ams_article_...', Array, true, NULL)
#7 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\Templater->renderTemplate('public:xa_ams_a...', Array)
#8 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XenAddons\\AMS:A...', 'public:xa_ams_a...', Array)
#10 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
Request state
array(4) {
["url"] => string(151) "/ams/5-x-0-pela-obrigatoriedade-compulsoriedade-da-vacinacao-contra-a-praga-chinesa-no-stf-alexandre-de-moraes-e-edson-fachin-votam-a-favor.1929/?amp=1"
["referrer"] => bool(false)
["_GET"] => array(2) {
["/ams/5-x-0-pela-obrigatoriedade-compulsoriedade-da-vacinacao-contra-a-praga-chinesa-no-stf-alexandre-de-moraes-e-edson-fachin-votam-a-favor_1929/"] => string(0) ""
["amp"] => string(1) "1"
}
["_POST"] => array(0) {
}
}

And another:

Code:
ErrorException: Template error: [E_USER_WARNING] Template public:xa_ams_attachment_macros is unknown src/XF/Template/Templater.php:664
Generated by: POLITZ Jan 11, 2021 at 3:08 AM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/usr/share/ngin...', 664, Array)
#1 src/XF/Template/Templater.php(664): trigger_error('Template public...', 512)
#2 src/XF/Template/Templater.php(626): XF\Template\Templater->getTemplateData('public', 'xa_ams_attachme...')
#3 src/XF/Template/Templater.php(745): XF\Template\Templater->getTemplateMacro('public', 'xa_ams_attachme...', 'attachment_list...')
#4 src/addons/MaZ/AMP/XF/Template/Templater.php(77): XF\Template\Templater->callMacro('xa_ams_attachme...', 'attachment_list...', Array, Array, NULL)
#5 internal_data/code_cache/templates/l3/s9/public/xa_ams_article_view.php(598): MaZ\AMP\XF\Template\Templater->callMacro('xa_ams_attachme...', 'attachment_list...', Array, Array)
#6 src/XF/Template/Templater.php(1626): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#7 src/addons/MaZ/AMP/XF/Template/Templater.php(72): XF\Template\Templater->renderTemplate('xa_ams_article_...', Array, true, NULL)
#8 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\Templater->renderTemplate('public:xa_ams_a...', Array)
#9 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#10 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XenAddons\\AMS:A...', 'public:xa_ams_a...', Array)
#11 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#15 src/XF.php(488): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
["url"] => string(151) "/ams/5-x-0-pela-obrigatoriedade-compulsoriedade-da-vacinacao-contra-a-praga-chinesa-no-stf-alexandre-de-moraes-e-edson-fachin-votam-a-favor.1929/?amp=1"
["referrer"] => bool(false)
["_GET"] => array(2) {
["/ams/5-x-0-pela-obrigatoriedade-compulsoriedade-da-vacinacao-contra-a-praga-chinesa-no-stf-alexandre-de-moraes-e-edson-fachin-votam-a-favor_1929/"] => string(0) ""
["amp"] => string(1) "1"
}
["_POST"] => array(0) {
}
}

With my best intention to cooperate with any issues, i already opened a ticket in Bob's website to tell him about this issue too.

And my last question, about Ads:

I'm going to put all then tomorrow. Reading your FAQ i just have to basically copy all my code Ads that i have, implement on (Ads -> AMP) and put this: "<amp-ad...>"? After the ads code or before?

Thank very much.

Your work is amazing and is going to have a testimonial very soon to help others administrators choose their best products.

Regards,

Peter.
 
Alright, it sort of works with TH styles but the addon makes some assumptions about colours, font sizes etc which in my case break the UX pretty nicely. Other than that it works, no amp errors or other issues aside from those already reported. I've logged a bunch of tickets so will see how much of this is my natural slowness and how much is improvements.

I think some basic styling options would benefit the addon greatly to begin with.

@mazzly good first release.

go to tipography and change the font size settings from .rem to px. That made the trick for me
 
i have minor addon conflicts with @Siropu keyword linking and [rellect] Favicon For Links. content rendered for unfurled urls are not bypassing these addons creating bad html which is creating errors in amp pages. conflicts with more complicated addons i guess is expected. hopefully these issues can be sorted out!
 
i have minor addon conflicts with @Siropu keyword linking and [rellect] Favicon For Links. content rendered for unfurled urls are not bypassing these addons creating bad html which is creating errors in amp pages. conflicts with more complicated addons i guess is expected. hopefully these issues can be sorted out!

same here, keyword linking by @Siropu
 
I'm trying to use (my site) as mobile right now and as a guest, but it looks like AMP haven't already deployed. I have to wait a little to the add-on do the effects?
(I really need to make a FAQ item about this..), If you open a thread (any thread) on your forum, and add ?amp=1 to the end of the url, you will see the AMP variant. Google/Bing will send people to this one for mobile users. Here is an example:
With my best intention to cooperate with any issues, i already opened a ticket in Bob's website to tell him about this issue too.
@Bob if this problem is related to our addon, can you open a discussion with me so we can get it resolved? :)
I'm going to put all then tomorrow. Reading your FAQ i just have to basically copy all my code Ads that i have, implement on (Ads -> AMP) and put this: "<amp-ad...>"? After the ads code or before?
You should go to e.g. Adsense, open the page where they give you the code, and select "AMP" to get the amp code, which will look something like:

<amp-ad width="100vw" height="320" type="adsense" data-ad-client="ca-pub-..." data-ad-slot="...." data-auto-format="rspv" data-full-width="">
<div overflow=""></div>
</amp-ad>
Your work is amazing and is going to have a testimonial very soon to help others administrators choose their best products.
Thanks! I take pride in the quality of my work :) Been doing Full-stack web-development both professionally and as a hobby for close to 10 years now :)
I will have to double check again, maybe because I opened the link within xf app.
What is the XF app? :) wondering if I need to mention in the FAQs that it might be buggy viewing with that one...
i have minor addon conflicts with @Siropu keyword linking and [rellect] Favicon For Links. content rendered for unfurled urls are not bypassing these addons creating bad html which is creating errors in amp pages. conflicts with more complicated addons i guess is expected. hopefully these issues can be sorted out!
Okay, well we have to collaborate a bit to see what can be done then. Worst case AMPXF just needs to temporarily override/disable the Siropu addon from breaking things, but I'm sure @Siropu has some ideas also. (from what I've seen he's a very competent developer)


I will likely have a release out later today/tonight with some fixes for e.g. @ThemeHouse magical 62.5% font size etc.. Until then, all the best!
 
that would be fine! again, siropu and favicon addons are already being bypassed for text content in posts. but they are processing unfurl url box content.



question. are mailto links not part of amp spec? all the errors i have gotten so far from the checking bot are related to email ids listed in posts. thanks!
 
folks need to read more about amp! the whole idea to use amp to get better listing on google search result pages. your content might appear in a carousal. it might get priority listing in search results and discover feed. the whole idea is to rank well. the first page user lands on is a barebones page with focus on content and speed. amp pages tend to load instantly. they are designed to load instantly. google even caches them on their own servers to preload them so that they appear instantly. the idea is to provide an instant experience to the mobile user searching for content on the web. this is also why amp is hated so much because it is basically powered by google and focused on google.

it would probably require heavy customization to get amp page to look similar to a custom third party theme. good start would be to get the color theme sorted out along with logo. for most forum owners, anything more would probably be an overkill. you are essentially paying for this addon to get that elusive first hit from google search result pages.

any other click from amp landing page would take the guest visitor to regular site. he would not get another amp page again during that session. the idea is to get the first hit. after that it is your regular portal.

sorry for offtopic opinion post lol.
forgot to add another crucial point lol. probably already covered in the faqs. this is not an addon for your members! your members would likely never see an amp page on your website unless they click a link to your website while conducting a search on google on their mobile phone (i am not sure if this addon would redirect logged in members away from amp page to regular page). this is primarily aimed at guests so addons like chat box, reactions and others are completely irrelevant for this particular component. amp is purely a content focused platform. to get the user faster to the content on websites they are searching for on their phones!
This should be added to the description/introduction of the add-on so people get an idea of the purpose of this add-on. Seems there’s a lot of confusion about compatibilities with other themes and add-ons when really most of them don’t matter.
 
(I really need to make a FAQ item about this..), If you open a thread (any thread) on your forum, and add ?amp=1 to the end of the url, you will see the AMP variant. Google/Bing will send people to this one for mobile users. Here is an example:

Oh, I understand that. Thanks for the clarification.

But, I tried to "test" this, using a mobile and anonymous tab, but I’m not seeing the amp variant, just the normal result.

Maybe there is some delay to the amp deploy in the search systems?


@Bob if this problem is related to our addon, can you open a discussion with me so we can get it resolved? :)

Bob is a very nice and competent guy. I’m sure there is something to figure out, specially since his add-on is one of the bests and most used for CMS purposes.

Again, thanks for the attention to my questions. Support very quick as always.
 
Oh, I understand that. Thanks for the clarification.

But, I tried to "test" this, using a mobile and anonymous tab, but I’m not seeing the amp variant, just the normal result.

Maybe there is some delay to the amp deploy in the search systems?




Bob is a very nice and competent guy. I’m sure there is something to figure out, specially since his add-on is one of the bests and most used for CMS purposes.

Again, thanks for the attention to my questions. Support very quick as always.
You need to add ?amp=1 to the end of the url of a thread. It will then show you the amp variant of the thread you are testing. This add-on only supports threads.
 
You need to add ?amp=1 to the end of the url of a thread. It will then show you the amp variant of the thread you are testing.
Dear Joy, but how the "guests visitors" will know this?

The process is by the search engines, adding the ?amp=1 automatically for this users?

Il trying to test as a "guest visitor" via mobile but the Google for example is nothing adding the ?amp=1 result as expected.

And yes, adding the amp in the link works perfectly. But is not to be a manual procedure, right?
 
Top Bottom