• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ideasonpurpose / wp-theme-init / #83

22 May 2026 06:21PM UTC coverage: 98.638% (-0.7%) from 99.377%
#83

push

php-coveralls

joemaller
2.20.0

652 of 661 relevant lines covered (98.64%)

2.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/src/ThemeInit/Admin/CustomLoginScreen.php
1
<?php
2
namespace IdeasOnPurpose\ThemeInit\Admin;
3

4
class CustomLoginScreen
5
{
6
    public mixed $siteLogo;
7
    public ?string $byline;
8
    public mixed $footer;
9

10
    public function __construct($siteLogo = null, $byline = null, $footer = null)
11
    {
12
        $this->siteLogo = $siteLogo;
×
13
        $this->byline = $byline;
×
14
        $this->footer = $footer;
×
15

16
        add_action('login_enqueue_scripts', [$this, 'load_styles']);
×
17
        add_filter('login_message', [$this, 'login_message']);
×
18
        add_action('login_footer', [$this, 'footer']);
×
19
    }
20

21
    public function load_styles()
22
    {
23
        $css_path = __DIR__ . '/CustomLoginScreen/CustomLoginScreen.css';
1✔
24
        $theme_path = get_template_directory();
1✔
25
        $css_url = get_template_directory_uri() . str_replace($theme_path, '', $css_path);
1✔
26
        wp_enqueue_style('iop-custom-login-screen-styles', $css_url, [], false, 'all');
1✔
27
    }
28

29
    public function login_message($message)
30
    {
31
        if ($this->byline === null) {
1✔
32
            $href = '<a href="https://www.ideasonpurpose.com" target="_blank">Ideas On Purpose</a>';
1✔
33
            $this->byline = sprintf(__('A WordPress site by %s', 'iopwp'), $href);
1✔
34
        }
35

36
        $siteLogo = '';
1✔
37
        if ($this->siteLogo) {
1✔
38
            if (is_callable($this->siteLogo)) {
1✔
39
                $siteLogo = call_user_func($this->siteLogo);
1✔
40
            } else {
41
                $siteLogo = $this->siteLogo;
1✔
42
            }
43
        }
44
        if (!empty($siteLogo)) {
1✔
45
            $siteLogo = sprintf('<div id="iop-client-logo">%s</div>', $siteLogo);
1✔
46
        }
47

48
        return $message .
1✔
49
            "<div id='iop-login-message'>
1✔
50
                {$siteLogo}
1✔
51
                <div id='iop-login-byline'>{$this->byline}</div>
1✔
52
            </div>";
1✔
53
    }
54

55
    public function footer()
56
    {
57
        $url = 'https://ideasonpurpose.com';
1✔
58
        $title = 'Ideas on Purpose';
1✔
59
        $logo = file_get_contents(__DIR__ . '/CustomLoginScreen/iop-logo.svg');
1✔
60

61
        if ($this->footer) {
1✔
62
            if (is_callable($this->footer)) {
1✔
63
                $footer = call_user_func($this->footer);
1✔
64
            } else {
65
                $footer = $this->footer;
1✔
66
            }
67
        }
68

69
        $footer ??= sprintf(
1✔
70
            '<a href="%s" target="_blank" title="%s">%s</a>',
1✔
71
            esc_url($url),
1✔
72
            esc_attr($title),
1✔
73
            $logo,
1✔
74
        );
1✔
75
        echo "<div id='iop-login-footer'>{$footer}</div>";
1✔
76
    }
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc