Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ReCaptcha to improve Google Page Speed score #27844

Closed
extroniks opened this issue Apr 13, 2020 · 13 comments
Closed

Refactor ReCaptcha to improve Google Page Speed score #27844

extroniks opened this issue Apr 13, 2020 · 13 comments
Labels
Issue: ready for confirmation not-confirmed Use for Issue that was closed during confirmation Reported on 2.3.x Indicates original Magento version for the Issue report.

Comments

@extroniks
Copy link

Preconditions (*)

  1. Magento 2.3.X
  2. ReCaptcha enabled and configured

Steps to reproduce (*)

  1. Enable google recaptcha
  2. Run google lighthouse audit

Expected result (*)

  1. Minimal impact on page speed score
  2. Load / preload the required assets without blocking main thread

Actual result (*)

  1. Assets are loaded within components with mage init, delaying execution
  2. Causes bad lighthouse score

image
image

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2020

Hi @extroniks. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@extroniks do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 13, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 28, 2020

Hi @prasannachelladurai90. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@prasannachelladurai-ziffity

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @prasannachelladurai90. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @prasannachelladurai90, here is your Magento instance.
Admin access: https://i-27844-2-4-develop.instances.magento-community.engineering/admin_9907
Login: 8e9557e2 Password: b82f67b1bfb8
Instance will be terminated in up to 3 hours.

@prasannachelladurai-ziffity

@magento give me 2.3.5p1 instance

@magento-engcom-team
Copy link
Contributor

Hi @prasannachelladurai90. Thank you for your request. I'm working on Magento 2.3.5p1 instance for you

@davidwindell
Copy link
Contributor

A vote from me for this! Although I'm not sure if magento/security-package#191 might have solved it in 2.4?

@m2-assistant
Copy link

m2-assistant bot commented Nov 13, 2020

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@magento-engcom-team magento-engcom-team added the Reported on 2.3.x Indicates original Magento version for the Issue report. label Nov 13, 2020
@engcom-Delta
Copy link
Contributor

@extroniks @davidwindell I checked issue on magento 2.4-develop + security-package 1.0-develop and I didn't have such decrease of page load.
Manual testing scenario:

  • Install magento 2.4-develop with security-package 1.0-develop
  • Enable recapthca for Contact Us and Newsletter Subscription
    image
  • Go to Contact Us page
  • Run google lighthouse audit

Result:
Reduce JavaScript execution time is 1.5 s
image

I close this issue as recaptcha is not part of magento code base
Please feel free to create issue in security-package repo for further investigation if it is still reproducible on the latest magento version

@engcom-Delta engcom-Delta removed their assignment Nov 14, 2020
@engcom-Delta engcom-Delta added the not-confirmed Use for Issue that was closed during confirmation label Nov 14, 2020
@xpoback
Copy link
Contributor

xpoback commented Feb 10, 2021

Any idea whether this ever will be fixed for Magento 2.3.x?

@WebKenth
Copy link

@engcom-Delta this is most certainly a Magento issue

You have chosen in your module to not allow the javascript to be deferred which would solve the entire issue -.-'

@WebKenth
Copy link

@engcom-Delta this is most certainly a Magento issue

You have chosen in your module to not allow the javascript to be deferred which would solve the entire issue -.-'

Not to mention you have decided to split the module into 17 different modules....

When all the recaptcha module is supposed to do is load one single javascript file and appending the api keys....

This is one hell of a bloated module

Sure from an architectural standpoint it's nice that all the features are split out, but be real here, when are you ever going to only use one of the modules?

Surely the 17 modules could have been reduces to maybe 3 modules?

The small performance drops each module adds is enough to question why the split is even necessary

I mean come on...

module-re-captcha-admin-ui
module-re-captcha-checkout
module-re-captcha-contact
module-re-captcha-customer
module-re-captcha-frontend-ui
module-re-captcha-migration
module-re-captcha-newsletter
module-re-captcha-paypal
module-re-captcha-review
module-re-captcha-send-friend
module-re-captcha-ui
module-re-captcha-user
module-re-captcha-validation
module-re-captcha-validation-api
module-re-captcha-version-2-checkbox
module-re-captcha-version-2-invisible
module-re-captcha-version-3-invisible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: ready for confirmation not-confirmed Use for Issue that was closed during confirmation Reported on 2.3.x Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

7 participants