Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
An Example of DIY Savings

Developer's Roundtable Notes

Session: Creating a Plugin

Why Do You Want a Plugin?

Before deciding how to enhance your site, ask yourself these questions:

What’s the specific functionality you need?

Is there a core function already in place for this?

Is it a simple, single function like adding another sidebar or customizing the admin menu?

Do you (or your client) need to change options for this particular use?



This will help you decide if it’s more effective to install a third party plugin, or if you should write one yourself.

And, when weighing your time, remember to include how long it will take you to find, test, and vet someone else’s plugin.

Also remember that once you’ve written a plugin, you can easily modify and re-use it for other projects.


Do It Yourself Advantages

You only have the features you specifically need – no bloat

You can reduce database calls (and page load speed) by hard coding options

If there’s an issue or a conflict, you know where to find it

Once you’ve written it, you can use it over and over – just like any other plugin

An Example of DIY Savings

Fatal error: Uncaught Error: Call to a member function id() on array in /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php:36 Stack trace: #0 /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(538): CrayonFormatter::format_code('', Array, Object(CrayonHighlighter)) #1 [internal function]: CrayonFormatter::delim_to_internal(Array) #2 /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(516): preg_replace_callback('#()#msi', 'CrayonFormatter...', '<?php\r\n\r\nif( ! ...') #3 /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(166): CrayonFormatter::format_mixed_code('<?php\r\n\r\nif( ! ...', Object(CrayonLang), Object(CrayonHighlighter)) #4 /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(186): Cr in /home/lylahnic/public_html/dev.wpwhatnot.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 36