yearginsm
Member
Posted 4 years ago #
Just for aesthetics, I modified the spamfree_stats() function. The extra <h3> takes up real-estate on the dashboard, and if the plugin has not yet blocked any spam, there isn't even a link back to its home page. Here's what I am running:
function spamfree_stats() {
$spamfree_count = get_option('spamfree_count');
if ( !$spamfree_count ) {
echo '<p>'.sprintf(__('<a href="%1$s" target="_blank">WP-SpamFree</a> has not yet blocked any spam comments.'), 'http://www.hybrid6.com/webgeek/plugins/wp-spamfree/' ).'</p>';
}
else {
echo '<p>'.sprintf(__('<a href="%1$s" target="_blank">WP-SpamFree</a> has blocked <strong>%2$s</strong> spam comments.'), 'http://www.hybrid6.com/webgeek/plugins/wp-spamfree/', number_format($spamfree_count) ).'</p>';
}
}
http://wordpress.org/extend/plugins/wp-spamfree/
yearginsm
Member
Posted 4 years ago #
Here is a Diff file for some other minor changes. I also ran the Javascript file through the WordPress wp_head() hooks to keep things nice and tidy.
1317d1316
< echo '<h3>WP-SpamFree</h3>';
1320c1319
< echo '<p>No comment spam attempts have been detected yet.</p>';
---
> echo '<p>'.sprintf(__('<a href="%1$s" target="_blank">WP-SpamFree</a> has not yet blocked any spam comments.'), 'http://www.hybrid6.com/webgeek/plugins/wp-spamfree/' ).'</p>';
1360c1359,1366
< add_action('wp_head', array(&$this, 'wp_head_intercept'));
---
>
> $wpSpamFreeVer=get_option('wp_spamfree_version');
> if ($wpSpamFreeVer!='') {
> $wpSpamFreeVerJS=' v'.$wpSpamFreeVer;
> }
>
> wp_enqueue_script('wp_spamfree', '/wp-content/plugins/wp-spamfree/js/wpSpamFreeJS.php', false, $wpSpamFreeVerJS);
>
1526,1539d1531
<
< function wp_head_intercept(){
< $wpSpamFreeVer=get_option('wp_spamfree_version');
< if ($wpSpamFreeVer!='') {
< $wpSpamFreeVerJS=' v'.$wpSpamFreeVer;
< }
< echo "\n";
< echo '<!-- WP-SpamFree'.$wpSpamFreeVerJS.' JS Code :: BEGIN -->'."\n";
< echo '<script type="text/javascript" src="'.get_option('siteurl').'/wp-content/plugins/wp-spamfree/js/wpSpamFreeJS.php"></script> '."\n";
< echo '<!-- WP-SpamFree'.$wpSpamFreeVerJS.' JS Code :: END -->'."\n";
< echo "\n";
< // Modified following line in 1.6.3
< // update_option( 'ak_count_pre', get_option('akismet_spam_count') );
< }
WebGeek
Member
Posted 4 years ago #
Hey yearginsm,
Thanks for your suggestions - I appreciate you taking the time to share this. I'll take a look at this as soon as I can. That H3 starts adding the extra real estate in WP 2.5...for Pre 2.5 versions it made sense, but not after that, so I'll add a mod in the next version to take care of it. Feel free to email me directly as well - my email is in the code for the plugin.