[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog
  • #
  • &
  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • J
  • L
  • M
  • N
  • O
  • P
  • Q
  • R
  • S
  • T
  • U
  • V
  • W
  • [

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

Cause

This problem occurs in the WordPress admin pages when the oik-header plugin is activated but oik is not activated.

Response

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

Workaround

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.

Explanation

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.

Published: August 3, 2012 | Last updated: December 4, 2020

Filed Under: 1.15, oik Tagged With: fatal error, oik-header

Information

Component:

Recent plugin updates

oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2025. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins

WordPress version: 6.8.3

Gutenberg version: 21.7.0

PHP version: 8.2.29