$83 GRAYBYTE WORDPRESS FILE MANAGER $72

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/kigalix.com/wp-content/plugins/wpforms-lite/src/Admin/Tools/Views/

HOME
Current File : /home/bravrvjk/kigalix.com/wp-content/plugins/wpforms-lite/src/Admin/Tools/Views//CodeSnippets.php
<?php

namespace WPForms\Admin\Tools\Views;

use WPForms\Integrations\WPCode\WPCode;

/**
 * Class WPCode view.
 *
 * @since 1.8.5
 */
class CodeSnippets extends View {

	/**
	 * View slug.
	 *
	 * @since 1.8.5
	 *
	 * @var string
	 */
	protected $slug = 'wpcode';

	/**
	 * WPCode action required.
	 *
	 * @since 1.8.5
	 *
	 * @var string
	 */
	private $action;

	/**
	 * WPCode snippets.
	 *
	 * @since 1.8.5
	 *
	 * @var array
	 */
	private $snippets;

	/**
	 * WPCode plugin slug or download URL.
	 *
	 * @since 1.8.5
	 *
	 * @var string
	 */
	private $plugin;

	/**
	 * Whether WPCode action is required.
	 *
	 * @since 1.8.5
	 *
	 * @var bool
	 */
	private $action_required;

	/**
	 * Init view.
	 *
	 * @since 1.8.5
	 */
	public function init() {

		$wpcode = new WPCode();

		$this->snippets        = $wpcode->load_wpforms_snippets();
		$plugin_slug           = $wpcode->is_pro_installed() ? $wpcode->pro_plugin_slug : $wpcode->lite_plugin_slug;
		$update_required       = $wpcode->is_plugin_installed() && version_compare( $wpcode->plugin_version(), '2.0.10', '<' );
		$installed_action      = $update_required ? 'update' : 'activate';
		$this->action_required = $update_required || ! $wpcode->is_plugin_installed() || ! $wpcode->is_plugin_active();
		$this->action          = $wpcode->is_plugin_installed() ? $installed_action : 'install';
		$this->plugin          = $this->action === 'activate' ? $plugin_slug : $wpcode->lite_download_url;

		$this->hooks();
	}

	/**
	 * Add hooks.
	 *
	 * @since 1.8.5
	 *
	 * @return void
	 */
	private function hooks() {

		if ( $this->action !== 'update' ) {
			return;
		}

		add_filter(
			'upgrader_package_options',
			static function ( $options ) {
				$options['clear_destination'] = true;

				return $options;
			}
		);
	}

	/**
	 * Get view label.
	 *
	 * @since 1.8.5
	 *
	 * @return string
	 * @noinspection PhpMissingReturnTypeInspection
	 * @noinspection ReturnTypeCanBeDeclaredInspection
	 */
	public function get_label() {

		return esc_html__( 'Code Snippets', 'wpforms-lite' );
	}

	/**
	 * Checking user capability to view.
	 *
	 * @since 1.8.5
	 *
	 * @return bool
	 * @noinspection  PhpMissingReturnTypeInspection
	 * @noinspection  ReturnTypeCanBeDeclaredInspection
	 */
	public function check_capability() {

		return wpforms_current_user_can();
	}

	/**
	 * Display view content.
	 *
	 * @since 1.8.5
	 *
	 * @noinspection  PhpMissingReturnTypeInspection
	 * @noinspection  ReturnTypeCanBeDeclaredInspection
	 */
	public function display() {

		// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		echo wpforms_render(
			'integrations/wpcode/code-snippets',
			[
				'snippets'        => $this->snippets,
				'action_required' => $this->action_required,
				'action'          => $this->action,
				'plugin'          => $this->plugin,
			],
			true
		);
	}
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
9 May 2025 2.02 AM
bravrvjk / bravrvjk
0755
ActionScheduler.php
1.368 KB
18 Aug 2022 2.59 PM
bravrvjk / bravrvjk
0644
ActionSchedulerList.php
2.394 KB
26 Sep 2024 3.36 PM
bravrvjk / bravrvjk
0644
CodeSnippets.php
2.778 KB
28 Nov 2023 4.59 PM
bravrvjk / bravrvjk
0644
Export.php
9.409 KB
24 Apr 2025 2.53 PM
bravrvjk / bravrvjk
0644
Import.php
11.35 KB
26 Sep 2024 3.36 PM
bravrvjk / bravrvjk
0644
Importer.php
9.669 KB
10 Aug 2023 3.19 PM
bravrvjk / bravrvjk
0644
Logs.php
8.197 KB
26 Sep 2024 3.36 PM
bravrvjk / bravrvjk
0644
System.php
13.258 KB
8 Aug 2024 7.32 PM
bravrvjk / bravrvjk
0644
View.php
1.703 KB
7 Nov 2024 5.15 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF