• Resolved frenchomatic

    (@frenchomatic)


    There is something wrong with the plugin’s use of vendor code in class-amp-post-template.php on design 2

    Much of this code is being run two times for a static home page or a blog posts page. This leads to problems with incorrect structured data being presented. For example a simple static home page and the featured image on the page is different to what gets rendered into the structured data attribute.

    This function public function __construct( $post_id ) is run twice.

    • This topic was modified 7 years, 6 months ago by frenchomatic.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter frenchomatic

    (@frenchomatic)

    Further investigation in features.php :

    add_filter( ‘amp_post_template_metadata’, ‘ampforwp_search_or_homepage_or_staticpage_metadata’, 10, 2 );

    This filter doesn’t set the featured image for a static front page. There are also other obvious errors like this in that filter.

    if( $featured_image_array ) {
    					$structured_data_image = $featured_image_array[0];
    					$structured_data_image = $featured_image_array[1];
    					$structured_data_image = $featured_image_array[2];
    				}
    • This reply was modified 7 years, 6 months ago by frenchomatic.
    • This reply was modified 7 years, 6 months ago by frenchomatic.
    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @frenchomatic

    It’s the kind of question that’s really hard to answer on the forum. We will have to test this properly. Perhaps if you create a ticket with more proof then we will include in the next update.

    Regards,

    Thread Starter frenchomatic

    (@frenchomatic)

    @ahmed – I set up a test system for you sometime ago. You have ftp and login details. I will send the login details etc to you again @team?

    • This reply was modified 7 years, 6 months ago by frenchomatic.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Static home page – running vendor code twice’ is closed to new replies.