LXC with ReverseProxy and (HTTPS/SSL + WordPress) Redirect Loop

And how I resolved them!

At my place of work we have started isolating clients in LXC (Linux Containers) in a bid to improve the security amongst our clients websites. The way we do this is each client has a LXC container, setup from an image we created with LAMP, and all other assets we need installed already.

Continue reading

PHPScanner – Scanning your uploads before you get them!

I’m a web developer, and if you are too you’ll know all too well the worry of malicious scripts being uploaded to your website. And yes, you’ve put all the checks in.. Checking the extension is an image, checking the mime type. Authenticating the user against the upload.

But what about those third party plugins, or when your client has FTP access to “tinker with/break” the work you’ve done? The point I’m making is, even if you’re 99% sure you’ve got it covered – why take the risk?

We’ve been developing PHPScanner because exactly that happened to us, a client had FTP access and allowed some dodgy uploads because they did not properly check the file types.

PHPScanner reads the content of each upload before your website gets access to it, if it considers the upload a PUP (Potentially Unwanted Program) it quarantines the upload and provides useful information.


More information: https://github.com/ChubbyNinja/PHPScanner


More information to follow.

Plugin to see what template I’m currently using

When developing in WordPress one of the things I always get frustrated about is checking what plugin the post/page is currently using. More often than not when doing amendment work for an existing installation of WordPress it is a task to diagnose exactly where you are before you even start at the job in hand!

So I decided to make a very simple plugin which would show you the current template in use..

What’s more, it shows you all the included template files for that current page too



If you’re using child themes, so you’re including from more than 1 theme, it will nest them nicely for you to easily access them.

But there’s more!

Clicking on a specific template will take you right into the editor with that template selected.. ready for you to get editing!

I hope you enjoy this plugin, and let me know how you would improve it

WordPress Plugin: Quick Edit Template Link

Make a JavaScript library like jQuery

Have you ever wondered how to make a JavaScript Library?

If you’ve ever used jQuery you’ll appreciate how simple it is to pick up and use, it’s full of easy to remember functions which are way more convenient than remembering the vanilla JavaScript version.

Before we start writing our own library, let’s first look at some vanilla JavaScript versions of what we use in jQuery

Continue reading

How to Turn the whole element into a clickable link

So we’ve probably all come across that situation where we have a nice list of articles, or images with descriptions that we want to make clickable.

Often we see developers wrap an anchor tag around the image, and another one around the text.. take this fairly standard example:

<div class="list-item">
 <div class="item-img">
 <a href="#"><img src="myimage.jpg"></a>

 <div class="item-text">
 <a href="#">Check out this awesome article about cats!</a>

That looks great, but there are a couple of issues:

  • You have to create two anchor tags
  • You probably have to fix some CSS to make sure there are no borders, or horrible underlines
  • It doesn’t make the whole element clickable..

Continue reading

Make your own custom share buttons

A great alternative to shareThis, or addthis is to add your own share buttons.

The Share Buttons

Share on Google+Share on Pinterest

Feel free to test them out 😉

Here’s a javascript snippet for sharing to Twitter, Facebook, Google+ and Pinterest

Continue reading

jQuery: Make all external links open in a new window

It’s easy to forget to add that target=”_blank” each time, and even more difficult to remind clients to select that option in your WYSIWYG!

In a lot of websites I develop we use jQuery – and one of the things I place at the bottom of every website is a snippet to add target=”_blank” to every external link tag.

The jQuery/JavaScript

  return this.hostname && this.hostname !== location.hostname;

Nice custom file upload button styled with HTML & CSS

We have all seen the horrible file upload button boxes, we all know what they look like.. and they all differ slightly from browser to browser.

There are lots of hacks out there to emulate an upload button click to launch the file input dialog, or to position the input box transparent ontop of a beautified button, but all of these are limited to the browser support and some browsers require hacks.

I want to show you the simplest way I can think of..

Here’s how it looks (give it a click!):


Ok that’s cool, but how exactly does it work?
Continue reading

How to fix your email newsletter to render correctly in all email clients

So, building a newsletter that works in all the different email clients is a mission!

Luckily there is a program that helps out, adobe fireworks – this program exports the HTML files and images needed for the newsletter, unfortunately this isn’t all you need to do.. That’ll be ok for some templates but if you have any text in yours newsletter there’ll be issues!

There’s a tool called eshotdoctor.com which takes your HTML freshly exported from fireworks and processes is to fix all the issues like padding, images out of shape, text resizing on iPhone mail, images jumping on googles gmail, blue links underline on mac outlook and more!

Give it a try.. It saves you so much time

How to apply a custom google plus +1 share button

So I needed a custom google plus +1 button for a website I am developing.. But there wasn’t any around! Sure there were custom buttons, icons etc, but no way to implement them. I searched on the interwebz for a tutorial on how to make a custom google +1 share button.

But then I decided I might as well just make it myself.

It was surprisingly easy to be honest, and because of the lack of tutorials out there, I thought I’d write a quicky!

So, How did I turn this:


Into this:

Well when you see below you’ll kick yourself if you haven’t already, because it’s so simple.

Continue reading

© 2019 Chubby Ninja

Theme by Anders NorenUp ↑