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

ideasonpurpose / wp-theme-init / #78

16 Oct 2025 04:50PM UTC coverage: 99.377% (-0.2%) from 99.531%
#78

push

php-coveralls

joemaller
2.18.2

638 of 642 relevant lines covered (99.38%)

1.91 hits per line

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

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

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

10
    public function __construct($siteLogo = null, $byline = null, $footer = null)
11
    {
12
        $this->siteLogo = $siteLogo;
1✔
13
        if ($byline === null) {
1✔
14
            $href = '<a href="https://www.ideasonpurpose.com" target="_blank">Ideas On Purpose</a>';
1✔
15
            $this->byline = sprintf(__('A WordPress site by %s', 'iopwp'), $href);
1✔
16
        } else {
17
            $this->byline = $byline;
×
18
        }
19
        $this->footer = $footer;
1✔
20

21
        add_action('login_enqueue_scripts', [$this, 'load_styles']);
1✔
22
        add_filter('login_message', [$this, 'login_message']);
1✔
23
        add_action('login_footer', [$this, 'footer']);
1✔
24
    }
25

26
    public function load_styles()
27
    {
28
        $css_path = __DIR__ . '/CustomLoginScreen/CustomLoginScreen.css';
1✔
29
        $theme_path = get_template_directory();
1✔
30
        $css_url = get_template_directory_uri() . str_replace($theme_path, '', $css_path);
1✔
31
        wp_enqueue_style('iop-custom-login-screen-styles', $css_url, [], false, 'all');
1✔
32
    }
33

34
    public function login_message($message)
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