Git Product home page Git Product logo

Comments (3)

pryley avatar pryley commented on August 15, 2024

Site Reviews does not load in an iframe, it is part of the HTML of your webpage.

Please show an example online that demonstrates the performance benefit and method of lazy loading html content (not images) of a page.

from site-reviews.

wpsumo avatar wpsumo commented on August 15, 2024

Sure: https://www.sertmedia.com/lazy-load-your-wordpress-comments-for-better-performance/

Would be great to have this integrated into site reviews, so no matter way adding it, Gutenberg shortcodes etc it can be lazy loaded.

Options for users:
No lazy load
Lazy load on scroll (specify off-set)
Lazy load on "load reviews click"
Lazy load after page fully rendered.

from site-reviews.

pryley avatar pryley commented on August 15, 2024

The problem with this is that it is not SEO friendly. You generally want your reviews accessible to search engines, and if using the schema options on the [site_reviews] shortcode, the added Review schema requires that the reviews are visible to search engines.

Another concern is user experience. The few milliseconds you save by lazy loading reviews may make the site experience worse for your visitors as lazy-loading requires an AJAX request on scroll which can make your site jump as the content loads.

Lazy loading your posts used to be very popular a few years ago, but many stay away from it now because of the SEO and user experience implications. Reviews should not be classified the same as comments; they hold a very different purpose and are more important and relevant to your customers. If your site is loading slow, the culprit will likely not be due to the ~0.2ms of time it takes to load the reviews...

If you want to optimise the review loading and you have enabled avatars, I recommend that you:

  1. Install a lazy loading plugin for images
  2. Only display up to 10 reviews
  3. Use the pagination option with ajax
  4. If you are assigning reviews, only assign to either a category or a post ID, not both

However, I will add this request to the Roadmap for future consideration and review, though I cannot promise that it will ever be implemented. Likely, the only lazy loading that will be added will be for the avatars.

from site-reviews.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.