Plugin Directory

Changeset 1553953


Ignore:
Timestamp:
12/13/2016 07:43:00 PM (9 years ago)
Author:
WPMUDEV
Message:

2.2

Location:
anti-splog/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • anti-splog/trunk/anti-splog.php

    r1368748 r1553953  
    66Author: WPMU DEV
    77Author URI: http://premium.wpmudev.org/
    8 Version: 2.1.8
     8Version: 2.2
    99Network: true
    1010WDP ID: 120
     
    859859    global $ust_admin_url, $wp_version;
    860860
    861     $page = add_menu_page( __( 'Anti-Splog', 'ust' ), __( 'Anti-Splog', 'ust' ), 'manage_sites', 'ust', 'ust_admin_moderate', plugins_url( '/anti-splog/includes/icon-small.png' ) );
     861    $page = add_menu_page( __( 'Anti-Splog', 'ust' ), __( 'Anti-Splog', 'ust' ), 'manage_sites', 'ust', 'ust_admin_moderate', 'dashicons-shield' );
    862862    $page = add_submenu_page( 'ust', __( 'Site Moderation', 'ust' ), __( 'Moderation', 'ust' ), 'manage_sites', 'ust', 'ust_admin_moderate' );
    863863
     
    10921092        }
    10931093
    1094     } else if ( $ust_settings['signup_protect'] == 'asirra' ) {
    1095 
    1096         require_once( 'includes/asirra.php' );
    1097         $asirra = new AsirraValidator( $_POST['Asirra_Ticket'] );
    1098         if ( ! $asirra->passed ) {
    1099             $content['errors']->add( 'asirra', __( "Please try to correctly identify the cats again.", 'ust' ) );
    1100         }
    1101 
    11021094    } else if ( $ust_settings['signup_protect'] == 'questions' ) {
    11031095
     
    11491141        if ( ! $resp ) {
    11501142            $bp->signup->errors['recaptcha'] = __( "The reCAPTCHA wasn't entered correctly. Please try again.", 'ust' );
    1151         }
    1152 
    1153     } else if ( $ust_settings['signup_protect'] == 'asirra' ) {
    1154 
    1155         require_once( 'includes/asirra.php' );
    1156         $asirra = new AsirraValidator( $_POST['Asirra_Ticket'] );
    1157         if ( ! $asirra->passed ) {
    1158             $bp->signup->errors['asirra'] = __( "Please try to correctly identify the cats again.", 'ust' );
    11591143        }
    11601144
  • anti-splog/trunk/includes/admin_templates/moderate.php

    r1204296 r1553953  
    9898
    9999<div class="wrap">
    100     <div class="icon32"><img src="<?php echo plugins_url( '/anti-splog/includes/icon-large.png' ); ?>"/></div>
    101100    <h2><?php _e( 'Anti-Splog', 'ust' ) ?></h2>
    102101    <h3 class="nav-tab-wrapper">
  • anti-splog/trunk/includes/admin_templates/patterns.php

    r1019799 r1553953  
    8080?>
    8181<div class="wrap">
    82 <div class="icon32"><img src="<?php echo plugins_url( '/anti-splog/includes/icon-large.png' ); ?>"/></div>
    8382<h2><?php _e( 'Anti-Splog Pattern Matching', 'ust' ) ?></h2>
    8483
  • anti-splog/trunk/includes/admin_templates/settings.php

    r1368748 r1553953  
    9999?>
    100100<div class="wrap">
    101 <div class="icon32"><img src="<?php echo plugins_url( '/anti-splog/includes/icon-large.png' ); ?>"/></div>
    102101<h2><?php _e( 'Anti-Splog Settings', 'ust' ) ?></h2>
    103102
     
    286285                <td>
    287286                    <select name="ust[signup_protect]" id="ust_signup_protect">
    288                         <option value="none" <?php if ( $ust_settings['signup_protect'] == 'none' ) {
    289                             echo 'selected="selected"';
    290                         } ?>><?php _e( 'None', 'ust' ) ?></option>
    291                         <option value="questions" <?php if ( $ust_settings['signup_protect'] == 'questions' ) {
    292                             echo 'selected="selected"';
    293                         } ?>><?php _e( 'Admin Defined Questions', 'ust' ) ?></option>
    294                         <option value="asirra" <?php if ( $ust_settings['signup_protect'] == 'asirra' ) {
    295                             echo 'selected="selected"';
    296                         } ?>><?php _e( 'ASIRRA - Pick the Cats', 'ust' ) ?></option>
    297                         <option value="recaptcha" <?php if ( $ust_settings['signup_protect'] == 'recaptcha' ) {
    298                             echo 'selected="selected"';
    299                         } ?>><?php _e( 'reCAPTCHA - Advanced Captcha', 'ust' ) ?></option>
     287                        <option value="none" <?php selected( $ust_settings['signup_protect'], 'none' ); ?>><?php _e( 'None', 'ust' ) ?></option>
     288                        <option value="recaptcha" <?php selected( $ust_settings['signup_protect'], 'recaptcha' ); ?>><?php _e( 'reCAPTCHA - Advanced Captcha', 'ust' ) ?></option>
     289                        <option value="questions" <?php selected( $ust_settings['signup_protect'], 'questions' ); ?>><?php _e( 'Admin Defined Questions', 'ust' ) ?></option>
    300290                    </select>
    301291                    <br/><em><?php _e( 'These options are designed to prevent automated spam bot signups, so will have limited effect in stopping human sploggers. Be cautious using these options as it is important to find a balance between stopping bots and not annoying your users.', 'ust' ); ?></em>
     
    306296            <?php do_action( 'ust_settings' ); ?>
    307297        </table>
    308     </div>
    309 </div>
    310 
    311 <div class="postbox">
    312     <h3 class='hndle'><span><?php _e( 'Assira', 'ust' ) ?></span></h3>
    313 
    314     <div class="inside">
    315         <p><?php _e( 'Asirra works by asking users to identify photographs of cats and dogs. This task is difficult for computers, but user studies have shown that people can accomplish it quickly and accurately. Many even think it\'s fun!. <a href="http://research.microsoft.com/en-us/um/redmond/projects/asirra/default.aspx" target="_blank">Read more and try a demo here.</a> You must have the cURL extension enabled in PHP to use this. There are no configuration options for Assira.', 'ust' ) ?></p>
    316298    </div>
    317299</div>
  • anti-splog/trunk/includes/admin_templates/stats.php

    r1019799 r1553953  
    266266</script>
    267267<div class="wrap">
    268     <div class="icon32"><img src="<?php echo plugins_url( '/anti-splog/includes/icon-large.png' ); ?>"/></div>
    269268    <h2><?php _e( 'Anti-Splog Statistics', 'ust' ) ?></h2>
    270269
  • anti-splog/trunk/includes/blog-suspended-template.php

    r1261386 r1553953  
    55//don't display spam form if archived
    66if ( $current_blog->archived == '1' ) {
    7     wp_die( __( 'This blog has been archived.' ) );
     7    if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
     8        return WP_CONTENT_DIR . '/blog-suspended.php';
     9    else
     10        wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
    811}
    912
     
    1922//process form
    2023$email_sent = $error1 = $error2 = $reason = false;
    21 if ( isset( $_POST['spam-submit'] ) && ! get_option( 'ust_email_sent' ) ) {
     24if ( isset( $_POST['wp-submit'] ) && ! get_option( 'ust_email_sent' ) ) {
    2225    $reason = wp_filter_nohtml_kses( stripslashes( trim( $_POST['reason'] ) ) );
    2326
     
    4043        $user_email      = get_option( 'admin_email' );
    4144        $review_url      = $ust_admin_url . "&tab=splogs&bid=$blog_id";
    42         $unspam_url      = network_admin_url( "edit.php?action=confirm&action2=unspamblog&id=$blog_id&ref=" . urlencode( $ust_admin_url ) . "&msg=" . urlencode( sprintf( __( "You are about to unspam the blog %s" ), get_bloginfo( 'name' ) ) ) );
    4345        $message_headers = "MIME-Version: 1.0\n" . "From: $user_email\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
    4446        $subject         = sprintf( __( 'Splog Review Request: %s', 'ust' ), get_bloginfo( 'url' ) );
    4547        $message         = sprintf( __( "Someone is disputing the spam status for the blog %s (%s).\nHere is their reason:\n_______________________\n\n%s\n\n_______________________\n", 'ust' ), get_bloginfo( 'name' ), get_bloginfo( 'url' ), $reason );
    4648        $message .= sprintf( __( "Review: %s\n", 'ust' ), $review_url );
    47         $message .= sprintf( __( "Unspam: %s\n", 'ust' ), $unspam_url );
    4849        wp_mail( $admin_email, $subject, $message, $message_headers );
    4950
     
    5657$auto_spammed = get_option( 'ust_auto_spammed' );
    5758
     59
     60//fixes css urls to be from home site so they are not blocked
     61function override_css_url( $url ) {
     62    return str_replace( site_url( '/' ), network_site_url( '/' ), $url );
     63}
     64add_filter( 'style_loader_src', 'override_css_url' );
     65
    5866/**
    5967 * Output the login page header.
    6068 *
    61  * @param string $title Optional. WordPress Log In Page title to display in <title> element. Default 'Log In'.
    62  * @param string $message Optional. Message to display in header. Default empty.
     69 * @param string   $title    Optional. WordPress Log In Page title to display in <title> element. Default 'Log In'.
     70 * @param string   $message Optional. Message to display in header. Default empty.
    6371 * @param WP_Error $wp_error Optional. The error to pass. Default empty.
    6472 */
     
    8694<!--<![endif]-->
    8795<head>
    88     <meta http-equiv="Content-Type"
    89           content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>"/>
    90     <title><?php bloginfo( 'name' ); ?> &rsaquo; <?php echo $title; ?></title>
     96    <meta http-equiv="Content-Type"
     97          content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>"/>
     98    <title><?php bloginfo( 'name' ); ?> &rsaquo; <?php echo $title; ?></title>
    9199    <?php
    92100
     
    125133        $classes[] = 'interim-login';
    126134        ?>
    127         <style type="text/css">html {
    128                 background-color: transparent;
    129             }</style>
     135
    130136        <?php
    131137
     
    141147     * @since 3.5.0
    142148     *
    143      * @param array $classes An array of body classes.
    144      * @param string $action The action that brought the visitor to the login page.
     149     * @param array  $classes An array of body classes.
     150     * @param string $action  The action that brought the visitor to the login page.
    145151     */
    146152    $classes = apply_filters( 'login_body_class', $classes, $action );
    147153
    148154    ?>
     155    <style type="text/css">#login { width: 350px; }</style>
    149156</head>
    150157<body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
    151158<div id="login">
    152     <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"
    153            tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
     159    <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"
     160           tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
    154161    <?php
    155162
     
    215222     * @param string $input_id Which input to auto-focus
    216223     */
    217     function login_footer($input_id = '') {
     224    function login_footer( $input_id = '' ) {
    218225    ?>
    219226
     
    244251
    245252<style type="text/css" media="screen">
    246     #login form p {
    247         margin-bottom: 5px;
    248     }
    249 
    250     #reCAPTCHA {
    251         margin-left: -10px;
    252     }
    253 
    254     p.error {
    255         border: 1px solid red;
    256         padding: 5px;
    257     }
     253    #login form p {
     254        margin-bottom: 5px;
     255    }
     256
     257    #reCAPTCHA {
     258        margin-left: -10px;
     259    }
     260
     261    p.error {
     262        border: 1px solid red;
     263        padding: 5px;
     264    }
    258265</style>
    259266
     
    263270    <?php if ( $email_sent ) { ?>
    264271
    265         <p><?php _e( 'Your message has been sent. We will review it shortly.', 'ust' ); ?></p>
     272        <p><?php _e( 'Your message has been sent. We will review it shortly.', 'ust' ); ?></p>
    266273
    267274    <?php } else { ?>
    268275        <?php if ( $auto_spammed ) { ?>
    269             <p><?php _e( 'Our automated filters have determined that this blog signup looks like it could be by a spammer. Because of this, to complete you registration please describe in one or two sentences what you intend to use this blog for in the form below and we will review your request. Thank you for your cooperation!', 'ust' ); ?></p>
     276            <p><?php _e( 'Our automated filters have determined that this blog signup looks like it could be by a spammer. Because of this, to complete you registration please describe in one or two sentences what you intend to use this blog for in the form below and we will review your request. Thank you for your cooperation!', 'ust' ); ?></p>
    270277        <?php } else { ?>
    271             <p><?php _e( 'Sorry, but this blog has been marked as spam as defined in our Terms of Service.', 'ust' ); ?></p>
     278            <p><?php _e( 'Sorry, but this blog has been marked as spam as defined in our Terms of Service.', 'ust' ); ?></p>
    272279        <?php } ?>
    273280
    274281        <?php if ( ! get_option( 'ust_email_sent' ) ) { ?>
    275282            <?php if ( ! $auto_spammed ) { ?>
    276                 <p><?php _e( 'If you believe this decision was made in error you may contact us with your <strong>detailed</strong> reasons using the form below:', 'ust' ); ?></p>
     283                <p><?php _e( 'If you believe this decision was made in error you may contact us with your <strong>detailed</strong> reasons using the form below:', 'ust' ); ?></p>
    277284            <?php }
    278285            echo $error1; ?>
    279             <p>
    280                 <label><?php _e( 'Reason:', 'ust' ) ?><br/>
    281                     <textarea name="reason" style="width: 100%" rows="5"
    282                               tabindex="20"><?php echo esc_textarea( $reason ); ?></textarea></label>
    283             </p>
     286            <p>
     287                <label><?php _e( 'Reason:', 'ust' ) ?><br/>
     288                    <textarea name="reason" style="width: 100%" rows="5"
     289                              tabindex="20"><?php echo esc_textarea( $reason ); ?></textarea></label>
     290            </p>
    284291            <?php
    285292            $recaptcha = get_site_option( 'ust_recaptcha' );
     
    287294            if ( $recaptcha['privkey'] ) {
    288295                echo '<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
    289                 echo '<p><label>' . __( 'Human Verification:', 'ust' ) . '</label></p>';
    290296                echo $error2;
    291297                echo '<div class="g-recaptcha" data-sitekey="' . esc_attr( $recaptcha['pubkey'] ) . '" data-theme="' . esc_attr( $recaptcha['theme'] ) . '"></div>';
     
    293299            }
    294300            ?>
    295             <br class="clear"/>
    296             <p class="submit"><input type="submit" name="wp-submit" id="wp-submit"
    297                                      class="button button-primary button-large"
    298                                      value="<?php _e( 'Submit', 'ust' ); ?>"/></p>
     301            <br class="clear"/>
     302            <p class="submit"><input type="submit" name="wp-submit" id="wp-submit"
     303                                     class="button button-primary button-large"
     304                                     value="<?php _e( 'Submit', 'ust' ); ?>"/></p>
    299305        <?php } else { ?>
    300             <p><?php _e( 'The admin has already been contacted to review.', 'ust' ); ?></p>
    301         <?php
     306            <p><?php _e( 'The admin has already been contacted to review.', 'ust' ); ?></p>
     307            <?php
    302308        }
    303309    } ?>
  • anti-splog/trunk/readme.txt

    r1547754 r1553953  
    6666* Changing the signup page location
    6767* Random user defined questions
    68 * ASSIRA - picking the cat pictures
    6968* reCAPTCHA
    7069* Moderation Queues
     
    82813. Changing the signup page location every 24 hours
    83824. Random user defined questions
    84 5. ASSIRA - picking the cat pictures
     835. ASSIRA - no longer available
    85846. reCAPTCHA protection
    86857. Recent splogs queue, notice all the instant actions!
     
    9493
    9594== Changelog ==
     95
     96= 2.2 =
     97* Remove Assira signup protection option that has been discontinued by Microsoft
     98* Fix spammed site form not sending reviews
     99* Fix missing styles on spammed site form in subdir installs
     100* Remove invalid unspam link from review emails
    96101
    97102= 2.1.8 =
Note: See TracChangeset for help on using the changeset viewer.