function wpt_sidebar()
{
    ?>
	<div class="postbox-container jcd-narrow">
	<div class="metabox-holder">
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<?php 
    if (!function_exists('wpt_pro_exists')) {
        ?>
					<h3>
						<span><strong><?php 
        _e('Support WP to Twitter', 'wp-to-twitter');
        ?>
</strong></span></h3>
				<?php 
    } else {
        ?>
					<h3>
						<span><strong><?php 
        _e('WP to Twitter Support', 'wp-to-twitter');
        ?>
</strong></span></h3>
				<?php 
    }
    ?>
				<div class="inside resources">
					<p>
						<a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button"
						   data-size="small" data-related="joedolson">Follow @joedolson</a>
						<script>!function (d, s, id) {
								var js, fjs = d.getElementsByTagName(s)[0];
								if (!d.getElementById(id)) {
									js = d.createElement(s);
									js.id = id;
									js.src = "https://platform.twitter.com/widgets.js";
									fjs.parentNode.insertBefore(js, fjs);
								}
							}(document, "script", "twitter-wjs");</script>
					</p>
					<?php 
    if (function_exists('wpt_pro_exists')) {
        $support_url = admin_url('admin.php?page=wp-tweets-pro');
    } else {
        $support_url = admin_url('options-general.php?page=wp-to-twitter/wp-to-twitter.php');
    }
    ?>
					<a href="<?php 
    echo esc_url(add_query_arg('tab', 'support', $support_url));
    ?>
#get-support"><?php 
    _e("Get Support", 'wp-to-twitter');
    ?>
</a> &bull;
					<a href="https://www.joedolson.com/wp-content/uploads/wp-tweets-pro-users-guide-1.8.2.pdf"><?php 
    _e('Read the Manual', 'wp-to-twitter');
    ?>
</a>
					<?php 
    if (get_option('jd_donations') != 1 && !function_exists('wpt_pro_exists')) {
        ?>
						<p><?php 
        _e('<a href="https://www.joedolson.com/wp-tweets-pro/">Get WP Tweets Pro</a> or <a href="http://www.joedolson.com/donate.php">Make a donation</a> today!', 'wp-to-twitter');
        ?>
</p>
						<div class='donations'>
							<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
								<div>
									<input type="hidden" name="cmd" value="_s-xclick"/>
									<input type="hidden" name="hosted_button_id" value="8490399"/>
									<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
									       name="submit" alt="Donate"/>
									<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
									     height="1"/>
								</div>
							</form>
							<a href="http://flattr.com/thing/559528/WP-to-Twitter"><img
									src="http://api.flattr.com/button/flattr-badge-large.png"
									alt="Flattr WP to Twitter"/></a>
						</div>
					<?php 
    }
    ?>
				</div>
			</div>
		</div>
		
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<h3><?php 
    _e('Twitter Time Check', 'wp-to-twitter');
    ?>
</h3>

				<div class="inside server">
						<?php 
    wpt_do_server_check();
    ?>
				</div>
			</div>
		</div>

		<?php 
    if (get_option('wpt_rate_limiting') == 1) {
        ?>
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<h3><?php 
        _e('Monitor Rate Limiting', 'wp-to-twitter');
        ?>
</h3>

				<div class="inside server">		
					<?php 
        echo wpt_view_rate_limits();
        ?>
				</div>
			</div>
		</div>	
		<?php 
    }
    ?>
	</div>
<?php 
}
function wpt_sidebar()
{
    $context = !function_exists('wpt_pro_exists') ? 'free' : 'premium';
    ?>
	<div class="postbox-container jcd-narrow">
	<div class="metabox-holder">
		<div class="ui-sortable meta-box-sortables<?php 
    echo ' ' . $context;
    ?>
">
			<div class="postbox">
				<?php 
    if ($context == 'free') {
        ?>
					<h3>
						<span><strong><?php 
        _e('Support WP to Twitter', 'wp-to-twitter');
        ?>
</strong></span></h3>
				<?php 
    } else {
        ?>
					<h3>
						<span><strong><?php 
        _e('WP to Twitter Support', 'wp-to-twitter');
        ?>
</strong></span></h3>
				<?php 
    }
    ?>
				<div class="inside resources">
					<?php 
    if (get_option('jd_donations') != 1 && !function_exists('wpt_pro_exists')) {
        ?>
						<p class='cta'><?php 
        _e('<a href="https://www.joedolson.com/wp-tweets-pro/">Get WP Tweets Pro</a>', 'wp-to-twitter');
        ?>
</p>
					<?php 
    }
    ?>
					<p>
						<a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button"
						   data-size="small" data-related="joedolson">Follow @joedolson</a>
						<script>!function (d, s, id) {
								var js, fjs = d.getElementsByTagName(s)[0];
								if (!d.getElementById(id)) {
									js = d.createElement(s);
									js.id = id;
									js.src = "https://platform.twitter.com/widgets.js";
									fjs.parentNode.insertBefore(js, fjs);
								}
							}(document, "script", "twitter-wjs");</script>
					</p>
					<?php 
    if ($context == 'premium') {
        $support_url = admin_url('admin.php?page=wp-tweets-pro');
        $support = '<a href="' . esc_url(add_query_arg('tab', 'support', $support_url)) . '#get-support">' . __("Get Support", 'wp-to-twitter') . '</a> &bull;';
    } else {
        $support_url = false;
        $support = '';
    }
    echo $support;
    ?>
					<a href="https://www.joedolson.com/wp-content/uploads/wp-tweets-pro-users-guide-current.pdf"><?php 
    _e('Read the Manual', 'wp-to-twitter');
    ?>
</a>
				</div>
			</div>
		</div>
		
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<h3><?php 
    _e('Twitter Time Check', 'wp-to-twitter');
    ?>
</h3>

				<div class="inside server">
						<?php 
    wpt_do_server_check();
    ?>
				</div>
			</div>
		</div>
		
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<h3><?php 
    _e('Test WP to Twitter', 'wp-to-twitter');
    ?>
</h3>
				
				<div class="inside test">
				<p>
					<?php 
    _e('Check whether WP to Twitter is setup correctly for Twitter and your URL Shortener. The test sends a status update to Twitter and shortens a URL using your chosen shortener.', 'wp-to-twitter');
    ?>
				</p>
				<form method="post" action="">
					<fieldset>
						<input type="hidden" name="submit-type" value="check-support"/>
						<?php 
    $nonce = wp_nonce_field('wp-to-twitter-nonce', '_wpnonce', true, false) . wp_referer_field(false);
    echo "<div>{$nonce}</div>";
    ?>
						<p>
							<input type="submit" name="submit" value="<?php 
    _e('Test WP to Twitter', 'wp-to-twitter');
    ?>
" class="button-primary" />
						</p>
					</fieldset>
				</form>				
				</div>
			</div>
		</div>

		<?php 
    if (get_option('wpt_rate_limiting') == 1) {
        ?>
		<div class="ui-sortable meta-box-sortables">
			<div class="postbox">
				<h3><?php 
        _e('Monitor Rate Limiting', 'wp-to-twitter');
        ?>
</h3>

				<div class="inside server">		
					<?php 
        echo wpt_view_rate_limits();
        ?>
				</div>
			</div>
		</div>	
		<?php 
    }
    ?>
	</div>
<?php 
}