Plugin Directory

Changeset 992977


Ignore:
Timestamp:
09/19/2014 02:04:48 AM (12 years ago)
Author:
natereist
Message:

tagging version 1.3.2 tested with WordPress 4.0

Location:
protected-posts-logout-button
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • protected-posts-logout-button/tags/1.3.2/logout.js

    r951684 r992977  
    66       
    77        $.post( pplb_ajax.ajaxurl, data, function( response ) {
     8                if( response.log == 1 && typeof console == "object" && typeof console.log != 'undefined'){
     9                        console.log( response );
     10                }
    811            if( response.status == 0 ){
    912                // nothing hanppens
  • protected-posts-logout-button/tags/1.3.2/pplb_logout_button.php

    r951684 r992977  
    44    Plugin URI: http://omfgitsnater.com/protected-posts-logout-button/
    55    Description: A plugin built to add a logout button automatically to protected posts.
    6     Version: 1.3.1
     6    Version: 1.3.2
    77    Author: Nate Reist
    88    Author URI: http://omfgitsnater.com
     
    6161    $options = get_option('pplb_options');
    6262    $pplb_alert = (array_key_exists('pplb_alert', $options)) ? $options['pplb_alert'] : 'no';
     63    $log = isset( $options['pplb_debug'] ) ? $options['pplb_debug'] : 0;
    6364   
    6465    $response = array(
    6566        'status'    => 0,
    66         'message'   => ''
     67        'message'   => '',
     68        'log'           => $log
    6769    );
    6870   
     
    101103add_filter( 'post_password_expires','pplb_change_postpass_expires', 10, 1 );
    102104
    103 /*
    104     The settings page in admin
    105 */
    106 function pplb_settings_page(){
    107     if ( isset( $_POST['pplb_action'] ) ) {
     105add_action( 'admin_init', 'pplb_options_save' );
     106
     107/*
     108        Save on admin init
     109*/
     110function pplb_options_save(){
     111        if ( isset( $_POST['pplb_action'] ) ) {
    108112        //update the option.
    109113        $options = array();
    110114        $options['pplb_alert'] = ( array_key_exists('pplb_alert', $_POST) ) ? $_POST['pplb_alert']: 'no';
    111115        $options['pplb_message'] = esc_js( $_POST['pplb_message'] );
     116        $options['pplb_debug'] = ( array_key_exists('pplb_debug', $_POST) ) ? $_POST['pplb_debug']: 0;
    112117        $options['pplb_button_class'] = esc_attr($_POST['pplb_button_class']);
    113118        update_option('pplb_options', $options);
     
    118123        $filter = isset($_POST['pplb_button_filter']) ? $_POST['pplb_button_filter']: 'yes';
    119124        update_option('pplb_button_filter', $filter);
    120     }
     125        $redirect = add_query_arg( array( 'message' => 1 ) );
     126        wp_redirect( $redirect );
     127        exit();
     128    }
     129}
     130/*
     131    The settings page in admin
     132*/
     133function pplb_settings_page(){
     134   
    121135    $new_options = get_option('pplb_options');
     136    if ( isset( $_GET['message'] ) && $_GET['message'] == 1 ){
     137            ?>
     138            <div class="message updated">
     139                    <p>Settings updated</p>
     140            </div>
     141            <?php
     142    }
     143   
    122144    if ( is_array($new_options ) ) {
    123         extract($new_options); 
     145       
     146        $pplb_debug = isset( $new_options['pplb_debug'] ) ? $new_options['pplb_debug'] : 0;
     147        $pplb_alert = isset( $new_options['pplb_alert'] ) ? $new_options['pplb_alert'] : 0;
     148        $pplb_message = isset( $new_options['pplb_message'] ) ? $new_options['pplb_message'] : '';
     149        $pplb_button_class = isset( $new_options['pplb_button_class'] ) ? $new_options['pplb_button_class'] : '';
     150       
    124151    }
    125152    ?>
     
    133160                    <tr>
    134161                        <th><label>Alert user log out was successful?</label></th><td><input type="checkbox" name="pplb_alert" value="yes" <?php checked($pplb_alert, 'yes'); ?> /></td>
     162                    </tr><tr>
     163                        <th><label>Turn on console debugging in javascript ( for developers )?</label></th><td><input type="checkbox" name="pplb_debug" value="1" <?php checked($pplb_debug, 1); ?> /></td>
    135164                    </tr>
    136165                    <tr>
  • protected-posts-logout-button/tags/1.3.2/readme.txt

    r951684 r992977  
    44Tags: logout, password protected posts logout button, wordpress security
    55Requires at least: 2.8
    6 Tested up to: 3.9.1
    7 Stable tag: 1.3.1
     6Tested up to: 4.0
     7Stable tag: 1.3.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151
    5252== Changelog ==
     53= 1.3.2 =
     54* Added a optional debug to the send response to the console.log function ( only for debugging use should not be used in production. )
     55* Added a check to see the `message` is not of type "undefined"
     56* Added an option to the options page for turning on or off debug.
     57* Tested with version 4.0!
    5358
    5459= 1.3.1 =
  • protected-posts-logout-button/trunk/logout.js

    r951684 r992977  
    66       
    77        $.post( pplb_ajax.ajaxurl, data, function( response ) {
     8                if( response.log == 1 && typeof console == "object" && typeof console.log != 'undefined'){
     9                        console.log( response );
     10                }
    811            if( response.status == 0 ){
    912                // nothing hanppens
  • protected-posts-logout-button/trunk/pplb_logout_button.php

    r951684 r992977  
    44    Plugin URI: http://omfgitsnater.com/protected-posts-logout-button/
    55    Description: A plugin built to add a logout button automatically to protected posts.
    6     Version: 1.3.1
     6    Version: 1.3.2
    77    Author: Nate Reist
    88    Author URI: http://omfgitsnater.com
     
    6161    $options = get_option('pplb_options');
    6262    $pplb_alert = (array_key_exists('pplb_alert', $options)) ? $options['pplb_alert'] : 'no';
     63    $log = isset( $options['pplb_debug'] ) ? $options['pplb_debug'] : 0;
    6364   
    6465    $response = array(
    6566        'status'    => 0,
    66         'message'   => ''
     67        'message'   => '',
     68        'log'           => $log
    6769    );
    6870   
     
    101103add_filter( 'post_password_expires','pplb_change_postpass_expires', 10, 1 );
    102104
    103 /*
    104     The settings page in admin
    105 */
    106 function pplb_settings_page(){
    107     if ( isset( $_POST['pplb_action'] ) ) {
     105add_action( 'admin_init', 'pplb_options_save' );
     106
     107/*
     108        Save on admin init
     109*/
     110function pplb_options_save(){
     111        if ( isset( $_POST['pplb_action'] ) ) {
    108112        //update the option.
    109113        $options = array();
    110114        $options['pplb_alert'] = ( array_key_exists('pplb_alert', $_POST) ) ? $_POST['pplb_alert']: 'no';
    111115        $options['pplb_message'] = esc_js( $_POST['pplb_message'] );
     116        $options['pplb_debug'] = ( array_key_exists('pplb_debug', $_POST) ) ? $_POST['pplb_debug']: 0;
    112117        $options['pplb_button_class'] = esc_attr($_POST['pplb_button_class']);
    113118        update_option('pplb_options', $options);
     
    118123        $filter = isset($_POST['pplb_button_filter']) ? $_POST['pplb_button_filter']: 'yes';
    119124        update_option('pplb_button_filter', $filter);
    120     }
     125        $redirect = add_query_arg( array( 'message' => 1 ) );
     126        wp_redirect( $redirect );
     127        exit();
     128    }
     129}
     130/*
     131    The settings page in admin
     132*/
     133function pplb_settings_page(){
     134   
    121135    $new_options = get_option('pplb_options');
     136    if ( isset( $_GET['message'] ) && $_GET['message'] == 1 ){
     137            ?>
     138            <div class="message updated">
     139                    <p>Settings updated</p>
     140            </div>
     141            <?php
     142    }
     143   
    122144    if ( is_array($new_options ) ) {
    123         extract($new_options); 
     145       
     146        $pplb_debug = isset( $new_options['pplb_debug'] ) ? $new_options['pplb_debug'] : 0;
     147        $pplb_alert = isset( $new_options['pplb_alert'] ) ? $new_options['pplb_alert'] : 0;
     148        $pplb_message = isset( $new_options['pplb_message'] ) ? $new_options['pplb_message'] : '';
     149        $pplb_button_class = isset( $new_options['pplb_button_class'] ) ? $new_options['pplb_button_class'] : '';
     150       
    124151    }
    125152    ?>
     
    133160                    <tr>
    134161                        <th><label>Alert user log out was successful?</label></th><td><input type="checkbox" name="pplb_alert" value="yes" <?php checked($pplb_alert, 'yes'); ?> /></td>
     162                    </tr><tr>
     163                        <th><label>Turn on console debugging in javascript ( for developers )?</label></th><td><input type="checkbox" name="pplb_debug" value="1" <?php checked($pplb_debug, 1); ?> /></td>
    135164                    </tr>
    136165                    <tr>
  • protected-posts-logout-button/trunk/readme.txt

    r951684 r992977  
    44Tags: logout, password protected posts logout button, wordpress security
    55Requires at least: 2.8
    6 Tested up to: 3.9.1
    7 Stable tag: 1.3.1
     6Tested up to: 4.0
     7Stable tag: 1.3.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151
    5252== Changelog ==
     53= 1.3.2 =
     54* Added a optional debug to the send response to the console.log function ( only for debugging use should not be used in production. )
     55* Added a check to see the `message` is not of type "undefined"
     56* Added an option to the options page for turning on or off debug.
     57* Tested with version 4.0!
    5358
    5459= 1.3.1 =
Note: See TracChangeset for help on using the changeset viewer.