Plugin Directory

Changeset 2493592


Ignore:
Timestamp:
03/11/2021 08:06:20 PM (5 years ago)
Author:
cayenne
Message:

1.5.3 version

Location:
anonymous-restricted-content/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • anonymous-restricted-content/trunk/README.txt

    r2464550 r2493592  
    33Tags: restricted access, block content, content control, access control, restrict anonymous, hide content, limited access, permission, private
    44Requires at least: 4.6
    5 Tested up to: 5.6
    6 Stable tag: 1.5.2
     5Tested up to: 5.7
     6Stable tag: 1.5.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676
    7777== Changelog ==
     78= 1.5.3 =
     79* JS scripts included into translations
     80* Tested up to WP 5.7
     81
    7882= 1.5.2 =
    7983* Started work on plugin translation
  • anonymous-restricted-content/trunk/admin/class-arc-admin.php

    r2464550 r2493592  
    6868     */
    6969    public function enqueue_scripts() {
    70         // wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/arc-admin.js', array( 'jquery' ), $this->version, false );
    71 
    7270
    7371        if ( !is_plugin_active('classic-editor/classic-editor.php') ) {
    7472            wp_enqueue_script(
    75             $this->plugin_name,
     73            'arc-admin.js',
    7674            plugin_dir_url( __FILE__ ) . 'js/arc-admin.js',
    7775            array( 'wp-element', 'wp-components', 'wp-i18n', 'wp-plugins', 'wp-edit-post' ), // Dependencies, defined above.
     
    7977            true
    8078        );
     79
     80            wp_localize_script( 'arc-admin.js', 'ArcLStrings', $this->get_language_strings() );
     81
     82        // if(get_current_screen()->base == 'post'){
     83            //
     84        //   global $post;
     85            //
     86        //   $is_post_restricted = ( get_post_meta($post->ID, 'arc_restricted_post', true) && (bool) get_post_meta($post->ID, 'arc_restricted_post', true) === true ) ? true : false;
     87            //
     88        //   $js_arc_vars = array(
     89        //     'arc_checked' => $is_post_restricted,
     90        //     'post_id' => $post->ID
     91        //   );
     92            //  wp_add_inline_script( 'arc-admin.js', 'const arc_vars = ' . json_encode( $js_arc_vars ), 'before' );
     93        // }
    8194        }
    82 
    83     if(get_current_screen()->base == 'post'){
    84 
    85       global $post;
    86 
    87       $is_post_restricted = ( get_post_meta($post->ID, 'arc_restricted_post', true) && (bool) get_post_meta($post->ID, 'arc_restricted_post', true) === true ) ? true : false;
    88 
    89       $localize = array(
    90         'arc_checked' => $is_post_restricted,
    91         'post_id' => $post->ID
    92       );
    93 
    94       wp_localize_script( $this->plugin_name, 'arc_vars', $localize);
    95     }
     95    }
     96
     97    /**
     98  * translations strings for JS scripts
     99  *
     100  * @since    1.5.2
     101  */
     102    private function get_language_strings() {
     103        $strings = array(
     104        'RestrictedForAnonymousUsers' => __( 'Restricted for anonymous users', 'anonymous-restricted-content' ),
     105    );
     106
     107    return $strings;
    96108    }
    97109
  • anonymous-restricted-content/trunk/admin/js/arc-admin.js

    r2260252 r2493592  
    3131      el(
    3232        CheckboxControl, {
    33           label: 'Restricted for anonymous users',
     33          label: ArcLStrings.RestrictedForAnonymousUsers,
    3434          checked: props.metaFieldValue,
    3535          id: 'arc_checkbox',
  • anonymous-restricted-content/trunk/anonymous-restricted-content.php

    r2464550 r2493592  
    1111 * Plugin URI:        https://wordpress.org/plugins/anonymous-restricted-content/
    1212 * Description:       Restrict access to selected content (posts/pages/categories) for NOT LOGGED IN users.
    13  * Version:           1.5.2
     13 * Version:           1.5.3
    1414 * Author:            Taras Sych
    1515 * Author URI:        https://wordpress.org/plugins/anonymous-restricted-content//
     
    2828 * Currently plugin version.
    2929 */
    30 define( 'ARC_VERSION', '1.5.2' );
     30define( 'ARC_VERSION', '1.5.3' );
    3131define( 'ARC_PACKAGE_NAME', 'ARC' );
    3232
  • anonymous-restricted-content/trunk/languages/anonymous-restricted-content-uk.po

    r2464551 r2493592  
    125125#: admin/class-arc-admin.php:238
    126126msgid "Anonymous Restricted Content"
    127 msgstr "Обмеження доступу без авторизації"
     127msgstr "Anonymous Restricted Content"
  • anonymous-restricted-content/trunk/languages/arc.pot

    r1898412 r2493592  
     1# Copyright (C) 2021 Taras Sych
     2# This file is distributed under the same license as the Anonymous Restricted Content plugin.
     3msgid ""
     4msgstr ""
     5"Project-Id-Version: Anonymous Restricted Content 1.5.3\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/anonymous-restricted-content\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
     9"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
     11"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: 2021-03-11T19:58:14+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.4.0\n"
     15"X-Domain: anonymous-restricted-content\n"
     16
     17#. Plugin Name of the plugin
     18#: admin/class-arc-admin.php:309
     19msgid "Anonymous Restricted Content"
     20msgstr ""
     21
     22#. Plugin URI of the plugin
     23msgid "https://wordpress.org/plugins/anonymous-restricted-content/"
     24msgstr ""
     25
     26#. Description of the plugin
     27msgid "Restrict access to selected content (posts/pages/categories) for NOT LOGGED IN users."
     28msgstr ""
     29
     30#. Author of the plugin
     31msgid "Taras Sych"
     32msgstr ""
     33
     34#. Author URI of the plugin
     35msgid "https://wordpress.org/plugins/anonymous-restricted-content//"
     36msgstr ""
     37
     38#: admin/class-arc-admin.php:104
     39msgid "Restricted for anonymous users"
     40msgstr ""
     41
     42#: admin/class-arc-admin.php:121
     43msgid "Restricted for anonymouse users"
     44msgstr ""
     45
     46#: admin/class-arc-admin.php:156
     47msgid "Redirect Options"
     48msgstr ""
     49
     50#: admin/class-arc-admin.php:163
     51msgid "Redirect URL:"
     52msgstr ""
     53
     54#: admin/class-arc-admin.php:175
     55msgid "Login Screen:"
     56msgstr ""
     57
     58#: admin/class-arc-admin.php:182
     59msgid "Login screen message:"
     60msgstr ""
     61
     62#: admin/class-arc-admin.php:194
     63msgid "AJAX Alternative:"
     64msgstr ""
     65
     66#: admin/class-arc-admin.php:201
     67msgid "AJAX Login:"
     68msgstr ""
     69
     70#: admin/class-arc-admin.php:274
     71msgid "Anonymous users, who are restricted to access content, can be redirected to the URL you provide below."
     72msgstr ""
     73
     74#: admin/class-arc-admin.php:275
     75msgid "Leave Redirect URL empty to force anonymous users to login (redirect to Wordpress Login page)."
     76msgstr ""
     77
     78#: admin/class-arc-admin.php:285
     79msgid "Message to be shown on the login screen, for users who trying to access restricted content and forced to login."
     80msgstr ""
     81
     82#: admin/class-arc-admin.php:286
     83msgid "Defaul message: \"This content was restricted from anonymous access. Please, login first:\""
     84msgstr ""
     85
     86#: admin/class-arc-admin.php:296
     87msgid "Turn ON this option to prevent users redirects to the WP login page."
     88msgstr ""
     89
     90#: admin/class-arc-admin.php:297
     91msgid "And use AJAX login form in floating popup instead."
     92msgstr ""
     93
     94#: admin/class-arc-admin.php:298
     95msgid "This feature should prevent issues with \"loop login screen redirects\" in case of other plugin integration conflicts."
     96msgstr ""
     97
     98#: admin/class-arc-admin.php:310
     99#: public/class-arc-public.php:85
     100msgid "Restricted Content"
     101msgstr ""
     102
     103#: admin/class-arc-admin.php:374
     104msgid "Restr"
     105msgstr ""
     106
     107#: admin/class-arc-admin.php:403
     108msgid "Restrict for Anonymous"
     109msgstr ""
     110
     111#: admin/class-arc-admin.php:430
     112msgid "Settings"
     113msgstr ""
     114
     115#: public/class-arc-public.php:83
     116msgid "Sending user info, please wait..."
     117msgstr ""
     118
     119#: public/class-arc-public.php:84
     120msgid "Log In failed. Try again later."
     121msgstr ""
     122
     123#: public/class-arc-public.php:86
     124msgid "Please log in to get access:"
     125msgstr ""
     126
     127#: public/class-arc-public.php:87
     128msgid "Username:"
     129msgstr ""
     130
     131#: public/class-arc-public.php:88
     132msgid "Password:"
     133msgstr ""
     134
     135#: public/class-arc-public.php:89
     136msgid "Log In"
     137msgstr ""
     138
     139#: public/class-arc-public.php:90
     140msgid "Go Back"
     141msgstr ""
     142
     143#: public/class-arc-public.php:304
     144msgid "Login successful."
     145msgstr ""
     146
     147#: public/class-arc-public.php:306
     148msgid "Login failed."
     149msgstr ""
     150
     151#: public/class-arc-public.php:331
     152msgid "This content was restricted from anonymous access. Please, login first:"
     153msgstr ""
  • anonymous-restricted-content/trunk/public/class-arc-public.php

    r2464550 r2493592  
    7070    public function enqueue_scripts() {
    7171
    72         wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/arc-public.js', array( 'jquery' ), $this->version, false );
    73     }
    74 
    75 
     72        wp_enqueue_script( 'arc-public.js', plugin_dir_url( __FILE__ ) . 'js/arc-public.js', array( 'jquery' ), $this->version, false );
     73        wp_localize_script( 'arc-public.js', 'ArcPubLStrings', $this->get_language_strings() );
     74    }
     75
     76    /**
     77  * translations strings for JS scripts
     78  *
     79  * @since    1.5.2
     80  */
     81    private function get_language_strings() {
     82        $strings = array(
     83            'SendingUserInfo' => __( 'Sending user info, please wait...', 'anonymous-restricted-content' ),
     84            'LogInFailed' => __( 'Log In failed. Try again later.', 'anonymous-restricted-content' ),
     85            'RestrictedContent' => __( 'Restricted Content', 'anonymous-restricted-content' ),
     86            'PleaseLogIn' => __( 'Please log in to get access:', 'anonymous-restricted-content' ),
     87            'Username' => __( 'Username:', 'anonymous-restricted-content' ),
     88            'Password' => __( 'Password:', 'anonymous-restricted-content' ),
     89            'LogIn' => __( 'Log In', 'anonymous-restricted-content' ),
     90            'GoBack' => __( 'Go Back', 'anonymous-restricted-content' ),
     91    );
     92
     93    return $strings;
     94    }
    7695
    7796    /**
  • anonymous-restricted-content/trunk/public/js/arc-public.js

    r2459127 r2493592  
    1818        e.preventDefault();
    1919
    20         $("#arc-ajax-login-status-text", loginForm).html('Sending user info, please wait...');
     20        $("#arc-ajax-login-status-text", loginForm).html(ArcPubLStrings.SendingUserInfo);
    2121        $("#arc-ajax-login-submit-btn", loginForm).prop( "disabled", true );
    2222
     
    3939                  loginContainer.remove();
    4040
    41                   window.location.reload(false); 
     41                  window.location.reload(false);
    4242
    4343                } else if ( data.error == true ) {
     
    4646            },
    4747            error: function(){
    48               $("#arc-ajax-login-status-text", loginForm).html('Log In failed. Try again later.');
     48              $("#arc-ajax-login-status-text", loginForm).html(ArcPubLStrings.LogInFailed);
    4949              $("#arc-ajax-login-submit-btn", loginForm).prop( "disabled", false );
    5050            }
     
    5454      });
    5555
    56       jQuery('<h5/>').html('Restricted Content').appendTo(loginForm);
    57       jQuery('<p/>').html('Please log in to get access:').appendTo(loginForm);
    58       jQuery('<label/>', { for: 'arc-ajax-login-username-input'}).html('Username:').appendTo(loginForm);
     56      jQuery('<h5/>').html(ArcPubLStrings.RestrictedContent).appendTo(loginForm);
     57      jQuery('<p/>').html(ArcPubLStrings.PleaseLogIn).appendTo(loginForm);
     58      jQuery('<label/>', { for: 'arc-ajax-login-username-input'}).html(ArcPubLStrings.Username).appendTo(loginForm);
    5959      jQuery('<input/>', { "type": 'text', id: 'arc-ajax-login-username-input'}).appendTo(loginForm);
    60       jQuery('<label/>', { for: 'arc-ajax-login-password-input'}).html('Password:').appendTo(loginForm);
     60      jQuery('<label/>', { for: 'arc-ajax-login-password-input'}).html(ArcPubLStrings.Password).appendTo(loginForm);
    6161      jQuery('<input/>', { "type": 'password', id: 'arc-ajax-login-password-input'}).appendTo(loginForm);
    6262      jQuery('<p/>', { id: 'arc-ajax-login-status-text'}).appendTo(loginForm);
    63       jQuery('<input/>', { "type": 'submit', "class": "submit_button", "value": "Log In", id: 'arc-ajax-login-submit-btn'}).appendTo(loginForm);
     63      jQuery('<input/>', { "type": 'submit', "class": "submit_button", "value": ArcPubLStrings.LogIn, id: 'arc-ajax-login-submit-btn'}).appendTo(loginForm);
    6464      jQuery('<p/>').appendTo(loginForm);
    6565      jQuery('<input/>', { "type": 'button',
    6666                            "class": "cancel_button",
    67                             "value": "Go Back",
     67                            "value": ArcPubLStrings.GoBack,
    6868                            "id": 'arc-login-go-back-btn',
    6969                            "click": function() {
Note: See TracChangeset for help on using the changeset viewer.