-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhs-wordpress-plugin.php
41 lines (31 loc) · 1.31 KB
/
hs-wordpress-plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Plugin Name: Hypersign Authentcation
* Description: Allow your users to login into your website without using passwordless.
*/
require_once 'routes/index.php';
require_once 'routes/heartbeat-api-pulse.php';
function func_load_vuescripts()
{
wp_register_script('wp_jqueryjs', 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js');
wp_register_script('wp_qrcodejs', 'https://cdn.jsdelivr.net/npm/jquery.qrcode@1.0.3/jquery.qrcode.min.js');
wp_register_script('hsutils', plugins_url('js/utils.js', __FILE__));
wp_register_script('hypersign', plugins_url('js/hypersign.js', __FILE__));
}
add_action('wp_enqueue_scripts', 'func_load_vuescripts');
//Add shortscode
function func_wp_vue()
{
///// Loading all scripts
wp_enqueue_script('wp_jqueryjs');
wp_enqueue_script('wp_qrcodejs');
wp_enqueue_script('hsutils');
wp_enqueue_script('hypersign');
$src = "<div id='qrcode' style='border: 1px solid #80808042; padding: 12px;width: 330px;'></div><span style='padding-left:10%; text-align: center; font-size: medium; color: grey'>Scan QR code using Hypersign Wallet</span>";
return $src;
}
add_shortcode('hypersign', 'func_wp_vue');
// //// Heart beat - polling
$heartbeat_api_pulse = new Heartbeat_API_Pulse(__FILE__);
$heartbeat_api_pulse->version = '1.0.0';
$heartbeat_api_pulse->init();