Advertisement:

Author Topic: AMP4SMF  (Read 3513 times)

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,152
  • Gender: Male
    • XinYenFon on GitHub
    • @XinYenFon on Twitter
AMP4SMF
« on: July 27, 2020, 04:43:04 PM »
Link to Mod

Adds very basic AMP support for your SMF forum... Only supported structure is topics.

SMF2: v0.0.1 (same code as SMF 2.1 version just less hooks due to core-software limitations)
SMF2.1: v0.0.3

You can support me via Twitch Prime* or Patreon.

Changelog
v0.0.3 (SMF 2.1 version only)
- Img bbcode and Code bbcode disabled.
- Poll related code removed.
v0.0.2 (SMF 2.1 version only)
! Small code adapts & more hooks
v0.0.1
! First release

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #1 on: July 27, 2020, 07:06:45 PM »
I will test it to see how it works, even if it is basic it can fulfill its function well. I saw some advertising agencies implement it in some highly modified SMF but the performance worsened (I don't know why).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline diegolyanky

  • Jr. Member
  • **
  • Posts: 338
  • Gender: Male
Re: AMP4SMF
« Reply #2 on: July 27, 2020, 07:55:17 PM »

Didn't worked on 2 of my sites. SMF 2.0.17

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: AMP4SMF
« Reply #3 on: July 28, 2020, 08:29:23 AM »

Didn't worked on 2 of my sites. SMF 2.0.17



How did it not work? Do you go to the doctor when you are unwell and just say “I’m ill”, no, you provide details. Please do so here.
No good deed goes unpunished
All helpful urges should be circumvented

Offline diegolyanky

  • Jr. Member
  • **
  • Posts: 338
  • Gender: Male
Re: AMP4SMF
« Reply #4 on: July 28, 2020, 08:56:12 AM »

haha... Sorry, you're right.

I installed without problem, all fine and no errors. When I tested the AMP under search console, said: NO AMP DETECTED.

That's all...

Maybe I am doing something wrong (IDK)

Thanks a lot for your quick reply
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,152
  • Gender: Male
    • XinYenFon on GitHub
    • @XinYenFon on Twitter
Re: AMP4SMF
« Reply #5 on: July 28, 2020, 10:53:11 AM »

haha... Sorry, you're right.

I installed without problem, all fine and no errors. When I tested the AMP under search console, said: NO AMP DETECTED.

That's all...

Maybe I am doing something wrong (IDK)

Thanks a lot for your quick reply

There are few things;

The mod does not make your entire site AMP Valid. Its only for topics. When I try to validate a page in AMPValidator it fails but tells me that this page redirects to AMP version (weird that validator itself is not self-redirecting).

Once I tell the page that show me the redirected (AMP) results: https://search.google.com/test/amp?skip_amp_follow=true&id=APQM6j9Ket1IaCc4aCaiEA

To validate your page if it has valid AMP version... Navigate to the topic, check source file and you should see something like...

Code: [Select]
<link rel="amphtml" href="https://www.yoursite.tld/index.php?action=amp;topic=id">
if the code is there your page (SHOULD) be fine... as again we don't know how well the system works but according to their Docs, this is the way to redirect search engine (Google) to AMP page... If the following code does not exist in your page, either you didn't install the mod's edits to your custom theme or something else -which I don't know-.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #6 on: July 28, 2020, 02:47:03 PM »
It works as it should although I thought it causes problems with the nice url, so far it works fine. But when there are citations or the code bbcode fails in the validation, not everywhere but in some specific points related to php (I have to do more tests). Left where that error marks me:

Quote
<a href="" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code">SET xdate = %date: ~ -10,2%% date: ~ -7,2%% date: ~ -4,4%</code><br /><div class="codeheader">Código: (Windows) <a href="" onclick="return smfSelectText(this);" class="codeoperation">[Seleccionar]</a></div><code class="bbc_code">@echo on<br />

Try one 2.0.15 and two 2.0.17... In all of them something similar happens to me when I put [code][/code] with lines in php/bach/bash (I have to try more).


Regards!

ADD: Apparently the error occurs because the "onclick" attribute cannot appear in the "a" tag (it's an AMP rule from what I read). It's time to do a little more research! :P
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline marcosbr

  • Jr. Member
  • **
  • Posts: 203
  • Gender: Male
  • Vivendo e Aprendendo!
    • marcos.gomes.5477272 on Facebook
    • @marcosbrgomes on Twitter
    • amigosdaeletronica
Re: AMP4SMF
« Reply #7 on: July 28, 2020, 10:25:35 PM »

 I only have this error on topics with image from the RSS Feed Poster. (I use this mod)
 AMP validator: "The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? Debug. Learn more..."


 Remaining OK!

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,152
  • Gender: Male
    • XinYenFon on GitHub
    • @XinYenFon on Twitter
Re: AMP4SMF
« Reply #8 on: July 29, 2020, 02:37:26 AM »
It works as it should although I thought it causes problems with the nice url, so far it works fine. But when there are citations or the code bbcode fails in the validation, not everywhere but in some specific points related to php (I have to do more tests). Left where that error marks me:

Quote
<a href="" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code">SET xdate = %date: ~ -10,2%% date: ~ -7,2%% date: ~ -4,4%</code><br /><div class="codeheader">Código: (Windows) <a href="" onclick="return smfSelectText(this);" class="codeoperation">[Seleccionar]</a></div><code class="bbc_code">@echo on<br />

Try one 2.0.15 and two 2.0.17... In all of them something similar happens to me when I put [code][/code] with lines in php/bach/bash (I have to try more).


Regards!

ADD: Apparently the error occurs because the "onclick" attribute cannot appear in the "a" tag (it's an AMP rule from what I read). It's time to do a little more research! :P


 I only have this error on topics with image from the RSS Feed Poster. (I use this mod)
 AMP validator: "The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? Debug. Learn more..."


 Remaining OK!

That's expected... BBCodes are using different type of goodies to become alive and AMP by design is very limited system... The solution is not editing your post, please do not do that.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #9 on: July 29, 2020, 02:06:21 PM »
I did not even think about editing topics for this error, I will look for another solution if it exists, although the impression that smf already brings cannot be used? Isn't it similar in the sense it has to be as simple as possible?

https://www.simplemachines.org/community/index.php?action=printpage;topic=574227.0 < It is even more direct than AMP or so it seems to me.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: AMP4SMF
« Reply #10 on: July 29, 2020, 02:19:14 PM »
Yes but it doesn't use the magical markup that Google tells you to use, so it can better make money out of your content.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,152
  • Gender: Male
    • XinYenFon on GitHub
    • @XinYenFon on Twitter
Re: AMP4SMF
« Reply #11 on: July 29, 2020, 02:26:02 PM »
I did not even think about editing topics for this error, I will look for another solution if it exists, although the impression that smf already brings cannot be used? Isn't it similar in the sense it has to be as simple as possible?

https://www.simplemachines.org/community/index.php?action=printpage;topic=574227.0 < It is even more direct than AMP or so it seems to me.


Regards!

The system is built based on printpage to keep the simplicity, the reality is AMP is a horrid spawn of Google... The only reason I wrote this mod because a) it was relatively easy to do b) I had time. Solution to BBCode may not be simple, I need to make some research because I honestly think, someone shouldn't just hook-into parseBBC and replace BBCodes with other ones...

Another reality is... ResponsiveCurve is 100000000000000 (0 to infinity) better than AMP can ever be, because Responsive design does not limit your functionality UNLIKE this horrid spawn of Google... The mod will become obsolete, once Google says, "okay I' f'd up... this system is not working" -which is relatively soon- because we know that they are removing limitation of promoting sites (to upper story parts) to AMP.

Yes but it doesn't use the magical markup that Google tells you to use, so it can better make money out of your content.

also +1

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #12 on: July 29, 2020, 03:54:42 PM »
Yes but it doesn't use the magical markup that Google tells you to use, so it can better make money out of your content.

If it is something I notice and more in these times, I never thought to make a site profitable because I think it loses the sense of fun when editing something and becomes an obligation. Added you need 100000000 visits to win 1USD... There are better and easier ways to get money (that's what I think).

The system is built based on printpage to keep the simplicity, the reality is AMP is a horrid spawn of Google... The only reason I wrote this mod because a) it was relatively easy to do b) I had time. Solution to BBCode may not be simple, I need to make some research because I honestly think, someone shouldn't just hook-into parseBBC and replace BBCodes with other ones...

Another reality is... ResponsiveCurve is 100000000000000 (0 to infinity) better than AMP can ever be, because Responsive design does not limit your functionality UNLIKE this horrid spawn of Google... The mod will become obsolete, once Google says, "okay I' f'd up... this system is not working" -which is relatively soon- because we know that they are removing limitation of promoting sites (to upper story parts) to AMP.

It is the truth that for a while they will use AMP and then change everything, after all they must generate their profit. To see how it works it is not badly, it does not add or subtract having it installed (in forum normal operation).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: AMP4SMF
« Reply #13 on: July 29, 2020, 03:58:43 PM »
No, it's not about making *your* site profitable. It's about Google making money from you.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #14 on: July 29, 2020, 04:53:22 PM »
Now that you mention it you are right and many want google to look at their websites, a perfect cycle.
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline AllMassive

  • Jr. Member
  • **
  • Posts: 148
  • Gender: Male
Re: AMP4SMF
« Reply #15 on: August 10, 2020, 07:48:11 PM »
Sorry, but:
What is AMP ?

Offline efk

  • Jr. Member
  • **
  • Posts: 390
  • Gender: Male
Re: AMP4SMF
« Reply #16 on: August 10, 2020, 08:53:13 PM »
Sorry, but:
What is AMP ?
Probably 99%+ members and guests will have exactly the same question. Even google fails to answer  :D
Edit: Got an idea what it could be since I saw many Amplifiers in google store in past, so it has to be Amplifier but still no clue for what since there is no info about mod.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,873
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: AMP4SMF
« Reply #17 on: August 10, 2020, 08:55:06 PM »
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: AMP4SMF
« Reply #18 on: August 11, 2020, 05:32:16 AM »
A way of making your site easier for Google to scrape and display content from without having to send users to you / a way of displaying ads better without all the other stuff on your site.
No good deed goes unpunished
All helpful urges should be circumvented

Offline pocttopus

  • Full Member
  • ***
  • Posts: 499
  • Low pressure
    • @pocttopus on Twitter
    • mkreef.com
Re: AMP4SMF
« Reply #19 on: August 21, 2020, 01:18:47 PM »
Does AMP stands for Accelerated Mobile Pages?