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.
Completed
Push — master ( 09969e...e7c062 )
by
unknown
02:43 queued 02:40
created

admin.php ➔ admin_menu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 9 and the first side effect is on line 14.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Undefined\Stash\Admin;
4
5
/**
6
 * Clean up adminpages
7
 */
8
9
function login_redirect($redirect_to, $request, $user)
0 ignored issues
show
Unused Code introduced by
The parameter $redirect_to is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $user is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
{
11
    return admin_url('edit.php?post_type=page');
12
}
13
14
add_filter('login_redirect', __NAMESPACE__ . '\\login_redirect', 10, 3);
15
16
function remove_menu()
17
{
18
    remove_menu_page('index.php'); //dashboard
19
    remove_menu_page('edit-comments.php'); //comments
20
}
21
22
add_action('admin_menu', __NAMESPACE__ . '\\remove_menu', 99);
23
24
function remove_wp_logo($wp_admin_bar)
25
{
26
    $wp_admin_bar->remove_node('wp-logo');
27
}
28
29
add_action('admin_bar_menu', __NAMESPACE__ . '\\remove_wp_logo', 999);
30
31
function change_footer_admin()
32
{
33
    return '&nbsp;';
34
}
35
36
add_filter('admin_footer_text', __NAMESPACE__ . '\\change_footer_admin', 9999);
37
38
function change_footer_version()
39
{
40
    return ' ';
41
}
42
43
add_filter('update_footer', __NAMESPACE__ . '\\change_footer_version', 9999);
44
45
/*
46
 * Change the opacity of WordPress Admin Bar
47
 */
48
function adminbar_opacity()
49
{
50
    $adminbar_opacity = '<style type="text/css">#wpadminbar { filter:alpha(opacity=50); opacity:0.5; }</style>';
51
    echo $adminbar_opacity;
52
}
53
54
if (!is_admin()) {
55
    add_action('wp_head', __NAMESPACE__ . '\\adminbar_opacity');
56
}
57
58
/*
59
 * Redirect Dashboard to pages
60
 */
61
function redirect_from_dashboard()
62
{
63
    wp_redirect(admin_url('edit.php?post_type=page'));
64
    exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The function redirect_from_dashboard() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
65
}
66
67
add_action('wp_dashboard_setup', __NAMESPACE__ . '\\redirect_from_dashboard');
68
69
function admin_menu()
70
{
71
    global $menu;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
72
    $url = '/';
0 ignored issues
show
Unused Code introduced by
$url is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
73
    $menu[0] = array(__('STASH'), 'read', '#', 'undefined-logo', 'undefined-logo');
74
}
75
76
add_action('admin_menu', __NAMESPACE__ . '\\admin_menu');
77
78
function admin_style()
79
{
80
    echo '<link rel="stylesheet" href="' . get_template_directory_uri() . '/dist/css/admin/main.css" type="text/css" media="all" />';
81
}
82
83
add_action('admin_head', __NAMESPACE__ . '\\admin_style');
84