# share-button/0.9/classes/class-install.php

Social Share Buttons, version 0.9. 85 lines.

- Page: https://pluginprobe.com/plugins/share-button/0.9/code/classes/class-install.php
- Raw: https://pluginprobe.com/plugins/share-button/0.9/raw/classes/class-install.php
- Modified: 2017-11-22T15:53:42+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/share-button/0.9/code/classes/class-install.php#L10-L20`.

```php
<?php
namespace MBSocial;
defined('ABSPATH') or die('No direct access permitted');

class Install
{
	protected static $issue;

	public static function getIssue()
	{
			if (! is_null(self::$issue))
				return self::$issue;

			return false;

	}

	public static function verifyPlugin()
	{
		$not_fatal = true;

		$status = static::checkMaxButtons();
		if (! $status)
		{
				self::$issue = 'no-maxclass';
				return false; // prevent loading
		}

		$version = self::check_mb_version();
		if ( ! $version )
			self::$issue = 'mb-wrong-version';

			return true;
	}

	protected static function checkMaxButtons()
	{
		if (! class_exists('MaxButtons\maxButtonsPlugin'))
		{
			add_action('admin_notices', array(__NAMESPACE__ . '\Install', 'noMaxButtons'));
			return false;
		}
		return true;
	}

	protected static function check_mb_version()
	{
		$result = version_compare( MAXBUTTONS_VERSION_NUM, MBSOCIAL_REQUIRED_MB );

		if ($result >= 0)
			return true;
		else
			return false;

	}

	public static function noMaxButtons()
	{

		$action = 'install-plugin';
		$slug = 'maxbuttons';
		$url = wp_nonce_url(
			add_query_arg(
				array(
				    'action' => $action,
				    'plugin' => $slug
				),
				admin_url( 'update.php' )
			),
			$action.'_'.$slug
		);


		$message = sprintf( __("MaxButtons Social Share requires MaxButtons, which doesn't seem to be active or installed","maxbuttons"), PHP_VERSION);
		echo"<div class='error'> <h4>$message</h4>
				<p><a href='$url'>" . __('Install MaxButtons Now','mbsocial') . "</a></p>
			</div>";
		return;

	}



}

```
