diff --git a/admin/apple-actions/index/class-delete.php b/admin/apple-actions/index/class-delete.php
index e9d4fb2c..3c21e908 100644
--- a/admin/apple-actions/index/class-delete.php
+++ b/admin/apple-actions/index/class-delete.php
@@ -63,12 +63,12 @@ public function perform() {
*/
private function delete() {
if ( ! $this->is_api_configuration_valid() ) {
- throw new \Apple_Actions\Action_Exception( __( 'Your Apple News API settings seem to be empty. Please fill the API key, API secret and API channel fields in the plugin configuration page.', 'apple-news' ) );
+ throw new \Apple_Actions\Action_Exception( esc_html__( 'Your Apple News API settings seem to be empty. Please fill the API key, API secret and API channel fields in the plugin configuration page.', 'apple-news' ) );
}
$remote_id = get_post_meta( $this->id, 'apple_news_api_id', true );
if ( ! $remote_id ) {
- throw new \Apple_Actions\Action_Exception( __( 'This post has not been pushed to Apple News, cannot delete.', 'apple-news' ) );
+ throw new \Apple_Actions\Action_Exception( esc_html__( 'This post has not been pushed to Apple News, cannot delete.', 'apple-news' ) );
}
try {
diff --git a/admin/class-admin-apple-meta-boxes.php b/admin/class-admin-apple-meta-boxes.php
index be83d0ee..488d083a 100644
--- a/admin/class-admin-apple-meta-boxes.php
+++ b/admin/class-admin-apple-meta-boxes.php
@@ -448,7 +448,7 @@ public static function build_sections_field( $post_id ) {
?>
diff --git a/includes/apple-exporter/components/class-embed-web-video.php b/includes/apple-exporter/components/class-embed-web-video.php
index 4a3a72c3..f75e9e7b 100644
--- a/includes/apple-exporter/components/class-embed-web-video.php
+++ b/includes/apple-exporter/components/class-embed-web-video.php
@@ -37,7 +37,7 @@ class Embed_Web_Video extends Component {
*/
public static function node_matches( $node ) {
// First, check to see if the node is a YouTube or Vimeo Gutenberg block, because these are the simplest checks to make.
- $is_figure = 'figure' === $node->nodeName;
+ $is_figure = 'figure' === $node->nodeName; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$is_vimeo_block = self::node_has_class( $node, 'wp-block-embed-vimeo' );
$is_youtube_block = self::node_has_class( $node, 'wp-block-embed-youtube' );
if ( $is_figure && ( $is_vimeo_block || $is_youtube_block ) ) {
@@ -45,7 +45,7 @@ public static function node_matches( $node ) {
}
// Second, check to see if the node contains a YouTube or Vimeo oEmbed as a text string.
- $inner_text = trim( $node->nodeValue );
+ $inner_text = trim( $node->nodeValue ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$has_vimeo_url = (bool) preg_match( self::VIMEO_MATCH, $inner_text );
$has_youtube_url = (bool) preg_match( self::YOUTUBE_MATCH, $inner_text );
if ( $has_vimeo_url || $has_youtube_url ) {
diff --git a/includes/apple-exporter/components/class-tweet.php b/includes/apple-exporter/components/class-tweet.php
index 7ca29ffa..f36ad470 100644
--- a/includes/apple-exporter/components/class-tweet.php
+++ b/includes/apple-exporter/components/class-tweet.php
@@ -25,6 +25,7 @@ class Tweet extends Component {
*/
public static function node_matches( $node ) {
+ /* phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */
// Handling for a Gutenberg Twitter embed.
if (
'figure' === $node->nodeName
@@ -38,6 +39,7 @@ public static function node_matches( $node ) {
'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i',
trim( $node->nodeValue )
);
+ /* phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */
if ( self::node_has_class( $node, 'twitter-tweet' ) || $is_twitter_url ) {
return $node;
diff --git a/includes/apple-exporter/components/class-video.php b/includes/apple-exporter/components/class-video.php
index 13be12dd..09cde78b 100644
--- a/includes/apple-exporter/components/class-video.php
+++ b/includes/apple-exporter/components/class-video.php
@@ -32,10 +32,10 @@ public static function node_matches( $node ) {
// Is this a gutenberg video block?
( self::node_has_class( $node, 'wp-block-video' )
&& $node->hasChildNodes()
- && 'video' === $node->firstChild->nodeName
+ && 'video' === $node->firstChild->nodeName // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
)
// Or is this a stand-alone video tag?
- || 'video' === $node->nodeName
+ || 'video' === $node->nodeName // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
) {
return $node;
}
diff --git a/includes/meta.php b/includes/meta.php
index faa653c7..132f5dc0 100644
--- a/includes/meta.php
+++ b/includes/meta.php
@@ -37,7 +37,7 @@ function apple_news_register_meta_helper( $object_type, $object_slugs, $meta_key
// Object type must be either post or term.
if ( ! in_array( $object_type, [ 'post', 'term' ], true ) ) {
throw new InvalidArgumentException(
- __(
+ esc_html__(
'Object type must be one of "post", "term".',
'apple-news'
)