This post explains a problem with the oik-header plugin and the workaround that you can apply to fix it.
It is applicable to the following message.
Fatal error: Call to undefined function oik_require() in oik\admin\oik-header.inc on line 2
This problem occurs in the WordPress admin pages when the oik-header plugin is activated but oik is not activated.
As it’s a fatal error in the WordPress admin pages, the only way you can recover from this is to alter the files directly. On a hosted site this means using the control panel functionality or FTP.
The next time you visit your WordPress dashboard the plugin will be deactivated automatically.
Watch the video
If you are able to edit the files on your server then this solution will enable you to continue to use the oik plugin’s custom header image functionality.
The new function should look like this
function oik_header_init() {
if ( is_admin() ) {
require_once( 'admin/oik-header.inc' );
}
add_action( 'wp_footer', 'bw_page_header_style' );
}
This should re-enable the admin pages. You should now activate the oik plugin.
Most of the oik plugins are dependent upon the oik base functionality. The dependent functions assume that once oik has been loaded then they can use the oik functions. The error in the oik-header code was that the admin/oik-header.inc file would get loaded even when oik was not activated This meant that the oik_require() function could not be found.
The problem would also occur if the oik-header plugin was being loaded before the oik plugin. oik-header would attempt to run code that had not been loaded.
The fix is to move the is_admin() test into the initialisation logic that is only executed when oik has been loaded.
I apologise for my code being the cause of this problem. I had not detected it since most of the time I have the oik-bwtrace plugin activated. oik-bwtrace loads oik_boot.inc which is the file that defines oik_require(). So even if I deactivate oik – which I often do to test the dependency checking of oik-nivo-slider and other plugins that depend upon oik – I hadn’t noticed it.
Thanks to shkinfo and azurewitch for taking the time to report the problem in the WordPress forums.
A permanent fix for this problem was delivered in oik version 1.16. You should not have to apply the workaround yourself, just update your version of oik.
I AM SO FRUSTRATED RIGHT NOW, YOUR POST IS’NT EVEN WELL EXPLANATORY.. I REGRET INSTALLING THIS PLUGIN AT ALL, I STILL CANNOT LOGIN TO MY ADMIN AREA AND I HAVE PENDING ISSUES TO ATTEND TO.
Hi, James, please let me know what problems you are unable to resolve.
The only way to fix the problem on a hosted site ( i.e. not a local installation) is to use your site’s control panel ( e.g. cpanel ) or by ftp.
If you cannot edit your files then you will have to either delete the oik-header.php file or rename it ( e.g. oik-header.hph )
You should then be able to use the dashboard again.
Hi James, I’ve just tried to make a video to demonstrate the fix to the problem and I got into as much trouble as I expect you did. I got the Fatal error even with the oik base plugin activated. In order to get a working version without applying the workaround fix to the code I needed to activate oik bwtrace as well. I am currently testing the fix. It will be in oik version 1.16. The “dev” version is already on WordPress.org. I do apologise for the inconvenience caused to anyone who has suffered from this problem.
Pingback: Coming soon - oik version 1.16 - fixes the Fatal error in oik-header.inc | [oik] plugins
An annotated version of the video is now available to view: http://www.oik-plugins.com/tutorials/recover-from-a-wordpress-fatal-error-using-your-wesites-control-panel-cpanel/