Error
Call to undefined function App\Controllers\wc_product_in_user_portal() Error thrown with message "Call to undefined function App\Controllers\wc_product_in_user_portal()" Stacktrace: #6 Error in /sites/localhost/html/public/app/themes/247able-theme/resources/controllers/WooCommerceController.php:519 #5 App\Controllers\WooCommerceController:return_404_for_hidden_sub_brands in /sites/localhost/html/public/wp/wp-includes/class-wp-hook.php:324 #4 WP_Hook:apply_filters in /sites/localhost/html/public/wp/wp-includes/class-wp-hook.php:348 #3 WP_Hook:do_action in /sites/localhost/html/public/wp/wp-includes/plugin.php:517 #2 do_action in /sites/localhost/html/public/wp/wp-includes/template-loader.php:13 #1 require_once in /sites/localhost/html/public/wp/wp-blog-header.php:19 #0 require in /sites/localhost/html/public/index.php:7
Stack frames (7)
6
Error
/public/app/themes/247able-theme/resources/controllers/WooCommerceController.php519
5
App\Controllers\WooCommerceController return_404_for_hidden_sub_brands
/public/wp/wp-includes/class-wp-hook.php324
4
WP_Hook apply_filters
/public/wp/wp-includes/class-wp-hook.php348
3
WP_Hook do_action
/public/wp/wp-includes/plugin.php517
2
do_action
/public/wp/wp-includes/template-loader.php13
1
require_once
/public/wp/wp-blog-header.php19
0
require
/public/index.php7
/sites/localhost/html/public/app/themes/247able-theme/resources/controllers/WooCommerceController.php
            
            return $wpseo_xml;
            
        }
        
        public function draft_not_visible( $visible, $product_id ) {
            
            return $visible ? get_post_status( $product_id ) !== 'draft' : $visible;
            
        }
        
        public function return_404_for_hidden_sub_brands() {
            
            if( is_product() ) {
                
                global $post, $wp_query;
                
                $product = wc_get_product( $post );
                
                if( ! in_array($product->get_catalog_visibility(), array('search', 'catalog', 'visible')) && ! user_is_admin() && ! wc_product_in_user_portal( $product ) ) {
                    
                    status_header(404);
                
                    $wp_query->set_404();
                    
                }
                
            } else if ( is_tax( 'product_brand' ) ) {
                
                global $wp_query;
                
                $brand = get_queried_object();
                
                if( $brand->parent ) {
                    
                    status_header(404);
                    
                    $wp_query->set_404();
                    
                }
Arguments
  1. "Call to undefined function App\Controllers\wc_product_in_user_portal()"
    
/sites/localhost/html/public/wp/wp-includes/class-wp-hook.php
 
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        $num_args = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
 
            $priority = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 === $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        --$this->nesting_level;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
/sites/localhost/html/public/wp/wp-includes/class-wp-hook.php
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        --$this->nesting_level;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
/sites/localhost/html/public/wp/wp-includes/plugin.php
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    if ( empty( $arg ) ) {
        $arg[] = '';
    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
        $arg[0] = $arg[0][0];
    }
 
    $wp_filter[ $hook_name ]->do_action( $arg );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Calls the callback functions that have been added to an action hook, specifying arguments in an array.
 *
 * @since 2.1.0
 *
 * @see do_action() This function is identical, but the arguments passed to the
 *                  functions hooked to `$hook_name` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $hook_name The name of the action to be executed.
 * @param array  $args      The arguments supplied to the functions hooked to `$hook_name`.
 */
function do_action_ref_array( $hook_name, $args ) {
/sites/localhost/html/public/wp/wp-includes/template-loader.php
<?php
/**
 * Loads the correct template based on the visitor's url
 *
 * @package WordPress
 */
if ( wp_using_themes() ) {
    /**
     * Fires before determining which template to load.
     *
     * @since 1.5.0
     */
    do_action( 'template_redirect' );
}
 
/**
 * Filters whether to allow 'HEAD' requests to generate content.
 *
 * Provides a significant performance bump by exiting before the page
 * content loads for 'HEAD' requests. See #14348.
 *
 * @since 3.5.0
 *
 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
 */
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
    exit;
}
 
// Process feeds and trackbacks even if not using themes.
if ( is_robots() ) {
    /**
     * Fired when the template loader determines a robots.txt request.
     *
     * @since 2.1.0
     */
    do_action( 'do_robots' );
    return;
} elseif ( is_favicon() ) {
    /**
/sites/localhost/html/public/wp/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
Arguments
  1. "/sites/localhost/html/public/wp/wp-includes/template-loader.php"
    
/sites/localhost/html/public/index.php
<?php
    
$GLOBALS['START_TIME'] = floatval(microtime(true));
 
/** WordPress view bootstrapper */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
 
Arguments
  1. "/sites/localhost/html/public/wp/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache/2.4.59 (Unix)"
REQUEST_URI
"/product/pepperl-fuchs-kfa6-sr2-ex2-w-switch-amplifier/"
WEBSITE_DEFAULT_HOSTNAME
"prod-ableuk-wordpress.azurewebsites.net"
APPSETTING_AZURE_SERVICE_BUS_SAS_KEY
"XwzuAsAFR4reZUUQJRqj36fTiYgqC6O+/+ASbKf5JHY="
WP_HOME
"https://247able.com"
LOGGED_IN_KEY
"generateme"
WEBSITES_ENABLE_APP_SERVICE_STORAGE
"true"
APPSETTING_PRODUCTS_JSON_URL
"https://prodableukstorage.blob.core.windows.net/able-public/products.json"
APPSETTING_API_URL
"https://247able.com"
WEBJOB_HOME
"/home"
WP_ALL_EXPORT_PRO_URL
""
APPSETTING_DB_NAME
"prod-ableuk-wordpress-db"
FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED
"0"
APPSETTING_WEBSITE_DEFAULT_HOSTNAME
"prod-ableuk-wordpress.azurewebsites.net"
REGION_NAME
"uksouth"
PLATFORM_VERSION
"103.0.7.267"
PRODUCTS_JSON_URL
"https://prodableukstorage.blob.core.windows.net/able-public/products.json"
APPSETTING_FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED
"0"
WEBSITE_INSTANCE_ID
"0397c5cd55fab51b5685c7f1c2f118d330054b49d1b0d8b6295045439dbb773d"
HOSTNAME
"prod-ableu_6bcb797200"
APPSETTING_WEBSITES_ENABLE_APP_SERVICE_STORAGE
"true"
APP_URL
"https://247able.com"
APPSETTING_WP_HOME
"https://247able.com"
APPSETTING_JWT_SECRET
"q2OM07XMHe"
APPSETTING_SIGNATURE_PRIVATE_KEY
"93ypi/cl8S9cN0ZddtZUlNtLOvckN8+PAx/t9OLJ9SoeePrUf9bSkzc/BGsbCL82P9AYQPkafZBR50N3pSN9qw=="
SHLVL
"1"
MICROSOFT_AZURE_ACCOUNT_KEY
"WCtlZC0UOyDMgpPuXonOv89wEUBD1YY8vkUReKySLUFkpZZvB2X9kVsoQ56gSnprz64Zsq90VWeg+AStmDPa3w=="
WEBSITE_RESOURCE_GROUP
"prod-ableuk"
HOME
"/home/www-data"
DB_NAME
"prod-ableuk-wordpress-db"
WEBSITE_HOME_STAMPNAME
"waws-prod-ln1-109"
APPSETTING_APP_URL
"https://247able.com"
ScmType
"None"
REMOTEDEBUGGINGVERSION
"17.10.20419.3425"
AZURE_SERVICE_BUS_NAMESPACE
"prod-ableuk-servicebus"
WEBSITE_HOSTNAME
"prod-ableuk-wordpress.azurewebsites.net"
WEBSITE_STACK
"DOCKER"
SECURE_AUTH_SALT
"generateme"
APPSETTING_MICROSOFT_AZURE_ACCOUNT_KEY
"WCtlZC0UOyDMgpPuXonOv89wEUBD1YY8vkUReKySLUFkpZZvB2X9kVsoQ56gSnprz64Zsq90VWeg+AStmDPa3w=="
NUM_CORES
"2"
WEBSITE_AUTH_LOGOUT_PATH
"/.auth/logout"
WP_ENV
"production"
COMPOSER_ALLOW_SUPERUSER
"1"
WEBSITE_ROLE_INSTANCE_ID
"3531"
APPSETTING_REMOTEDEBUGGINGVERSION
"17.10.20419.3425"
MICROSOFT_AZURE_CNAME
"https://247able.com"
WEBSITE_AUTH_ENCRYPTION_KEY
"98007A353E2B10192D5676E8D3D7618925D94524683FA8593FB46E2F5EA554D9"
APPSETTING_AZURE_SERVICE_BUS_NAMESPACE
"prod-ableuk-servicebus"
SIGNATURE_PRIVATE_KEY
"93ypi/cl8S9cN0ZddtZUlNtLOvckN8+PAx/t9OLJ9SoeePrUf9bSkzc/BGsbCL82P9AYQPkafZBR50N3pSN9qw=="
APPSETTING_WEBSITE_AUTH_LOGOUT_PATH
"/.auth/logout"
SECURE_AUTH_KEY
"generateme"
WEBJOB_ENV
"true"
WEBSITE_ISOLATION
"lxc"
MICROSOFT_AZURE_USE_FOR_DEFAULT_UPLOAD
"1"
APPSETTING_DB_PREFIX
"a247_"
ACP_KEY
"93d36a90-7700-4e7b-891f-f1336fa12aa8"
WEBSITE_SITE_NAME
"prod-ableuk-wordpress"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
AZURE_SERVICE_BUS_QUEUE
"prod-ableuk-functions-queue"
WEBSITE_AUTH_AUTO_AAD
"False"
WP_SITEURL
"https://247able.com/wp"
MICROSOFT_AZURE_ACCOUNT_NAME
"prodableukstorage"
APPSETTING_MICROSOFT_AZURE_CNAME
"https://247able.com"
MICROSOFT_AZURE_CONTAINER
"wp-uploads"
APPSETTING_WEBSITE_SITE_NAME
"prod-ableuk-wordpress"
LD_PRELOAD
"/usr/lib/preloadable_libiconv.so php"
WEBSITE_AUTH_ENABLED
"False"
APPSETTING_ACP_KEY
"93d36a90-7700-4e7b-891f-f1336fa12aa8"
DB_PREFIX
"a247_"
WP_ALL_IMPORT_PRO_KEY
""
APPSETTING_MICROSOFT_AZURE_USE_FOR_DEFAULT_UPLOAD
"1"
APPSETTING_AZURE_SERVICE_BUS_QUEUE
"prod-ableuk-functions-queue"
APPSETTING_WEBSITE_AUTH_AUTO_AAD
"False"
APPSETTING_WP_SITEURL
"https://247able.com/wp"
APPSETTING_WEBSITE_AUTH_ENABLED
"False"
JWT_SECRET
"q2OM07XMHe"
DISABLE_WP_CRON
"true"
WEBSITE_OWNER_NAME
"eb779aee-837d-46ef-8b82-34e6ab6e2344+prod-ableuk-UKSouthwebspace-Linux"
APPSETTING_DB_PASSWORD
"jpnLK3LMe30lJKm"
WP_PLUGIN_GF_KEY
"48af70f71661bfbd69606761e0f8e7aa"
AZURE_SERVICE_BUS_SAS_KEY_NAME
"RootManageSharedAccessKey"
APPSETTING_MICROSOFT_AZURE_ACCOUNT_NAME
"prodableukstorage"
APPSETTING_MICROSOFT_AZURE_CONTAINER
"wp-uploads"
MICROSOFT_AZURE_OVERRIDE_CONTAINER_PATH
"uploads"
WP_ALL_EXPORT_PRO_KEY
""
APPSETTING_DB_HOST
"prod-ableuk-mysql-server.mysql.database.azure.com"
APPSETTING_DB_USER
"zawuhkhlpe"
APPSETTING_WP_PLUGIN_GF_KEY
"48af70f71661bfbd69606761e0f8e7aa"
AUTH_SALT
"generateme"
DB_PASSWORD
"jpnLK3LMe30lJKm"
WP_DEBUG_LOG
"false"
APPSETTING_AZURE_SERVICE_BUS_SAS_KEY_NAME
"RootManageSharedAccessKey"
NONCE_SALT
"generateme"
PWD
"/sites/localhost/html"
COMPUTERNAME
"ln1xsdlwk0002Q3"
ACF_PRO_KEY
"b3JkZXJfaWQ9NTA3MTh8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE1LTAyLTI0IDE2OjM5OjA1"
WP_ALL_IMPORT_PRO_URL
""
AZURE_SERVICE_BUS_SAS_KEY
"XwzuAsAFR4reZUUQJRqj36fTiYgqC6O+/+ASbKf5JHY="
WEBSITE_OS
"linux"
DB_HOST
"prod-ableuk-mysql-server.mysql.database.azure.com"
AUTH_KEY
"generateme"
NONCE_KEY
"generateme"
API_URL
"https://247able.com"
WEBSITE_PRIVATE_IP
"10.0.1.254"
APPSETTING_ScmType
"None"
LOGGED_IN_SALT
"generateme"
WEBSITE_AUTH_SIGNING_KEY
"262774CB75B18812444D568A2394642826C7313374D0A068FC2B0DE73918B50C"
APPSETTING_MICROSOFT_AZURE_OVERRIDE_CONTAINER_PATH
"uploads"
DB_USER
"zawuhkhlpe"
WEBSITE_SKU
"Premium0V3"
APPSETTING_ACF_PRO_KEY
"b3JkZXJfaWQ9NTA3MTh8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE1LTAyLTI0IDE2OjM5OjA1"
USER
"www-data"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/product/pepperl-fuchs-kfa6-sr2-ex2-w-switch-amplifier/"
REMOTE_PORT
"58803"
SCRIPT_FILENAME
"/sites/localhost/html/public/index.php"
SERVER_ADMIN
"you@example.com"
CONTEXT_DOCUMENT_ROOT
"/sites/localhost/html/public"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"http"
DOCUMENT_ROOT
"/sites/localhost/html/public"
REMOTE_ADDR
"169.254.131.1"
SERVER_PORT
"80"
SERVER_ADDR
"169.254.131.4"
SERVER_NAME
"247able.com"
SERVER_SIGNATURE
"<address>Apache/2.4.59 (Unix) Server at prod-ableuk-wordpress.azurewebsites.net Port 80</address>\n"
HTTP_X_CLIENT_PORT
"37210"
HTTP_X_CLIENT_IP
"147.243.230.7"
HTTP_X_WAWS_UNENCODED_URL
"/product/pepperl-fuchs-kfa6-sr2-ex2-w-switch-amplifier/"
HTTP_X_ORIGINAL_URL
"/product/pepperl-fuchs-kfa6-sr2-ex2-w-switch-amplifier/"
HTTP_X_FORWARDED_TLSVERSION
"1.3"
HTTP_X_ARR_SSL
"2048|256|CN=Microsoft Azure RSA TLS Issuing CA 04, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"
HTTP_X_APPSERVICE_PROTO
"https"
HTTP_WAS_DEFAULT_HOSTNAME
"prod-ableuk-wordpress.azurewebsites.net"
HTTP_X_SITE_DEPLOYMENT_ID
"prod-ableuk-wordpress"
HTTP_DISGUISED_HOST
"prod-ableuk-wordpress.azurewebsites.net"
HTTP_CLIENT_IP
"147.243.230.7:37210"
HTTP_X_ARR_LOG_ID
"14efd714-7b68-42bc-ac0e-8ed295cd7de7"
HTTP_X_AZURE_REQUESTCHAINV2
"hops=4"
HTTP_X_AZURE_SOCKETIP
"18.216.167.229"
HTTP_X_AZURE_CLIENTIP
"18.216.167.229"
HTTP_X_AZURE_REF
"20250124T054836Z-166df7ff8b6xn42fhC1CHIg85s0000000tug000000001w11, 20250124T054836Z-276d755b5f5lvkn2hC2CHI1mes0000000u60000000001c04, 20250124T054836Z-15bccbb6b94rz226hP1DM1tegg0000000rrg000000001typ, 20250124T054836Z-264894df7662sddthP2DM19uyc00000006zg000000001q3c"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_FORWARDED_HOST
"247able.com"
HTTP_X_AZURE_FDID
"13a37c99-e556-4554-a71b-98594ee0c856"
HTTP_X_FORWARDED_FOR
"18.216.167.229, 147.243.76.247, 147.243.230.7:37210"
HTTP_X_FD_INT_ROXY_EXPECTEDPURGEID
"0"
HTTP_VIA
"HTTP/2.0 Azure"
HTTP_REFERER
"https://247able.com/product/pepperl-fuchs-kfa6-sr2-ex2-w-switch-amplifier"
HTTP_RANGE
"bytes=0-8388607"
HTTP_MAX_FORWARDS
"9"
HTTP_ACCEPT_ENCODING
"gzip, br"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_HOST
"247able.com"
HTTP_ACCEPT
"*/*"
proxy-nokeepalive
"1"
W3TC_ENC
"_gzip"
W3TC_SSL
"_ssl"
W3TC_QUERY_STRING
""
NEW_HOST
"247able.com"
HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
REDIRECT_W3TC_SLASH
"_slash"
REDIRECT_W3TC_ENC
"_gzip"
REDIRECT_W3TC_SSL
"_ssl"
REDIRECT_W3TC_QUERY_STRING
""
REDIRECT_NEW_HOST
"247able.com"
REDIRECT_HTTP_AUTHORIZATION
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1737697717.189
REQUEST_TIME
1737697717
HTTPS
"on"
empty
0. Whoops\Handler\PrettyPageHandler