• Resolved Pixelbart

    (@pixelbart)


    Since one of the recent updates, we’ve been experiencing issues with the plugin on a subpage. We’re using a custom header-none.php for get_header('none'), and everything was working fine with OMGF until recently.

    <!doctype html>
    <html <?php language_attributes(); ?> class="no-js">

    <head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <?php

    $nectar_options = get_nectar_theme_options();

    nectar_meta_viewport();

    // Shortcut icon fallback.
    if (! empty($nectar_options['favicon']) && ! empty($nectar_options['favicon']['url'])) {
    echo '<link rel="shortcut icon" href="' . esc_url(nectar_options_img($nectar_options['favicon'])) . '" />';
    }

    wp_head();

    ?>
    </head><?php

    $nectar_header_options = nectar_get_header_variables();

    ?>

    <body <?php body_class(); ?> <?php nectar_body_attributes(); ?>>

    <?php

    nectar_hook_after_body_open();

    nectar_hook_before_header_nav();

    // Boxed theme option opening div.
    if ($nectar_header_options['n_boxed_style']) {
    echo '<div id="boxed">';
    }

    ?>
    <?php

    if (! empty($nectar_options['enable-cart']) && '1' === $nectar_options['enable-cart']) {
    get_template_part('includes/partials/header/woo-slide-in-cart');
    }

    if (
    'ascend' === $nectar_header_options['theme_skin'] ||
    'left-header' === $nectar_header_options['header_format'] &&
    'false' !== $nectar_header_options['header_search']
    ) {
    get_template_part('includes/header-search');
    }

    get_template_part('includes/partials/footer/body-border');

    ?>
    <div id="ajax-content-wrap">
    <?php nectar_hook_after_outer_wrap_open(); ?>

    Any ideas?

    [03-Jun-2025 12:30:30 UTC] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in .../wp-content/plugins/host-webfonts-local/src/Frontend/Process.php:286
    Stack trace:
    #0 .../wp-content/plugins/host-webfonts-local/src/Frontend/Process.php(286): array_key_exists('bt-beaverbuilde...', NULL)
    #1 .../wp-content/plugins/host-webfonts-local/src/Frontend/Actions.php(128): OMGF\Frontend\Process::should_start()
    #2 .../wp-includes/class-wp-hook.php(324): OMGF\Frontend\Actions->maybe_add_frontend_assets('')
    #3 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #4 .../wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #5 .../wp-includes/script-loader.php(2299): do_action('wp_enqueue_scri...')
    #6 .../wp-includes/class-wp-hook.php(324): wp_enqueue_scripts('')
    #7 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #8 .../wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #9 .../wp-includes/general-template.php(3192): do_action('wp_head')
    #10 .../wp-content/themes/salient-child/header-none.php(17): wp_head()
    #11 .../wp-includes/template.php(810): require_once('/Users/kevin/Lo...')
    #12 .../wp-includes/template.php(745): load_template('/Users/kevin/Lo...', true, Array)
    #13 .../wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #14 .../wp-content/themes/salient-child/page-buchen.php(354): get_header('none')
    #15 .../wp-includes/template-loader.php(106): include('/Users/kevin/Lo...')
    #16 .../wp-blog-header.php(19): require_once('/Users/kevin/Lo...')
    #17 .../index.php(17): require('/Users/kevin/Lo...')
    #18 {main}
    thrown in .../wp-content/plugins/host-webfonts-local/src/Frontend/Process.php on line 286

    Thank you very much!

    Salient WordPress-Theme is in use.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    This must be due to another change, because that piece of code hasn’t been changed in recent updates.

    Besides that, it’s weird, because the exact code where the error arises is:

        /**
    * Make sure Page Builder previews don't get optimized content.
    */
    foreach ( self::$page_builders as $page_builder ) {
    if ( array_key_exists( $page_builder, $_GET ) ) { // This line is where the error arises.
    return false;
    }
    }

    The error arises on that line, because the $_GET array doesn’t exist. And the weird thing is, $_GET is a superglobal and as far as I know, superglobals should always exist.

    That being said, I did create this beta to resolve the issue in OMGF; it explicitly checks if the $_GET superglobal exists. However, if I were you I’d go through your own recent code changes, because I’m carefully assuming you’re going to find an unset($_GET) somewhere that’s going to cause issues with other plugins/themes as well.

    Thread Starter Pixelbart

    (@pixelbart)

    In some old code i’ve found this “wtf-code”:

    $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_SPECIAL_CHARS);
    $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_SPECIAL_CHARS);

    After removing this and sanitizing the correct way, anything works. Thank you very much for the help. After your tip, it was easy for me to find the problem 😀

    Good day!

    • This reply was modified 9 months, 3 weeks ago by Pixelbart.
    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    wtf, indeed! Good find! Happy it’s resolved!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught TypeError in Process.php’ is closed to new replies.