GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

for_every_podcast_blog()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 10
nc 4
nop 1
dl 0
loc 15
rs 9.9332
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
2
3
namespace PodloveSubscribeButton;
4
5
function for_every_podcast_blog($callback) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function for_every_podcast_blog()
Loading history...
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
introduced by
No space after opening parenthesis is prohibited
Loading history...
introduced by
No space before closing parenthesis is prohibited
Loading history...
6
	global $wpdb;
7
8
	$plugin  = basename(\PodloveSubscribeButton\PLUGIN_DIR) . '/' . \PodloveSubscribeButton\PLUGIN_FILE_NAME;
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
9
	$blogids = $wpdb->get_col("SELECT blog_id FROM " . $wpdb->blogs);
0 ignored issues
show
introduced by
Usage of a direct database call is discouraged.
Loading history...
introduced by
Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().
Loading history...
Coding Style Comprehensibility introduced by
The string literal SELECT blog_id FROM does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
10
11
	if (!is_array($blogids))
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
introduced by
Expected 1 space before "!"; 0 found
Loading history...
introduced by
Expected 1 space after "!"; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
12
		return;
13
14
	foreach ($blogids as $blog_id) {
0 ignored issues
show
introduced by
No space after opening parenthesis is prohibited
Loading history...
introduced by
No space before closing parenthesis is prohibited
Loading history...
15
		switch_to_blog($blog_id);
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
16
		if (is_plugin_active($plugin)) {
0 ignored issues
show
introduced by
No space after opening parenthesis is prohibited
Loading history...
introduced by
No space before closing parenthesis is prohibited
Loading history...
Coding Style introduced by
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
17
			$callback();
18
		}
19
		restore_current_blog();
20
	}
21
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...