When CSF firewal is enabled – ping reports lots of lost packets

I use just-ping.com when I need to ping my servers from various locations in the world to see if it’s working right. I have noticed that when CSF Firewall is installed and active I get losts of lost packets when trying to ping the server, but when I disable it – results are okay. The solution for this is to increase the ICMP_IN_RATE value from 1/s to 30/s.

To do so login to your WHM go to ConfigServer Security & Firewall and there click on Firewall Configuration button and on that page locate ICMP_IN_RATE (CTRL+F can help you locate it) and then increase it’s value from 1/s to 30/s. Scroll all the way down and pres “Change” button to save the changes. Restart the firewall and test it again.

Here’s a screenshot of what you need to chage:
csf ping problem solution

Now you should have good ping results at just-ping.com 🙂

04.12.2014 Update: Looks like the just-ping (now on new address cloudmonitor.ca.com) changed the way their service works. Now they ping you instantly from all places at once and CSF firewall will block most of these out and you’ll get lost packets in report. So for the testing you should set ICMP_IN_RATE to 0 – that will disable it – and then you can do tests. Other way around it to set it to fairly large number (200 or even bigger). Don’t forget to restart CSF + LFD in order these changes to apply.

How to add Iframes in WordPress posts or pages

A friend of mine needed some help. He wanted to place iframes inside WordPress posts but WordPress removes those codes automatically. So I searched for solutions and found this pretty simple one. All you need to do is to add these 4-5 lines of code to functions.php located in your theme’s folder.

function add_iframe($initArray) {
$initArray['extended_valid_elements'] = "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]";
return $initArray;
}
add_filter('tiny_mce_before_init', 'add_iframe');

You can get there by going Appearance -> Editor -> Theme Functions (functions.php). If there’s no functions.php you’ll have to create one (to do so you must login to FTP or to your cPanel and create a functions.php file by hand in theme’s folder and then place this code in it. Don’t forget to open and close php segment.

Now WordPress will not remove iframes from your posts or pages!
Hope it helps!

Tags: wordpress iframe, iframe wordpress, iframe in wordpress, iframe wordpress page, iframes in wordpress, wordpress iframe in page

WordPress 3.5 custom media upload path missing

After WordPress 3.5 was released many of useful options were removed or simply disabled because of some reason. One of those options is possibility to define custom path where you want your pictures (and other media files) to be uploaded. This is really important in case – you want to use CDN or you want to use some other web server to serve that static content (both are simply a must for medium and big sites).

So if you go to Settings -> Media in your WordPress (versions after 3.5) you will see something like this:
wordpres uploading files no custom paths

And it should look like this (versions prior 3.5):
wordpress uploading files with custom paths

In order to enable custom media upload paths go to phpMyAdmin and open Database of your WordPress 3.5 installation, then locate table wp_options (could be different depending on your prefix) and then those two option_name inputs:
phpmyadmin wp_options
And change them according to your needs.

Same domain just different folder Example
upload_path to images
upload_url_path to http://www.yoursite.com/images

Subdomain example
upload_path to images
upload_url_path to http://images.yoursite.com
– then go to cPanel and setup that subdomain like this
cPanel subdomains
cpanel making subdomain

After setting those two values in phpMyAdmin those two forms will appear in WordPress so you can change it’s values if needed. If this helped you out please post some comments. Also if you need any help or experience any problems – feel free to leave a comment.