Create and secure your own proxy with cURL and MCrypt

JavaScript’s same-origin policy can be a pain. Of course it’s very necessary for security reasons, but sometimes you want to access a remote web service client-side, or manipulate the display of remote content in an iframe. There’s a still a way to do these things of course, and it’s to build a server-side interface for the remote site and attach your JavaScript to that. Building a generic proxy-style interface is tempting, but can be dangerous if it’s not properly secured. Luckily, securing such a system is possible and relatively simple. See it in action

Tagged with: , ,
Posted in HTML & CSS, PHP, Server Administration, Server Side Code, Try It

Automated site and database backups using PHP and cron

Using cron jobs to perform maintenance tasks becomes so much more inviting once you realize you don’t have to go out and learn PERL in order to make use of them. Any server with PHP installed can run any arbitrary PHP scripts you throw its way, and with the help of powerful functions like exec() and passthru() just about any administrative maintenance task can be carried out easily, including whole site and database backups. How it works

Tagged with: , ,
Posted in MySQL, PHP, Server Administration, Server Side Code

WordPress caching and wp-cron.php

After battling with terrible response time on three WordPress sites on the same hosting account for three days, I think I’ve finally gotten to the source of the issue: the wp-cron.php file. This file is how WordPress runs scheduled tasks, and is intended to run silently in the background without affecting load times. However, as I found out, this isn’t always the case. How to fix it

Tagged with: , ,
Posted in PHP, Server Administration, Server Side Code, WordPress