Open nowmichaelclark opened 1 week ago
also uploaded a console log for AI to analyze; here are the results
Key Takeaways:
setTimeout
and setInterval
handlers are taking an unusually long time, potentially blocking other processes.Detailed Explanations and Solutions:
Passive Event Listeners:
{ passive: true }
as the third argument when attaching event listeners to scroll or wheel events. For example:
element.addEventListener('scroll', myScrollHandler, { passive: true });
Deprecated jQuery:
.click()
, .submit()
, etc., forces the jQuery Migrate plugin to run extra code, increasing execution time..on()
. For example, replace $('form').submit(function() { ... });
with:
$('form').on('submit', function() { ... });
Google Maps Loading:
async
and defer
attributes:
<script async defer src="https://maps.googleapis.com/..."></script>
Blocked Resources:
Duplicate IDs:
Autocomplete Issues:
autocomplete="new-password"
to your password input fields:
<input type="password" name="user_password" id="user_password" autocomplete="new-password">
<input type="password" name="confirm_user_password" id="confirm_user_password" autocomplete="new-password">
Long-Running Handlers:
setTimeout
or setInterval
handlers can block the main thread, making the page feel unresponsive.async/await
). Consider using requestAnimationFrame for animation-related tasks. Additional Performance Tips:
srcset
attribute) to serve appropriately sized images.Remember: Implementing these solutions requires understanding the underlying code of your website. Consider working with a web developer if you're not comfortable modifying the code yourself.
Here is a link sent from a Hostinger employee that goes further into depth about speed and performance insights regarding OSF. Can switch between mobile and desktop versions of the sight to see what issues arise.
Describe the bug For now, just dumping what I find here as I find it. Not always sure what I am looking at. Using this page to test loading times using the chrome debugger: https://opensanghafoundation.org/newsite/a-mikey-test-page/
google maps elements not found (don't need to be loaded)
these are being called and have errors and timeouts: paypal recaptcha bettermessages youtube google play
deprecated Elementor (elementor needs updating)
bp-messages has many tasks labeled as "Long Tasks" in chrome indicating that it is loading in slow also bp-messages audio content not allowed to start
"Found 2 elements with non-unique id": This occurs several times, not sure how to track yet
can also convert images and icons to ".webp" format for faster loading
jQuery: some javascript code uses deprecated formating; "event shorthand is deprecated"
AI Explanation for JQuery-
The Cause of the Error (Likely): Somewhere in your web application's JavaScript code, you're probably using a syntax like this:
Copy code $('form').submit(function(event) { // Your form submission logic here }); Use code snippets with caution
This shorthand way of binding the submit event is considered deprecated. The Solution: You should replace the shorthand with the more standard .on() method:
Copy code $('form').on('submit', function(event) { // Your form submission logic here }); Use code snippets with caution
Explanation: .submit() shorthand: This was a convenient way to attach an event handler to the submit event, but it's no longer the recommended approach. .on() method: This is the more versatile and preferred way to bind events in jQuery. It allows you to attach events to elements even if they are added to the DOM later.