MOON
Server: Apache
System: Linux server.netcommlabs.in 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64
User: dermova (1051)
PHP: 5.4.45
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/dermova/www/india/wp-content/plugins/google-analytics-for-wordpress/includes/class-utils.php
<?php

class Yoast_GA_Utils {

	/**
	 * Check if WordPress SEO or WordPress SEO Premium is active
	 *
	 * @return bool
	 */
	public static function wp_seo_active() {
		$wp_seo_active = false;

		//Makes sure is_plugin_active is available when called from front end
		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
		if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) {
			$wp_seo_active = true;
		}

		return $wp_seo_active;
	}

	/**
	 * Calculate the date difference, return the amount of hours between the two dates
	 *
	 * @param $last_run datetime
	 * @param $now      datetime
	 *
	 * @return int
	 */
	public static function hours_between( $last_run, $now ) {
		$seconds = max( ( $now - $last_run ), 1 );
		$hours   = $seconds / 3600;

		return floor( $hours );
	}

}