WordPress.org

Plugin Directory

Changeset 658820


Ignore:
Timestamp:
01/25/13 18:14:44 (15 months ago)
Author:
eskapism
Message:

version 1.0.8

Location:
simple-history/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-history/trunk/index.php

    r618244 r658820  
    44Plugin URI: http://eskapism.se/code-playground/simple-history/ 
    55Description: Get a log/history/audit log/version history of the changes made by users in WordPress. 
    6 Version: 1.0.7 
     6Version: 1.0.8 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    2828load_plugin_textdomain('simple-history', false, "/simple-history/languages"); 
    2929 
    30 define( "SIMPLE_HISTORY_VERSION", "1.0.7"); 
     30define( "SIMPLE_HISTORY_VERSION", "1.0.8"); 
    3131define( "SIMPLE_HISTORY_NAME", "Simple History");  
    3232// define( "SIMPLE_HISTORY_URL", WP_PLUGIN_URL . '/simple-history/');   // http://playground.ep/wordpress/wp-content/plugins/simple-history/ 
     
    348348                        <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description> 
    349349                        <link><?php echo get_bloginfo("siteurl") ?></link> 
    350                         <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" /> 
    351350                        <item> 
    352351                            <title><?php _e("Wrong RSS secret", 'simple-history')?></title> 
     
    887886 */ 
    888887function simple_history_purge_db() { 
     888 
     889    $do_purge_history = TRUE; 
     890    $do_purge_history = apply_filters("simple_history_allow_db_purge", $do_purge_history); 
     891 
    889892    global $wpdb; 
    890893    $tableprefix = $wpdb->prefix; 
    891894    $sql = "DELETE FROM {$tableprefix}simple_history WHERE DATE_ADD(date, INTERVAL 60 DAY) < now()"; 
    892     $wpdb->query($sql); 
     895 
     896    if ($do_purge_history) { 
     897        $wpdb->query($sql); 
     898    } 
     899 
    893900} 
    894901 
  • simple-history/trunk/readme.txt

    r618244 r658820  
    44Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin 
    55Requires at least: 3.0 
    6 Tested up to: 3.4.2 
    7 Stable tag: 1.0.7 
     6Tested up to: 3.5 
     7Stable tag: 1.0.8 
    88 
    99View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more. 
     
    4747`<?php 
    4848 
    49 # Will show “Plugin your_plugin_name Edited” in the history log 
    50 simple_history_add("action=edited&object_type=plugin&object_name=your_plugin_name"); 
    51  
    52 # Will show the history item "Starship USS Enterprise repaired" 
    53 simple_history_add("action=repaired&object_type=Starship&object_name=USS Enterprise"); 
    54  
     49# Check that function exists before trying to use it 
     50# Just in case someone disabled the history plugin or similar 
     51if (function_exists("simple_history_add")) { 
     52 
     53    # Log that an email has been sent 
     54    simple_history_add(array( 
     55        "object_type" => "Email", 
     56        "action" => "sent", 
     57        "object_name" => "Hi there" 
     58    )); 
     59 
     60    # Will show “Plugin your_plugin_name Edited” in the history log 
     61    simple_history_add("action=edited&object_type=plugin&object_name=your_plugin_name"); 
     62     
     63    # Will show the history item "Starship USS Enterprise repaired" 
     64    simple_history_add("action=repaired&object_type=Starship&object_name=USS Enterprise"); 
     65     
     66?> 
     67` 
     68 
     69#### Never clear the history 
     70 
     71By default the items in the history log is cleared automatically afer 60 days.  
     72You can override this behaviour by using a filter, like this: 
     73 
     74` 
     75<?php 
     76// Never clear the database 
     77add_action("simple_history_allow_db_purge", function($bool) { 
     78    return false; 
     79}); 
    5580?> 
    5681` 
     
    92117 
    93118== Changelog == 
     119 
     120= 1.0.8 = 
     121- Added: filter simple_history_allow_db_purge that is used to determine if the history should be purged/cleaned after 60 days or not. Return false and it will never be cleaned. 
     122- Fixed: fixed a security issue with the RSS feed. User who should not be able to view the feed could get access to it. Please update to this version to keep your change log private! 
    94123 
    95124= 1.0.7 = 
Note: See TracChangeset for help on using the changeset viewer.