WordPress.org

Ready to get started?Download WordPress

Forums

Meteor Slides
[resolved] Meteor Slides Rsesource Hog? (11 posts)

  1. pazzaglia
    Member
    Posted 1 year ago #

    I've posted here earlier that I absolutely love the slider BUT.. my host is saying that my website is taking up too many resources and in looking at my access logs I noticed that meteor slides, which I have only placed on the homepage, makes FIVE calls to the server EVERY TIME any OTHER page (that does not contain meteor slides) loads.

    http://www.hippressurecooking.com/beer-can-chicken-pressure-cooked-whole/
    GET /wp-content/plugins/meteor-slides/css/meteor-slides.css?ver=1.0 HTTP/1.1
    GET /wp-content/plugins/meteor-slides/js/jquery.cycle.all.js?ver=3.5.1 HTTP/1.1
    GET /wp-content/plugins/meteor-slides/js/jquery.touchwipe.1.1.1.js?ver=3.5.1 HTTP/1.1
    GET /wp-content/plugins/meteor-slides/js/jquery.metadata.v2.js?ver=3.5.1 HTTP/1.1
    GET /wp-content/plugins/meteor-slides/js/slideshow.js?ver=3.5.1 HTTP/1.1

    Any tweak I can make to the code to make it stop? I would like to keep the slides, but loose the calls.

    Thanks!

    L

    http://wordpress.org/extend/plugins/meteor-slides/

  2. allm
    Member
    Posted 1 year ago #

    I would like to know the answer to this too...

  3. Josh Leuze
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry for the delay, loading these scripts on each page generally isn't a big deal. After they are loaded for the first page, the scripts are cached in the visitor's browser for each subsequent page that they visit, so it isn't re-downloading them for every single page.

    The only time that it's really an issue is when a visitor enters your site to like say single blog post and doesn't visit the homepage with the slideshow, then they just loaded the slideshow scripts for no reason.

    You can prevent the scripts and stylesheet from loading on all by the homepage by adding this function to your functions.php file:

    function remove_meteorslides_scripts() {
    	if ( !is_front_page() ) {
    		remove_action( 'wp_print_scripts', 'meteorslides_javascript' );
    		remove_action( 'wp_enqueue_scripts', 'meteorslides_css' );
    	}
    }
    add_action( 'get_header', 'remove_meteorslides_scripts' );
  4. pazzaglia
    Member
    Posted 1 year ago #

    Josh,

    I pasted this code in my functions file and it suppresses the slider from the front page as well.

    Is there a place in the code where I should change the name of the front page? In my template the meteor slides PHP call code is put in featured-content.php

    I've temporarily "klooged" the slider it by using the short code in a text widget on my home page - but Ideally I would like for it to be integrated so the extra vertical space and style the widget requires aren't being displayed around the slideshow.

    Thanks,

    L

  5. allm
    Member
    Posted 1 year ago #

    @Josh: thanks for your explanation. I'll leave things as the are.

    @pazzaglia: you might check the pagenumber of your frontpage and then change:
    !is_front_page()
    to
    !is_single( '99' )

    This presumes the pagenumber of your front page is 99. Change as needed.

  6. Josh Leuze
    Member
    Plugin Author

    Posted 1 year ago #

    Did you get this working? It looks like Meteor Slides is only loading on the homepage of your site. The is_front_page function is a conditional tag that checks if the homepage is loaded but depending on how your homepage is setup it might be possible a different tag might need to be used.

  7. pazzaglia
    Member
    Posted 1 year ago #

    Josh and realblueorange,

    I tried changing the line in the script to "!is_single( '99' )" and what I saw was one broken meteor slides (all the slides showed up at once in a column) of the homepage.

    So, I quickly removed the modification and put my text widget klooge back.

    Let me know if you would like for me to try something else.

    Ciao,

    L

  8. allm
    Member
    Posted 1 year ago #

    @pazzaglia:
    You need to replace 99 with the actual page id of the front page. You can find the page ID like this:
    http://www.techtrot.com/wordpress-page-id/

  9. pazzaglia
    Member
    Posted 1 year ago #

    @realblueorange

    Sorry if I wasn't clear. When I added your modification to the functions file I adapted the code with my information - changing the homepage from 99 to 694.

    Ciao,

    L

  10. allm
    Member
    Posted 1 year ago #

    @pazzaglia:
    OK, in that case I hope Josh can elaborate on his code and what happened in your case. Succes!

  11. Josh Leuze
    Member
    Plugin Author

    Posted 1 year ago #

    The is_front_page function should work. If you are using a static page as your homepage you could also use is_page, but is_single probably isn't the best choice. I would start by trying is_home instead.

    Try installing the What Template File Am I Viewing? plugin to see exactly which template file is loading, that could give me a better idea of what tag you need to use.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic