Changeset 3407370
- Timestamp:
- 12/01/2025 11:16:20 PM (4 months ago)
- Location:
- hipaatizer
- Files:
-
- 69 added
- 4 edited
-
tags/1.3.7 (added)
-
tags/1.3.7/admin (added)
-
tags/1.3.7/admin/class-hipaatizer-admin.php (added)
-
tags/1.3.7/admin/css (added)
-
tags/1.3.7/admin/css/hipaatizer-admin.css (added)
-
tags/1.3.7/admin/img (added)
-
tags/1.3.7/admin/img/beta.svg (added)
-
tags/1.3.7/admin/img/edit-icon.png (added)
-
tags/1.3.7/admin/img/features-image.jpg (added)
-
tags/1.3.7/admin/img/icon.png (added)
-
tags/1.3.7/admin/img/info-icon.svg (added)
-
tags/1.3.7/admin/img/link-icon.png (added)
-
tags/1.3.7/admin/img/login-icon.png (added)
-
tags/1.3.7/admin/img/logo.svg (added)
-
tags/1.3.7/admin/img/logout-icon.svg (added)
-
tags/1.3.7/admin/img/refesh-icon.svg (added)
-
tags/1.3.7/admin/img/spinner.gif (added)
-
tags/1.3.7/admin/index.php (added)
-
tags/1.3.7/admin/js (added)
-
tags/1.3.7/admin/js/hipaatizer-admin.js (added)
-
tags/1.3.7/admin/partials (added)
-
tags/1.3.7/admin/partials/hipaatizer-admin-display.php (added)
-
tags/1.3.7/assets (added)
-
tags/1.3.7/assets/banner-1544x500.png (added)
-
tags/1.3.7/assets/banner-772x250.png (added)
-
tags/1.3.7/assets/icon-128x128.png (added)
-
tags/1.3.7/assets/screenshot-1.png (added)
-
tags/1.3.7/assets/screenshot-10.png (added)
-
tags/1.3.7/assets/screenshot-11.png (added)
-
tags/1.3.7/assets/screenshot-12.png (added)
-
tags/1.3.7/assets/screenshot-13.png (added)
-
tags/1.3.7/assets/screenshot-14.png (added)
-
tags/1.3.7/assets/screenshot-15.png (added)
-
tags/1.3.7/assets/screenshot-2.png (added)
-
tags/1.3.7/assets/screenshot-3.png (added)
-
tags/1.3.7/assets/screenshot-4.png (added)
-
tags/1.3.7/assets/screenshot-5.png (added)
-
tags/1.3.7/assets/screenshot-6.png (added)
-
tags/1.3.7/assets/screenshot-7.png (added)
-
tags/1.3.7/assets/screenshot-8.png (added)
-
tags/1.3.7/assets/screenshot-9.png (added)
-
tags/1.3.7/hipaatizer.php (added)
-
tags/1.3.7/includes (added)
-
tags/1.3.7/includes/block.json (added)
-
tags/1.3.7/includes/build (added)
-
tags/1.3.7/includes/build/index.asset.php (added)
-
tags/1.3.7/includes/build/index.js (added)
-
tags/1.3.7/includes/build/style-index.css (added)
-
tags/1.3.7/includes/class-hipaatizer-activator.php (added)
-
tags/1.3.7/includes/class-hipaatizer-deactivator.php (added)
-
tags/1.3.7/includes/class-hipaatizer-i18n.php (added)
-
tags/1.3.7/includes/class-hipaatizer-loader.php (added)
-
tags/1.3.7/includes/class-hipaatizer.php (added)
-
tags/1.3.7/includes/css (added)
-
tags/1.3.7/includes/css/editor.css (added)
-
tags/1.3.7/includes/css/style.css (added)
-
tags/1.3.7/includes/js (added)
-
tags/1.3.7/includes/js/hipaa-form.js (added)
-
tags/1.3.7/includes/js/index.js (added)
-
tags/1.3.7/includes/package.json (added)
-
tags/1.3.7/languages (added)
-
tags/1.3.7/languages/hipaatizer.pot (added)
-
tags/1.3.7/public (added)
-
tags/1.3.7/public/class-hipaatizer-public.php (added)
-
tags/1.3.7/public/css (added)
-
tags/1.3.7/public/css/hipaatizer-public.css (added)
-
tags/1.3.7/public/index.php (added)
-
tags/1.3.7/readme.txt (added)
-
tags/1.3.7/uninstall.php (added)
-
trunk/admin/class-hipaatizer-admin.php (modified) (20 diffs)
-
trunk/admin/js/hipaatizer-admin.js (modified) (6 diffs)
-
trunk/hipaatizer.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hipaatizer/trunk/admin/class-hipaatizer-admin.php
r3192694 r3407370 21 21 add_action( 'init', array( $this, 'hipaatizer_id' ) ); 22 22 add_action( 'init', array( $this, 'hipaa_whiteLabet' ) ); 23 add_action( ' init', array( $this, 'hipaa_transfer_cf7_uregistered' ) );24 add_action( ' init', array( $this, 'hipaa_transfer_wpf_uregistered' ) );25 add_action( ' init', array( $this, 'hipaa_transfer_gf_uregistered' ) );23 add_action( 'admin_init', array( $this, 'hipaa_transfer_cf7_uregistered' ) ); 24 add_action( 'admin_init', array( $this, 'hipaa_transfer_wpf_uregistered' ) ); 25 add_action( 'admin_init', array( $this, 'hipaa_transfer_gf_uregistered' ) ); 26 26 add_filter( 'script_loader_tag', array( $this,'hipaa_script_tags'), 10, 2); 27 27 add_action( 'wp_ajax_refresh_hipaa_forms', array( $this, 'hipaa_refresh_hipaa_forms' ) ); 28 add_action( 'wp_ajax_nopriv_refresh_hipaa_forms', array( $this, 'hipaa_refresh_hipaa_forms' ) );29 28 add_action( 'wp_ajax_tabs_hipaa_forms', array( $this, 'hipaa_tabs_hipaa_forms' ) ); 30 add_action( 'wp_ajax_nopriv_tabs_hipaa_forms', array( $this, 'hipaa_tabs_hipaa_forms' ) );31 32 33 29 } 34 30 … … 37 33 38 34 $site_id = ( is_multisite() ) ? get_current_blog_id() : ''; 39 $dbprefix = ( is_multisite() ) ? $wpdb->get_blog_prefix(0) : $wpdb->prefix;35 $dbprefix = is_multisite() ? $wpdb->get_blog_prefix( get_current_blog_id() ) : $wpdb->prefix; 40 36 $cf7key = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); 41 37 … … 54 50 ); endif; 55 51 56 if( !empty($_GET['code']) ){ 57 $code = sanitize_key($_GET['code']); 58 59 if( !empty($_GET['cf7']) ){ 60 61 $this->hipaa_transfer_cf7(); 62 63 if( $message == "Successful operation."){ 64 $curl = HIPAATIZER_APP.'/api/v1/account/activate?code='.$code.'&contactForm7Id='.$cf7key; 52 if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { 53 return; 54 } 55 if( !empty($_GET['code']) ){ 56 $code = sanitize_text_field( wp_unslash( $_GET['code'] ) ); 57 if( !empty($_GET['cf7']) ){ 58 59 $this->hipaa_transfer_cf7(); 60 61 if( $message == "Successful operation."){ 62 $curl = HIPAATIZER_APP.'/api/v1/account/activate?code='.$code.'&contactForm7Id='.$cf7key; 63 } else { 64 $curl = HIPAATIZER_APP.'/api/v1/account/activate?code='.$code; 65 } 66 65 67 } else { 66 68 $curl = HIPAATIZER_APP.'/api/v1/account/activate?code='.$code; 67 69 } 68 69 } else { 70 $curl = HIPAATIZER_APP.'/api/v1/account/activate?code='.$code; 71 } 72 73 74 $response = wp_remote_get( $curl); 75 $body = wp_remote_retrieve_body( $response ); 76 $res = json_decode($body, true); 77 $hipaa_message = ( !empty($res['message']) ) ? $res['message'] : ''; 78 79 if( $hipaa_message == '' ){ 80 $new_hipaaID = sanitize_key($body); 81 if( !empty($new_hipaaID)){ 82 83 if (isset($hipaaID)){ 84 if( !empty($site_id)) : 85 $wpdb->query( $wpdb->prepare( "UPDATE `{$dbprefix}hipaatizer` SET hipaatizer_id = %s WHERE id = %s AND site_id = %s", $new_hipaaID, $rowID, $site_id ) ); 86 else: 87 $wpdb->query( $wpdb->prepare( "UPDATE `{$dbprefix}hipaatizer` SET hipaatizer_id = %s WHERE id = %s", $new_hipaaID, $rowID ) ); 88 endif; 89 } else { 90 if( !empty($site_id)) : 91 $wpdb->query( $wpdb->prepare( "INSERT INTO `{$dbprefix}hipaatizer` (hipaatizer_id, site_id) VALUES ( %s, %s)", $new_hipaaID, $site_id ) ); 92 else: 93 $wpdb->query( $wpdb->prepare( "INSERT INTO `{$dbprefix}hipaatizer` (hipaatizer_id) VALUES ( %s )", $new_hipaaID ) ); 94 endif; 70 $response = wp_remote_get( $curl); 71 $body = wp_remote_retrieve_body( $response ); 72 $res = json_decode($body, true); 73 $hipaa_message = ( !empty($res['message']) ) ? $res['message'] : ''; 74 75 if( $hipaa_message == '' ){ 76 $new_hipaaID = sanitize_key($body); 77 if( !empty($new_hipaaID)){ 78 79 if (isset($hipaaID)){ 80 if( !empty($site_id)) : 81 $wpdb->query( $wpdb->prepare( "UPDATE `{$dbprefix}hipaatizer` SET hipaatizer_id = %s WHERE id = %s AND site_id = %s", $new_hipaaID, $rowID, $site_id ) ); 82 else: 83 $wpdb->query( $wpdb->prepare( "UPDATE `{$dbprefix}hipaatizer` SET hipaatizer_id = %s WHERE id = %s", $new_hipaaID, $rowID ) ); 84 endif; 85 } else { 86 if( !empty($site_id)) : 87 $wpdb->query( $wpdb->prepare( "INSERT INTO `{$dbprefix}hipaatizer` (hipaatizer_id, site_id) VALUES ( %s, %s)", $new_hipaaID, $site_id ) ); 88 else: 89 $wpdb->query( $wpdb->prepare( "INSERT INTO `{$dbprefix}hipaatizer` (hipaatizer_id) VALUES ( %s )", $new_hipaaID ) ); 90 endif; 91 } 92 delete_transient( 'hipaatizer_public_info_' . $new_hipaaID ); 93 unset($_COOKIE['hipaaID']); 94 setcookie('hipaaID', '', time() - 3600); 95 $path = admin_url( 'admin.php' ).'?page=hipaatizer'; 96 wp_redirect( esc_url($path) ); 97 exit; 95 98 } 96 unset($_COOKIE['hipaaID']); 97 setcookie('hipaaID', '', time() - 3600); 98 $path = admin_url( 'admin.php' ).'?page=hipaatizer'; 99 wp_redirect( esc_url($path) ); 100 exit; 101 } 102 103 } 104 99 100 } 105 101 } 106 102 if( !empty($_COOKIE['hipaaID'])){ … … 120 116 endif; 121 117 } 118 delete_transient( 'hipaatizer_public_info_' . $new_hipaaID ); 122 119 unset($_COOKIE['hipaaID']); 123 120 setcookie('hipaaID', '', time() - 3600); … … 129 126 130 127 if( isset($_GET['hipaa_logout']) && $_GET['hipaa_logout'] == 1){ 128 if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { 129 return; 130 } 131 132 if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'hipaa_logout' ) ) { 133 return; 134 } 131 135 unset($_COOKIE['hipaaID']); 136 if ( ! empty( $hipaaID ) ) { 137 delete_transient( 'hipaatizer_public_info_' . $hipaaID ); 138 } 132 139 setcookie('hipaaID', '', time() - 3600); 133 140 if( !empty($site_id)) : … … 149 156 $iframe = ''; 150 157 $screen = get_current_screen(); 151 $dbprefix = ( is_multisite() ) ? $wpdb->get_blog_prefix(0) : $wpdb->prefix;158 $dbprefix = is_multisite() ? $wpdb->get_blog_prefix( get_current_blog_id() ) : $wpdb->prefix; 152 159 $login = '/login'; 153 160 … … 226 233 } 227 234 228 public function hipaa_whiteLabet() { 229 global $hipaaID, $whiteLabelUrl; 230 231 if ( $hipaaID != '' ): 232 233 $curl = HIPAATIZER_APP.'/api/v1/account/'.$hipaaID.'/public_info'; 234 $response = wp_remote_get( $curl); 235 $body = wp_remote_retrieve_body( $response ); 236 $res = json_decode($body, true); 237 238 $whiteLabelUrl = ( isset($res['whiteLabelUrl']) ) ? $res['whiteLabelUrl'] : ''; 239 240 if($whiteLabelUrl != '' && strrev($whiteLabelUrl)[0]==='/') { 241 $whiteLabelUrl = rtrim($whiteLabelUrl, '/'); 242 } 243 244 endif; 245 246 return $whiteLabelUrl; 235 public function hipaa_whiteLabet() { 236 global $hipaaID, $whiteLabelUrl; 237 238 if ( empty( $hipaaID ) ) { 239 return $whiteLabelUrl; 240 } 241 242 $cache_key = 'hipaatizer_public_info_' . $hipaaID; 243 244 $whiteLabelUrl = get_transient( $cache_key ); 245 if ( false !== $whiteLabelUrl ) { 246 return $whiteLabelUrl; 247 } 248 $curl = HIPAATIZER_APP . '/api/v1/account/' . $hipaaID . '/public_info'; 249 $response = wp_remote_get( $curl ); 250 251 if ( is_wp_error( $response ) ) { 252 return $whiteLabelUrl; 253 } 254 255 $body = wp_remote_retrieve_body( $response ); 256 $res = json_decode( $body, true ); 257 258 $whiteLabelUrl = ! empty( $res['whiteLabelUrl'] ) ? rtrim( $res['whiteLabelUrl'], '/' ) : ''; 259 260 set_transient( $cache_key, $whiteLabelUrl, DAY_IN_SECONDS ); 261 262 return $whiteLabelUrl; 247 263 } 264 248 265 public function hipaa_admin_menu() { 249 266 global $hipaaID; … … 344 361 } 345 362 public function hipaa_refresh_hipaa_forms(){ 346 363 if ( ! current_user_can( 'manage_options' ) ) { 364 wp_send_json_error( array( 'message' => 'Forbidden' ), 403 ); 365 } 347 366 check_ajax_referer( 'hipaa_refresh_hipaa_forms_nonce', 'nonce' ); 348 367 echo $this->hipaa_get_forms(); … … 351 370 352 371 public function hipaa_tabs_hipaa_forms(){ 372 if ( ! current_user_can( 'manage_options' ) ) { 373 wp_send_json_error( array( 'message' => 'Forbidden' ), 403 ); 374 } 375 376 check_ajax_referer( 'hipaa_refresh_hipaa_forms_nonce', 'nonce' ); 353 377 354 378 echo $this->hipaa_get_forms(); 355 wp_die();379 wp_die(); 356 380 } 357 381 … … 362 386 363 387 foreach($_GET['cf7'] as $val) { 364 388 $id = absint( $val ); 389 if ( ! $id ) { 390 continue; 391 } 365 392 $form = array(); 366 $cf7_post = get_post($ val);367 $form['id'] = $ val;393 $cf7_post = get_post($id); 394 $form['id'] = $id; 368 395 $form['title'] = $cf7_post->post_title; 369 396 $form['content'] = $cf7_post->post_content; … … 386 413 public function hipaa_transfer_cf7_uregistered(){ 387 414 global $cf7key, $message; 415 if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { 416 return; 417 } 418 if ( empty( $_GET['cf7'] ) || empty( $_GET['hipaaID'] ) ) { 419 return; 420 } 421 422 if ( ! isset( $_GET['hipaa_import_cf7_nonce'] ) || 423 ! wp_verify_nonce( $_GET['hipaa_import_cf7_nonce'], 'hipaa_import_cf7' ) ) { 424 return; 425 } 426 $hipaaID = sanitize_key( wp_unslash( $_GET['hipaaID'] ) ); 427 $_GET['cf7'] = array_map( 428 'absint', 429 (array) wp_unslash( $_GET['cf7'] ) 430 ); 388 431 if( !empty($_GET['cf7']) && !empty($_GET['hipaaID']) ){ 389 432 $this->hipaa_transfer_cf7(); … … 391 434 if( $message == "Successful operation."){ 392 435 if(!empty($_GET['hipaaID'])) { 393 $url = HIPAATIZER_APP.'/api/v1/account/import/contact_from_7?utm_source=wppl&contactForm7Id='.$cf7key.'&accountId='. sanitize_key($_GET['hipaaID']);436 $url = HIPAATIZER_APP.'/api/v1/account/import/contact_from_7?utm_source=wppl&contactForm7Id='.$cf7key.'&accountId='.$hipaaID; 394 437 $response = wp_remote_get( $url ); 395 438 $body = wp_remote_retrieve_body( $response ); … … 405 448 $url = admin_url( 'admin.php' )."?page=hipaatizer&import_cf7=error"; 406 449 } 407 wp_ redirect( esc_url($url) );450 wp_safe_redirect( esc_url_raw( $url ) ); 408 451 exit; 409 452 } … … 416 459 417 460 foreach($_GET['wpf'] as $val) { 418 461 $id = absint( $val ); 462 if ( ! $id ) { 463 continue; 464 } 419 465 $form = array(); 420 $wpf_post = get_post($ val);421 $form['id'] = $ val;466 $wpf_post = get_post($id); 467 $form['id'] = $id ; 422 468 $form['title'] = $wpf_post->post_title; 423 469 $form['content'] = $wpf_post->post_content; … … 425 471 } 426 472 427 $data = json_encode($arr); wp_die($data);473 $data = wp_json_encode( $arr ); 428 474 $url = HIPAATIZER_APP.'/api/v1/sign_up/prepare_cf7_forms_for_import?wpformsId='.$cf7key; 429 475 … … 441 487 442 488 public function hipaa_transfer_wpf_uregistered(){ 443 global $cf7key, $message; 444 if( !empty($_GET['wpf']) && !empty($_GET['hipaaID']) ){ 489 global $cf7key, $message; 490 491 if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { 492 return; 493 } 494 495 if ( empty( $_GET['wpf'] ) || empty( $_GET['hipaaID'] ) ) { 496 return; 497 } 498 499 if ( ! isset( $_GET['hipaa_import_wpf_nonce'] ) || 500 ! wp_verify_nonce( $_GET['hipaa_import_wpf_nonce'], 'hipaa_import_wpf' ) ) { 501 return; 502 } 503 504 $hipaaID = sanitize_key( wp_unslash( $_GET['hipaaID'] ) ); 505 $_GET['wpf'] = array_map( 506 'absint', 507 (array) wp_unslash( $_GET['wpf'] ) 508 ); 509 510 if ( ! empty( $_GET['wpf'] ) && ! empty( $hipaaID ) ) { 445 511 $this->hipaa_transfer_wpf(); 446 512 447 if( $message == "Successful operation."){ 448 if(!empty($_GET['hipaaID'])) { 449 $url = HIPAATIZER_APP.'/api/v1/account/import/contact_from_7?wpformsId='.$cf7key.'&accountId='.sanitize_key($_GET['hipaaID']); 513 if ( $message === 'Successful operation.' ) { 514 $url = HIPAATIZER_APP . '/api/v1/account/import/contact_from_7?wpformsId=' . $cf7key . '&accountId=' . $hipaaID; 450 515 $response = wp_remote_get( $url ); 451 $body = wp_remote_retrieve_body( $response );452 $res = json_decode($body, true);453 $message_import = $res['message'];454 if( $message_import == "Successful operation."){ 455 $url = admin_url( 'admin.php' )."?page=hipaatizer&import_wpf=success";456 516 $body = wp_remote_retrieve_body( $response ); 517 $res = json_decode( $body, true ); 518 $message_import = isset( $res['message'] ) ? $res['message'] : ''; 519 520 if ( $message_import === 'Successful operation.' ) { 521 $url = admin_url( 'admin.php?page=hipaatizer&import_wpf=success' ); 457 522 } else { 458 $url = admin_url( 'admin.php ' )."?page=hipaatizer&import_wpf=error";523 $url = admin_url( 'admin.php?page=hipaatizer&import_wpf=error' ); 459 524 } 460 525 461 } else { 462 $url = admin_url( 'admin.php' )."?page=hipaatizer&import_wpf=error"; 463 } 464 wp_redirect( esc_url($url) ); 526 wp_safe_redirect( esc_url_raw( $url ) ); 465 527 exit; 466 528 } 467 529 } 468 530 } 469 470 531 public function hipaa_transfer_gf(){ 471 532 global $cf7key, $message; … … 536 597 $results = $res['workflows']; 537 598 538 $type_form = (isset($_GET['type'])) ? trim($_GET['type']): 'SimpleForm';539 $folder_form = (isset($_GET['folderId'])) ? trim($_GET['folderId']): '';540 $status_form = (isset($_GET['status'])) ? trim($_GET['status']): '';599 $type_form = isset( $_GET['type'] ) ? sanitize_text_field( wp_unslash( $_GET['type'] ) ) : 'SimpleForm'; 600 $folder_form = isset( $_GET['folderId'] ) ? sanitize_text_field( wp_unslash( $_GET['folderId'] ) ) : ''; 601 $status_form = isset( $_GET['status'] ) ? sanitize_text_field( wp_unslash( $_GET['status'] ) ) : ''; 541 602 $forms = array(); 542 603 foreach ($results as $item) : … … 570 631 if( $forms ): 571 632 $nb_elem_per_page = 10; 572 $page = isset( $_GET['paged'])?intval($_GET['paged']-1):0;633 $page = isset( $_GET['paged'] ) ? max( 0, intval( $_GET['paged'] ) - 1 ) : 0; 573 634 $number_of_pages = intval(count($forms)/$nb_elem_per_page)+1; 574 635 … … 701 762 <input type="hidden" name="page" value="hipaatizer"> 702 763 <input type="hidden" name="hipaaID" value="<?php echo sanitize_key($hipaaID); ?>"> 764 <?php wp_nonce_field( 'hipaa_import_cf7', 'hipaa_import_cf7_nonce' ); ?> 703 765 <?php 704 766 $args = array( … … 758 820 public function hipaa_import_gf() { 759 821 global $wpdb, $hipaaID; 760 $dbprefix = ( is_multisite() ) ? $wpdb->get_blog_prefix(0) : $wpdb->prefix;822 $dbprefix = is_multisite() ? $wpdb->get_blog_prefix( get_current_blog_id() ) : $wpdb->prefix; 761 823 ?> 762 824 <form id="export-gf" action="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>" method="get" class="export-forms"> -
hipaatizer/trunk/admin/js/hipaatizer-admin.js
r2991169 r3407370 1 (function ( $) {2 'use strict';3 4 var ifrm = document.createElement('iframe'),5 $url = hipaa_params.url,1 (function ($) { 2 'use strict'; 3 4 var ifrm = document.createElement('iframe'), 5 $url = hipaa_params.url, 6 6 $pluginUrl = hipaa_params.pluginUrl, 7 $curl = hipaa_params.curl,8 $query_param = window.location.href.slice(window.location.href.indexOf('?') +1),7 $curl = hipaa_params.curl, 8 $query_param = window.location.href.slice(window.location.href.indexOf('?') + 1), 9 9 searchParams = new URLSearchParams(window.location.search); 10 // $irameH = $(window).height() - 32;11 12 //ifrm.setAttribute('src', $url);13 // ifrm.style.height = $irameH+'px';14 15 if ( $url) {16 location.href = $url+'&pluginUrl='+encodeURIComponent($pluginUrl);17 }18 19 $( document ).ready(function() {20 if( $('.hipaa-iframe-container').length ){10 // $irameH = $(window).height() - 32; 11 12 //ifrm.setAttribute('src', $url); 13 // ifrm.style.height = $irameH+'px'; 14 15 if ($url) { 16 location.href = $url + '&pluginUrl=' + encodeURIComponent($pluginUrl); 17 } 18 19 $(document).ready(function () { 20 if ($('.hipaa-iframe-container').length) { 21 21 $('.hipaa-iframe-container').append(ifrm); 22 22 } 23 $('#adminmenu .wp-has-current-submenu ul li a').each(function (){23 $('#adminmenu .wp-has-current-submenu ul li a').each(function () { 24 24 var $this = $(this), 25 25 $href = $this.attr('href'); 26 if ( $href == '?'+$query_param) {26 if ($href == '?' + $query_param) { 27 27 $('#adminmenu .wp-has-current-submenu ul li.current a').removeClass('current'); 28 28 $('#adminmenu .wp-has-current-submenu ul li.current').removeClass('current'); … … 31 31 } 32 32 }); 33 if ( searchParams.has('auth') ){33 if (searchParams.has('auth')) { 34 34 $('.hipaa-loader').show(); 35 35 $('.hipaa-fcontent').hide(); 36 36 } 37 $('.copyShortcode').on('click', function(e){38 e.preventDefault();39 var $this = $(this),37 $('.copyShortcode').on('click', function (e) { 38 e.preventDefault(); 39 var $this = $(this), 40 40 $temp = $("<input>"), 41 41 element = $this.next('span'); 42 $("body").append($temp); 43 $temp.val($(element).text()).select(); 44 document.execCommand("copy"); 45 $temp.remove(); 46 $this.find('.tooltip_copied').addClass('show'); 47 $this.find('.tooltip').hide(); 48 setTimeout(function(){ 49 $this.find('.tooltip_copied').removeClass('show'); 50 $this.find('.tooltip').show(); 51 }, 2000); 42 $("body").append($temp); 43 $temp.val($(element).text()).select(); 44 document.execCommand("copy"); 45 $temp.remove(); 46 $this.find('.tooltip_copied').addClass('show'); 47 $this.find('.tooltip').hide(); 48 setTimeout(function () { 49 $this.find('.tooltip_copied').removeClass('show'); 50 $this.find('.tooltip').show(); 51 }, 2000); 52 }); 53 54 $('.hipaa-refresh').on('click', function () { 55 var $type_form = $(this).attr('data-type'); 56 $('.hipaa-loader').show(); 57 $.ajax({ 58 type: 'GET', 59 url: hipaa_params.ajax_url, 60 data: { action: 'refresh_hipaa_forms', nonce: hipaa_params.nonce, type: $type_form }, 61 success: function (response) { 62 $('#hipaa-list').html(response); 63 $('.hipaa-loader').hide(); 64 } 65 66 52 67 }); 53 54 $('.hipaa-refresh').on('click', function () { 55 var $type_form = $(this).attr('data-type'); 56 $('.hipaa-loader').show(); 57 $.ajax({ 68 }); 69 70 $('.hipaa-tabs a').on('click', function (e) { 71 e.preventDefault(); 72 $('.hipaa-loader').show(); 73 var $this = $(this), 74 $type = $this.attr('data-type'), 75 $folderId = $this.attr('data-folderId'), 76 $status = $this.attr('data-status'); 77 78 $('.hipaa-tabs li').removeClass('active'); 79 $this.parent().addClass('active'); 80 if (!$status) { 81 $.ajax({ 58 82 type: 'GET', 59 83 url: hipaa_params.ajax_url, 60 data: { action: 'refresh_hipaa_forms', nonce: hipaa_params.nonce, type: $type_form},61 success: function (response) {84 data: { action: 'tabs_hipaa_forms', nonce: hipaa_params.nonce, type: $type, folderId: $folderId }, 85 success: function (response) { 62 86 $('#hipaa-list').html(response); 63 87 $('.hipaa-loader').hide(); 64 88 } 65 66 67 }); 68 }); 69 70 $('.hipaa-tabs a').on('click', function (e) { 71 e.preventDefault(); 72 $('.hipaa-loader').show(); 73 var $this = $(this), 74 $type = $this.attr('data-type'), 75 $folderId = $this.attr('data-folderId'), 76 $status = $this.attr('data-status'); 77 78 $('.hipaa-tabs li').removeClass('active'); 79 $this.parent().addClass('active'); 80 if( !$status ) { 81 $.ajax({ 89 }); 90 } else { 91 $.ajax({ 82 92 type: 'GET', 83 93 url: hipaa_params.ajax_url, 84 data: { action: 'tabs_hipaa_forms', type: $type, folderId: $folderId},85 success: function (response) {94 data: { action: 'tabs_hipaa_forms', nonce: hipaa_params.nonce, type: $type, status: $status }, 95 success: function (response) { 86 96 $('#hipaa-list').html(response); 87 97 $('.hipaa-loader').hide(); 88 }89 });90 } else {91 $.ajax({92 type: 'GET',93 url: hipaa_params.ajax_url,94 data: { action: 'tabs_hipaa_forms', type: $type, status: $status },95 success: function(response) {96 $('#hipaa-list').html(response);97 $('.hipaa-loader').hide();98 }99 });100 }101 });102 103 function checked_all($el){104 if( $el.is(':checked') ){105 $('#export-wpcf7').find('input[type="checkbox"]').prop('checked',true);106 } else {107 $('#export-wpcf7').find('input[type="checkbox"]').prop('checked',false);108 98 } 109 }110 checked_all($('#select_all'));111 112 $('#select_all').on('change', function() {113 var $this = $(this);114 checked_all($this);115 99 }); 116 117 $('#toplevel_page_hipaatizer .item_target_blank').each(function(){ 118 $(this).parent().attr('target', '_blank'); 119 }); 120 121 $.urlParam = function(name){ 122 var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); 123 if (results==null) { 124 return null; 125 } 126 return decodeURI(results[1]) || 0; 127 } 128 if( $.urlParam('change_account') == 1 ){ 129 $('#item_change_account').parent().parent().addClass('current').siblings().removeClass('current'); 130 } 131 132 $('.hippa_message').on('click', function(){ 133 $(this).hide(); 134 var uri = window.location.toString(); 135 if (uri.indexOf("&") > 0) { 136 var clean_uri = uri.substring(0, uri.indexOf("&")); 137 window.history.replaceState({}, document.title, clean_uri); 138 } 139 140 }); 141 142 $('.hipaaIconMenu').on('click', function(){ 143 $('body').addClass('hipaa-open-menu'); 144 }); 145 146 $('.hipaaIconClose').on('click', function(){ 147 $('body').removeClass('hipaa-open-menu'); 148 }); 149 }); 150 function geneate_form($form_id){ 151 var form_id = $form_id; 152 var basicUrl = $curl+form_id; 153 var iFrameParent = document.getElementById(form_id); 154 var iFrame = document.createElement('iframe'); 155 156 iFrameParent.appendChild(iFrame).setAttribute('src', basicUrl) 157 158 } 159 160 $(document).on('change', '.hipaa-select select', function(){ 161 var $this = $(this); 162 setTimeout( function(){ 163 var $hipaa = $this.parent().next('.hipaa-form'), 164 $id = $hipaa.attr('id'); 165 geneate_form($id); 166 },1000); 167 168 169 }); 170 171 $( window ).load(function() { 100 } 101 }); 102 103 function checked_all($el) { 104 if ($el.is(':checked')) { 105 $('#export-wpcf7').find('input[type="checkbox"]').prop('checked', true); 106 } else { 107 $('#export-wpcf7').find('input[type="checkbox"]').prop('checked', false); 108 } 109 } 110 checked_all($('#select_all')); 111 112 $('#select_all').on('change', function () { 113 var $this = $(this); 114 checked_all($this); 115 }); 116 117 $('#toplevel_page_hipaatizer .item_target_blank').each(function () { 118 $(this).parent().attr('target', '_blank'); 119 }); 120 121 $.urlParam = function (name) { 122 var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); 123 if (results == null) { 124 return null; 125 } 126 return decodeURI(results[1]) || 0; 127 } 128 if ($.urlParam('change_account') == 1) { 129 $('#item_change_account').parent().parent().addClass('current').siblings().removeClass('current'); 130 } 131 132 $('.hippa_message').on('click', function () { 133 $(this).hide(); 134 var uri = window.location.toString(); 135 if (uri.indexOf("&") > 0) { 136 var clean_uri = uri.substring(0, uri.indexOf("&")); 137 window.history.replaceState({}, document.title, clean_uri); 138 } 139 140 }); 141 142 $('.hipaaIconMenu').on('click', function () { 143 $('body').addClass('hipaa-open-menu'); 144 }); 145 146 $('.hipaaIconClose').on('click', function () { 147 $('body').removeClass('hipaa-open-menu'); 148 }); 149 }); 150 function geneate_form($form_id) { 151 var form_id = $form_id; 152 var basicUrl = $curl + form_id; 153 var iFrameParent = document.getElementById(form_id); 154 var iFrame = document.createElement('iframe'); 155 156 iFrameParent.appendChild(iFrame).setAttribute('src', basicUrl) 157 158 } 159 160 $(document).on('change', '.hipaa-select select', function () { 161 var $this = $(this); 162 setTimeout(function () { 163 var $hipaa = $this.parent().next('.hipaa-form'), 164 $id = $hipaa.attr('id'); 165 geneate_form($id); 166 }, 1000); 167 168 169 }); 170 171 $(window).load(function () { 172 172 const searchParams = new URLSearchParams(window.location.search); 173 173 … … 177 177 document.cookie = `hipaaID = ${accountId}`; 178 178 179 window.location.href = hipaa_params.admin_url+"?page=hipaatizer"; 180 } 181 182 $('.hipaa-form').each(function(){ 183 var $id = $(this).attr('id') 184 geneate_form($id); 185 }); 186 hipaa_mobile(); 187 }); 188 189 $( window ).resize(function() { 179 window.location.href = hipaa_params.admin_url + "?page=hipaatizer"; 180 } 181 182 $('.hipaa-form').each(function () { 183 var $id = $(this).attr('id') 184 geneate_form($id); 185 }); 190 186 hipaa_mobile(); 191 187 }); 192 188 189 $(window).resize(function () { 190 hipaa_mobile(); 191 }); 192 193 193 function hipaa_mobile() { 194 if ( $( window).width() < 1181) {195 $('.hipaa-changeAccount').appendTo( '.nav-menu');194 if ($(window).width() < 1181) { 195 $('.hipaa-changeAccount').appendTo('.nav-menu'); 196 196 } else { 197 197 $('.nav-menu .hipaa-changeAccount').remove(); … … 200 200 201 201 202 })( jQuery);202 })(jQuery); 203 203 204 204 window.addEventListener('message', event => { … … 206 206 const identityHeader = '#accountId'; 207 207 208 if (typeof eventData === 'string' && eventData.includes(identityHeader)) {208 if (typeof eventData === 'string' && eventData.includes(identityHeader)) { 209 209 const accountId = eventData.substring(identityHeader.length); 210 210 … … 212 212 console.log('accountId', accountId) 213 213 214 document.cookie = `hipaaID = ${accountId}`;215 window.location.href = hipaa_params.admin_url+"?page=hipaatizer";214 document.cookie = `hipaaID = ${accountId}`; 215 window.location.href = hipaa_params.admin_url + "?page=hipaatizer"; 216 216 } 217 217 }); 218 218 var logout = location.search.split('hipaa_account=')[1] 219 if ( logout == 'login' ){220 document.cookie = 'hipaaID=; Max-Age=0'221 }219 if (logout == 'login') { 220 document.cookie = 'hipaaID=; Max-Age=0' 221 } 222 222 223 223 window.fwSettings = { 224 224 widget_id: 72000002319, 225 };226 !(function () {225 }; 226 !(function () { 227 227 if ("function" != typeof window.FreshworksWidget) { 228 228 var n = function () { 229 n.q.push(arguments);230 };231 (n.q = []), (window.FreshworksWidget = n);229 n.q.push(arguments); 230 }; 231 (n.q = []), (window.FreshworksWidget = n); 232 232 } 233 233 })(); -
hipaatizer/trunk/hipaatizer.php
r3192702 r3407370 5 5 * Plugin URI: https://hipaatizer.com/free-developer-account 6 6 * Description: HIPAAtizer - Helps you create and manage HIPAA-Compliant web forms. 7 * Version: 1.3. 67 * Version: 1.3.7 8 8 * Author: HIPAAtizer 9 9 * Author URI: https://hipaatizer.com … … 39 39 * Currentl plugin version. 40 40 */ 41 define('HIPAATIZER_VERSION', '1.3. 6');41 define('HIPAATIZER_VERSION', '1.3.7'); 42 42 43 43 /** -
hipaatizer/trunk/readme.txt
r3273947 r3407370 8 8 Requires PHP: 5.6 9 9 Requires at least: 4.6 10 Tested up to: 6. 811 Stable tag: 1.3. 610 Tested up to: 6.9 11 Stable tag: 1.3.7 12 12 13 13 Whether you are enhancing a new or existing website, HIPAAtizer delivers a seamless, flexible HIPAA‑Compliant form solution. Always free for developers. … … 124 124 == Additional Resources == 125 125 126 1. [Docs](https:// hipaatizer.com/free-developer-account#how-it-works/?utm_source=wps)126 1. [Docs](https://www.hipaatizer.com/hipaa-form-solutions/developers/?utm_source=wps) 127 127 2. [FAQ](https://www.hipaatizer.com/hipaa-compliance-resources/faq/?utm_source=wps) 128 128 … … 146 146 147 147 == Changelog == 148 149 = 1.3.7 = 150 * Improved performance and stability. 148 151 149 152 = 1.3.6 =
Note: See TracChangeset
for help on using the changeset viewer.