Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Minor styling fix and license errors downgraded to warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Jul 22, 2019
1 parent b0e32c7 commit afee0c7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/dev/styles/components/_admin-screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
color: #5c5c5c;
font-size: 0.9em;
font-style: italic;
font-weight: 100;
font-weight: 400;
}

&-btn {
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/readme-helpers-trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ public function get_response_message( $response ) {
}
} else { // Multiple matches returned, so it's FSF provided critera.
$matches = array_keys( $response->live );
$response->status = 'error';
$response->status = 'warning';
/* translators: %s: listing of license IDs matched. */
$response->message = sprintf( esc_html__( 'Found multiple records matching these licenses: %s, it\'s required to use a single SPDX Idenitfier!', 'theme-sniffer' ), implode( ', ', $matches ) );
}
} elseif ( ! empty( $response->deprecated ) ) { // Deprecated match found.
$response->status = 'error';
$response->status = 'warning';
/* translators: %s: User provided license identifier. */
$response->message = sprintf( esc_html__( 'The license identification provided, $s, indicates a deprecated license! Please use a valid SPDX Identifier!', 'theme-sniffer' ), $response->provided );
} else { // No matches found.
$response->status = 'error';
$response->status = 'warning';
/* translators: %s: unrecognized user provided license identifier */
$response->message = sprintf( esc_html__( 'No matching license critera could be determined from: %s!', 'theme-sniffer' ), $response->provided );
}
Expand Down
10 changes: 5 additions & 5 deletions src/sniffs/readme/class-license-uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ public function check() {
$license = $this->find_license( $this->args->primary );

// Still report errors when license status is warning (or success of course).
if ( $license->status !== 'error' ) {
if ( $license->status !== 'warning' ) {
$uris = $this->license_data[ $license->id ]['uris'];

// Missing License URI field error.
// Missing License URI field warning.
if ( empty( $this->args->uri ) ) {
$this->results[] = [
'severity' => 'error',
'severity' => 'warning',
'message' => esc_html__( 'All themes are required to provide a License URI in their readme.txt!', 'theme-sniffer' ),
];
}

// URI field is invalid.
if ( empty( preg_grep( '/^' . preg_quote( $this->args->uri, '/' ) . '$/i', $uris ) ) ) {
$this->results[] = [
'severity' => 'error',
'severity' => 'warning',
'message' => wp_kses(
sprintf(
/* translators: 1: the user provided License URI in readme.txt 2: the license comparing against in readme.txt 3: a list of suitable license URIs that could be used */
Expand All @@ -77,7 +77,7 @@ public function check() {
} else {
// Unable to determine License URI without valid License.
$this->results[] = [
'severity' => 'error',
'severity' => 'warning',
'message' => esc_html__( 'Unable to determine License URI with an invalid License supplied in readme.txt!', 'theme-sniffer' ),
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/sniffs/readme/class-license.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public function check() {
}

// Check if GPLv2 compatible if no errors found with License Identifier so far.
if ( $license_data->status !== 'error' && ! $this->is_gpl2_or_later_compatible( $license_data ) ) {
if ( $license_data->status !== 'warning' && ! $this->is_gpl2_or_later_compatible( $license_data ) ) {
$this->results[] = [
'severity' => 'error',
'severity' => 'warning',
'message' => sprintf(
/* translators: %s: the license specified in readme.txt */
esc_html__( 'The license specified, %s is not compatible with WordPress\' license of GPL-2.0-or-later. All themes must meet this requirement!' ),
Expand Down

0 comments on commit afee0c7

Please sign in to comment.