• Hello,
    I use (beeing an artist) a few pages that are password protected.
    I create each page for a different recipient to be able to show them a different sets of a musical portfolio.
    I use a built-into WordPress password thing.

    Is there maybe any third party plugin that allows me to LOG whenenver a person enters this password, which means that have looked at my portfolio? Thank you

    • This topic was modified 7 years, 6 months ago by Jan Dembowski.
    • This topic was modified 7 years, 6 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress as this is not a Developing with WordPress topic
Viewing 5 replies - 1 through 5 (of 5 total)
  • A whole bunch of them out there. See:

    Activity Log: https://www.ads-software.com/plugins/aryo-activity-log/
    Simple History: https://www.ads-software.com/plugins/simple-history/
    User Activity Log: https://www.ads-software.com/plugins/user-activity-log/
    User Activity Tracking and Log: https://www.ads-software.com/plugins/user-activity-tracking-and-log/

    I know they all track user login/logout, but I don’t know if they also track password-protected access. That’s yours to find out.

    hi, the author of simple history here. my plugin does not track when a user enters a password protected page – but it’s a nice idea so I should be able to add such a function pretty easy. If I have the time I will fix it this weekend ??

    Well, pretty easy anyway. First install Simple History and then paste this snippet into your functions.php-file and both succesful password entries and unsuccessful entries will be logged. Hope it works or is good enough to get you started.

    
    // Log when a user enters something into the post password form.
    // Both correct and incorrect usage is logged.
    add_action( 'login_form_postpass', function() {
        $postPass = isset($_POST['post_password']) ? $_POST['post_password'] : null;
    
        if (!$postPass) {
            return;
        }
    
        $urlPath = parse_url(wp_get_referer(), PHP_URL_PATH);
        $pageByPath = get_page_by_path($urlPath);
    
        if (!$pageByPath) {
            return;
        }
    
        $correctPasswordEntered = ($pageByPath->post_password === $postPass);
    
        if ($correctPasswordEntered) {
            apply_filters(
                'simple_history_log',
                'A user correctly entered the password for page "{page_name}"',
                array('page_name' => $pageByPath->post_title)
            );
        } else {
            apply_filters(
                'simple_history_log',
                'A user entered the wrong password for page "{page_name}"',
                array('page_name' => $pageByPath->post_title)
            );
        }
    });
    

    That’s very kind of you, @eskapism. I hope the OP appreciates your effort.

    Hi @eskapism,

    I have the same issue and would like to know if you have been able to add this functionality into the plugin as yet or will be soon?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Password plugin that logs entries’ is closed to new replies.