Changeset 3463786
- Timestamp:
- 02/17/2026 07:39:21 PM (3 weeks ago)
- Location:
- lifepress
- Files:
-
- 74 added
- 7 edited
-
tags/2.2.2 (added)
-
tags/2.2.2/README.txt (added)
-
tags/2.2.2/assets (added)
-
tags/2.2.2/assets/admin.css (added)
-
tags/2.2.2/assets/admin.js (added)
-
tags/2.2.2/assets/global.css (added)
-
tags/2.2.2/assets/libs (added)
-
tags/2.2.2/assets/libs/fontawesome (added)
-
tags/2.2.2/assets/libs/fontawesome/all.js (added)
-
tags/2.2.2/assets/libs/fontawesome/all.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/brands.js (added)
-
tags/2.2.2/assets/libs/fontawesome/brands.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/conflict-detection.js (added)
-
tags/2.2.2/assets/libs/fontawesome/conflict-detection.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/fontawesome.js (added)
-
tags/2.2.2/assets/libs/fontawesome/fontawesome.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/regular.js (added)
-
tags/2.2.2/assets/libs/fontawesome/regular.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/solid.js (added)
-
tags/2.2.2/assets/libs/fontawesome/solid.min.js (added)
-
tags/2.2.2/assets/libs/fontawesome/v4-shims.js (added)
-
tags/2.2.2/assets/libs/fontawesome/v4-shims.min.js (added)
-
tags/2.2.2/assets/libs/handlebars.js (added)
-
tags/2.2.2/assets/libs/jquery-ui (added)
-
tags/2.2.2/assets/libs/jquery-ui/images (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-bg_glass_100_f8f8f8_1x400.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-bg_glass_35_dddddd_1x400.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-bg_glass_60_eeeeee_1x400.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-bg_inset-hard_75_999999_1x100.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-bg_inset-soft_50_c9c9c9_1x100.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-icons_3383bb_256x240.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-icons_70b2e1_256x240.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-icons_999999_256x240.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/images/ui-icons_fbc856_256x240.png (added)
-
tags/2.2.2/assets/libs/jquery-ui/jquery-ui.css (added)
-
tags/2.2.2/assets/libs/jquery-ui/jquery-ui.min.css (added)
-
tags/2.2.2/assets/libs/jquery-ui/theme.css (added)
-
tags/2.2.2/assets/libs/spectrum.css (added)
-
tags/2.2.2/assets/libs/spectrum.js (added)
-
tags/2.2.2/assets/libs/trumbowyg (added)
-
tags/2.2.2/assets/libs/trumbowyg/trumbowyg.min.js (added)
-
tags/2.2.2/assets/libs/trumbowyg/ui (added)
-
tags/2.2.2/assets/libs/trumbowyg/ui/icons.svg (added)
-
tags/2.2.2/assets/libs/trumbowyg/ui/trumbowyg.css (added)
-
tags/2.2.2/assets/libs/trumbowyg/ui/trumbowyg.min.css (added)
-
tags/2.2.2/assets/script.js (added)
-
tags/2.2.2/includes (added)
-
tags/2.2.2/includes/admin (added)
-
tags/2.2.2/includes/admin/class-admin-ajax.php (added)
-
tags/2.2.2/includes/admin/class-admin.php (added)
-
tags/2.2.2/includes/class-ajax.php (added)
-
tags/2.2.2/includes/class-entries.php (added)
-
tags/2.2.2/includes/class-entry.php (added)
-
tags/2.2.2/includes/class-frontend.php (added)
-
tags/2.2.2/includes/class-helper.php (added)
-
tags/2.2.2/includes/class-install.php (added)
-
tags/2.2.2/includes/class-lp_type_data.php (added)
-
tags/2.2.2/includes/class-lunisolar.php (added)
-
tags/2.2.2/includes/class-metrics.php (added)
-
tags/2.2.2/includes/class-settings.php (added)
-
tags/2.2.2/includes/class-shortcode.php (added)
-
tags/2.2.2/includes/class-time.php (added)
-
tags/2.2.2/includes/lib (added)
-
tags/2.2.2/includes/lib/MoonPhase.php (added)
-
tags/2.2.2/lang (added)
-
tags/2.2.2/lang/lifepress.mo (added)
-
tags/2.2.2/lang/lifepress.po (added)
-
tags/2.2.2/lifepress.php (added)
-
tags/2.2.2/templates (added)
-
tags/2.2.2/templates/class-template_parts.php (added)
-
tags/2.2.2/templates/dashboard.php (added)
-
tags/2.2.2/templates/header.php (added)
-
tags/2.2.2/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/assets/global.css (modified) (5 diffs)
-
trunk/assets/script.js (modified) (6 diffs)
-
trunk/includes/class-ajax.php (modified) (10 diffs)
-
trunk/lifepress.php (modified) (2 diffs)
-
trunk/templates/class-template_parts.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lifepress/trunk/README.txt
r3429289 r3463786 4 4 Author URI: https://ashanjay.com 5 5 Requires at least: 6.0 6 Tested up to: 6.9 7 Stable tag: 2.2. 16 Tested up to: 6.9.1 7 Stable tag: 2.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 56 56 This view is ideal for those who prefer to plan, reflect, and reset in harmony with nature’s cycles rather than purely linear time. 57 **[Learn how to use Moon Cycles](https://ashanjay.com/before-clocks-ruled-us-a-life-aligned-with-moon-sun-cycles/)** in your life. 57 58 58 59 == 🗄️ Data Metrics (New in 2.2) == … … 132 133 133 134 == Changelog == 135 = 2.2.2 (2026-2-17) = 136 FIXED: new entry form focus on title field on load 137 FIXED: saving entry loading all again 138 FIXED: save button styles 139 FIXED: action=lp_form_submit vulnerability 140 UPDATED: Button styles 141 UPDATED: Today box styles 142 134 143 = 2.2.1 (2025-12-29) = 135 144 FIXED: Normal calendar to other calendar view not working -
lifepress/trunk/assets/admin.css
r3428394 r3463786 187 187 .lp_loading.lp_lightbox_in:before{top: 0;left: 0; border-radius: 20px;} 188 188 189 189 190 /* Lightbox */ 190 191 #lp_lightboxes{ position: fixed;width: 100%;z-index: 900000; top:0; } -
lifepress/trunk/assets/global.css
r3429289 r3463786 51 51 cursor: pointer; 52 52 text-transform: uppercase; 53 padding: 7px 20px; 54 display: inline-block; 53 padding: 10px 20px; 54 display: inline-flex; 55 align-items: center; 55 56 border-radius: 20px; 56 57 background-color: #fff; 57 58 color: var(--lp_color_1); 59 font-family: var(--lp_font_1); 58 60 font-size: 13px; 59 61 font-weight: bold; 60 62 margin-right: 5px; 61 63 text-decoration: none; 62 } 64 border:none; box-shadow: none; 65 } 66 .lp_btn:focus, .lp_nobtn:focus{outline:none; box-shadow: 0rem 0rem 0rem .063rem #FFFFFF, 0rem 0rem 0rem .188rem #000000;} 63 67 .lp_btn:hover{opacity: 0.8} 64 68 .lp_btn.blue{background-color: var(--lp_color_blue); color:#fff;} … … 71 75 .lp_btn.lp_svg{display: inline-flex; align-items: center; padding: 0; background-color: transparent;} 72 76 .lp_btn.lp_svg svg{margin:0!important; padding: 5px 10px 5px 5px;} 77 .lp_btn.bold{ 78 font-size: 14px; 79 padding: 15px 30px; 80 border-radius: 10px;max-height: 44px; 81 } 82 .lp_nobtn{box-shadow: none; border:none; outline: none;} 73 83 74 84 .lp_trans{ … … 588 598 transform:translateX(-100%); 589 599 } 600 601 602 .lp_loading_spinner { 603 display: inline-block; 604 width: 18px; 605 height: 18px; 606 border: 3px solid #fff; 607 border-top: 3px solid transparent; 608 border-radius: 50%; 609 animation: spin 1s linear infinite; 610 margin-right: 10px; 611 vertical-align: middle; 612 } 613 .lp_loading_spinner.d{ 614 border: 3px solid #0073aa; 615 border-top: 3px solid transparent; 616 } 617 618 @keyframes spin { 619 0% { transform: rotate(0deg); } 620 100% { transform: rotate(360deg); } 621 } 590 622 /* tooltip */ 591 623 .lp_elms{ position: absolute; z-index: 48392749832;pointer-events: none;} … … 660 692 border-radius: 10px; 661 693 padding: 10px; 662 flex: 1;663 694 } 664 695 … … 931 962 .lp_moon_view .day.new{ background-color: #f8f8f8;} 932 963 .lp_moon_view .day.newMonth{ border-left: 3px solid var(--lp_color_blue);} 964 .lp_moon_view .day.today{ box-shadow: inset 0px 0px 2px;} 933 965 934 966 /* list view */ -
lifepress/trunk/assets/script.js
r3429289 r3463786 4 4 */ 5 5 jQuery(document).ready(function($){ 6 7 6 8 7 … … 975 974 }) 976 975 977 .on('click','.lp_toggles',function(){ 976 .on('click','.lp_toggles',function(e){ 977 e.preventDefault(); 978 978 var item = $(this).data('t'); 979 979 … … 993 993 } 994 994 }) 995 .on('click','.lp_toggles_dn',function(){ 995 .on('click','.lp_toggles_dn',function(e){ 996 e.preventDefault(); 996 997 item = $(this).data('t'); 997 998 BODY.find('.'+ item).toggleClass('dn'); … … 1099 1100 }); 1100 1101 1102 setTimeout(() => { BODY.find('.lp_entry_title').focus();} ,500); 1101 1103 $('.lp_form_details').trumbowyg({ 1102 1104 btns: [ … … 1447 1449 1448 1450 // save 1449 BODY.on('click','.form_submit',function(){ 1450 form = $(this).closest('form'); 1451 LB = $(this).closest('.lp_one_lightbox'); 1451 BODY.on('click','.form_submit',function(e){ 1452 e.preventDefault(); 1453 1454 const $btn = $(this); 1455 const form = $(this).closest('form'); 1456 const LB = $(this).closest('.lp_one_lightbox'); 1452 1457 1458 $btn.html( `<span class="lp_loading_spinner"></span> Saving...`).prop('disabled', true); 1453 1459 1454 1460 var form_submit_type = $(this).hasClass('save_draft') ? 'save_draft':'submit'; … … 1458 1464 var item_type = form.find('input[name=item_type]').val(); 1459 1465 1466 1460 1467 form.ajaxSubmit({ 1461 beforeSend: function(){ LB.addClass('lp_loading'); }, 1468 beforeSend: function(){ 1469 //LB.addClass('lp_loading'); 1470 }, 1462 1471 type: 'POST',url:lp_ajax.ajaxurl,dataType:'json', 1463 success:function(data){ 1472 success:function(data){ 1464 1473 if(data.status == 'good'){ 1465 1474 -
lifepress/trunk/includes/class-ajax.php
r3429289 r3463786 295 295 $post = $HELP->recursive_sanitize_array_fields($_POST); 296 296 297 $item_type = $post['item_type']; 298 $tag_data = array(); 297 $item_type = isset($post['item_type']) ? trim($post['item_type']) : ''; 298 $tag_data = []; 299 $entry_id = isset($post['entry_id']) ? absint($post['entry_id']) : 0; 300 $tag_id = isset($post['tag_id']) ? absint($post['tag_id']) : 0; 301 302 // verify item type pass 303 if (!in_array($item_type, ['entry', 'tag'], true)) { 304 wp_send_json_error([ 305 'error_msg' => 'Invalid item_type', 306 'notice_msg' => 'Invalid request', 307 'notice_type' => 'bad' 308 ]); 309 } 299 310 300 311 // ENTRY 301 312 if( $item_type == 'entry'){ 302 313 314 // Check if user is logged in 315 if ( ! is_user_logged_in() ) { 316 wp_send_json(array( 317 'status'=>'bad', 318 'error_msg'=>__('You must be logged in to perform this action', 'lp'), 319 'notice_msg'=>__('Unauthorized access'), 320 'notice_type'=>'bad', 321 )); 322 wp_die(); 323 } 324 325 303 326 // EDIT 304 if(isset($post['entry_id']) && !empty($post['entry_id'])){ 305 $entry_id = (int)$post['entry_id']; 327 if( $entry_id > 0 ){ 328 329 // Check permission to edit this specific post 330 if ( ! current_user_can('edit_post', $entry_id) ) { 331 wp_send_json(array( 332 'status'=>'bad', 333 'error_msg'=>__('You do not have permission to edit this entry', 'lp'), 334 'notice_msg'=>__('Permission denied'), 335 'notice_type'=>'bad', 336 )); 337 wp_die(); 338 } 306 339 307 340 $date = explode('-', $post['date'] ); … … 320 353 ); 321 354 $result = wp_update_post($entry); 355 356 if (is_wp_error($result)) { 357 error_log("LifePress form_submit wp_update_post failed: " . $result->get_error_message()); 358 wp_send_json([ 359 'status' => 'bad', 360 'notice_msg' => __('Could not update entry. Please try again.', 'lp'), 361 'notice_type'=> 'bad' 362 ]); 363 wp_die(); 364 } 322 365 323 366 if($result){ … … 357 400 // NEW 358 401 }else{ 402 // Check permission to create/publish new posts of this type 403 $post_type_object = get_post_type_object('lp_entry'); 404 if ( ! current_user_can($post_type_object->cap->publish_posts) ) { 405 wp_send_json(array( 406 'status'=>'bad', 407 'error_msg'=>__('You do not have permission to create new entries', 'lp'), 408 'notice_msg'=>__('Permission denied'), 409 'notice_type'=>'bad', 410 )); 411 wp_die(); 412 } 413 359 414 $ENT = new LIFEPRESS_Entries(); 360 415 … … 365 420 $D->setDate($date[0], $date[1], $date[2]); 366 421 $D->setTime(0,0,1); 422 $post_status = current_user_can('publish_posts') ? 'publish' : 'draft'; 367 423 368 424 $entry_id = $ENT->create_new(array( … … 370 426 'post_title'=> (isset($post['title'])? 371 427 $post['title']: __('Entry on').' '. $post['date'] ), 372 'post_status'=> 'publish',428 'post_status'=> $post_status, 373 429 'post_content'=> (isset($post['details'])? $post['details'] :''), 374 430 'date'=> $D->format('Y-m-d H:i:s'), … … 385 441 // save image 386 442 if( !empty( $_FILES ) && 'POST' == $_SERVER['REQUEST_METHOD'] ){ 387 $this->save_featured_image($entry_id, 'lp_entry_img'); 443 if (current_user_can('upload_files')) { 444 $this->save_featured_image($entry_id, 'lp_entry_img'); 445 } 388 446 } 389 447 … … 422 480 } 423 481 424 }else{ // tag type 482 } 483 484 // tag type 485 if ($item_type === 'tag' && $tag_id > 0) { 486 // Check if user is logged in 487 if ( ! is_user_logged_in() ) { 488 wp_send_json(array( 489 'status'=>'bad', 490 'error_msg'=>__('You must be logged in to perform this action', 'lp'), 491 'notice_msg'=>__('Unauthorized access'), 492 'notice_type'=>'bad', 493 )); 494 wp_die(); 495 } 425 496 426 497 if( !isset($post['tag_id'])){ … … 433 504 434 505 $ETD = new LIFEPRESS_Type_Data(); 435 $term_id = $post['tag_id']; 436 $ETD->set_id($term_id); 506 $ETD->set_id($tag_id); 437 507 438 508 $exists = $ETD->tag_exists(); … … 443 513 'notice_msg'=>__('Tag does not exists'), 444 514 'notice_type'=>'bad', 445 ));wp_die();515 ));wp_die(); 446 516 447 517 // exists 448 518 }else{ 519 if ( ! current_user_can('manage_categories') ) { 520 wp_send_json(array( 521 'status'=>'bad', 522 'error_msg'=>__('You do not have permission to edit tags', 'lp'), 523 'notice_msg'=>__('Permission denied'), 524 'notice_type'=>'bad', 525 )); 526 wp_die(); 527 } 449 528 450 529 $C = isset($post['c'])? $post['c']:'808080'; … … 459 538 'notice_msg'=>__('Successfully updated tag'), 460 539 'notice_type'=>'good', 461 ));wp_die(); 540 )); 541 wp_die(); 462 542 } 463 543 -
lifepress/trunk/lifepress.php
r3429289 r3463786 5 5 * Description: You are the creator of events in your life. Record and track progress in your life. 6 6 * Author: Ashan Jay 7 * Version: 2.2. 17 * Version: 2.2.2 8 8 * Requires at least: 6.0 9 * Tested up to: 6.9 9 * Tested up to: 6.9.1 10 10 * Author URI: http://www.ashanjay.com/ 11 11 * … … 20 20 class LIFEPRESS{ 21 21 22 public $version='2.2. 122 public $version='2.2.2 23 23 '; 24 24 public $name = 'LifePress'; -
lifepress/trunk/templates/class-template_parts.php
r3428394 r3463786 345 345 </span> 346 346 </div> 347 <p class="data_row padt10"><span class='lp_btn form_submit orange'><?php _e('Submit');?></span></p>347 <p class="data_row padt10"><span class='lp_btn bold form_submit lp_trans blue'><?php _e('Submit');?></span></p> 348 348 </form> 349 349 <?php … … 432 432 </p> 433 433 434 <p class='data_row no_icon'><input type="text" placeholder='<?php _e('Add title','lp')?>' name='title' value='{{fields.title}}'/></p>434 <p class='data_row no_icon'><input class='lp_entry_title' tab-index='3' type="text" placeholder='<?php _e('Add title','lp')?>' name='title' value='{{fields.title}}'/></p> 435 435 436 436 <div class='data_row details marb10 lp_toggabalables'> … … 438 438 <i class="fas fa-align-left"></i> 439 439 </span> 440 < span class='lp_form_field_label lp_toggles lp_clickable lp_hidable' data-t='lp_editor_box'><?php _e('Add description','lp');?></span>440 <button class='lp_form_field_label lp_btn lp_nobtn lp_toggles lp_clickable lp_hidable' data-t='lp_editor_box'><i class='fa fa-plus' style="margin:0 5px 0 0;"></i> <?php _e('Add description','lp');?></button> 441 441 442 442 <div class='lp_editor_box ' style='display:{{#if fields.details}}block{{else}}none{{/if}}'> 443 <textarea class='lp_form_details' name='details'>{{fields.details}}</textarea>443 <textarea tab-index='4' class='lp_form_details' name='details'>{{fields.details}}</textarea> 444 444 </div> 445 445 </div> … … 449 449 <i class="fas fa-image"></i> 450 450 <p class='w100'> 451 < span class='lp_btn blue lp_select_image'><?php _e('Select Image','lp');?></span>451 <button class='lp_btn blue lp_select_image'><?php _e('Select Image','lp');?></button> 452 452 <input class='lp_select_image_input' style='opacity:0;display:none' type="file" name="lp_entry_img"/> 453 453 <?php echo wp_nonce_field( 'my_image_upload', 'my_image_upload_nonce' );?> … … 474 474 475 475 <p class="data_row no_icon padt30" style="justify-content: flex-start;"> 476 < span class='lp_btn orange form_submit'><?php _e('Submit','lp');?></span>477 < span class='lp_btn grey form_submit save_draft'><?php _e('Save Draft','lp');?></span>476 <button class='lp_btn bold blue lp_trans form_submit'><?php _e('Submit','lp');?></button> 477 <button class='lp_btn bold grey form_submit save_draft'><?php _e('Save Draft','lp');?></button> 478 478 </p> 479 479 </form>
Note: See TracChangeset
for help on using the changeset viewer.