| 1 |
<?php if( ! defined( "ABSPATH" ) ) exit(); ?> |
| 2 |
|
| 3 |
<input type="hidden" name="wpfaction" value="antispam_settings_save"> |
| 4 |
|
| 5 |
<?php WPF()->settings->header( 'antispam' ); ?> |
| 6 |
|
| 7 |
<div class="wpf-subtitle"> |
| 8 |
<span class="dashicons dashicons-shield"></span> <?php _e( 'wpForo Spam Control', 'wpforo' ) ?> |
| 9 |
<p class="wpf-desc"></p> |
| 10 |
</div> |
| 11 |
|
| 12 |
<?php WPF()->settings->form_field( 'antispam', 'spam_filter' ); ?> |
| 13 |
<?php WPF()->settings->form_field( 'antispam', 'spam_user_ban' ); ?> |
| 14 |
<?php WPF()->settings->form_field( 'antispam', 'should_unapprove_after_report' ); ?> |
| 15 |
<?php WPF()->settings->form_field( 'antispam', 'spam_filter_level_topic' ); ?> |
| 16 |
<?php WPF()->settings->form_field( 'antispam', 'spam_filter_level_post' ); ?> |
| 17 |
|
| 18 |
<div class="wpf-subtitle"> |
| 19 |
<span class="dashicons dashicons-admin-users"></span> <?php _e( 'New Registered User', 'wpforo' ) ?> |
| 20 |
<p class="wpf-desc"><?php _e( |
| 21 |
'Some useful options to limit just registered users and minimize spam. These options don\'t affect users whose Usergroup has "Can edit member" and "Can pass moderation" permissions.', |
| 22 |
'wpforo' |
| 23 |
) ?></p> |
| 24 |
</div> |
| 25 |
<?php WPF()->settings->form_field( 'antispam', 'new_user_max_posts' ); ?> |
| 26 |
<?php WPF()->settings->form_field( 'antispam', 'unapprove_post_if_user_is_new' ); ?> |
| 27 |
<?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_edit_account' ); ?> |
| 28 |
<?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_attach' ); ?> |
| 29 |
<?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_link' ); ?> |
| 30 |
<?php WPF()->settings->form_field( 'antispam', 'limited_file_ext' ); ?> |
| 31 |
|
| 32 |
<div class="wpf-subtitle"> |
| 33 |
<span class="dashicons dashicons-performance"></span> <?php _e( 'Flood Protection', 'wpforo' ) ?> |
| 34 |
<p class="wpf-desc"><?php _e( |
| 35 |
'Prevent spam floods by limiting how many posts users can create within specific time windows. This helps detect and stop automated spam attacks and excessive posting.', |
| 36 |
'wpforo' |
| 37 |
) ?></p> |
| 38 |
</div> |
| 39 |
<?php WPF()->settings->form_field( 'antispam', 'flood_protection_enabled' ); ?> |
| 40 |
<?php WPF()->settings->form_field( 'antispam', 'flood_posts_per_minute' ); ?> |
| 41 |
<?php WPF()->settings->form_field( 'antispam', 'flood_posts_per_hour' ); ?> |
| 42 |
<?php WPF()->settings->form_field( 'antispam', 'flood_ip_protection_enabled' ); ?> |
| 43 |
<?php WPF()->settings->form_field( 'antispam', 'flood_posts_per_ip_hour' ); ?> |
| 44 |
<?php WPF()->settings->form_field( 'antispam', 'flood_action' ); ?> |
| 45 |
<?php WPF()->settings->form_field( 'antispam', 'flood_temp_ban_duration' ); ?> |
| 46 |
|
| 47 |
<div class="wpf-subtitle"> |
| 48 |
<span class="dashicons dashicons-paperclip"></span> <?php _e( 'Possible Spam Attachments', 'wpforo' ) ?> |
| 49 |
<p class="wpf-desc"><?php _e( |
| 50 |
'This tool is designed to find attachment which have been uploaded by spammers. The tool checks most common spammer filenames and suggest to delete but you should check one by one and make sure those are spam files before deleting.', |
| 51 |
'wpforo' |
| 52 |
) ?></p> |
| 53 |
</div> |
| 54 |
<?php WPF()->settings->form_field( 'antispam', 'spam_file_scanner' ); ?> |
| 55 |
<?php WPF()->settings->form_field( 'antispam', 'exclude_file_ext' ); ?> |
| 56 |
<div class="wpf-spam-attach"> |
| 57 |
<div class="wpf-spam-attach-dir"><?php _e( 'Directory', 'wpforo' ); ?>: <?php echo WPF()->folders['default_attachments']['dir'] ?> </div> |
| 58 |
<div style="margin-top:10px; clear:both;"> |
| 59 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
| 60 |
<tbody> |
| 61 |
<?php |
| 62 |
$default_attachments_dir = WPF()->folders['default_attachments']['dir']; |
| 63 |
if( is_dir( $default_attachments_dir ) && wpforo_setting( 'antispam', 'spam_file_scanner' ) ): |
| 64 |
if( $handle = opendir( $default_attachments_dir ) ): |
| 65 |
while( false !== ( $filename = readdir( $handle ) ) ): |
| 66 |
if( $filename == '.' || $filename == '..' ) continue; |
| 67 |
|
| 68 |
$level = 0; |
| 69 |
$color = ''; |
| 70 |
$file = $default_attachments_dir . DIRECTORY_SEPARATOR . $filename; |
| 71 |
$extension = strtolower( (string) pathinfo( $filename, PATHINFO_EXTENSION ) ); |
| 72 |
if( filesize( $file ) === 0 ) continue; |
| 73 |
if( ! $level = WPF()->moderation->spam_file( $filename ) ) continue; |
| 74 |
if( $level == 2 ) $color = 'style="color:#EE9900;"'; |
| 75 |
if( $level == 3 ) $color = 'style="color:#FF0000;"'; |
| 76 |
if( $level == 4 ) $color = 'style="color:#BB0000;"'; |
| 77 |
?> |
| 78 |
<tr> |
| 79 |
<td class="wpf-spam-item" <?php echo $color; ?> title="<?php echo WPF()->folders['default_attachments']['url'] . '/' . $filename ?>"> |
| 80 |
<?php if( WPF()->moderation->spam_file( $filename, 'file-open' ) ): ?> |
| 81 |
<a href="<?php echo WPF()->folders['default_attachments']['url'] . '/' . $filename ?>" target="_blank" <?php echo $color ?>><?php echo wpforo_text( |
| 82 |
$filename, |
| 83 |
50, |
| 84 |
false |
| 85 |
); ?></a> |
| 86 |
<?php else: ?> |
| 87 |
<?php echo $filename; ?> |
| 88 |
<?php endif; ?> |
| 89 |
<?php echo ' (' . strtoupper( $extension ) . ' | ' . wpforo_human_filesize( filesize( $file ), 1 ) . ')'; ?> |
| 90 |
</td> |
| 91 |
<td class="wpf-actions"><a href="<?php echo wp_nonce_url( |
| 92 |
admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_spam_file&sfname=' . urlencode( (string) $filename ) ), |
| 93 |
'wpforo_tools_antispam_files' |
| 94 |
); ?>" title="<?php _e( 'Delete this file', 'wpforo' ); ?>" |
| 95 |
onclick="return confirm('<?php _e( 'Are you sure you want to permanently delete this file?', 'wpforo' ); ?>');"><?php _e( |
| 96 |
'Delete', |
| 97 |
'wpforo' |
| 98 |
); ?></a></td> |
| 99 |
</tr> |
| 100 |
<?php |
| 101 |
endwhile; |
| 102 |
closedir( $handle ); |
| 103 |
endif; |
| 104 |
endif; |
| 105 |
?> |
| 106 |
<tr style="background:#fff;"> |
| 107 |
<td colspan="2" class="wpf-actions" style="padding-top:20px; text-align:right;"> |
| 108 |
<a href="<?php echo wp_nonce_url( |
| 109 |
admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=1' ), |
| 110 |
'wpforo_tools_antispam_files' |
| 111 |
); ?>" |
| 112 |
title="<?php _e( 'Click to delete Blue marked files', 'wpforo' ); ?>" |
| 113 |
onclick="return confirm('<?php _e( |
| 114 |
'Are you sure you want to delete all BLUE marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', |
| 115 |
'wpforo' |
| 116 |
); ?>');"> |
| 117 |
<?php _e( 'Delete All', 'wpforo' ); ?> |
| 118 |
</a> | |
| 119 |
<a href="<?php echo wp_nonce_url( |
| 120 |
admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=2' ), |
| 121 |
'wpforo_tools_antispam_files' |
| 122 |
); ?>" |
| 123 |
title="<?php _e( 'Click to delete Orange marked files', 'wpforo' ); ?>" |
| 124 |
style="color:#EE9900;" |
| 125 |
onclick="return confirm('<?php _e( |
| 126 |
'Are you sure you want to delete all ORANGE marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', |
| 127 |
'wpforo' |
| 128 |
); ?>');"> |
| 129 |
<?php _e( 'Delete All', 'wpforo' ); ?> |
| 130 |
</a> | |
| 131 |
<a href="<?php echo wp_nonce_url( |
| 132 |
admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=3' ), |
| 133 |
'wpforo_tools_antispam_files' |
| 134 |
); ?>" |
| 135 |
title="<?php _e( 'Click to delete Red marked files', 'wpforo' ); ?>" |
| 136 |
style="color:#FF0000;" |
| 137 |
onclick="return confirm('<?php _e( |
| 138 |
'Are you sure you want to delete all RED marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', |
| 139 |
'wpforo' |
| 140 |
); ?>');"> |
| 141 |
<?php _e( 'Delete All', 'wpforo' ); ?> |
| 142 |
</a> | |
| 143 |
<a href="<?php echo wp_nonce_url( |
| 144 |
admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=4' ), |
| 145 |
'wpforo_tools_antispam_files' |
| 146 |
); ?>" |
| 147 |
title="<?php _e( 'Click to delete Dark Red marked files', 'wpforo' ); ?>" |
| 148 |
style="color:#BB0000;" |
| 149 |
onclick="return confirm('<?php _e( |
| 150 |
'Are you sure you want to delete all DARK RED marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', |
| 151 |
'wpforo' |
| 152 |
); ?>');"> |
| 153 |
<?php _e( 'Delete All', 'wpforo' ); ?> |
| 154 |
</a> |
| 155 |
</td> |
| 156 |
</tr> |
| 157 |
</tbody> |
| 158 |
</table> |
| 159 |
</div> |
| 160 |
</div> |
| 161 |
|