WordPress.org

Ready to get started?Download WordPress

Forums

Q and A FAQ and Knowledge Base for WordPress
[Plugin: Q and A - FAQ Plugin] Some optimizations request... (1 post)

  1. Paul G.
    Member
    Posted 2 years ago #

    Hi,

    First, I use this plugin quite a bit - I think it works super great. Thank you.

    I do have some optimizations I'd like to suggest if you can - currently I get around it in my theme, but if it was in the plugin core, it'd be best.

    It basically involves CSS and Javascript files. The less files that are loaded on the site, the better.

    The q-and-a.css file has 3 lines, and I feel you could optimize this by just putting them inline within the shortcode function. So line 116 in q-and-a.php could be replaced with:

    $qa_shortcode = '
    	<style media="screen">
    		p.faq-catname {margin: 0 0 5px 0; font-weight: bold;}
    		div.faq-title {	font-style: italic;	margin:  0 0 10px 0;}
    		div.faq-answer {margin: 0 0 20px 15px;display: none;}
    	</style>
    ';

    This would then mean there is 1 less file included on every page.

    Then, because FAQs are not used on each page, we can optimize the Javascript loading by simply only enqueue it when the Q-A function is called. So then we'd move your enqueue from qa_init() to the bottom of the function qa_shortcode()

    This way, the javascript file is ONLY included when its needed - typically I use it on 1 or 2 pages on the site, so this is a big bonus.

    What do you think?

    Hope you can make these changes in the plugin and you appreciate where this suggestion is coming from.

    Thanks for a great plugin!
    Cheers,
    Paul.

    http://wordpress.org/extend/plugins/q-and-a/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic