Whoops \ Exception \ ErrorException (E_WARNING)
Attempt to read property "name" on string Whoops\Exception\ErrorException thrown with message "Attempt to read property "name" on string" Stacktrace: #7 Whoops\Exception\ErrorException in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php:105 #6 Whoops\Run:handleError in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php:105 #5 THEME\ViewModel\Post\Components\Product\StructuredData:getData in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php:86 #4 THEME\ViewModel\Single:setComponents in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php:35 #3 THEME\ViewModel\Single:__construct in /data/websites/telefonino/web/app/themes/telefonino/single-prodotti.php:6 #2 include in /data/websites/telefonino/web/wp/wp-includes/template-loader.php:106 #1 require_once in /data/websites/telefonino/web/wp/wp-blog-header.php:19 #0 require in /data/websites/telefonino/web/index.php:6
Stack frames (8)
7
Whoops\Exception\ErrorException
/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php:105
6
Whoops\Run handleError
/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php:105
5
THEME\ViewModel\Post\Components\Product\StructuredData getData
/web/app/themes/telefonino/src/ViewModel/Single.php:86
4
THEME\ViewModel\Single setComponents
/web/app/themes/telefonino/src/ViewModel/Single.php:35
3
THEME\ViewModel\Single __construct
/web/app/themes/telefonino/single-prodotti.php:6
2
include
/web/wp/wp-includes/template-loader.php:106
1
require_once
/web/wp/wp-blog-header.php:19
0
require
/web/index.php:6
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php

        $author = (object) [
            "@type" => "Person",
            "name" => get_the_author_meta('display_name', $this->post->post_author),
            "url" => get_author_posts_url( $this->post->post_author )
        ];

        if ( $this->rating > 0 ) {

            $product = (object) [

                "@context"     => "https://schema.org/",
                "@type"        => "Product",
                'name'         => $this->productName->name,            
                "image"        => $image,
                "description"  => $this->post->post_excerpt,
                'brand'        => (object) [
    
                    "@type" => "Brand",
                    "name" =>  $this->brandName->name
                ],
            ];

            $product->review = (object) [

                "@type" => "Review",
                "reviewRating" => (object) [

                    "@type"       => "Rating",
                    "worstRating" => 0,
                    "bestRating"  => 10,
                    "ratingValue" => $this->rating
                ], 
                "author" => $author
            ];

            $product->offers = (object) [
                "@type" => "Offer",
                "priceCurrency" => "EUR",
                "price" => $this->price,
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Post/Components/Product/StructuredData.php

        $author = (object) [
            "@type" => "Person",
            "name" => get_the_author_meta('display_name', $this->post->post_author),
            "url" => get_author_posts_url( $this->post->post_author )
        ];

        if ( $this->rating > 0 ) {

            $product = (object) [

                "@context"     => "https://schema.org/",
                "@type"        => "Product",
                'name'         => $this->productName->name,            
                "image"        => $image,
                "description"  => $this->post->post_excerpt,
                'brand'        => (object) [
    
                    "@type" => "Brand",
                    "name" =>  $this->brandName->name
                ],
            ];

            $product->review = (object) [

                "@type" => "Review",
                "reviewRating" => (object) [

                    "@type"       => "Rating",
                    "worstRating" => 0,
                    "bestRating"  => 10,
                    "ratingValue" => $this->rating
                ], 
                "author" => $author
            ];

            $product->offers = (object) [
                "@type" => "Offer",
                "priceCurrency" => "EUR",
                "price" => $this->price,
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php
            'Taxonomies',
            'Credits',
            'Canonical',
            'StructuredDataFaq',
            'AnalysisTracking',
            'Meta'
        ];
    }
    
    /**
     * Get data from all the components in the 
     * $components list
     */
    private function setComponents() {

        foreach($this->components as $component) {

            $component = __NAMESPACE__ .'\\Post\Components\\'. $component; 

            $component_instance = (new $component( $this->post->ID, $this->data ))->getData();
            
            $this->data[$component_instance->name] = $component_instance->data;
        }
    }




    /**
     * questa parte deve essere applicata al content
     * 
     * filter the embeds and removes width attributes
     * 
     * va aggiunto ? comunque in content
     *//*
    protected function removeWidthAttributes(){
    
        $content = $this->data['post']['content'];
        $patterns = [
            '/width\s*=\s*".*?"/i',
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php
    
    function __construct($post, $postTemplate = 'Single') {     
        
        parent::__construct();

        $this->post = $post;

        // assign the post template (default is 'Single')        
        $this->postTemplate = $this->postTemplateFactory($postTemplate);
        
        // init the post template 
        // (includes content details as well)
        $this->setPost(); 

        // set the components list into property
        // $components 
        $this->initComponents();

        // add all the default components 
        $this->setComponents();

    }

        
    /**
     * Writes the basic page info
     */
    protected function setPageData(){       
        
        $this->data = [
            'type' => 'single_post',
            'infinite' => 'true'
        ];        
    }

    /**
     * Add the post info to data
     */
    protected function setPost() {        
        $this->data['post'] = $this->postTemplate->getPostData($this->post);
/data/websites/telefonino/web/app/themes/telefonino/single-prodotti.php
<?php
use THEME\ViewModel\SingleProduct;
use THEME\Utils\Timber;

// load data
$data = ( new SingleProduct($posts[0], 'SingleProdotti') )->getData();

$template = 'single-product.twig';

Timber::render( $template, $data );
 
/data/websites/telefonino/web/wp/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
/data/websites/telefonino/web/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';
 
}
 
/data/websites/telefonino/web/index.php
<?php
/**
 * WordPress View Bootstrapper
 */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.26.2
REQUEST_URI /prodotti/xiaomi-mi-11-5g/
USER nginx
HOME /var/lib/nginx
HTTP_REFERER https://staging.telefonino.net/prodotti/xiaomi-mi-11-5g
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_X_FORWARDED_FOR 216.73.216.49
HTTP_HOST staging.telefonino.net
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
REDIRECT_STATUS 200
SERVER_NAME staging.telefonino.net
SERVER_PORT 443
SERVER_ADDR 10.50.50.197
REMOTE_PORT 55838
REMOTE_ADDR 10.50.50.12
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.0
DOCUMENT_ROOT /data/websites/telefonino/web
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/websites/telefonino/web/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1774684469.8926
REQUEST_TIME 1774684469
DB_NAME telefonino
DB_USER telefoninoUSR
DB_PASSWORD .T3lefon!n0.
DB_HOST localhost
DB_PREFIX wp_
GTM_ID GTM-PV4S3R4X
ASSETS_DIR /app/themes/telefonino/assets
FORMINATOR_NEWSLETTER_FORM_ID 404256
WP_ENV staging
WP_HOME https://staging.telefonino.net
WP_SITEURL https://staging.telefonino.net/wp
WP_THEMEPATH https://staging.telefonino.net/app/themes/telefonino/
WP_EMAIL no-reply@telefonino.net
WP_DEBUG true
WP_CACHE false
DISABLE_WP_CRON true
WP_MEMORY_LIMIT 512M
WP_POST_REVISIONS false
AUTH_KEY &uq&p$ypr;Yr7DiuR3ECXHD14o0M562d|MYpdP>;X.fm9q@pOvJ^D-/w9uC+`q1z
SECURE_AUTH_KEY *kkFy7N_9]uNEIk%lG{zxv|aT/_BSV:-|l+C{NU|2/|-HJqP82K[e7mg=>qX!Mef
LOGGED_IN_KEY RJ%0[1(1^$bKjvj^IXV!e[%+yD;d1_fl/)Q4/SdSO>>np:+=`+Es9UbS]dOg89J=
NONCE_KEY 1RTq(</}tixMOUC^n44?.,xA!,n-ms-6J@,LS@/aVJAk8<Ofvjaeu[1iPzU,oG{q
AUTH_SALT ,ptA@)1JrYHO3CjZxYcqX_v<7@X1>2*v7K<Ul2?ofl2qP<>!qzjkf)$Zu&iovz-k
SECURE_AUTH_SALT GA/axYdH9ls=wCH#1XwF9P&E<jOP^d4VKlFF?>vb4Czz3v$jz0dl@DES]&A3D_`^
LOGGED_IN_SALT tWjy]Qb,XQ9%th/9Oi1D;E/L@z-Oo5<TfTSVD-obR;MTyal!SWCcez=fnAGNFlFL
NONCE_SALT aMNhCOYLU+(1URHOor&2^Ux0}9%5eQ1B;MRZ({=XMcw!+42NI3Gx?;,L&Y;yYni]
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
Key Value
DB_NAME telefonino
DB_USER telefoninoUSR
DB_PASSWORD .T3lefon!n0.
DB_HOST localhost
DB_PREFIX wp_
GTM_ID GTM-PV4S3R4X
ASSETS_DIR /app/themes/telefonino/assets
FORMINATOR_NEWSLETTER_FORM_ID 404256
WP_ENV staging
WP_HOME https://staging.telefonino.net
WP_SITEURL https://staging.telefonino.net/wp
WP_THEMEPATH https://staging.telefonino.net/app/themes/telefonino/
WP_EMAIL no-reply@telefonino.net
WP_DEBUG true
WP_CACHE false
DISABLE_WP_CRON true
WP_MEMORY_LIMIT 512M
WP_POST_REVISIONS false
AUTH_KEY &uq&p$ypr;Yr7DiuR3ECXHD14o0M562d|MYpdP>;X.fm9q@pOvJ^D-/w9uC+`q1z
SECURE_AUTH_KEY *kkFy7N_9]uNEIk%lG{zxv|aT/_BSV:-|l+C{NU|2/|-HJqP82K[e7mg=>qX!Mef
LOGGED_IN_KEY RJ%0[1(1^$bKjvj^IXV!e[%+yD;d1_fl/)Q4/SdSO>>np:+=`+Es9UbS]dOg89J=
NONCE_KEY 1RTq(</}tixMOUC^n44?.,xA!,n-ms-6J@,LS@/aVJAk8<Ofvjaeu[1iPzU,oG{q
AUTH_SALT ,ptA@)1JrYHO3CjZxYcqX_v<7@X1>2*v7K<Ul2?ofl2qP<>!qzjkf)$Zu&iovz-k
SECURE_AUTH_SALT GA/axYdH9ls=wCH#1XwF9P&E<jOP^d4VKlFF?>vb4Czz3v$jz0dl@DES]&A3D_`^
LOGGED_IN_SALT tWjy]Qb,XQ9%th/9Oi1D;E/L@z-Oo5<TfTSVD-obR;MTyal!SWCcez=fnAGNFlFL
NONCE_SALT aMNhCOYLU+(1URHOor&2^Ux0}9%5eQ1B;MRZ({=XMcw!+42NI3Gx?;,L&Y;yYni]
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
0. Whoops\Handler\PrettyPageHandler