Changeset 3129161
- Timestamp:
- 08/01/2024 04:47:20 AM (16 months ago)
- Location:
- simple-jwt-login-mailpoet
- Files:
-
- 29 added
- 5 edited
-
tags/1.0.0/LICENSE (added)
-
tags/1.0.0/README.md (added)
-
tags/1.0.0/README.txt (added)
-
tags/1.0.0/assets (added)
-
tags/1.0.0/assets/css (added)
-
tags/1.0.0/assets/css/style.css (added)
-
tags/1.0.0/assets/js (added)
-
tags/1.0.0/assets/js/scripts.js (added)
-
tags/1.0.0/i18n (added)
-
tags/1.0.0/i18n/simple-jwt-login-mailpoet.pot (added)
-
tags/1.0.0/mailpoet.php (added)
-
tags/1.0.0/simple-jwt-login-mailpoet.php (added)
-
tags/1.0.0/views (added)
-
tags/1.0.0/views/layout.php (added)
-
tags/1.0.1 (added)
-
tags/1.0.1/LICENSE (added)
-
tags/1.0.1/README.md (added)
-
tags/1.0.1/README.txt (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/style.css (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/scripts.js (added)
-
tags/1.0.1/i18n (added)
-
tags/1.0.1/i18n/simple-jwt-login-mailpoet.pot (added)
-
tags/1.0.1/mailpoet.php (added)
-
tags/1.0.1/simple-jwt-login-mailpoet.php (added)
-
tags/1.0.1/views (added)
-
tags/1.0.1/views/layout.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/assets/js/scripts.js (modified) (1 diff)
-
trunk/mailpoet.php (modified) (5 diffs)
-
trunk/simple-jwt-login-mailpoet.php (modified) (1 diff)
-
trunk/views/layout.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-jwt-login-mailpoet/trunk/README.txt
r3080651 r3129161 3 3 Contributors: nicu_m 4 4 Donate 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, mailpoet5 Tags: jwt, auto login, tokens, auth, generate jwt, mailpoet 6 6 Requires at least: 4.4.0 7 Tested up to: 6. 57 Tested up to: 6.6 8 8 Requires PHP: 5.5 9 Stable tag: 1.0. 09 Stable tag: 1.0.1 10 10 License: GPLv2 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 36 36 `` 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"] 38 38 `` 39 39 40 40 This example will generate a red link, with the text "Login". 41 42 You can also customize the shortcode to just return the URL. 43 44 `` 45 [custom:simple-jwt-login text="Login" validity="604800" isUrl="on"] 46 `` 41 47 42 48 == Screenshots == … … 76 82 == Changelog == 77 83 84 = 1.0.1 ( 31 Jul 2024) 85 - Fix Shortcode handler 86 - Update WordPress 6.6 compatibility 87 78 88 = 1.0.0 ( 03 May 2024) 79 89 - Test with latest WordPress version -
simple-jwt-login-mailpoet/trunk/assets/js/scripts.js
r3080651 r3129161 3 3 const shortcode = 'custom:simple-jwt-login'; 4 4 const shortCodePreview = document.getElementById('simple-jwt-login-mailpoet-short-code'); 5 const linkPreview = document.getElementById('simple-jwt-login-mailpo rt-preview');5 const linkPreview = document.getElementById('simple-jwt-login-mailpoet-preview'); 6 6 7 7 renderCode(); -
simple-jwt-login-mailpoet/trunk/mailpoet.php
r3080651 r3129161 2 2 3 3 use SimpleJWTLogin\Helpers\Jwt\JwtKeyFactory; 4 use SimpleJWTLogin\Libraries\JWT ;4 use SimpleJWTLogin\Libraries\JWT\JWT; 5 5 use SimpleJWTLogin\Modules\SimpleJWTLoginSettings; 6 6 use SimpleJWTLogin\Modules\WordPressData; … … 8 8 add_filter('mailpoet_newsletter_shortcode', 'simple_jwt_login_mailpoet_shortcode', 1, 6); 9 9 //mailpoet_newsletter_shortcode 10 11 10 12 11 function simple_jwt_login_mailpoet_shortcode( … … 19 18 ) 20 19 { 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); 23 22 24 23 // always return the shortcode if it doesn't match your own! 25 if ( $isValidShortcode === false || $subscriber === null) {24 if (empty($matches)) { 26 25 return $shortcode; 27 26 } … … 66 65 } 67 66 if (isset($arguments['redirectUrl']) && $arguments['redirectUrl'] !== '') { 68 $url .= '&redirectUrl=' . $arguments['redirectUrl'];67 $url .= '&redirectUrl=' . urlencode($arguments['redirectUrl']); 69 68 } 70 69 … … 77 76 } 78 77 79 return '<a href="' . $url . '"'78 return '<a href="' . $url . '"' 80 79 . ($style ? ' style="' . $style . '"' : '') 81 80 . ($class ? ' class="' . $class . '"' : '') -
simple-jwt-login-mailpoet/trunk/simple-jwt-login-mailpoet.php
r3080651 r3129161 8 8 Text Domain: simple-jwt-login-mailpoet 9 9 Domain Path: /i18n 10 Version: 1.0. 010 Version: 1.0.1 11 11 */ 12 12 13 13 add_action('admin_menu', 'simple_jwt_login__mailpoet_plugin_create_menu_entry', 11); 14 if ( check_simple_jwt_login_activated() == false) {14 if (!check_simple_jwt_login_activated()) { 15 15 add_action('admin_notices', 'simple_jwt_login_plugin_missing_notice'); 16 16 } -
simple-jwt-login-mailpoet/trunk/views/layout.php
r3080651 r3129161 31 31 } 32 32 ?> 33 33 34 <div id="simple-jwt-login-mailpoet"> 34 35 <div class="row"> … … 68 69 </div> 69 70 <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> 71 73 <p> 72 74 <?php … … 77 79 ?> 78 80 </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"/> 80 82 81 83 </div> … … 92 94 </p> 93 95 <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> 95 98 </div> 96 99 <div class="item"> … … 107 110 108 111 </div> 112 <hr/> 109 113 <h2><?php echo __('Design', 'simple-jwt-login-mailpoet'); ?></h2> 110 114 <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> 112 116 <p> 113 117 <?php … … 121 125 </div> 122 126 <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> 124 128 <p> 125 129 <?php … … 133 137 </div> 134 138 <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> 136 140 <p> 137 141 <?php … … 142 146 ?> 143 147 </p> 144 <textarea id="class-style" class="input form-control" value=""></textarea>148 <textarea id="class-style" class="input form-control"></textarea> 145 149 </div> 146 150 </div> … … 163 167 <h3><?php echo __('Shortcode Preview', 'simple-jwt-login-mailpoet'); ?></h3> 164 168 <div class="preview-button-container"> 165 <div id="simple-jwt-login-mailpo rt-preview"></div>169 <div id="simple-jwt-login-mailpoet-preview"></div> 166 170 </div> 167 171 </div> 168 172 </div> 169 170 173 </div> 171 174 </div>
Note: See TracChangeset
for help on using the changeset viewer.