HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /var/www/html/qcr24/wp-content/plugins/rocket-lazy-load/src/Admin/ImagifyNotice.php
<?php
/**
 * Imagify Notice Class
 *
 * @package RocketLazyloadPlugin
 */

namespace RocketLazyLoadPlugin\Admin;

/**
 * Imagify Notice display
 *
 * @since 2.0
 * @author Remy Perona
 */
class ImagifyNotice
{
    /**
     * Template path
     *
     * @since 2.0
     * @author Remy Perona
     *
     * @var string
     */
    private $template_path;

    /**
     * Constructor
     *
     * @since 2.0
     * @author Remy Perona
     *
     * @param string $template_path Template path.
     */
    public function __construct($template_path)
    {
        $this->template_path = $template_path;
    }

    /**
     * Renders the Imagify notice
     *
     * @since 2.0
     * @author Remy Perona
     *
     * @return void
     */
    public function displayNotice()
    {
        $this->renderTemplate('imagify-notice');
    }

    /**
     * Renders the given template if it's readable.
     *
     * @since 2.0
     * @author Remy Perona
     *
     * @param string $template Template name.
     */
    protected function renderTemplate($template)
    {
        $template_path = $this->template_path . $template . '.php';

        if (! is_readable($template_path)) {
            return;
        }

        include $template_path;
    }
}