WordPress plugins and themes

Fatal error: Call to undefined function oik_require() in oik\admin\oik-header.inc on line 2

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.

Quick fix

  1. Access your server file using the control panel or FTP site
  2. Navigate to the wp-content/plugins/oik folder
  3. Rename or delete the file called oik-header.php

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.

  • Edit the file oik/oik-header.php  Note: this is a different file from where the error occurred.
  • Move the last 3 non-blank lines from the end of the file to inside the oik_header_init() function.
  • Save the changes

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.

Apologies and excuses

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.

Permanent fix

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.

5 Responses to Fatal error: Call to undefined function oik_require() in oik\admin\oik-header.inc on line 2

Leave a Reply

Recent plugin updates
oik v2.4-alpha.1112 Changes for WP-a2z and oik-plugins. ...
oik-shortcodes v1.26 Changes to improve the display of the Dynamic API Reference for WP-a2z and oik-plugins. ...
oik-rwd v0.5 Added support for defining the breakpoint where RWD logic starts to take effect. ...
oik-css v.07 Required for better control over Automatic paragraph creation. Now dependent on oik v2.3 or higher. ...
oik v2.4-alpha.1012 Improvements to the [bw_fields] shortcode. ...
oik-bob-bing-wide v1.27 Changes for oik-plugins and any other site wanting to display data from the wp_options table. ...
oik-plugins v1.13 Tested with WordPress 4.0. Required for improved results for [bw_table]. ...
oik-bob-bing-wide v1.26 Required for AumAbsFitnessStudios.com with multiple instances of the Responsive Pricing Table shortcode. ...
oik-types v1.6 oik-types v1.6 adds the ability to select the post types to be displayed on the home page. So your front page really can display your most recent activity! ...
oik v2.3 oik version 2.3, tested on WordPress 4.0 and WordPress Multisite, now delivers over 80 advanced shortcodes. ...