<?php
		/** function/method
		* Usage: hooking (registering) the plugin menu
		* Arg(0): null
		* Return: void
		*/
		function menu_buffer_single(){
		if ( is_admin() )
		add_submenu_page( 'spam-master', 'Spam Buffer', 'Spam Buffer', 'manage_options', 'spam-master-buffer', 'spam_master_buffer' );
		}

		///////////////////////
		// WORDPRESS ACTIONS //
		///////////////////////
		if( is_multisite() ) {
		add_action( 'admin_menu', 'menu_buffer_single' );
		}
		else{
		add_action( 'admin_menu', 'menu_buffer_single' );
		}

function spam_master_buffer(){
global $wpdb;

$plugin_master_name = constant('SPAM_MASTER_NAME');

?>
<div class="wrap">
<h1><?php echo $plugin_master_name; ?> Buffer</h1>

<table class="widefat" cellspacing="0">
	<thead>
		<tr>
			<th>
				<h2><img src="<?php echo plugins_url('../images/techgasp-minilogo-16.png', dirname(__FILE__)); ?>" style="float:left; height:18px; vertical-align:middle;" /><?php _e('&nbsp;Spam Buffer Threats', 'spam_master'); ?></h2>
				<p>Automatically collects Emails and Ip's detected as threats in Spam Master Online RBL Servers and stores them in your local website Spam Buffer. Works with the Firewall to prevent unauthorized or unwanted communications between dangerous hosts and your website. It saves precious bandwidth and keeps your website fast and clean.</p>
			</th>
		</tr>
		<tr>
			<th>
				<p>To remove Emails or Ip's from your local Spam Buffer use <b>Whitelist</b>. To remove Emails or Ip's from online RBL servers use <b>Remove RBL</b>. Ideally you should remove both. To add Emails or Ip's to your Spam Buffer use the bellow Add Threat to online RBL.</p>
			</th>
		</tr>
	</thead>

	<tfoot>
		<tr>
			<td></td>
		</tr>
	</tfoot>

	<tbody>
		<tr>
			<td class="alternate">
				<p><a href="https://spammaster.techgasp.com/add-threat/" target="_blank"><img src="<?php echo plugins_url('../images/check-pass.png', dirname(__FILE__)); ?>" style="height:24px; vertical-align:middle;" > Add RBL</a> <a href="https://spammaster.techgasp.com/remove-threat/" target="_blank"><img src="<?php echo plugins_url('../images/check-fail.png', dirname(__FILE__)); ?>" style="height:24px; vertical-align:middle;" > Remove RBL</a> <a href="https://spammaster.techgasp.com/search-threat/" target="_blank"><a href="https://spammaster.techgasp.com/search-threat/" target="_blank"><img src="<?php echo plugins_url('../images/check-threat.png', dirname(__FILE__)); ?>" style="height:24px; vertical-align:middle;" > Search RBL</a></p>
			</td>
		</tr>
	</tbody>
</table>

<br>

<?php
if(!class_exists('spam_master_buffer_table')){
	require_once( WP_PLUGIN_DIR . '/spam-master/includes/buffer/spam-master-admin-buffer-table.php');
}
//Prepare Table of elements
$wp_list_table = new spam_master_buffer_table();
$wp_list_table->prepare_items();
?>
<form method="get">
<input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?>" />
<?php
$wp_list_table->search_box('search', '-search-input');
//Table of elements
$wp_list_table->display();
?>
</form>

<br>

<h2>IMPORTANT: Makes no use of Javascript or Ajax to keep your website fast and conflicts free</h2>

<div style="background: url(<?php echo plugins_url('../images/techgasp-hr.png', dirname(__FILE__)); ?>) repeat-x; height: 10px"></div>
<br>
<p>
<a class="button-secondary" href="https://wordpress.techgasp.com" target="_blank" title="Visit Website">More TechGasp Plugins</a>
<a class="button-secondary" href="https://www.techgasp.com/support/" target="_blank" title="TechGasp Support">TechGasp Support</a>
<a class="button-primary" href="https://wordpress.techgasp.com/spam-master/" target="_blank" title="Visit Website"><?php echo $plugin_master_name; ?> Info</a>
<a class="button-primary" href="https://wordpress.techgasp.com/spam-master-documentation/" target="_blank" title="Visit Website"><?php echo $plugin_master_name; ?> Documentation</a>
<a class="button-primary" href="https://wordpress.org/plugins/spam-master/" target="_blank" title="Visit Website">RATE US *****</a>
</p>
</div>
<?php
}
