AMPXF - AMP for Xenforo 2

AMPXF - AMP for Xenforo 2 [Paid] 2.3.0 Patch Level 3

No permission to buy (€50.00)
Thanks for your response!

I just realized that there’s an option in XenForo that determines whether category pages open in a new page or not. If this setting is disabled, maybe that’s why you’re not experiencing the issue.

Could you check if your category pages are set to open in a new page? If not, enabling that option might help reproduce the issue on your setup.

Also, I haven't opened a ticket on @mazzly ’s site yet because I assumed the developer would be active here. But since there hasn't been any response for over a month, I’ll try reaching out there as well.

Thanks again for your input!
 
Using a plugin that minifys the forum will also cause some errors with this addon too.
Thanks for your input!

I understand that using a minify plugin might cause issues, but in this case, the problem seems to be more fundamental.

Looking at the listener file, it explicitly checks for the following data-amp-page-type values:

  • thread
  • forum
  • resource
  • media
  • xa_ams
  • xa_cas
  • xa_ubs
  • xa_rms
  • xa_sc
However, category is missing from these checks, which means the addon doesn’t recognize category pages at all. As a result, AMP-specific styles aren’t being applied to category pages.

This issue doesn't seem to be related to minification but rather a missing check in the plugin’s logic. Has anyone found a way to manually add category page support to AMPXF? Or has anyone received any response from the developer regarding this issue?
 
Thanks for your input!

I understand that using a minify plugin might cause issues, but in this case, the problem seems to be more fundamental.

Looking at the listener file, it explicitly checks for the following data-amp-page-type values:

  • thread
  • forum
  • resource
  • media
  • xa_ams
  • xa_cas
  • xa_ubs
  • xa_rms
  • xa_sc
However, category is missing from these checks, which means the addon doesn’t recognize category pages at all. As a result, AMP-specific styles aren’t being applied to category pages.

This issue doesn't seem to be related to minification but rather a missing check in the plugin’s logic. Has anyone found a way to manually add category page support to AMPXF? Or has anyone received any response from the developer regarding this issue?
I answered in the support ticket you opened, but also adding a note here for others:
The category page is basically a subset/copy of the forum list page, and doesn't contain any useful content to rank for. Therefore there is no AMP styling for it, and also no meta tag from the "normal" page that indicates there exist an AMP page for it.

Similar things have been discussed before: https://xenforo.com/community/threads/ampxf-amp-for-xenforo-2-paid.189922/post-1496724
 
Okay I've disabled downloading of the new version then until we can get a fixed version.. A bit odd that those errors would appear now all the sudden with the small chabges made..
I thought it might be local to me but my changes were only in the extra file to which I've reverted.
 
Getting a lot of these:

Code:
TypeError: Extension public:featured_content_item :: metadata() error: MaZ\AMP\XF\Entity\Thread::getLdStructuredData(): Argument #1 ($firstDisplayedPost) must be of type XF\Entity\Post, null given, called in /home/nginx/domains/domain.com/public/src/XF/FeaturedContent/ThreadHandler.php on line 32
src/addons/MaZ/AMP/XF/Entity/Thread.php:28

Stack trace
#0 src/XF/FeaturedContent/ThreadHandler.php(32): MaZ\AMP\XF\Entity\Thread->getLdStructuredData(NULL)
#1 src/XF/Entity/FeaturedContent.php(227): XF\FeaturedContent\ThreadHandler->getContentStructuredData(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#2 src/XF/Template/Templater.php(1282): XF\Entity\FeaturedContent->getStructuredData()
#3 internal_data/code_cache/templates/l2/s28/public/featured_content_item.php(91): XF\Template\Templater->method(Object(XF\Entity\FeaturedContent), 'getStructuredDa...', Array)
#4 src/XF/Template/Templater.php(1092): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#5 src/XF/Template/Templater.php(1028): XF\Template\Templater->renderExtensionInternal('metadata', Array, Array, Object(XF\Template\ExtensionSet))
#6 internal_data/code_cache/templates/l2/s28/public/content_display_macros.php(150): XF\Template\Templater->renderExtension('metadata', Array, Object(XF\Template\ExtensionSet))
#7 src/XF/Template/Templater.php(921): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#8 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('content_display...', 'article', Array, Array, Object(XF\Template\MacroState))
#9 src/XF/Template/Templater.php(912): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:content_...', 'article', Array, Array, Object(XF\Template\MacroState))
#10 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('featured_conten...', 'article', Array, Array, Object(XF\Template\MacroState))
#11 src/XF/Template/Templater.php(912): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:featured...', 'article', Array, Array, Object(XF\Template\MacroState))
#12 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('featured_conten...', 'article', Array, Array, Object(XF\Template\MacroState))
#13 src/XF/Template/Templater.php(966): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:featured...', 'article', Array, Array)
#14 src/XF/FeaturedContent/AbstractHandler.php(332): XF\Template\Templater->renderMacro('public:featured...', 'article', Array)
#15 src/XF/Entity/FeaturedContent.php(87): XF\FeaturedContent\AbstractHandler->render(Object(XF\Entity\FeaturedContent), 'article', 0)
#16 src/XF/Template/Templater.php(1282): XF\Entity\FeaturedContent->render()
#17 internal_data/code_cache/templates/l2/s28/public/featured_content_list.php(109): XF\Template\Templater->method(Object(XF\Entity\FeaturedContent), 'render', Array)
#18 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#19 src/addons/MaZ/AMP/Traits/Templater/XF22.php(52): XF\Template\Templater->renderTemplate('featured_conten...', Array, true, NULL)
#20 src/addons/MaZ/AUN/XF/Template/Templater.php(39): MaZ\AMP\XF\Template\Templater->renderTemplate('public:featured...', Array, true, NULL)
#21 src/XF/Template/Template.php(24): MaZ\AUN\XF\Template\Templater->renderTemplate('public:featured...', Array)
#22 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#23 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Html->renderView('XF:FeaturedCont...', 'public:featured...', Array)
#24 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#25 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#26 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#27 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#28 src/XF.php(806): XF\App->run()
#29 index.php(23): XF::runApp('XF\\Pub\\App')
#30 {main}

Request state
array(4) {
  ["url"] => string(10) "/featured/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/featured/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
From Google webmaster tools
Missing URL in HTML tag amp-img.
AMP pages with this issue are invalid. Invalid AMP pages aren’t served on Google

I see the profile images are big compared to normal forum view, the images don't fit the layout, they are too big. any chance to possibly disable or resize profile images?
 
Getting a lot of these:

Code:
TypeError: Extension public:featured_content_item :: metadata() error: MaZ\AMP\XF\Entity\Thread::getLdStructuredData(): Argument #1 ($firstDisplayedPost) must be of type XF\Entity\Post, null given, called in /home/nginx/domains/domain.com/public/src/XF/FeaturedContent/ThreadHandler.php on line 32
src/addons/MaZ/AMP/XF/Entity/Thread.php:28

Stack trace
#0 src/XF/FeaturedContent/ThreadHandler.php(32): MaZ\AMP\XF\Entity\Thread->getLdStructuredData(NULL)
#1 src/XF/Entity/FeaturedContent.php(227): XF\FeaturedContent\ThreadHandler->getContentStructuredData(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#2 src/XF/Template/Templater.php(1282): XF\Entity\FeaturedContent->getStructuredData()
#3 internal_data/code_cache/templates/l2/s28/public/featured_content_item.php(91): XF\Template\Templater->method(Object(XF\Entity\FeaturedContent), 'getStructuredDa...', Array)
#4 src/XF/Template/Templater.php(1092): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#5 src/XF/Template/Templater.php(1028): XF\Template\Templater->renderExtensionInternal('metadata', Array, Array, Object(XF\Template\ExtensionSet))
#6 internal_data/code_cache/templates/l2/s28/public/content_display_macros.php(150): XF\Template\Templater->renderExtension('metadata', Array, Object(XF\Template\ExtensionSet))
#7 src/XF/Template/Templater.php(921): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#8 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('content_display...', 'article', Array, Array, Object(XF\Template\MacroState))
#9 src/XF/Template/Templater.php(912): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:content_...', 'article', Array, Array, Object(XF\Template\MacroState))
#10 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('featured_conten...', 'article', Array, Array, Object(XF\Template\MacroState))
#11 src/XF/Template/Templater.php(912): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:featured...', 'article', Array, Array, Object(XF\Template\MacroState))
#12 src/addons/MaZ/AMP/XF/Template/Templater.php(159): XF\Template\Templater->callMacro('featured_conten...', 'article', Array, Array, Object(XF\Template\MacroState))
#13 src/XF/Template/Templater.php(966): MaZ\AMP\XF\Template\TemplaterAbstract->callMacro('public:featured...', 'article', Array, Array)
#14 src/XF/FeaturedContent/AbstractHandler.php(332): XF\Template\Templater->renderMacro('public:featured...', 'article', Array)
#15 src/XF/Entity/FeaturedContent.php(87): XF\FeaturedContent\AbstractHandler->render(Object(XF\Entity\FeaturedContent), 'article', 0)
#16 src/XF/Template/Templater.php(1282): XF\Entity\FeaturedContent->render()
#17 internal_data/code_cache/templates/l2/s28/public/featured_content_list.php(109): XF\Template\Templater->method(Object(XF\Entity\FeaturedContent), 'render', Array)
#18 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#19 src/addons/MaZ/AMP/Traits/Templater/XF22.php(52): XF\Template\Templater->renderTemplate('featured_conten...', Array, true, NULL)
#20 src/addons/MaZ/AUN/XF/Template/Templater.php(39): MaZ\AMP\XF\Template\Templater->renderTemplate('public:featured...', Array, true, NULL)
#21 src/XF/Template/Template.php(24): MaZ\AUN\XF\Template\Templater->renderTemplate('public:featured...', Array)
#22 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#23 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Html->renderView('XF:FeaturedCont...', 'public:featured...', Array)
#24 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#25 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#26 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#27 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#28 src/XF.php(806): XF\App->run()
#29 index.php(23): XF::runApp('XF\\Pub\\App')
#30 {main}

Request state
array(4) {
  ["url"] => string(10) "/featured/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/featured/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
Hmm, not sure if that is related to AMPXF, since the URL/page where it happens is not an AMP page...
AMPXF getLdStructuredData only overrides the core functionality if it is an AMP page, otherwise it calls the parent (core XF) functionality.

It seems that the error is related to not finding/passing a firstPost to the functionality that renders LD+JSON on the page..

From Google webmaster tools
Missing URL in HTML tag amp-img.
AMP pages with this issue are invalid. Invalid AMP pages aren’t served on Google

I see the profile images are big compared to normal forum view, the images don't fit the layout, they are too big. any chance to possibly disable or resize profile images?
Please open a support ticket on ampxf.com with the affected pages and we'll have a look at it :)
 
Back
Top Bottom