Skip to content

Conversation

philipjohn
Copy link
Contributor

The refresh interval can be set by the site owner to any value. On AMP liveblogs this is used for the data-poll-interval in the amp-live-list but that value has to be greater than 15. https://amp.dev/documentation/examples/components/amp-live-list/

This change ensures that AMP Liveblogs have a minimum interval of 15.

When building, NPM reports the following error:

> error  Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener  react/jsx-no-target-blank

This change fixes that by adding the required rel attribute to the link.
The refresh interval can be set by the site owner to any value. On AMP liveblogs this is used for the `data-poll-interval` in the `amp-live-list` but that value has to be greater than 15. https://amp.dev/documentation/examples/components/amp-live-list/

This change ensures that AMP Liveblogs enforce a minimum value of 15 for the interval.
'settings' => array(
'entries_per_page' => WPCOM_Liveblog_Lazyloader::get_number_of_entries(),
'refresh_interval' => WPCOM_Liveblog::get_refresh_interval(),
'refresh_interval' => min( 15, WPCOM_Liveblog::get_refresh_interval() ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put this in a constant.

@GaryJones GaryJones added this to the 1.next milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants