WordPress All-in-One SEO Pack PHP Error
Beware this content is over 7 years old and considered stale. It may no longer be accurate and/or reflect the understanding of the author but remains here for reference only. Please keep this in mind as you use this content.
The All-in-One SEO pack made by Semper Fi Web Design is a WordPress plugin that is used by innumerable blogs and websites all over the Internet.
It’s easy to install and relatively easy to setup if you already know all your SEO terminology.
So, I’m not a big fan of the plugin. From what I could work out, 98% of the features it provides really should be baked-in to any half-decent website.
The value is no doubt for those that either don’t have the tech-savvy to build such features into their websites or maybe because of shared or limited hosting access can’t tinker with the raw HTML/CSS/PHP of their website.
After installing the All-in-One SEO Pack (v126.96.36.199) plugin on Wordpress v3.3.1 for the first time, I get this error message on the front-end:
Notice: Undefined index: aiosp_ex_pages in /var/www/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php on line 118
Travelling to line 118 in
aioseop.class.php I get to see:
From a quick look it seems like there is no check to see whether or not they index/key
aiosp_ex_pages existing within the
$aioseop_options variable, which it most likely would not following a fresh install.
Quick fix, should be just to add a conditional statement to check if that index/key is in fact set before looping over it.
See fixed code below:
That should silence those notice errors. Of course you could bury your head in the sand and just turn all error messages off so you don’t even see this, but that wouldn’t be good web development, would it?
Any questions/comments, drop a line below.