Feeling little tired but happy as I have just now completed my WP 5k 2016 walk ( #WWWP5K ) !! If you aren’t aware of the WP 5k 2016, it’s a 5-kilometer run/walk/hike/hop in between September 19th to September 25th. Wherever you are, whatever you are doing, if you are anyway involved with WordPress, just participate and blog about it.
Today morning I thought about taking part in the Worldwide WP 5k 2016 by walking the distance of 5 Km. Started off from my home and went to the Buddha Park and walked until I cover the WP 5k 2016 🙂 It’s really awesome to get up early and walk around that too for WordPress’s Worldwide WP 5k 2016.
I have been involved with WordPress for more than 5 years now, currently working as a WordPress developer at Axelerant. Love to unite with worldwide bloggers, runners, WP developers !!
Here is the map of my walk !!
Recently, while writing a blog post I found that I am not able to update/publish any post on my WordPress website dashboard rather it redirects me to the website front page when I click the “Update” button. Now, I was unsure what’s creating this trouble and how to fix this 302 redirect when updating posts in WordPress.
To check what could be the issue, I tried the followings :
- I deactivated all the plugins
- Even changed the theme to the default Twenty Sixteen
Still, the issue was there. After debugging a little more I found the cause of this. It was the strict Mode_Security which was causing the trouble. Now the question is: “What is Mod_Security?”
ModSecurity is an open source, cross-platform web application firewall (WAF) module. Known as the “Swiss Army Knife” of WAFs, it enables web application defenders to gain visibility into HTTP(S) traffic and provides a power rules language and API to implement advanced protections.
Basically, this is an Apache module that is installed on most servers by default to help protect your website from various attacks. It is used to block commonly known exploits by use of regular expressions and rule sets. This sometimes blocks the POST requests being generated after a post is updated or published because of the complex HTML content having all the tags, embed code, shortcodes etc. which get caught by the ModSecurity’s rule set.
To fix this issue simply disable the module on your server. This can be achieved through the
Modsec Manager plugin for cPanel if you are on a shared server. Read the following to know how to disable manually on VPS and Dedicated servers. http://www.inmotionhosting.com/support/website/modsecurity/what-is-modsecurity-and-why-is-it-important
I am sure there are a ton of other reasons for a 302 redirect issue but in my case, this was Mod_Security causing the problem and after disabling the module I am able to update and publish the posts. 🙂
When a developer starts WordPress development and tries to make the process easier and faster, generally he searches for best tools and various boiler plates which can alleviate the manual task of starting the development from scratch.
WordPress Gear (WPgear.org) is a website which lists out lots of useful tools those are free and GPL(OpenSource). The list includes tools and its related information for all aspects of WordPress development. Starting from WordPress base tools to Debug tools, PHP boiler plates, Meta fields frameworks, Theme development tools and lot more..
New and latest tools are being added constantly into this list as this is a community driven site. Whole of the code for this page resides in Github and anybody can add any free tool into the list. Just fork the project, add/edit your tool with a link, submit a pull request.
Visit WPGear.org to browse the complete list of tools. Happy WP Coding 🙂
Recently I faced a situation where the timthumb script was unable to crop the images and was throwing error messages. There are themes those still use timthumb even though its a bad practice to use in themes when we have already functions available in core WordPress. Anyway I had to fix the issue as I was not state to replace the timthumb functionality with core WordPress functions.
Here is the error message:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.
is not within the allowed path(s): (/home/:/usr/lib/php:/tmp)
on line 862
This issue occurs in several hosts, mainly the free hosts available these days. So, the trick is to find where the $docRoot variable was set and set it to my public_html folder manually in my home directory. In my file it was on line number 825. I did the following…
// $docRoot = @$_SERVER['DOCUMENT_ROOT'];
$docRoot = '/home/a9582221/public_html';
Obviously the /a9582221/ would be your username.
Where to make this changes ??
Search for the file timthumb.php and make the above changes. Thats it. The issue got resolved now.