[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-themes v1.4.0 

Update to oik-themes v1.4.0 to support Full Site Editing (FSE) themes. FSE themes, which are currently experimental, deliver block based templates and template parts.

 ...
oik-clone v2.0.1 oik-clone v2.0.1 contains a fix for a 500 internal server error being produced when cloning content with certain taxonomy terms. ...
SB Chart block v0.1.1 

Update to SB Chart block v0.1.1 for improved enqueing of the chart.js Javascript and better colours in the Gutenberg palette.

 ...
Slog v1.3.1 

Update to Slog v1.3.1 for a new Driver tab and improved display of charts grouping Elapsed times.

 ...
SB-Chart-Block v0.0.8 SB-Chart-Block v0.0.8, a WordPress single block plugin, supports 4 different chart types; Line, Bar, Horizontal bar and Pie. ...

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: [email protected]

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-2021. All rights reserved.


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