# cookiebot/3.10.0/addons/lib/theme-settings-service.php

Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA &amp; Google Consent Mode, version 3.10.0. 71 lines.

- Page: https://pluginprobe.com/plugins/cookiebot/3.10.0/code/addons/lib/theme-settings-service.php
- Raw: https://pluginprobe.com/plugins/cookiebot/3.10.0/raw/addons/lib/theme-settings-service.php
- Modified: 2021-03-23T11:49:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/cookiebot/3.10.0/code/addons/lib/theme-settings-service.php#L10-L20`.

```php
<?php

namespace cookiebot_addons\lib;

class Theme_Settings_Service extends Settings_Service {


	/**
	 * Returns true if the addon is installed
	 *
	 * @param $addon
	 *
	 * @return bool
	 *
	 * @since 1.3.0
	 */
	public function is_addon_installed( $addon ) {
		return wp_get_theme($addon)->exists();
	}

	/**
	 * Returns the addon version
	 *
	 * @param $addon
	 *
	 * @return bool
	 *
	 * @since 2.2.1
	 */
	public function get_addon_version( $addon ) {
		$theme = wp_get_theme($addon);
		if($theme->exists()) {
			return $theme->get('Version');
		}

		return false;
	}

	/**
	 * Returns true if the addon plugin is activated
	 *
	 * @param $addon
	 *
	 * @return bool
	 *
	 * @since 1.3.0
	 */
	public function is_addon_activated( $addon ) {
		if ( empty( $addon ) ) {
			return false;
		}

		$addon = strtolower( $addon );

		$addon_theme      = wp_get_theme( $addon );
		$addon_theme_name = strtolower( $addon_theme->get( 'Name' ) );
		$active_theme     = wp_get_theme();
		if ( $addon_theme_name === strtolower( $active_theme->get( 'Name' ) ) ) {
			return true;
		}

		$active_theme_parent = $active_theme->parent();
		if ( $active_theme_parent !== false && $addon_theme_name === strtolower( $active_theme_parent->get( 'Name' ) ) ) {
			return true;
		}

		return false;
	}

}

```
