Plugin Directory

Changeset 3129161


Ignore:
Timestamp:
08/01/2024 04:47:20 AM (16 months ago)
Author:
nicu_m
Message:

Release 1.0.1

Location:
simple-jwt-login-mailpoet
Files:
29 added
5 edited

Legend:

Unmodified
Added
Removed
  • simple-jwt-login-mailpoet/trunk/README.txt

    r3080651 r3129161  
    33Contributors: nicu_m
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PK9BCD6AYF58Y&source=url
    5 Tags: jwt, API, auto login, tokens, REST, auth, generate jwt, mailpoet
     5Tags: jwt, auto login, tokens, auth, generate jwt, mailpoet
    66Requires at least: 4.4.0
    7 Tested up to: 6.5
     7Tested up to: 6.6
    88Requires PHP: 5.5
    9 Stable tag: 1.0.0
     9Stable tag: 1.0.1
    1010License: GPLv2
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3535
    3636``
    37 [custom:simple-jwt-login text="Login" class="myClassName" style="color:red;" validity="604800" authCode="1"]
     37    [custom:simple-jwt-login text="Login" class="myClassName" style="color:red;" validity="604800" authCode="1"]
    3838``
    3939
    4040This example will generate a red link, with the text "Login".
     41
     42You can also customize the shortcode to just return the URL.
     43
     44``
     45    [custom:simple-jwt-login text="Login" validity="604800" isUrl="on"]
     46``
    4147
    4248== Screenshots ==
     
    7682== Changelog ==
    7783
     84= 1.0.1 ( 31 Jul 2024)
     85- Fix Shortcode handler
     86- Update WordPress 6.6 compatibility
     87
    7888= 1.0.0 ( 03 May 2024)
    7989- Test with latest WordPress version
  • simple-jwt-login-mailpoet/trunk/assets/js/scripts.js

    r3080651 r3129161  
    33        const shortcode = 'custom:simple-jwt-login';
    44        const shortCodePreview = document.getElementById('simple-jwt-login-mailpoet-short-code');
    5         const linkPreview = document.getElementById('simple-jwt-login-mailport-preview');
     5        const linkPreview = document.getElementById('simple-jwt-login-mailpoet-preview');
    66
    77        renderCode();
  • simple-jwt-login-mailpoet/trunk/mailpoet.php

    r3080651 r3129161  
    22
    33use SimpleJWTLogin\Helpers\Jwt\JwtKeyFactory;
    4 use SimpleJWTLogin\Libraries\JWT;
     4use SimpleJWTLogin\Libraries\JWT\JWT;
    55use SimpleJWTLogin\Modules\SimpleJWTLoginSettings;
    66use SimpleJWTLogin\Modules\WordPressData;
     
    88add_filter('mailpoet_newsletter_shortcode', 'simple_jwt_login_mailpoet_shortcode', 1, 6);
    99//mailpoet_newsletter_shortcode
    10 
    1110
    1211function simple_jwt_login_mailpoet_shortcode(
     
    1918)
    2019{
    21     $pluginshortcode = 'custom:simplejwtlogin';
    22     $isValidShortcode = strpos($shortcode, '[' . $pluginshortcode) === 0;
     20    $re = '/^\[custom:simple[-]?jwt[-]?login(.*)\]$/m';
     21    preg_match_all($re, $shortcode, $matches, PREG_SET_ORDER, 0);
    2322
    2423    // always return the shortcode if it doesn't match your own!
    25     if ($isValidShortcode === false || $subscriber === null) {
     24    if (empty($matches)) {
    2625        return $shortcode;
    2726    }
     
    6665        }
    6766        if (isset($arguments['redirectUrl']) && $arguments['redirectUrl'] !== '') {
    68             $url .= '&redirectUrl=' . $arguments['redirectUrl'];
     67            $url .= '&redirectUrl=' . urlencode($arguments['redirectUrl']);
    6968        }
    7069
     
    7776        }
    7877
    79        return '<a href="' . $url . '"'
     78        return '<a href="' . $url . '"'
    8079            . ($style ? ' style="' . $style . '"' : '')
    8180            . ($class ? ' class="' . $class . '"' : '')
  • simple-jwt-login-mailpoet/trunk/simple-jwt-login-mailpoet.php

    r3080651 r3129161  
    88    Text Domain: simple-jwt-login-mailpoet
    99    Domain Path: /i18n
    10     Version: 1.0.0
     10    Version: 1.0.1
    1111*/
    1212
    1313add_action('admin_menu', 'simple_jwt_login__mailpoet_plugin_create_menu_entry', 11);
    14 if (check_simple_jwt_login_activated() == false) {
     14if (!check_simple_jwt_login_activated()) {
    1515    add_action('admin_notices', 'simple_jwt_login_plugin_missing_notice');
    1616}
  • simple-jwt-login-mailpoet/trunk/views/layout.php

    r3080651 r3129161  
    3131}
    3232?>
     33
    3334<div id="simple-jwt-login-mailpoet">
    3435    <div class="row">
     
    6869                </div>
    6970                <div class="item">
    70                     <label for="text-auth-code"><?php echo __('JWT Validity', 'simple-jwt-login-mailpoet'); ?></label>
     71                    <label
     72                        for="text-jwt-validity"><?php echo __('JWT Validity', 'simple-jwt-login-mailpoet'); ?></label>
    7173                    <p>
    7274                        <?php
     
    7779                        ?>
    7880                    </p>
    79                     <input type="text" id="text-jwt-validity" class="input form-control" value="604800" />
     81                    <input type="text" id="text-jwt-validity" class="input form-control" value="604800"/>
    8082
    8183                </div>
     
    9294                    </p>
    9395                    <input type="checkbox" id="text-jwt-isUrl" class="input form-control">
    94                     <label for="text-jwt-isUrl"><?php echo __('Shortcode should return only the autologin URL', 'simple-jwt-login-mailpoet'); ?></label>
     96                    <label
     97                        for="text-jwt-isUrl"><?php echo __('Shortcode should return only the autologin URL', 'simple-jwt-login-mailpoet'); ?></label>
    9598                </div>
    9699                <div class="item">
     
    107110
    108111                </div>
     112                <hr/>
    109113                <h2><?php echo __('Design', 'simple-jwt-login-mailpoet'); ?></h2>
    110114                <div class="item">
    111                     <label for="text-value"><?php echo __('Text', 'simple-jwt-login-mailpoet'); ?>:</label>
     115                    <label for="text-value"><?php echo __('Text', 'simple-jwt-login-mailpoet'); ?></label>
    112116                    <p>
    113117                        <?php
     
    121125                </div>
    122126                <div class="item">
    123                     <label for="class-value"><?php echo __('Class', 'simple-jwt-login-mailpoet'); ?>:</label>
     127                    <label for="class-value"><?php echo __('Class', 'simple-jwt-login-mailpoet'); ?></label>
    124128                    <p>
    125129                        <?php
     
    133137                </div>
    134138                <div class="item">
    135                     <label for="class-style"><?php echo __('Style', 'simple-jwt-login-mailpoet'); ?>:</label>
     139                    <label for="class-style"><?php echo __('Style', 'simple-jwt-login-mailpoet'); ?></label>
    136140                    <p>
    137141                        <?php
     
    142146                        ?>
    143147                    </p>
    144                     <textarea id="class-style" class="input form-control" value=""></textarea>
     148                    <textarea id="class-style" class="input form-control"></textarea>
    145149                </div>
    146150            </div>
     
    163167                    <h3><?php echo __('Shortcode Preview', 'simple-jwt-login-mailpoet'); ?></h3>
    164168                    <div class="preview-button-container">
    165                         <div id="simple-jwt-login-mailport-preview"></div>
     169                        <div id="simple-jwt-login-mailpoet-preview"></div>
    166170                    </div>
    167171                </div>
    168172            </div>
    169 
    170173        </div>
    171174    </div>
Note: See TracChangeset for help on using the changeset viewer.