I recently wrote a plugin that lets you add a quiz to your site(http://wordpress.org/extend/plugins/eventr/)
To show the quiz in the client side, the user should and a HTML comment to any blog post – in my case <!– QUIZZIN 1 –> (1 is ID of quiz)
In the plugin, I use the ‘the_content’ filter to search for this code insert the plugin into its place.
The problem is that if a user is viewing the home page of the blog, each and every post goes thru my searching function. It works perfectly – but I still has some reservations about using this method. It don’t seem like the more optimized method for doing this.
Am I doing anything wrong? What is the best practice to follow in such a case?
The searching function can be found at http://svn.wp-plugins.org/eventr/tags/1.00.1/eventr.php (look for eventr_scan_content() ).
- The topic ‘Best Practice for HTML code to show plugin’ is closed to new replies.