PluginProbe
wpForo Forum / 2.3.0
wpForo Forum v2.3.0
3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 All 137 releases
wpforo / admin / settings / antispam.php

antispam.php in wpForo Forum 2.3.0, at admin/settings/antispam.php

103 lines 7.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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', 'spam_filter_level_topic' ); ?>
15 <?php WPF()->settings->form_field( 'antispam', 'spam_filter_level_post' ); ?>
16
17 <div class="wpf-subtitle">
18 <span class="dashicons dashicons-admin-users"></span> <?php _e( 'New Registered User', 'wpforo' ) ?>
19 <p class="wpf-desc"><?php _e( '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.', 'wpforo' ) ?></p>
20 </div>
21 <?php WPF()->settings->form_field( 'antispam', 'new_user_max_posts' ); ?>
22 <?php WPF()->settings->form_field( 'antispam', 'unapprove_post_if_user_is_new' ); ?>
23 <?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_edit_account' ); ?>
24 <?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_attach' ); ?>
25 <?php WPF()->settings->form_field( 'antispam', 'min_number_posts_to_link' ); ?>
26 <?php WPF()->settings->form_field( 'antispam', 'limited_file_ext' ); ?>
27
28 <div class="wpf-subtitle">
29 <span class="dashicons dashicons-paperclip"></span> <?php _e( 'Possible Spam Attachments', 'wpforo' ) ?>
30 <p class="wpf-desc"><?php _e( '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.', 'wpforo' ) ?></p>
31 </div>
32 <?php WPF()->settings->form_field( 'antispam', 'spam_file_scanner' ); ?>
33 <?php WPF()->settings->form_field( 'antispam', 'exclude_file_ext' ); ?>
34 <div class="wpf-spam-attach">
35 <div class="wpf-spam-attach-dir"><?php _e( 'Directory', 'wpforo' ); ?>: <?php echo WPF()->folders['default_attachments']['dir'] ?>&nbsp;</div>
36 <div style="margin-top:10px; clear:both;">
37 <table width="100%" border="0" cellspacing="0" cellpadding="0">
38 <tbody>
39 <?php
40 $default_attachments_dir = WPF()->folders['default_attachments']['dir'];
41 if( is_dir( $default_attachments_dir ) && wpforo_setting( 'antispam', 'spam_file_scanner' ) ):
42 if( $handle = opendir( $default_attachments_dir ) ):
43 while( false !== ( $filename = readdir( $handle ) ) ):
44 if( $filename == '.' || $filename == '..' ) continue;
45
46 $level = 0;
47 $color = '';
48 $file = $default_attachments_dir . DIRECTORY_SEPARATOR . $filename;
49 $extension = strtolower((string) pathinfo( $filename, PATHINFO_EXTENSION ) );
50 if( ! $level = WPF()->moderation->spam_file( $filename ) ) continue;
51 if( $level == 2 ) $color = 'style="color:#EE9900;"';
52 if( $level == 3 ) $color = 'style="color:#FF0000;"';
53 if( $level == 4 ) $color = 'style="color:#BB0000;"';
54 ?>
55 <tr>
56 <td class="wpf-spam-item" <?php echo $color; ?> title="<?php echo WPF()->folders['default_attachments']['url'] . '/' . $filename ?>">
57 <?php if( WPF()->moderation->spam_file( $filename, 'file-open' ) ): ?>
58 <a href="<?php echo WPF()->folders['default_attachments']['url'] . '/' . $filename ?>" target="_blank" <?php echo $color ?>><?php echo wpforo_text( $filename, 50, false ); ?></a>
59 <?php else: ?>
60 <?php echo $filename; ?>
61 <?php endif; ?>
62 <?php echo ' (' . strtoupper( $extension ) . ' | ' . wpforo_human_filesize( filesize( $file ), 1 ) . ')'; ?>
63 </td>
64 <td class="wpf-actions"><a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_spam_file&sfname=' . urlencode( (string) $filename ) ), 'wpforo_tools_antispam_files' ); ?>" title="<?php _e( 'Delete this file', 'wpforo' ); ?>" onclick="return confirm('<?php _e( 'Are you sure you want to permanently delete this file?', 'wpforo' ); ?>');"><?php _e( 'Delete', 'wpforo' ); ?></a></td>
65 </tr>
66 <?php
67 endwhile;
68 closedir( $handle );
69 endif;
70 endif;
71 ?>
72 <tr style="background:#fff;">
73 <td colspan="2" class="wpf-actions" style="padding-top:20px; text-align:right;">
74 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=1' ), 'wpforo_tools_antispam_files' ); ?>"
75 title="<?php _e( 'Click to delete Blue marked files', 'wpforo' ); ?>"
76 onclick="return confirm('<?php _e( '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.', 'wpforo' ); ?>');">
77 <?php _e( 'Delete All', 'wpforo' ); ?>
78 </a> |
79 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=2' ), 'wpforo_tools_antispam_files' ); ?>"
80 title="<?php _e( 'Click to delete Orange marked files', 'wpforo' ); ?>"
81 style="color:#EE9900;"
82 onclick="return confirm('<?php _e( '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.', 'wpforo' ); ?>');">
83 <?php _e( 'Delete All', 'wpforo' ); ?>
84 </a> |
85 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=3' ), 'wpforo_tools_antispam_files' ); ?>"
86 title="<?php _e( 'Click to delete Red marked files', 'wpforo' ); ?>"
87 style="color:#FF0000;"
88 onclick="return confirm('<?php _e( '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.', 'wpforo' ); ?>');">
89 <?php _e( 'Delete All', 'wpforo' ); ?>
90 </a> |
91 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=antispam&wpfaction=delete_all_spam_files&level=4' ), 'wpforo_tools_antispam_files' ); ?>"
92 title="<?php _e( 'Click to delete Dark Red marked files', 'wpforo' ); ?>"
93 style="color:#BB0000;"
94 onclick="return confirm('<?php _e( '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.', 'wpforo' ); ?>');">
95 <?php _e( 'Delete All', 'wpforo' ); ?>
96 </a>
97 </td>
98 </tr>
99 </tbody>
100 </table>
101 </div>
102 </div>
103