SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > wpforms-lite > > src > Emails >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/wpforms-lite//src/Emails/

NameTypeSizeLast ModifiedActions
Templates Directory - -
FetchInfoBlocksTask.php File 2121 bytes September 26 2024 15:36:36.
Helpers.php File 12901 bytes January 16 2024 17:57:58.
InfoBlocks.php File 5491 bytes April 24 2025 14:53:30.
Mailer.php File 12764 bytes April 24 2025 14:53:30.
NotificationBlocks.php File 4738 bytes September 26 2024 15:36:36.
Notifications.php File 37950 bytes June 05 2025 16:54:44.
Preview.php File 13258 bytes July 31 2025 14:13:36.
Styler.php File 2595 bytes November 28 2023 16:59:36.
Summaries.php File 14416 bytes October 17 2024 15:23:50.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/wpforms-lite//src/Emails//Styler.php

<?php

namespace WPForms\Emails;

use WPForms\Vendor\TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
use WPForms\Helpers\Templates;

/**
 * Styler class inline style email templates.
 *
 * @since 1.5.4
 */
class Styler {

	/**
	 * Email message with no styles.
	 *
	 * @since 1.5.4
	 *
	 * @var string
	 */
	protected $email;

	/**
	 * Email style templates names.
	 *
	 * @since 1.5.4
	 *
	 * @var array
	 */
	protected $style_templates;

	/**
	 * Email style overrides.
	 *
	 * @since 1.5.4
	 *
	 * @var array
	 */
	protected $style_overrides;

	/**
	 * Email message with inline styles.
	 *
	 * @since 1.5.4
	 *
	 * @var string
	 */
	protected $styled_email;

	/**
	 * Constructor.
	 *
	 * @since 1.5.4
	 *
	 * @param string $email           Email with no styles.
	 * @param array  $style_templates Email style templates.
	 * @param array  $style_overrides Email style overrides.
	 */
	public function __construct( $email, $style_templates, $style_overrides ) {

		$this->email = $email;

		$this->style_templates = is_array( $style_templates ) ? $style_templates : [];
		$this->style_overrides = is_array( $style_overrides ) ? $style_overrides : [];
	}

	/**
	 * Template style overrides.
	 *
	 * @since 1.5.4
	 *
	 * @return array
	 */
	protected function get_style_overrides() {

		$defaults = Helpers::get_current_template_style_overrides();

		$overrides = \wp_parse_args( $this->style_overrides, $defaults );

		return \apply_filters( 'wpforms_emails_mailer_get_style_overrides', $overrides, $this );
	}

	/**
	 * Locate template name matching styles.
	 *
	 * @since 1.5.4
	 *
	 * @param string $name Template file name part.
	 *
	 * @return string
	 */
	protected function get_styles( $name = 'style' ) {

		if ( ! \array_key_exists( $name, $this->style_templates ) ) {
			return '';
		}

		return Templates::get_html(
			$this->style_templates[ $name ],
			$this->get_style_overrides(),
			true
		);
	}

	/**
	 * Final processing of the template markup.
	 *
	 * @since 1.5.4
	 */
	public function process_markup() {

		$this->styled_email = ( new CssToInlineStyles() )->convert( $this->email, $this->get_styles() );

		$queries = '<style type="text/css">' . $this->get_styles( 'queries' ) . "</style>\n</head>";

		// Inject media queries, CssToInlineStyles strips them.
		$this->styled_email = \str_replace( '</head>', $queries, $this->styled_email );
	}

	/**
	 * Get an email with inline styles.
	 *
	 * @since 1.5.4
	 *
	 * @return string
	 */
	public function get() {

		if ( empty( $this->styled_email ) ) {
			$this->process_markup();
		}

		return $this->styled_email;
	}
}

SILENT KILLER Tool