WordPress.org

Plugin Directory

Changeset 1538907


Ignore:
Timestamp:
11/23/16 07:23:51 (5 months ago)
Author:
bmarshall511
Message:

Version 3.0.3 bug fixes and minor improvement.

Location:
zero-spam/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • zero-spam/trunk/lib/ZeroSpam/Admin.php

    r1538744 r1538907  
    55  public function run() { 
    66    // Merge and update new changes 
    7     if ( isset( $_POST['zerospam_general_settings'] ) ) { 
     7    if ( isset( $_POST['zerospam_general_settings'] ) ) 
     8    { 
    89      $saved_settings = array(); 
    910      foreach ( $this->default_settings as $key => $val ) { 
    10         if ( isset( $_POST['zerospam_general_settings'][$key] ) ) { 
    11           $saved_settings[$key] = $_POST['zerospam_general_settings'][$key]; 
     11        if ( ! empty( $_POST['zerospam_general_settings'][ $key ] ) ) 
     12        { 
     13          $saved_settings[ $key ] = $_POST['zerospam_general_settings'][ $key ]; 
    1214        } else { 
    13           $saved_settings[$key] = 0; 
     15          $saved_settings[ $key ] = 0; 
    1416        } 
    1517      } 
     
    442444      <input type="checkbox" id="log_spammers" name="zerospam_general_settings[log_spammers]" value="1" <?php if( isset( $this->settings['log_spammers'] ) ) : checked( $this->settings['log_spammers'] ); endif; ?> /> <?php echo __( 'Enabled', 'zerospam' ); ?> 
    443445    </label> 
    444  
    445     <p class="description"><?php echo __( 'If you are using CloudFlare, disable this option. Follow <a href="https://wphuman.com/blocking-spam-zero-spam/" target="_blank">this guide</a> to let CloudFlare blacklist spammers.', 'zerospam' ); ?> 
    446446    <?php 
    447447  } 
     
    517517   */ 
    518518  public function load_zerospam_settings() { 
    519     // We don't need to check $pagenow `cause we called this with load-$hook_suffix 
    520     // if ( ! function_exists('get_current_screen') || 
    521     //   ! get_current_screen() || 
    522     //   ! in_array(get_current_screen()->base, array('settings_page_zerospam', 'settings_page_zerospam-network')) ) { 
    523     //   return false; 
    524     // } 
    525  
    526519    wp_enqueue_style( 'zerospam-admin', plugins_url( 'css/style.css', ZEROSPAM_PLUGIN ) ); 
    527520    wp_enqueue_script( 'zerospam-charts', plugins_url( 'js/charts.js', ZEROSPAM_PLUGIN ), array( 'jquery' ) ); 
  • zero-spam/trunk/lib/ZeroSpam/Install.php

    r1538744 r1538907  
    174174 
    175175      // Set the updated plugin DB version. 
    176       update_option( 'zerospam_db_version', $this->db_version ); 
     176      update_option( 'zerospam_db_version', self::DB_VERSION ); 
    177177    } 
    178178  } 
  • zero-spam/trunk/lib/ZeroSpam/Plugin.php

    r1538761 r1538907  
    101101 
    102102  public function load_settings() { 
    103     // Retrieve the settings. 
    104     $settings = zerospam_settings(); 
    105     foreach ( $this->default_settings as $key => $val ) { 
    106       if ( ! isset( $settings[$key] ) ) { 
    107         if ( is_bool( $val ) ) { 
    108           $settings[$key] = 0; 
    109         } else { 
    110           $settings[$key] = $val; 
    111         } 
    112       } 
    113     } 
    114  
    115     $this->settings = $settings; 
     103    $this->settings = zerospam_settings(); 
    116104  } 
    117105 
  • zero-spam/trunk/lib/ZeroSpam/Scripts.php

    r1538787 r1538907  
    4646 
    4747  public function register_scripts() { 
    48     wp_register_script( 'zerospam', plugins_url( '/js/zerospam.js' , ZEROSPAM_PLUGIN ), array( 'jquery' ), '3.0.0', true ); 
     48    $plugin = get_plugin_data( ZEROSPAM_PLUGIN ); 
     49 
     50    wp_register_script( 'zerospam', plugins_url( '/js/zerospam.js' , ZEROSPAM_PLUGIN ), array( 'jquery' ), $plugin['Version'], true ); 
    4951  } 
    5052 
  • zero-spam/trunk/readme.txt

    r1538787 r1538907  
    55Requires at least: 3.0.0 
    66Tested up to: 4.6.1 
    7 Stable tag: 3.0.2 
     7Stable tag: 3.0.3 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    124124 
    125125== Changelog == 
     126 
     127= v3.0.3 (November 23, 2016) = 
     128* [bug] Fixed issue with settings not getting saved (https://wordpress.org/support/topic/can-unselect-default-options/). 
     129* [bug] Fixed PHP notice on Spammer Log page. 
     130* [bug] Removed outdated CloudFlare instructions. 
     131* [improvement] Made the JS file version dynamic. 
    126132 
    127133= 3.0.2 = 
  • zero-spam/trunk/tpl/spammer-logs.php

    r1538744 r1538907  
    1414?> 
    1515<div class="zero-spam__row"> 
     16 
    1617  <div class="zero-spam__cell"> 
    1718    <div class="zero-spam__widget zero-spam__bg--primary"> 
     
    1920        <h3><?php echo __( 'Summary', 'zerospam' ); ?></h3> 
    2021        <div class="zero-spam__row"> 
    21         <?php if ( isset( $num_days ) ): ?> 
    22           <div class="zero-spam__stat"> 
    23             <?php echo __( 'Protected', 'zerospam' ); ?> 
    24             <b><?php echo number_format( $num_days, 0 ); ?> <?php echo __( 'days', 'zerospam' ); ?></b> 
    25           </div> 
    26         <?php endif; ?> 
    27           <div class="zero-spam__stat"> 
    28             <?php echo __( 'Total Spam', 'zerospam' ); ?> 
    29             <b><?php echo number_format( $all_spam['raw'], 0 ); ?></b> 
    30           </div> 
    31         <?php if ( isset( $per_day ) ): ?> 
    32           <div class="zero-spam__stat"> 
    33             <?php echo __( 'Per day', 'zerospam' ); ?> 
    34             <b><?php echo number_format( $per_day, 0 ); ?></b> 
    35           </div> 
    36         <?php endif; ?> 
    37           <div class="zero-spam__stat"> 
    38             <?php echo __( 'Unique Spammers', 'zerospam' ); ?> 
    39             <b><?php echo number_format( $all_spam['unique_spammers'], 0 ); ?></b> 
    40           </div> 
     22          <?php if ( isset( $num_days ) ): ?> 
     23            <div class="zero-spam__stat"> 
     24              <?php echo __( 'Protected', 'zerospam' ); ?> 
     25              <b><?php echo number_format( $num_days, 0 ); ?> <?php echo __( 'days', 'zerospam' ); ?></b> 
     26            </div> 
     27          <?php endif; ?> 
     28            <div class="zero-spam__stat"> 
     29              <?php echo __( 'Total Spam', 'zerospam' ); ?> 
     30              <b><?php echo number_format( $all_spam['raw'], 0 ); ?></b> 
     31            </div> 
     32          <?php if ( isset( $per_day ) ): ?> 
     33            <div class="zero-spam__stat"> 
     34              <?php echo __( 'Per day', 'zerospam' ); ?> 
     35              <b><?php echo number_format( $per_day, 0 ); ?></b> 
     36            </div> 
     37          <?php endif; ?> 
     38          <?php if ( count( $all_spam['unique_spammers'] ) ): ?> 
     39            <div class="zero-spam__stat"> 
     40              <?php echo __( 'Unique Spammers', 'zerospam' ); ?> 
     41              <b><?php echo number_format( $all_spam['unique_spammers'], 0 ); ?></b> 
     42            </div> 
     43          <?php endif; ?> 
    4144        </div> 
    4245      </div> 
    4346    </div> 
    4447  </div> 
     48 
    4549  <div class="zero-spam__cell"> 
    4650    <div class="zero-spam__widget zero-spam__bg--secondary"> 
  • zero-spam/trunk/zero-spam.php

    r1538787 r1538907  
    44 * Plugin URI: https://benmarshall.me/wordpress-zero-spam 
    55 * Description: Tired of all the useless and bloated WordPress spam plugins? The WordPress Zero Spam plugin makes blocking spam a cinch. <strong>Just install, activate and say goodbye to spam.</strong> Based on work by <a href="http://davidwalsh.name/wordpress-comment-spam" target="_blank">David Walsh</a>. 
    6  * Version: 3.0.2 
     6 * Version: 3.0.3 
    77 * Author: Ben Marshall 
    88 * Author URI: https://benmarshall.me 
Note: See TracChangeset for help on using the changeset viewer.