Changeset 120599
- Timestamp:
- 05/26/2009 04:13:25 PM (17 years ago)
- Location:
- delete-spam-daily
- Files:
-
- 4 added
- 2 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/delete-spam-daily.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/screenshot-1.png (added)
-
trunk/delete-spam-daily.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
delete-spam-daily/trunk/delete-spam-daily.php
r120453 r120599 4 4 Plugin URI: http://brockangelo.com/wordpress/plugins/delete-spam-daily/ 5 5 Description: Uses wp_cron to delete comments each day that are marked "spam" in the database. 6 Version: 1.0 6 Version: 1.0.1 7 7 Author: Brock Angelo 8 8 Author URI: http://brockangelo.com … … 24 24 */ 25 25 26 # uncomment the next line if you want it to delete spam upon activation. 27 # register_activation_hook(__FILE__, 'delete_spam_daily'); 28 29 add_action('delete_spam_daily', 'delete_spam_now'); 26 30 27 31 function dsd_start_schedule() { … … 39 43 40 44 echo $dsd_spam_count; 45 } 46 47 function reschedule_delete_spam() { 48 wp_reschedule_event( (time()+60), 'daily', 'delete_spam_daily'); 41 49 } 42 50 … … 59 67 dsd_stop_schedule(); 60 68 } 69 if(isset($_REQUEST['reschedule_delete_spam_button'])) { 70 reschedule_delete_spam(); 71 } 61 72 } 62 ?>63 73 64 <?php if ( !empty($_POST ) ) : ?> 65 <div id="message" class="updated fade"> 66 <strong>Settings updated</strong> 67 </div> 68 <?php endif; ?> 69 74 if ( !empty($_POST ) ) : ?> 75 <div id="message" class="updated fade"> 76 <strong>Settings updated</strong> 77 </div> 78 <?php endif; ?> 70 79 71 80 <div class="wrap"> … … 73 82 74 83 <p><?php if (wp_next_scheduled('delete_spam_daily') == NULL) 75 { echo "The schedule has not been started."; } 76 else { ?> 77 Next Spam Delete: <?php echo date("l, F j, Y @ h:i a",(wp_next_scheduled('delete_spam_daily'))); ?></p> 84 { 85 echo "The schedule has not been started."; 86 } 87 else 88 { ?> 89 Next Spam Delete: <?php echo date("l, F j, Y @ h:i a",(wp_next_scheduled('delete_spam_daily'))); ?></p> 78 90 <?php 79 } ?>91 } ?> 80 92 <p>Current Spam Count: <?php get_spam_count(); ?></p><br /><br /> 81 82 93 83 94 <?php … … 89 100 echo '<div><input id="delete_spam_now_button" type="submit" value="Delete spam now »" /></div>'; 90 101 echo "</form>\n<br />"; 91 92 102 93 103 if (wp_next_scheduled('delete_spam_daily') == NULL) … … 110 120 echo '<div><input id="stop_deleting_spam_button" type="submit" value="Stop Deleting Spam »" /></div>'; 111 121 echo "</form>\n"; 122 123 124 echo '<form name="reschedule_delete_spam_button" action="" method="post">'; 125 if ( function_exists('wp_nonce_field') ) 126 wp_nonce_field('delete_spam_daily'); 127 128 echo '<input type="hidden" name="reschedule_delete_spam_button" value="update" />'; 129 echo '<div><input id="reschedule_delete_spam_button" type="submit" value="Reschedule to start in 1 minute »" /> <i>Helpful for testing cron</i></div>'; 130 echo "</form>\n<br />"; 131 112 132 } 113 114 115 116 117 133 ?> 118 119 134 <br /> 120 135 <br /> 121 136 Deactivating this plugin will stop the schedule. <br /> 122 123 137 </div> 124 <?php 125 } 138 139 <?php 140 } 126 141 127 142 register_deactivation_hook(__FILE__, 'dsd_stop_schedule'); -
delete-spam-daily/trunk/readme.txt
r120453 r120599 5 5 Requires at least: 2.1.0 6 6 Tested up to: 2.7.1 7 Stable tag: 1.0 7 Stable tag: 1.0.1 8 8 9 9 Uses wp_cron to delete comments each day that are marked "spam" in the database.
Note: See TracChangeset
for help on using the changeset viewer.