HEX
Server: Apache/2
System: Linux vpslll9m.sdns.vn 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
User: thuexe247c (1044)
PHP: 7.4.33
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/thuexe247c/public_html/wp-content/plugins/webmaster-user-role/includes/class-pro.php
<?php
require_once __DIR__ . '/themes/avian-theme-module.php';
require_once __DIR__ . '/themes/avada-theme-module.php';
require_once __DIR__ . '/themes/boss-theme-module.php';
require_once __DIR__ . '/themes/canvas-theme-module.php';
require_once __DIR__ . '/themes/cardinal-theme-module.php';
require_once __DIR__ . '/themes/divi-theme-module.php';
require_once __DIR__ . '/themes/enfold-theme-module.php';
require_once __DIR__ . '/themes/genesis-theme-module.php';
require_once __DIR__ . '/themes/invicta-theme-module.php';
require_once __DIR__ . '/themes/nativechurch-theme-module.php';
require_once __DIR__ . '/themes/ken-theme-module.php';
require_once __DIR__ . '/themes/kallyas-theme-module.php';
require_once __DIR__ . '/themes/total-theme-module.php';
require_once __DIR__ . '/themes/transport-theme-module.php';

if ( ! class_exists( 'SCD_Pro' ) ) {
	class SCD_Pro {

		public $config;
		public $plugin;

		function __construct( $plugin ) {
			$this->plugin = $plugin;
			$this->hooks();
		}

		public function hooks() {
			add_action( 'admin_init', array( $this, 'maybe_update_caps_on_settings_changed' ) );
			add_action( 'updated_option', array( $this, 'maybe_update_caps_on_plugin_installed' ), 10, 3 );

			$plugin_relative_path = basename( dirname( Simple_Client_Dashboard::file ) ) . '/' . basename( Simple_Client_Dashboard::file );
			add_filter( 'plugin_action_links_' . $plugin_relative_path, array( $this, 'add_action_links' ) );
		}

		public function add_action_links( $links ) {
			if ( empty( $links ) ) {
				$links = array();
			}
			return array_merge(
				array(
					'settings' => '<a href="' . admin_url( 'options-general.php?page=simple-client-dashboard' ) . '">' . __( 'Settings', 'webmaster-user-role' ) . '</a>',
				),
				$links
			);
		}

		public function maybe_update_caps_on_settings_changed() {
			$webmaster_user_role_config = $this->plugin->settings->get();

			$last_caps_update = get_site_option( 'td-webmaster-last-caps-update' );
			if ( is_array( $webmaster_user_role_config ) && ! empty( $webmaster_user_role_config['last_updated'] ) && $last_caps_update != $webmaster_user_role_config['last_updated'] ) {
				$this->plugin->update_webmaster_caps();
				update_site_option( 'td-webmaster-last-caps-update', $webmaster_user_role_config['last_updated'] );
			}
		}


		public function maybe_update_caps_on_plugin_installed( $option, $old_value, $value ) {
			if ( empty( $option ) || $option !== 'active_plugins' ) {
				return;
			}

			// TODO check specifially for plugins we're integrating with
			$this->plugin->update_webmaster_caps();
		}
	}
}