# easy-invoice/2.4.2/includes/Helpers/LogoHelper.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.4.2. 91 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.2/code/includes/Helpers/LogoHelper.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.2/raw/includes/Helpers/LogoHelper.php
- Modified: 2026-09-29T05:21:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.4.2/code/includes/Helpers/LogoHelper.php#L10-L20`.

```php
<?php
/**
 * The plugin's brand mark, and a kses list that can actually print it.
 *
 * `wp_kses_post()` has no <svg> in its allow-list, so the logo the sidebar
 * has always built was being stripped down to its coloured square. Anything
 * that echoes logo markup — including the White-Label addon's replacement —
 * goes through `easy_invoice_kses_logo()` instead.
 *
 * @package EasyInvoice
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( ! function_exists( 'easy_invoice_logo_allowed_html' ) ) {
    /**
     * post allow-list + the SVG subset the brand mark needs.
     *
     * @return array<string, array<string, bool>>
     */
    function easy_invoice_logo_allowed_html() {
        $shared = [
            'class' => true, 'style' => true, 'fill' => true, 'stroke' => true,
            'stroke-width' => true, 'stroke-linecap' => true, 'stroke-linejoin' => true,
            'opacity' => true, 'transform' => true,
        ];

        return array_merge(
            wp_kses_allowed_html( 'post' ),
            [
                'svg'            => array_merge( $shared, [
                    'xmlns' => true, 'viewbox' => true, 'width' => true, 'height' => true,
                    'aria-hidden' => true, 'role' => true, 'focusable' => true,
                ] ),
                'g'              => $shared,
                'defs'           => [],
                'title'          => [],
                'lineargradient' => [ 'id' => true, 'x1' => true, 'y1' => true, 'x2' => true, 'y2' => true, 'gradientunits' => true ],
                'stop'           => [ 'offset' => true, 'stop-color' => true, 'stop-opacity' => true ],
                'path'           => array_merge( $shared, [ 'd' => true ] ),
                'rect'           => array_merge( $shared, [ 'x' => true, 'y' => true, 'width' => true, 'height' => true, 'rx' => true, 'ry' => true ] ),
                'circle'         => array_merge( $shared, [ 'cx' => true, 'cy' => true, 'r' => true ] ),
                'line'           => array_merge( $shared, [ 'x1' => true, 'y1' => true, 'x2' => true, 'y2' => true ] ),
                'polyline'       => array_merge( $shared, [ 'points' => true ] ),
                'polygon'        => array_merge( $shared, [ 'points' => true ] ),
                'use'            => array_merge( $shared, [ 'href' => true, 'xlink:href' => true ] ),
            ]
        );
    }
}

if ( ! function_exists( 'easy_invoice_kses_logo' ) ) {
    /**
     * Sanitise logo markup without losing the SVG.
     *
     * @param string $html Logo markup.
     * @return string
     */
    function easy_invoice_kses_logo( $html ) {
        return wp_kses( $html, easy_invoice_logo_allowed_html() );
    }
}

if ( ! function_exists( 'easy_invoice_logo_mark_svg' ) ) {
    /**
     * The brand mark: the same document-and-tick used for the WordPress.org
     * icon and the admin menu, in colour.
     *
     * @param int $size Square size in pixels.
     * @return string
     */
    function easy_invoice_logo_mark_svg( $size = 32 ) {
        $size = (int) $size;
        $id   = 'ei-logo-g';

        return '<svg class="ei-app-logo-svg" width="' . $size . '" height="' . $size . '" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">'
            . '<defs><lineargradient id="' . $id . '" x1="0" y1="0" x2="48" y2="48" gradientunits="userSpaceOnUse">'
            . '<stop offset="0" stop-color="#4F46E5"/><stop offset="1" stop-color="#0EA5E9"/>'
            . '</lineargradient></defs>'
            . '<rect x="0" y="0" width="48" height="48" rx="12" fill="url(#' . $id . ')"/>'
            . '<rect x="13" y="9" width="22" height="28" rx="3" fill="#FFFFFF"/>'
            . '<path d="M18 17h12M18 22h12M18 27h6" stroke="#CBD5E1" stroke-width="2.4" stroke-linecap="round"/>'
            . '<path d="M18 27h6" stroke="#4F46E5" stroke-width="2.4" stroke-linecap="round"/>'
            . '<circle cx="34" cy="33" r="7.5" fill="#10B981" stroke="#FFFFFF" stroke-width="2.2"/>'
            . '<path d="M30.8 33.2l2.2 2.2 4.2-4.6" stroke="#FFFFFF" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>'
            . '</svg>';
    }
}

```
