Plugin Directory

Changeset 1478400


Ignore:
Timestamp:
08/19/2016 05:14:56 AM (10 years ago)
Author:
maratbn
Message:

Latest updates from the official repo, which is at: https://github.com/maratbn/LoginRequirePress

Location:
loginrequirepress/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • loginrequirepress/trunk/LICENSE

    r1436214 r1478400  
    1   LoginRequirePress -- WordPress plugin that allows site administrators to
    2                        specifically designate arbitrary posts with any public
    3                        post type as viewable only after user login.
     1  Login Require Press -- WordPress plugin that allows site administrators to
     2                         specifically designate arbitrary posts with any
     3                         public post type as viewable only after user login.
    44
    5                        It is an easy way to require user login to view specific
    6                        pages / posts.
     5                         It is an easy way to require user login to view
     6                         specific pages / posts.
    77
    8                        Unauthenticated site visitors attempting to view any
    9                        page that includes any such specifically designated
    10                        post will then be automatically redirected to the
    11                        site's default login page, and then back to the
    12                        original page after they login, thereby limiting access
    13                        only to logged-in users with subscriber roles and
    14                        above.
     8                         Unauthenticated site visitors attempting to view any
     9                         page that includes any such specifically designated
     10                         post will then be automatically redirected to the
     11                         site's default login page, and then back to the
     12                         original page after they login, thereby limiting
     13                         access only to logged-in users with subscriber roles
     14                         and above.
    1515
    16                        Plugin will still allow unauthenticated downloading of
    17                        site's feeds, but will filter out any login-requiring
    18                        posts from the feed listings.
     16                         Plugin will still allow unauthenticated downloading
     17                         of site's feeds, but will filter out any
     18                         login-requiring posts from the feed listings.
    1919
    20                        Plugin will protect the titles and contents of login-
    21                        requiring posts in search result page listings when the
    22                        user is not logged in.  The titles / contents will be
    23                        replaced by text "[Post title / content protected by
    24                        LoginRequirePress.  Login to see the title / content.]"
     20                         Plugin will protect the titles and contents of login-
     21                         requiring posts in search result page listings when
     22                         the user is not logged in.  The titles / contents
     23                         will be replaced by text "[Post title / content
     24                         protected by Login Require Press.  Login to see the
     25                         title / content.]"
    2526
    2627  https://wordpress.org/plugins/loginrequirepress
     
    3031  Copyright (C) 2015-2016  Marat Nepomnyashy  http://maratbn.com  maratbn@gmail
    3132
    32   Version:        1.2.0-development_unreleased
     33  Version:        1.3.0-development_unreleased
    3334
    3435  Module:         loginrequirepress/LICENSE
    3536
    36   Description:    License for LoginRequirePress.
     37  Description:    License for Login Require Press.
    3738
    38   This file is part of LoginRequirePress.
     39  This file is part of Login Require Press.
    3940
    4041  Licensed under the GNU General Public License Version 3.
    4142
    42   LoginRequirePress is free software: you can redistribute it and/or modify
     43  Login Require Press is free software: you can redistribute it and/or modify
    4344  it under the terms of the GNU General Public License as published by
    4445  the Free Software Foundation, either version 3 of the License, or
    4546  (at your option) any later version.
    4647
    47   LoginRequirePress is distributed in the hope that it will be useful,
     48  Login Require Press is distributed in the hope that it will be useful,
    4849  but WITHOUT ANY WARRANTY; without even the implied warranty of
    4950  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     
    5152
    5253  You should have received a copy of the GNU General Public License
    53   along with LoginRequirePress.  If not, see <http://www.gnu.org/licenses/>.
     54  along with Login Require Press.  If not, see <http://www.gnu.org/licenses/>.
  • loginrequirepress/trunk/LoginRequirePress.php

    r1436214 r1478400  
    11<?php
    22/*
    3   Plugin Name: LoginRequirePress
     3  Plugin Name: Login Require Press
    44  Plugin URI: https://wordpress.org/plugins/loginrequirepress
    55  Plugin URI: https://github.com/maratbn/LoginRequirePress
    66  Plugin URI: http://www.maratbn.com/projects/login-require-press
    7   Description: Allows site administrators to specifically designate arbitrary posts with any public post type as viewable only after user login.  It is an easy way to require user login to view specific pages / posts.  Unauthenticated site visitors attempting to view any page that includes any such specifically designated post will then be automatically redirected to the site's default login page, and then back to the original page after they login, thereby limiting access only to logged-in users with subscriber roles and above.  Plugin will still allow unauthenticated downloading of site's feeds, but will filter out any login-requiring posts from the feed listings.  Plugin will protect the titles and contents of login-requiring posts in search result page listings when the user is not logged in.  The titles / contents will be replaced by text "[Post title / content protected by LoginRequirePress.  Login to see the title / content.]"
     7  Description: Allows site administrators to specifically designate arbitrary posts with any public post type as viewable only after user login.
    88  Author: Marat Nepomnyashy
    99  Author URI: http://www.maratbn.com
    1010  License: GPL3
    11   Version: 1.2.0-development_unreleased
     11  Version: 1.3.0-development_unreleased
    1212  Text Domain: domain-plugin-LoginRequirePress
    1313*/
    1414
    1515/*
    16   LoginRequirePress -- WordPress plugin that allows site administrators to
    17                        specifically designate arbitrary posts with any public
    18                        post type as viewable only after user login.
    19 
    20                        It is an easy way to require user login to view specific
    21                        pages / posts.
    22 
    23                        Unauthenticated site visitors attempting to view any
    24                        page that includes any such specifically designated
    25                        post will then be automatically redirected to the
    26                        site's default login page, and then back to the
    27                        original page after they login, thereby limiting access
    28                        only to logged-in users with subscriber roles and
    29                        above.
    30 
    31                        Plugin will still allow unauthenticated downloading of
    32                        site's feeds, but will filter out any login-requiring
    33                        posts from the feed listings.
    34 
    35                        Plugin will protect the titles and contents of login-
    36                        requiring posts in search result page listings when the
    37                        user is not logged in.  The titles / contents will be
    38                        replaced by text "[Post title / content protected by
    39                        LoginRequirePress.  Login to see the title / content.]"
     16  Login Require Press -- WordPress plugin that allows site administrators to
     17                         specifically designate arbitrary posts with any
     18                         public post type as viewable only after user login.
     19
     20                         It is an easy way to require user login to view
     21                         specific pages / posts.
     22
     23                         Unauthenticated site visitors attempting to view any
     24                         page that includes any such specifically designated
     25                         post will then be automatically redirected to the
     26                         site's default login page, and then back to the
     27                         original page after they login, thereby limiting
     28                         access only to logged-in users with subscriber roles
     29                         and above.
     30
     31                         Plugin will still allow unauthenticated downloading
     32                         of site's feeds, but will filter out any
     33                         login-requiring posts from the feed listings.
     34
     35                         Plugin will protect the titles and contents of login-
     36                         requiring posts in search result page listings when
     37                         the user is not logged in.  The titles / contents
     38                         will be replaced by text "[Post title / content
     39                         protected by Login Require Press.  Login to see the
     40                         title / content.]"
    4041
    4142  https://wordpress.org/plugins/loginrequirepress
     
    4546  Copyright (C) 2015-2016  Marat Nepomnyashy  http://maratbn.com  maratbn@gmail
    4647
    47   Version:        1.2.0-development_unreleased
     48  Version:        1.3.0-development_unreleased
    4849
    4950  Module:         LoginRequirePress.php
    5051
    51   Description:    Main PHP file for the WordPress plugin 'LoginRequirePress'.
    52 
    53   This file is part of LoginRequirePress.
     52  Description:    Main PHP file for the WordPress plugin 'Login Require Press'.
     53
     54  This file is part of Login Require Press.
    5455
    5556  Licensed under the GNU General Public License Version 3.
    5657
    57   LoginRequirePress is free software: you can redistribute it and/or modify
     58  Login Require Press is free software: you can redistribute it and/or modify
    5859  it under the terms of the GNU General Public License as published by
    5960  the Free Software Foundation, either version 3 of the License, or
    6061  (at your option) any later version.
    6162
    62   LoginRequirePress is distributed in the hope that it will be useful,
     63  Login Require Press is distributed in the hope that it will be useful,
    6364  but WITHOUT ANY WARRANTY; without even the implied warranty of
    6465  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     
    6667
    6768  You should have received a copy of the GNU General Public License
    68   along with LoginRequirePress.  If not, see <http://www.gnu.org/licenses/>.
     69  along with Login Require Press.  If not, see <http://www.gnu.org/licenses/>.
    6970*/
    7071
     
    104105    function action_add_meta_boxes() {
    105106        add_meta_box('plugin_LoginRequirePress_require_login',
    106                      __('LoginRequirePress', 'domain-plugin-LoginRequirePress'),
     107                     __('Login Require Press', 'domain-plugin-LoginRequirePress'),
    107108                     '\\plugin_LoginRequirePress\\callbackMetaBox',
    108109                     null);
     
    110111
    111112    function action_admin_menu() {
    112         \add_options_page(\__('LoginRequirePress Settings', 'domain-plugin-LoginRequirePress'),
    113                           \__('LoginRequirePress', 'domain-plugin-LoginRequirePress'),
     113        \add_options_page(\__('Login Require Press Settings', 'domain-plugin-LoginRequirePress'),
     114                          \__('Login Require Press', 'domain-plugin-LoginRequirePress'),
    114115                          'manage_options',
    115116                          'plugin_LoginRequirePress_settings',
     
    168169        if ($w_p_query->is_search) return;
    169170
     171        //  Need to obtain the site root directory:
     172        $strSelf = $_SERVER['PHP_SELF'];
     173        if ($strSelf == null) return;
     174        $posIndexPHP = \strpos($strSelf, 'index.php');
     175        if ($posIndexPHP === false) return;                         //  Not on regular site page.
     176        $strSiteRoot = \substr($strSelf, 0, $posIndexPHP);
     177
     178        //  Need to obtain the internal site path portion after the root directory:
     179        $strRequestPath = $_SERVER['REQUEST_URI'];
     180        if ($strRequestPath == null) return;
     181        if (\strpos($strRequestPath, $strSiteRoot) !== 0) return;
     182        $strInternalPath = \substr($strRequestPath, \strlen($strSiteRoot));
     183
    170184        global $post;
    171185        if ($w_p_query->have_posts()) {
     
    173187                $w_p_query->the_post();
    174188                if (isLoginRequiredForPost($post)) {
    175                     \header('Location: ' . \wp_login_url(\home_url($_SERVER['REQUEST_URI'])));
     189                    \header('Location: ' . \wp_login_url(\home_url($strInternalPath)));
    176190                    exit(0);
    177191                }
     
    219233            if (isLoginRequiredForPost($post)) {
    220234                if ($flagIsSearchNotLoggedIn) {
    221                     $post->post_content = \__('[Post content protected by LoginRequirePress.  Login to see the content.]',
     235                    $post->post_content = \__('[Post content protected by Login Require Press.  Login to see the content.]',
    222236                                              'domain-plugin-LoginRequirePress');
    223                     $post->post_title = \__('[Post title protected by LoginRequirePress.  Login to see the title.]',
     237                    $post->post_title = \__('[Post title protected by Login Require Press.  Login to see the title.]',
    224238                                            'domain-plugin-LoginRequirePress');
    225239                } else {
     
    247261         if (\version_compare(\strtolower(\PHP_VERSION), PHP_VERSION_MIN_SUPPORTED, '<')) {
    248262            \wp_die(
    249                 \sprintf(\__('LoginRequirePress plugin cannot be activated because the currently active PHP version on this server is %s < %s and not supported.  PHP version >= %s is required.',
     263                \sprintf(\__('Login Require Press plugin cannot be activated because the currently active PHP version on this server is %s < %s and not supported.  PHP version >= %s is required.',
    250264                             'domain-plugin-LoginRequirePress'),
    251265                         \PHP_VERSION,
     
    278292                        ?><li><?php
    279293                          ?><a href='<?=\get_edit_post_link($objPost->ID)?>'><?php
    280                             ?><?=$objPost->post_name?><?php
     294                            ?><?=$objPost->post_name ? $objPost->post_name
     295                                                     : \sprintf(
     296                                                        \__('[no name %d]',
     297                                                            'domain-plugin-LoginRequirePress'),
     298                                                        $objPost->ID)
     299                               ?><?php
    281300                          ?></a><?php
    282301                        ?></li><?php
  • loginrequirepress/trunk/readme.txt

    r1436223 r1478400  
    1 === LoginRequirePress ===
     1=== Login Require Press ===
    22Contributors: maratbn
    33Tags: require login, password protect, security, limit access, control access, members, visitors, subscribers, require-login, password-protect, login-protect, limit-access
    44Requires at least: 3.8.1
    5 Tested up to: 4.5.2
    6 Stable tag: 1.1.0
     5Tested up to: 4.6
     6Stable tag: 1.2.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1414Overview:
    1515
    16   At the time of this writing, the latest version of WordPress, version 4.5.2,
     16  At the time of this writing, the latest version of WordPress, version 4.6,
    1717  has 3 post visibility options, which are 'public', 'password protected', and
    1818  'private'.
     
    2323  deny access only to the unauthenticated users.
    2424
    25   LoginRequirePress is a WordPress plugin that allows site administrators to
     25  Login Require Press is a WordPress plugin that allows site administrators to
    2626  specifically designate arbitrary posts with any public post type as viewable
    2727  only after user login.
     
    4141  search result page listings when the user is not logged in.  The titles /
    4242  contents will be replaced by text "[Post title / content protected by
    43   LoginRequirePress.  Login to see the title / content.]"
     43  Login Require Press.  Login to see the title / content.]"
    4444
    4545Technical summary:
     
    7676https://wordpress.org/plugins/display-php-version/
    7777
    78 = Where can I ask a question about LoginRequirePress? =
     78= Where can I ask a question about Login Require Press? =
    7979
    8080Ask your questions at: https://wordpress.org/support/plugin/loginrequirepress
     
    9090== Screenshots ==
    9191
    92 1. LoginRequirePress configuration screen with the table used to specify which posts are to be
     921. Login Require Press configuration screen with the table used to specify which posts are to be
    9393   login-protected.
    9494
    95 2. LoginRequirePress configuration screen with the lists of private, non-private login-protected,
     952. Login Require Press configuration screen with the lists of private, non-private login-protected,
    9696   and passcode-protected posts.
    9797
    98 3. LoginRequirePress edit post meta box to enable or disable login protection.
     983. Login Require Press edit post meta box to enable or disable login protection.
    9999
    100100== Changelog ==
     101
     102= 1.2.0 =
     103* Tested up to WordPress 4.6
     104* Changed the plugin name from 'LoginRequirePress' to 'Login Require Press'.
     105* Indicating posts without names by token [no name #] where # is the post ID number.
     106* Shortened the plugin description appearing on the admin dashboard plugins list to just one
     107  sentence.
     108* Added support for WordPress instances nested inside subdirectories.
    101109
    102110= 1.1.0 =
Note: See TracChangeset for help on using the changeset viewer.