PluginProbe
Plugin Check (PCP) / 0.2.1
Plugin Check (PCP) v0.2.1
2.1.0 trunk 0.1 0.2.0 0.2.1 0.2.2 0.2.3 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 ci-artifacts
plugin-check / checks / header.php

header.php in Plugin Check (PCP) 0.2.1, at checks/header.php

22 lines 634 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WordPressdotorg\Plugin_Check\Checks;
3 use WordPressdotorg\Plugin_Check\{Error, Guideline_Violation, Message, Notice, Warning};
4
5 class Header extends Check_Base {
6 function check_textdomain() {
7 if (
8 ! empty( $this->slug ) &&
9 ! empty( $this->headers['TextDomain'] ) &&
10 $this->slug !== $this->headers['TextDomain']
11 ) {
12 return new Warning(
13 'textdomain_mismatch',
14 sprintf(
15 'TextDomain header in plugin file does not match slug. Found %s, expected %s.',
16 '<code>' . esc_html( $this->headers['TextDomain'] ) . '</code>',
17 '<code>' . esc_html( $this->slug ) . '</code>'
18 )
19 );
20 }
21 }
22 }