Run code directly on your WordPress Sites with the iControlWP Code Snippets Feature

iControlWP WordPress Management LogoCode snippets… there are many people that rave about the ability to run arbitrary code on WordPress sites.

We know from multiple requests that many people find this useful, so we’ve provided the ability to run code snippets on your WordPress sites directly from within iControlWP.

Like most things we do though, we did it a bit differently – we let everyone have access to it. *gasp*

About the All-Access Code Snippets Feature

With other WordPress Managers you have to pay loads of cash to get a sniff at this feature (at least at the time of writing) – that is, you have to be at least a “Professional“.

We’re not quite sure why only a “Professional” or a “Business” should be allowed to use a feature like this, but turns out if you pay more money (tax?) you can.

So, as of today, all iControlWP premium users have access to the code snippets function that works in real-time within your web browser, and sends back the response from your site in a few seconds.

It’s simple to use but you need to know what you’re doing when it comes to PHP.

We put a glaring red notice bar on the screen to tell you that this is a potentially hazardous function, if you start experimenting with things which you don’t understand.

Think of this tool as fire.  It’s really useful, it can perform many different tasks really well, but when you’re careless with it, you’ll get burnt.

A Simple Code Snippets Example

The code snippet tool is simple to use and any PHP developer will immediately be able to get started.

To illustrate a simple example, try entering the following text into the box and click “Run Code On Site”. (Don’t worry, this will do nothing harmful to your site)

global $wp_version;
echo $wp_version;

As far as code snippets go, you can’t get simpler than this.

See the screenshot below for the result when we ran this code snippet on our iControlWP site.

iControlWP Code Snippets Example

iControlWP Code Snippets Example

A few things to keep in mind are:

  • The code that you supply will be executed using eval(), so you don’t need to start the PHP processor with <?php etc.
  • If the code is not semantically correct, nobody can really be sure what result, if any, you will get back.
  • If you’re not getting back the result you expect, this isn’t likely due to the tool not working… check your code.
  • If the result you get back is empty… make sure you are actually printing something. If you don’t print anything, nothing will come back.
  • Remember what your mummy and daddy taught you about playing with fire.

And that’s all there is to really tell you about the iControlWP code snippets tool.

Enjoy!

Leave a Reply

x Logo: ShieldPRO
This Site Is Protected By
ShieldPRO