Whoops \ Exception \ ErrorException (E_WARNING)
Attempt to read property "impact" on array Whoops\Exception\ErrorException thrown with message "Attempt to read property "impact" on array" Stacktrace: #20 Whoops\Exception\ErrorException in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php:53 #19 Whoops\Run:handleError in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php:53 #18 Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes:dataAdapt in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php:48 #17 Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes:getProgramData in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php:19 #16 Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes:setDirectLinkAttributes in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/Attributes.php:28 #15 Blazemedia\Affiliation\Rendering\DirectLink\Attributes:__construct in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/AttributesFactory.php:19 #14 Blazemedia\Affiliation\Rendering\DirectLink\AttributesFactory:get in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/Params.php:18 #13 Blazemedia\Affiliation\Rendering\Parse:getDirectLinkParams in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/Parse.php:199 #12 Blazemedia\Affiliation\Rendering\Parse:renderLink in /data/websites/webnews/web/app/plugins/affiliation/src/Rendering/Parse.php:47 #11 Blazemedia\Affiliation\Rendering\Parse:parseLinks in /data/websites/webnews/web/wp/wp-includes/class-wp-hook.php:324 #10 WP_Hook:apply_filters in /data/websites/webnews/web/wp/wp-includes/plugin.php:205 #9 apply_filters in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php:50 #8 THEME\ViewModel\Post\Content\SplittedContent:init in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php:25 #7 THEME\ViewModel\Post\Content\SplittedContent:__construct in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Templates/SingleSplittedContent.php:30 #6 THEME\ViewModel\Post\Templates\SingleSplittedContent:getContent in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Templates/Single.php:23 #5 THEME\ViewModel\Post\Templates\Single:getPostData in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Single.php:55 #4 THEME\ViewModel\Single:setPost in /data/websites/webnews/web/app/themes/webnews/src/ViewModel/Single.php:28 #3 THEME\ViewModel\Single:__construct in /data/websites/webnews/web/app/themes/webnews/single.php:16 #2 include in /data/websites/webnews/web/wp/wp-includes/template-loader.php:106 #1 require_once in /data/websites/webnews/web/wp/wp-blog-header.php:19 #0 require in /data/websites/webnews/web/index.php:6
Stack frames (21)
20
Whoops\Exception\ErrorException
/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php53
19
Whoops\Run handleError
/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php53
18
Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes dataAdapt
/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php48
17
Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes getProgramData
/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php19
16
Blazemedia\Affiliation\Rendering\DirectLink\ImpactAttributes setDirectLinkAttributes
/web/app/plugins/affiliation/src/Rendering/DirectLink/Attributes.php28
15
Blazemedia\Affiliation\Rendering\DirectLink\Attributes __construct
/web/app/plugins/affiliation/src/Rendering/DirectLink/AttributesFactory.php19
14
Blazemedia\Affiliation\Rendering\DirectLink\AttributesFactory get
/web/app/plugins/affiliation/src/Rendering/DirectLink/Params.php18
13
Blazemedia\Affiliation\Rendering\Parse getDirectLinkParams
/web/app/plugins/affiliation/src/Rendering/Parse.php199
12
Blazemedia\Affiliation\Rendering\Parse renderLink
/web/app/plugins/affiliation/src/Rendering/Parse.php47
11
Blazemedia\Affiliation\Rendering\Parse parseLinks
/web/wp/wp-includes/class-wp-hook.php324
10
WP_Hook apply_filters
/web/wp/wp-includes/plugin.php205
9
apply_filters
/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php50
8
THEME\ViewModel\Post\Content\SplittedContent init
/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php25
7
THEME\ViewModel\Post\Content\SplittedContent __construct
/web/app/themes/webnews/src/ViewModel/Post/Templates/SingleSplittedContent.php30
6
THEME\ViewModel\Post\Templates\SingleSplittedContent getContent
/web/app/themes/webnews/src/ViewModel/Post/Templates/Single.php23
5
THEME\ViewModel\Post\Templates\Single getPostData
/web/app/themes/webnews/src/ViewModel/Single.php55
4
THEME\ViewModel\Single setPost
/web/app/themes/webnews/src/ViewModel/Single.php28
3
THEME\ViewModel\Single __construct
/web/app/themes/webnews/single.php16
2
include
/web/wp/wp-includes/template-loader.php106
1
require_once
/web/wp/wp-blog-header.php19
0
require
/web/index.php6
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php
        usort($impactDomains, function ($a, $b) {
            return (strlen($a) > strlen($b)) ? -1 : 1;
        });
 
        $programDomain = array_filter($impactDomains, fn ($impactDomain) => str_contains(strtolower($this->url), $impactDomain));
        $programDomain = !empty($programDomain) ? array_shift($programDomain) : '';
 
        $program = $this->getCachedProgram($programDomain);
 
        // Se l'api non trova un programma, ritorna vuoto e stampa un errore
        if (empty($program)) {
            $this->printError($this->url, $programDomain);
            return $this->getEmptyProgram();
        }
        return $this->dataAdapt($program);
    }
 
 
    protected function dataAdapt($program) {
        $deepLink     = $program->impact->deeplink_domain;
        $publisher_id = '2643607';
        $ads_id       = $program->impact->ads_id;
        $program_id   = $program->impact->program_id;
 
        if (substr($deepLink, -1) !== '/') {
            $deepLink .= '/';
        }
 
        $deepLinkDomain = $deepLink . "c/" . $publisher_id . "/" . $ads_id . "/" . $program_id;
        $queryStringArr = [
            'subId1' => 'booBLZTRKood',
            'u'      => $this->url
        ];
        $urlBuilder = $deepLinkDomain . '?' . http_build_query($queryStringArr);
 
        return (object) [
 
            'name'         => $program->name,
            'suffix'       => $program->program_suffix,
            'subject'      => $program->related_subject,
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php
        usort($impactDomains, function ($a, $b) {
            return (strlen($a) > strlen($b)) ? -1 : 1;
        });
 
        $programDomain = array_filter($impactDomains, fn ($impactDomain) => str_contains(strtolower($this->url), $impactDomain));
        $programDomain = !empty($programDomain) ? array_shift($programDomain) : '';
 
        $program = $this->getCachedProgram($programDomain);
 
        // Se l'api non trova un programma, ritorna vuoto e stampa un errore
        if (empty($program)) {
            $this->printError($this->url, $programDomain);
            return $this->getEmptyProgram();
        }
        return $this->dataAdapt($program);
    }
 
 
    protected function dataAdapt($program) {
        $deepLink     = $program->impact->deeplink_domain;
        $publisher_id = '2643607';
        $ads_id       = $program->impact->ads_id;
        $program_id   = $program->impact->program_id;
 
        if (substr($deepLink, -1) !== '/') {
            $deepLink .= '/';
        }
 
        $deepLinkDomain = $deepLink . "c/" . $publisher_id . "/" . $ads_id . "/" . $program_id;
        $queryStringArr = [
            'subId1' => 'booBLZTRKood',
            'u'      => $this->url
        ];
        $urlBuilder = $deepLinkDomain . '?' . http_build_query($queryStringArr);
 
        return (object) [
 
            'name'         => $program->name,
            'suffix'       => $program->program_suffix,
            'subject'      => $program->related_subject,
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php
 
 
    protected function getProgramData() {
        $impactDomains = $this->getCachedDomains();
 
        usort($impactDomains, function ($a, $b) {
            return (strlen($a) > strlen($b)) ? -1 : 1;
        });
 
        $programDomain = array_filter($impactDomains, fn ($impactDomain) => str_contains(strtolower($this->url), $impactDomain));
        $programDomain = !empty($programDomain) ? array_shift($programDomain) : '';
 
        $program = $this->getCachedProgram($programDomain);
 
        // Se l'api non trova un programma, ritorna vuoto e stampa un errore
        if (empty($program)) {
            $this->printError($this->url, $programDomain);
            return $this->getEmptyProgram();
        }
        return $this->dataAdapt($program);
    }
 
 
    protected function dataAdapt($program) {
        $deepLink     = $program->impact->deeplink_domain;
        $publisher_id = '2643607';
        $ads_id       = $program->impact->ads_id;
        $program_id   = $program->impact->program_id;
 
        if (substr($deepLink, -1) !== '/') {
            $deepLink .= '/';
        }
 
        $deepLinkDomain = $deepLink . "c/" . $publisher_id . "/" . $ads_id . "/" . $program_id;
        $queryStringArr = [
            'subId1' => 'booBLZTRKood',
            'u'      => $this->url
        ];
        $urlBuilder = $deepLinkDomain . '?' . http_build_query($queryStringArr);
 
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/ImpactAttributes.php
<?php
 
namespace Blazemedia\Affiliation\Rendering\DirectLink;
 
use Blazemedia\Affiliation\Utils\HttpRequest;
 
/**
 * Sono i parametri per i link diretti 
 * ( tipicamente Amazon/eBay )
 */
class ImpactAttributes extends Attributes {
 
    protected function setDirectLinkAttributes() {
 
 
        $this->label = 'Impact';
        $this->code  = 'impt';
 
        $program = $this->getProgramData();
 
        $this->program        = $program->name;
        $this->program_suffix = $program->suffix;
        $this->subject        = $program->subject;
        $this->subject_code   = $program->subject_code;
        $this->theme_label    = $program->theme_label;
        $this->theme_code     = $program->theme_code;
        $this->built_url      = $program->built_url;
    }
 
 
    protected function getProgramData() {
        $impactDomains = $this->getCachedDomains();
 
        usort($impactDomains, function ($a, $b) {
            return (strlen($a) > strlen($b)) ? -1 : 1;
        });
 
        $programDomain = array_filter($impactDomains, fn ($impactDomain) => str_contains(strtolower($this->url), $impactDomain));
        $programDomain = !empty($programDomain) ? array_shift($programDomain) : '';
 
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/Attributes.php
 */
abstract class Attributes {
 
    protected $url;
 
    public string $label;
    public string $code;
    public string $program;
    public string $program_suffix;
    public string $subject;
    public string $subject_code;
    public string $theme_label;
    public string $theme_code;
    public ?string $built_url;
                
    function __construct( string $url ) {
        
        $this->url = $url;
 
        $this->setDirectLinkAttributes();
    }
 
    abstract protected function setDirectLinkAttributes();
}
 
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/AttributesFactory.php
<?php
 
namespace Blazemedia\Affiliation\Rendering\DirectLink;
 
class AttributesFactory {
 
    public static function get( $platform, $url ) {
 
        $platform = strtolower( $platform );
 
        switch( $platform ) {
 
            case 'amazon'        : return new AmazonAttributes( $url );
            case 'ebay'          : return new EbayAttributes( $url );
            case 'awin'          : return new AwinAttributes( $url );
            case 'tradetracker'  : return new TradeTrackerAttributes( $url );
            case 'partnerize'    : return new PartnerizeAttributes( $url );
            case 'primevideo'    : return new PrimeVideoAttributes( $url );
            case 'impact'        : return new ImpactAttributes( $url );
        }
 
    }
 
}
 
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/DirectLink/Params.php
<?php
 
namespace Blazemedia\Affiliation\Rendering\DirectLink;
 
trait Params {
    
    /**
     * Ricava i parametri per i link inseriti direttamente in pagina
     *
     * @param string $marketPlace
     * @param string $link
     * @return array
     */
    function getDirectLinkParams( $platform, $link ) {
 
        $link = str_replace( '&amp;', '&', $link );
 
        $attributes = AttributesFactory::get( $platform, $link );
 
        /**
         * Nel caso di "Impact" l'url è costruito da alcuni parametri custom del link provider
         * ed è passato tramite un parametro "built_url"
         */
        if(array_key_exists( 'built_url' , (array) $attributes)){
            $link = $attributes->built_url;
        }
 
        return [
 
            'format'     => $this->format,
            'format_id'  => 0,
            'link_id'    => 0,
            'extra'      => urlencode( json_encode( [
                'id'             => 0,
                'title'          => $attributes->label,
                'link'           => urlencode( $link ),
                'subject'        => $attributes->subject,
                'subject_code'   => $attributes->subject_code,
                'program'        => $attributes->program,
                'program_suffix' => $attributes->program_suffix,
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/Parse.php
 
        return str_replace([
                '{{ placeholder }}'
            ],[
                $placeHolder
            ],
            $url
        );
 
    }
 
    /**
     * Stampa il formato impostato da shortcode
     */
    public function renderLink( $link ) {
 
        $trackedLink = $this->addTrackingIdPlaceholder( $link, 'booBLZTRKood' );
        
        /// ricava i parametri per i link inseriti direttamente in pagina
        $directLinkParams = $this->getDirectLinkParams( $link->marketplace, $trackedLink );
 
        $params = $this->pageData->getParams( $directLinkParams );
 
        $this->getFormatData( $params );
 
        return $this->markup;
    }
 
    public function insertCSS() { }
}
 
 
 
/data/websites/webnews/web/app/plugins/affiliation/src/Rendering/Parse.php
        add_filter( 'the_content', [ $this, 'parseLinks'] , 1 );
    }
 
 
    /**
     * Rileva i link all'interno del contenuto 
     * e li trasforma aggiungendo i dati di affiliazione
     *
     * @param string $content
     * @return string
     */
    public function parseLinks( string $content ) {
    
        // conversione degli shortcode da formati precedenti
        $content = $this->convert( $content );    
 
        $links = $this->parser->parse( $content );
        foreach( $links as $link ) {
 
            $content = str_replace( $link->tag, $this->renderLink( $link ), $content );
        }
 
        return $content;
    }
 
    
    protected function addTrackingIdPlaceholder( $link, $placeHolder = 'booBLZTRKood' ) {
        switch( strtolower( $link->marketplace ) ) {
 
            case 'amazon'       : return $this->addAmazonTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'ebay'         : return $this->addEbayTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'awin'         : return $this->addAwinTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'tradetracker' : return $this->addTradeTrackerTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'partnerize'   : return $this->addPartnerizeTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'primevideo'   : return $this->addPrimeVideoTrackingIdPlaceholder( $link->url, $placeHolder );
            case 'impact'       : return $this->addImpactTrackingIdPlaceholder( $link->url, $placeHolder );
        }
    }
 
     protected function addAmazonTrackingIdPlaceholder( $url, $placeHolder ) {
/data/websites/webnews/web/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.
/data/websites/webnews/web/wp/wp-includes/plugin.php
        $all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
        _wp_call_all_hook( $all_args );
    }
 
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return $value;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    // Pass the value to WP_Hook.
    array_unshift( $args, $value );
 
    $filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
 
    array_pop( $wp_current_filter );
 
    return $filtered;
}
 
/**
 * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
 *
 * @since 3.0.0
 *
 * @see apply_filters() 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_filters        Stores the number of times each filter 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 filter hook.
 * @param array  $args      The arguments supplied to the functions hooked to `$hook_name`.
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php
     *
     * @return Array sections
     */
    public function getSections() {
 
        return $this->sections;
    }
 
    
    private function init($content) {   
 
        // load all the splitters
        $this->getAvailableSplitters();
 
        // cambiare gli shortcode "mutati"
        foreach($this->splitters as $splitter)
            $content = $splitter->convertShortCode($content);
 
        // applicare gli shortcode "reali"
        $content = apply_filters('the_content', $content);
 
        // initialize the content as a big section to split
        $this->sections = [
            [ 'type' => 'content', 'content' => $content ]
        ];
 
        foreach ($this->splitters as $splitter) 
            $this->splitSections($splitter);
        
    }
 
    
    /**
     * Return the list of the splitters
     */
    private function getAvailableSplitters(){
 
        // una reflection un po' accroccata ma funzionale
        $composer = require get_template_directory() . '/vendor/composer/autoload_classmap.php';
 
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Content/SplittedContent.php
 * @param content:string     - is the content to split
 * @param post_id:int        - the current post id
 *
 * getSections()     - Array with the sequence of content sections to print
 *                             each one indentified with a type and a content
 *
 * splitContent()    - activate the splitter on a new content
 */
class SplittedContent
{
 
    private $splitters;
    private $sections = [];
    private $post_id  = 0;
    
    function __construct($post)
    {
        $this->post_id = $post->ID;
 
        $this->init($post->post_content);
    }
 
 
    /**
     * Expose the sections
     *
     * @return Array sections
     */
    public function getSections() {
 
        return $this->sections;
    }
 
    
    private function init($content) {   
 
        // load all the splitters
        $this->getAvailableSplitters();
 
        // cambiare gli shortcode "mutati"
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Templates/SingleSplittedContent.php
     *
    public function getPostData($post) {
 
        $processedPost = parent::getPostData($post);
        
        $processedPost['content'] = $this->getContent($post);
 
        return $processedPost;            
    }
    */
 
    /**
     * Returns the content as a list (array) of splitted sections
     * 
     * @param WP_Post $post
     * @return array
     */
    protected function getContent( $post ) {
 
        return ( new SplittedContent( $post ) )->getSections();
    }
}
 
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Post/Templates/Single.php
 
use THEME\ViewModel\Post\Content\FeaturedImage;
 
class Single implements iTemplate {    
    
 
    /**
     * Basic post data for a generic Single
     *
     * @param WP_Post $post
     * @return array
     */
    public function getPostData( $post ) {
 
        /// basic post data 
        $postData = [
            'id'      => $post->ID,
            'title'   => $post->post_title,
            'excerpt' => $post->post_excerpt,
            'content' => $this->getContent( $post ),
            'image'   => $this->getImage( $post ),
            'pubdate' => $this->getDate( $post ),
            'moddate' => $this->getUpdateDate( $post ),
            'tags'    => $this->getTags( $post ),
            'link'    => get_the_permalink( $post ),
        ];
 
        /// add post_meta to basic data
        $customFields = $this->getCustomFields( $post );
 
        if( is_array( $customFields ) && !empty( $customFields ) ) {
 
            $postData = array_merge( $postData, $customFields );
        }
 
        return $postData;
    }
 
 
    /**
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Single.php
 
    }
 
        
    /**
     * 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);
    }
 
    /**
     * set the list of the components
     * override this to add or remove components    
     */
    protected function initComponents() {
 
        $this->components = [
            'Author',
            'Taxonomies',
            'AnalysisTracking',
            'BreadcrumbsPrimary',
            'Adv',
            'Comments',                    
            'Relateds',
            'StructuredData',
            'Credits',
            'Canonical' ,
            'Meta'           
/data/websites/webnews/web/app/themes/webnews/src/ViewModel/Single.php
 */
class Single extends Base {
 
    protected $post;
    protected $postTemplate;
    
    protected $components;
    
    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'
        ];        
/data/websites/webnews/web/app/themes/webnews/single.php
<?php
 
use Timber\Timber;
use THEME\ViewModel\Single;
use THEME\ViewModel\SingleMaxReina;
 
if (have_posts()) {
    
    $ajax = ( isset( $_GET['is_ajax_request']) );
 
    /// ottimizzazione per autore secondario di MaxReina
    $secondaryMaxReinaUser = get_user_by('login', WN_SECONDARY_USER_FOR_MAXREINA);
    $singleClass = $posts[0]->post_author == $secondaryMaxReinaUser->ID ? SingleMaxReina::class : Single::class;
    
    // load data
    $data = ( new $singleClass( $posts[0], 'SingleSplittedContent') )->getData();
 
    $template = $ajax ? 'singleAjax.twig' : 'single-notizia.twig';
    
    Timber::render( $template, $data);
}
 
?>
/data/websites/webnews/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/webnews/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/webnews/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.20.2
REQUEST_URI /test-impact-new-lp/
USER nginx
HOME /var/lib/nginx
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 13.58.39.23
HTTP_HOST staging.webnews.it
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
REDIRECT_STATUS 200
SERVER_NAME staging.webnews.it
SERVER_PORT 443
SERVER_ADDR 10.50.50.198
REMOTE_PORT 55594
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/webnews/web
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/websites/webnews/web/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1714727878.6242
REQUEST_TIME 1714727878
WP_ENV staging
WP_HOME https://staging.webnews.it
WP_SITEURL https://staging.webnews.it/wp
WP_DEBUG true
WP_CACHE false
WPLANG it_IT
WP_POST_REVISIONS false
DB_NAME webnews
DB_USER webnewsUSR
DB_PASSWORD M3l4.G4mes.N3ws
DB_HOST 10.50.50.198
GTM_ID_WEBNEWS GTM-P55CN7W
GTM_ID_MELABLOG GTM-P55CN7W
GTM_ID_GAMESBLOG GTM-P55CN7W
SITE_SPECIAL_TAXONOMY special
HTML_PRODUCT_POST_TYPE_SLUG prodotti
DISABLE_WP_CRON true
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
WP_ALLOW_MULTISITE true
MULTISITE true
SUBDOMAIN_INSTALL true
DOMAIN_CURRENT_SITE staging.webnews.it
PATH_CURRENT_SITE /
SITE_ID_CURRENT_SITE 1
BLOG_ID_CURRENT_SITE 1
OFFERS_POST_TYPE post
OFFERS_LIMIT 2000
AUTH_KEY E094PtbN,/./X6J)N>X}iRr2X@qzrp<)*n!<1kps=WXH11Ho^1)^#,,/N`RQ%4PA
SECURE_AUTH_KEY rek_-EaoK.j{F>G%}^{Kw+npcA[tI&MW0_:3|Liq*E/]U/ve{M`tRW7[,SX-?G|b
LOGGED_IN_KEY Y;LL^L-^5a5nG&?I;e[nj0<5<;&pprgWk9Eq-Ozp>H6DZwl)3LUtdxQJ-b*mXA/w
NONCE_KEY 1R!zPZ.mPoo=[i1B[dUi2a13}0:>G{BToB:OX_(S8zT+PZ7nlEn78.#t0u7x?9)&
AUTH_SALT e+WE5olbqDvW7C[%Fs}d3n#_@8^,Ha<k&}kBL|:t@*Sl2vs#qT(lw`famVOPZ:!F
SECURE_AUTH_SALT Ks7ArUFaxK%!B`mqAsS;{qC,vpR36AiIcb@N1$[2<^SVY|?11$PV&P[PPzta,N<Z
LOGGED_IN_SALT 8lh7Q,HpTM}CMRtES%GVPD--09e!MUsQbinsA0-lS=qiUFfOaC]*,R?W$Po7UMak
NONCE_SALT m%tOV5u+uWm$e4V|4!y,:K_7`-N=m$unEx>SO:VZGMS)Y!h_ln/#zTJAkM)FK7{2
Key Value
WP_ENV staging
WP_HOME https://staging.webnews.it
WP_SITEURL https://staging.webnews.it/wp
WP_DEBUG true
WP_CACHE false
WPLANG it_IT
WP_POST_REVISIONS false
DB_NAME webnews
DB_USER webnewsUSR
DB_PASSWORD M3l4.G4mes.N3ws
DB_HOST 10.50.50.198
GTM_ID_WEBNEWS GTM-P55CN7W
GTM_ID_MELABLOG GTM-P55CN7W
GTM_ID_GAMESBLOG GTM-P55CN7W
SITE_SPECIAL_TAXONOMY special
HTML_PRODUCT_POST_TYPE_SLUG prodotti
DISABLE_WP_CRON true
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
WP_ALLOW_MULTISITE true
MULTISITE true
SUBDOMAIN_INSTALL true
DOMAIN_CURRENT_SITE staging.webnews.it
PATH_CURRENT_SITE /
SITE_ID_CURRENT_SITE 1
BLOG_ID_CURRENT_SITE 1
OFFERS_POST_TYPE post
OFFERS_LIMIT 2000
AUTH_KEY E094PtbN,/./X6J)N>X}iRr2X@qzrp<)*n!<1kps=WXH11Ho^1)^#,,/N`RQ%4PA
SECURE_AUTH_KEY rek_-EaoK.j{F>G%}^{Kw+npcA[tI&MW0_:3|Liq*E/]U/ve{M`tRW7[,SX-?G|b
LOGGED_IN_KEY Y;LL^L-^5a5nG&?I;e[nj0<5<;&pprgWk9Eq-Ozp>H6DZwl)3LUtdxQJ-b*mXA/w
NONCE_KEY 1R!zPZ.mPoo=[i1B[dUi2a13}0:>G{BToB:OX_(S8zT+PZ7nlEn78.#t0u7x?9)&
AUTH_SALT e+WE5olbqDvW7C[%Fs}d3n#_@8^,Ha<k&}kBL|:t@*Sl2vs#qT(lw`famVOPZ:!F
SECURE_AUTH_SALT Ks7ArUFaxK%!B`mqAsS;{qC,vpR36AiIcb@N1$[2<^SVY|?11$PV&P[PPzta,N<Z
LOGGED_IN_SALT 8lh7Q,HpTM}CMRtES%GVPD--09e!MUsQbinsA0-lS=qiUFfOaC]*,R?W$Po7UMak
NONCE_SALT m%tOV5u+uWm$e4V|4!y,:K_7`-N=m$unEx>SO:VZGMS)Y!h_ln/#zTJAkM)FK7{2
0. Whoops\Handler\PrettyPageHandler