HEX
Server: LiteSpeed
System: Linux 111n6.sieutocviet.page 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User: nhathuocat (1048)
PHP: 7.4.30
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/nhathuocat/public_html/wp-content/plugins/fixed-toc/inc/init.php
<?php

/**
 * Initialization
 *
 * Detect min compatible version, action links, internationalization, etc.
 *
 * @since 3.1.0
 */
class Fixedtoc_Init {
	const WP_MIN_VERSION = '4.5';

	/**
	 * Constructor.
	 *
	 * @since 3.1.0
	 */
	public function __construct() {
		// Compare WordPress min version.
		register_activation_hook( FTOC_ROOTFILE, array( $this, 'wp_min_version_compare' ) );

		// Translation
		add_action( 'plugins_loaded', array( $this, 'internationalization' ) );

		// Add action links
		add_filter( 'plugin_action_links_' . plugin_basename( FTOC_ROOTFILE ), array( $this, 'action_links' ) );
	}

	/**
	 * Compare WordPress min version.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function wp_min_version_compare() {
		if ( version_compare( $GLOBALS['wp_version'], self::WP_MIN_VERSION, '<' ) ) {
			wp_die(
				sprintf(
					esc_html__( 'This plugin requires at least WordPress version %s. You are running version %s. Please upgrade and try again.', 'fixedtoc' ),
					self::WP_MIN_VERSION,
					$GLOBALS['wp_version']
				),
				'',
				array( 'back_link' => true )
			);
		}
	}

	/**
	 * Internationalization.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function internationalization() {
		load_plugin_textdomain( 'fixedtoc', false, basename( FTOC_ROOTDIR ) . '/languages/' );
	}

	/**
	 * Add action links.
	 *
	 * @since 1.0.0
	 *
	 * @param array $actions
	 *
	 * @return array
	 */
	public function action_links( $actions ) {
		$actions['settings']  = '<a href="' . admin_url( 'admin.php' ) . '?page=fixedtoc">' . esc_html__( 'Settings', 'fixedtoc' ) . '</a>';
		$actions['customize'] = '<a href="' . admin_url( 'customize.php' ) . '">' . esc_html__( 'Customize', 'fixedtoc' ) . '</a>';

		return $actions;
	}

}