-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_license_manager_8php_source.html
145 lines (143 loc) · 207 KB
/
_license_manager_8php_source.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GravityView: LicenseManager.php Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom-doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GravityView
 <span id="projectnumber">2.17</span>
</div>
<div id="projectbrief">The best, easiest way to display Gravity Forms entries on your website.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_c18ef6374e5a604878aeced0c5671a4f.html">vendor_prefixed</a></li><li class="navelem"><a class="el" href="dir_86b19f5df6747de098149f7d19a9f494.html">gravitykit</a></li><li class="navelem"><a class="el" href="dir_cef91bdb3eb284f59d80e56ba3584b5f.html">foundation</a></li><li class="navelem"><a class="el" href="dir_43934aaf9842616eb4dc1cec03c6d866.html">src</a></li><li class="navelem"><a class="el" href="dir_80e37e0f6a2cd9d5c47166d75818752a.html">Licenses</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">LicenseManager.php</div> </div>
</div><!--header-->
<div class="contents">
<a href="_license_manager_8php.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <?php<span class="comment"></span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/**</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * @license GPL-2.0-or-later</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Modified by gravityview on 13-January-2023 using Strauss.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * @see https://github.com/BrianHenryIE/strauss</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">namespace </span><a class="code" href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses.html">GravityKit\GravityView\Foundation\Licenses</a>;</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> use <a class="code" href="namespace_exception.html">Exception</a>;</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> use <a class="code" href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html">GravityKit\GravityView\Foundation\Core</a>;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> use <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_core.html">GravityKit\GravityView\Foundation\Helpers\Core</a> as CoreHelpers;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> use <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_logger_1_1_framework.html">GravityKit\GravityView\Foundation\Logger\Framework</a> as LoggerFramework;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> use <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_settings_1_1_framework.html">GravityKit\GravityView\Foundation\Settings\Framework</a> as SettingsFramework;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> use <a class="code" href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html">GravityKit\GravityView\Foundation\Encryption\Encryption</a>;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> use <a class="code" href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html">GravityKit\GravityView\Foundation\Helpers\Arr</a>;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> use <a class="code" href="namespace_g_f_forms.html">GFForms</a>;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> use <a class="code" href="namespace_g_f_forms_model.html">GFFormsModel</a>;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html"> 21</a></span> <span class="keyword">class </span><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html">LicenseManager</a> {</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5c13046d31ae77efff3158b3e7b00aa"> 22</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5c13046d31ae77efff3158b3e7b00aa">EDD_LICENSES_API_ENDPOINT</a> = <span class="stringliteral">'https://www.gravitykit.com'</span>;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a7f65edc8d73d046f3097394631358e6c"> 24</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a7f65edc8d73d046f3097394631358e6c">EDD_LICENSES_API_VERSION</a> = 2;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a369e10ea8657a5e643ba09c0e8e8c849"> 26</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a369e10ea8657a5e643ba09c0e8e8c849">EDD_ACTION_CHECK_LICENSE</a> = <span class="stringliteral">'check_license'</span>;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5bf82555dad6a9907dc926fc13326a3"> 28</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5bf82555dad6a9907dc926fc13326a3">EDD_ACTION_ACTIVATE_LICENSE</a> = <span class="stringliteral">'activate_license'</span>;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a331c951bc102db41f8866d4530ee2380"> 30</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a331c951bc102db41f8866d4530ee2380">EDD_ACTION_DEACTIVATE_LICENSE</a> = <span class="stringliteral">'deactivate_license'</span>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4dd6986d662e0e453abae7cef94b714"> 32</a></span>  <span class="keyword">const</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4dd6986d662e0e453abae7cef94b714">HARDCODED_LICENSE_CONSTANTS</a> = [ <span class="stringliteral">'GRAVITYVIEW_LICENSE_KEY'</span>, <span class="stringliteral">'GRAVITYKIT_LICENSES'</span> ];</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> /**</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> *</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> * @var LicenseManager Class instance.</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> */</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac350be23da328a6f5429313efc9b96e4"> 39</a></span>  <span class="keyword">private</span> <span class="keyword">static</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac350be23da328a6f5429313efc9b96e4">$_instance</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"></span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> /**</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment"> *</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> * @var array Cached licenses data object.</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> */</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa482cabcb47c4cc51bad202f08c96926"> 46</a></span>  <span class="keyword">public</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa482cabcb47c4cc51bad202f08c96926">$_licenses_data</a>;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment"></span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment"> /**</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment"> * Returns class instance.</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="comment"> *</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="comment"> *</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment"> * @return LicenseManager</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> */</span></div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aeeb76432d095288ac056df22cca56d16"> 55</a></span>  <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aeeb76432d095288ac056df22cca56d16">get_instance</a>() {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">if</span> ( is_null( self::$_instance ) ) {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  self::$_instance = <span class="keyword">new</span> <span class="keyword">self</span>();</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">return</span> self::$_instance;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="comment"></span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"> /**</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment"> * Initializes the class.</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> *</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> *</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"> */</span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a4be4055f3361d4800e16bc2e2e38cda6"> 70</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a4be4055f3361d4800e16bc2e2e38cda6">init</a>() {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keyword">static</span> $initialized;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">if</span> ( $initialized ) {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">if</span> ( ! wp_doing_ajax() ) {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9c70ebedf6f698c0219908f23650a84f">migrate_legacy_licenses</a>();</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a6a230a94ab4f510cdd453a7c06d83b4f">process_hardcoded_licenses</a>();</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a0fdc10e3583ceee28476ba0b0654f3dc">recheck_all_licenses</a>();</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  add_filter( <span class="stringliteral">'gk/foundation/ajax/'</span> . <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#ac4772ddb7b5b92e757c483bc606f4d16">Framework::AJAX_ROUTER</a> . <span class="stringliteral">'/routes'</span>, [ $this, <span class="stringliteral">'configure_ajax_routes'</span> ] );</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  add_action( <span class="stringliteral">'after_plugin_row'</span>, [ $this, <span class="stringliteral">'display_license_info_on_plugins_page'</span> ], 10, 2 );</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab490260b22eefc9b8d661f3a28e3c27b">update_submenu_badge_count</a>();</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  $initialized = <span class="keyword">true</span>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  }</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment"></span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment"> /**</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="comment"> * Configures AJAX routes handled by this class.</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"> *</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> *</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> * @see Core::process_ajax_request()</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment"> *</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"> * @param array $routes AJAX route to class method map.</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment"> *</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"> */</span></div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9395ed09b58eb3c8de70223326fc95de"> 105</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9395ed09b58eb3c8de70223326fc95de">configure_ajax_routes</a>( array $routes ) {</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> array_merge( $routes, [</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="stringliteral">'get_licenses'</span> => [ $this, <span class="stringliteral">'ajax_get_licenses_data'</span> ],</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="stringliteral">'activate_license'</span> => [ $this, <span class="stringliteral">'ajax_activate_license'</span> ],</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="stringliteral">'deactivate_license'</span> => [ $this, <span class="stringliteral">'ajax_deactivate_license'</span> ],</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  ] );</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"></span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> /**</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> * AJAX request wrapper for the get_licenses_data() method.</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"> *</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> *</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> * @param array $payload</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> *</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment"> *</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"> */</span></div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a5dcfac1f8e328d6adc4f7b832fd93b66"> 124</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a5dcfac1f8e328d6adc4f7b832fd93b66">ajax_get_licenses_data</a>( array $payload ) {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">Framework::get_instance</a>()->current_user_can( <span class="stringliteral">'view_licenses'</span> ) ) {</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'You do not have a permission to perform this action.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  $payload = wp_parse_args( $payload, [</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="stringliteral">'skip_cache'</span> => <span class="keyword">false</span>,</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  ] );</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9c70ebedf6f698c0219908f23650a84f">migrate_legacy_licenses</a>( $payload[<span class="stringliteral">'skip_cache'</span>] );</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a6a230a94ab4f510cdd453a7c06d83b4f">process_hardcoded_licenses</a>();</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a0fdc10e3583ceee28476ba0b0654f3dc">recheck_all_licenses</a>( $payload[<span class="stringliteral">'skip_cache'</span>] );</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  $licenses_data = [];</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">foreach</span> ( $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>() as $license ) {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  $license = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a53e09af1b1cc05c2e1fd12fcf9e3abdd">modify_license_data_for_frontend_output</a>( $license );</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  $licenses_data[ $license[<span class="stringliteral">'key'</span>] ] = $license;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  }</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">return</span> $licenses_data;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  }</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"></span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="comment"> /**</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="comment"> * Retrieves license data from the database.</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"> *</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="comment"> *</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="comment"> */</span></div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7"> 156</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>() {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> ( ! empty( $this->_licenses_data ) ) {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">return</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa482cabcb47c4cc51bad202f08c96926">$this->_licenses_data</a>;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  $licenses_data = get_site_option( <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">Framework::ID</a> );</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordflow">if</span> ( ! empty( $licenses_data ) ) {</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  $licenses_data = json_decode( <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html#afd0a3e9021de0ca766baecac9988efc8">Encryption::get_instance</a>()->decrypt( $licenses_data ) ?: <span class="stringliteral">''</span>, <span class="keyword">true</span> );</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  }</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  $this->_licenses_data = $licenses_data ?: [];</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">return</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa482cabcb47c4cc51bad202f08c96926">$this->_licenses_data</a>;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  }</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment"></span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="comment"> /**</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="comment"> * Saves license data in the database.</span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"> *</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="comment"> *</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="comment"> * @param array $licenses_data</span></div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="comment"> *</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="comment"> * @return bool</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="comment"> */</span></div><div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633"> 181</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( array $licenses_data ) {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  $expiry_dates = array_column( $licenses_data, <span class="stringliteral">'expiry'</span> );</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  array_multisort( $licenses_data, SORT_ASC, $expiry_dates );</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  $this->_licenses_data = $licenses_data;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  $licenses_data = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html#afd0a3e9021de0ca766baecac9988efc8">Encryption::get_instance</a>()->encrypt( json_encode( $licenses_data ) );</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  LoggerFramework::get_instance()->error( <span class="stringliteral">'Failed to encrypt licenses data: '</span> . $e->getMessage() );</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span> </div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  }</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">return</span> update_site_option( <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">Framework::ID</a>, $licenses_data );</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="comment"></span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment"> /**</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> <span class="comment"> * Returns an object keyed by product ID and associated licenses.</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> <span class="comment"> *</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span> <span class="comment"> *</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> <span class="comment"> * @param string $key_by (optional) Key (product ID or text domain) to use for the returned array.</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span> <span class="comment"> * Choices: 'id' or 'text_domain'. Default: 'id'.</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> <span class="comment"> *</span></div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> <span class="comment"> */</span></div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#adccdd12c5b599cc38455d77a920c4a5d"> 209</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#adccdd12c5b599cc38455d77a920c4a5d">get_product_license_map</a>( $key_by = <span class="stringliteral">'id'</span> ) {</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  $product_license_map = [];</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordflow">foreach</span> ( $licenses_data as $license_key => $license_data ) {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">if</span> ( empty( $license_data[<span class="stringliteral">'products'</span>] ) ) {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  }</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">foreach</span> ( $license_data[<span class="stringliteral">'products'</span>] as $product_id => $product_data ) {</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">switch</span> ( $key_by ) {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">case</span> <span class="stringliteral">'id'</span>:</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  $key = $product_id;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  $key = $product_data[<span class="stringliteral">'text_domain'</span>];</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> </div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span> ( empty( $product_license_map[ $key ] ) ) {</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  $product_license_map[ $key ] = [];</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  }</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> </div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  $product_license_map[ $key ][] = $license_key;</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  }</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordflow">return</span> $product_license_map;</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  }</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="comment"></span></div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="comment"> /**</span></div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> <span class="comment"> * Returns licenses for a product.</span></div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> <span class="comment"> *</span></div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> <span class="comment"> *</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> <span class="comment"> * @param int|string $id Product ID or text domain.</span></div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> <span class="comment"> *</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> <span class="comment"> */</span></div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad1f0314a7a26232c837ab95e21b3ebec"> 250</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad1f0314a7a26232c837ab95e21b3ebec">get_product_licenses</a>( $id ) {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  $key_by = ! ctype_alpha( $id ) ? <span class="stringliteral">'id'</span> : <span class="stringliteral">'text_domain'</span>;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  $product_license_map = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#adccdd12c5b599cc38455d77a920c4a5d">get_product_license_map</a>( $key_by );</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keywordflow">return</span> ! empty( $product_license_map[ $id ] ) ? $product_license_map[ $id ] : [];</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> <span class="comment"></span></div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="comment"> /**</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> <span class="comment"> * Returns license status message based on the EDD status code.</span></div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> <span class="comment"> *</span></div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> <span class="comment"> *</span></div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span> <span class="comment"> * @param string $status EDD status code.</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="comment"> *</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <span class="comment"> * @return mixed</span></div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span> <span class="comment"> */</span></div><div class="line"><a name="l00267"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4c415d2fcd4d64f10b86790d96e7d91"> 267</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4c415d2fcd4d64f10b86790d96e7d91">get_license_key_status_message</a>( $status ) {</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  $statuses = [</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="stringliteral">'site_inactive'</span> => esc_html__( <span class="stringliteral">'The license key is valid, but it has not been activated for this site.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="stringliteral">'inactive'</span> => esc_html__( <span class="stringliteral">'The license key is valid, but it has not been activated for this site.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="stringliteral">'no_activations_left'</span> => esc_html__( <span class="stringliteral">'This license has reached its activation limit.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="stringliteral">'deactivated'</span> => esc_html__( <span class="stringliteral">'This license has been deactivated.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="stringliteral">'valid'</span> => esc_html__( <span class="stringliteral">'This license key is valid and active.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="stringliteral">'invalid'</span> => esc_html__( <span class="stringliteral">'This license key is invalid.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="stringliteral">'missing'</span> => esc_html__( <span class="stringliteral">'This license key is invalid.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="stringliteral">'revoked'</span> => esc_html__( <span class="stringliteral">'This license key has been revoked.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="stringliteral">'expired'</span> => esc_html__( <span class="stringliteral">'This license key has expired.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  ];</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span> </div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">if</span> ( empty( $statuses[ $status ] ) ) {</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  LoggerFramework::get_instance()->warning( <span class="stringliteral">'Unknown license status: '</span> . $status );</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> </div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordflow">return</span> esc_html__( <span class="stringliteral">'License status could not be determined.'</span>, <span class="stringliteral">'gk-gravityview'</span> );</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  }</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> </div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">return</span> $statuses[ $status ];</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  }</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> <span class="comment"></span></div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span> <span class="comment"> /**</span></div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> <span class="comment"> * Performs remote call to the EDD API.</span></div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> <span class="comment"> *</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> <span class="comment"> * @sice 1.0</span></div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> <span class="comment"> *</span></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> <span class="comment"> * @param string|array $license</span></div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span> <span class="comment"> * @param string $edd_action</span></div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> <span class="comment"> *</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> <span class="comment"> *</span></div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="comment"> * @return array Response body.</span></div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> <span class="comment"> */</span></div><div class="line"><a name="l00301"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74"> 301</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">perform_remote_license_call</a>( $license, $edd_action ) {</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  $multiple_licenses = is_array( $license );</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span> </div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  $payload = [</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="stringliteral">'edd_action'</span> => $edd_action,</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="stringliteral">'url'</span> => is_multisite() ? network_home_url() : home_url(),</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="stringliteral">'api_version'</span> => self::EDD_LICENSES_API_VERSION,</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="stringliteral">'license'</span> => $license</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  ];</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">if</span> ( <span class="stringliteral">'check_license'</span> === $edd_action ) {</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  $payload[<span class="stringliteral">'site_data'</span>] = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae9a925845e64c2db6557a836c1c297ab">get_site_data</a>();</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  }</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> </div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  $response = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html#a22cd5177237699ccc3fb619f730ddbaf">Helpers::query_api</a>(</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  self::EDD_LICENSES_API_ENDPOINT,</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  $payload</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  );</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $e->getMessage() );</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  }</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="comment">// Response can be a multidimensional array when checking multiple licenses.</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  $response = $multiple_licenses ? $response : [ $response ];</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span> </div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="comment">// When checking multiple licenses (i.e., an array of keys) but there is only 1 key in the array, the response is an associative array that needs to be converted to a multidimensional array keyed by the license key.</span></div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordflow">if</span> ( $multiple_licenses && 1 === count( $license ) ) {</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  $response = [ $license[0] => $response ];</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  }</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span> </div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  $normalized_response_data = [];</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span> </div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  $license_keys = $multiple_licenses ? $license : [ $license ];</div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span> </div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keywordflow">foreach</span> ( (array) $response as $key => $data ) {</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="keywordflow">if</span> ( ! isset( $data[<span class="stringliteral">'success'</span>] ) || ! isset( $data[<span class="stringliteral">'license'</span>] ) || ! isset( $data[<span class="stringliteral">'checksum'</span>] ) ) {</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'License data received from the API is incomplete.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  }</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  $license_key = $multiple_licenses ? $key : $license;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span> </div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordflow">if</span> ( ! in_array( $license_key, $license_keys, <span class="keyword">true</span> ) ) {</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  LoggerFramework::get_instance()->warning( <span class="stringliteral">"EDD API returned unknown license key in response: {$license_key}"</span> );</div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span> </div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  }</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span> </div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="keywordflow">if</span> ( ! $data[<span class="stringliteral">'success'</span>] && empty( $data[<span class="stringliteral">'expires'</span>] ) ) {</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  $expiry = null;</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  $expiry = ! empty( $data[<span class="stringliteral">'expires'</span>] ) ? strtotime( $data[<span class="stringliteral">'expires'</span>], current_time( <span class="stringliteral">'timestamp'</span> ) ) : null;</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  $expiry = $expiry ?: $data[<span class="stringliteral">'expires'</span>];</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  }</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  $normalized_license_data = [</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="stringliteral">'name'</span> => ! empty( $data[<span class="stringliteral">'customer_name'</span>] ) ? $data[<span class="stringliteral">'customer_name'</span>] : null,</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <span class="stringliteral">'email'</span> => ! empty( $data[<span class="stringliteral">'customer_email'</span>] ) ? $data[<span class="stringliteral">'customer_email'</span>] : null,</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="stringliteral">'license_name'</span> => ! empty( $data[<span class="stringliteral">'license_name'</span>] ) ? $data[<span class="stringliteral">'license_name'</span>] : null,</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="stringliteral">'expiry'</span> => $expiry,</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  <span class="stringliteral">'key'</span> => $license_key,</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="stringliteral">'products'</span> => [],</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="stringliteral">'_raw'</span> => $data,</div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  ];</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span> </div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordflow">if</span> ( ! empty( $data[<span class="stringliteral">'products'</span>] ) ) {</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="keywordflow">foreach</span> ( $data[<span class="stringliteral">'products'</span>] as $product ) {</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keywordflow">if</span> ( empty( $product[<span class="stringliteral">'files'</span>][0][<span class="stringliteral">'file'</span>] ) || empty( $product[<span class="stringliteral">'id'</span>] ) || empty( $product[<span class="stringliteral">'textdomain'</span>] ) ) {</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  }</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span> </div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  $normalized_license_data[<span class="stringliteral">'products'</span>][ $product[<span class="stringliteral">'id'</span>] ] = [</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="stringliteral">'id'</span> => $product[<span class="stringliteral">'id'</span>],</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="stringliteral">'text_domain'</span> => $product[<span class="stringliteral">'textdomain'</span>],</div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="stringliteral">'download'</span> => $product[<span class="stringliteral">'files'</span>][0][<span class="stringliteral">'file'</span>]</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  ];</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  }</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  }</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keywordflow">if</span> ( $multiple_licenses ) {</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  $normalized_response_data[ $license_key ] = $normalized_license_data;</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  $normalized_response_data = $normalized_license_data;</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  }</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  }</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span> </div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="keywordflow">return</span> $normalized_response_data;</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  }</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span> <span class="comment"></span></div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span> <span class="comment"> /**</span></div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span> <span class="comment"> * Checks license key for validity.</span></div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span> <span class="comment"> *</span></div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span> <span class="comment"> *</span></div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span> <span class="comment"> * @param string $license_key</span></div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> <span class="comment"> *</span></div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span> <span class="comment"> *</span></div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span> <span class="comment"> * @return array License data.</span></div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span> <span class="comment"> */</span></div><div class="line"><a name="l00401"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#af185f845cce2e9e6657423774195049c"> 401</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#af185f845cce2e9e6657423774195049c">check_license</a>( $license_key ) {</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <span class="keywordflow">return</span> $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">perform_remote_license_call</a>( $license_key, self::EDD_ACTION_CHECK_LICENSE );</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $e->getMessage() );</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  }</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  }</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span> <span class="comment"></span></div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span> <span class="comment"> /**</span></div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span> <span class="comment"> * Checks multiples license keys for validity.</span></div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="comment"> *</span></div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span> <span class="comment"> *</span></div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span> <span class="comment"> * @param array $license_keys</span></div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span> <span class="comment"> *</span></div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span> <span class="comment"> *</span></div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> <span class="comment"> * @return array Licenses data.</span></div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span> <span class="comment"> */</span></div><div class="line"><a name="l00420"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05"> 420</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05">check_licenses</a>( array $license_keys ) {</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keywordflow">return</span> $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">perform_remote_license_call</a>( $license_keys, self::EDD_ACTION_CHECK_LICENSE );</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $e->getMessage() );</div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  }</div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  }</div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span> <span class="comment"></span></div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span> <span class="comment"> /**</span></div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span> <span class="comment"> * AJAX request wrapper for the activate_license() method.</span></div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span> <span class="comment"> *</span></div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span> <span class="comment"> *</span></div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span> <span class="comment"> * @param array $payload</span></div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span> <span class="comment"> *</span></div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span> <span class="comment"> *</span></div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span> <span class="comment"> * @return array License information.</span></div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span> <span class="comment"> */</span></div><div class="line"><a name="l00439"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae56aa7212a228b470bc42f4172f2a971"> 439</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae56aa7212a228b470bc42f4172f2a971">ajax_activate_license</a>( array $payload ) {</div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">Framework::get_instance</a>()->current_user_can( <span class="stringliteral">'manage_licenses'</span> ) ) {</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'You do not have a permission to perform this action.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  }</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span> </div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordflow">if</span> ( empty( $payload[<span class="stringliteral">'key'</span>] ) ) {</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'Missing license key.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  }</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span> </div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="keywordflow">return</span> $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a53e09af1b1cc05c2e1fd12fcf9e3abdd">modify_license_data_for_frontend_output</a>( $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a81b7136cf92fb242b8554e9555249d95">activate_license</a>( $payload[<span class="stringliteral">'key'</span>] ) );</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  }</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span> <span class="comment"></span></div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span> <span class="comment"> /**</span></div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span> <span class="comment"> * Activates license.</span></div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span> <span class="comment"> *</span></div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span> <span class="comment"> *</span></div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span> <span class="comment"> * @param string $license_key license_key</span></div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span> <span class="comment"> *</span></div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span> <span class="comment"> *</span></div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span> <span class="comment"> * @return array License information.</span></div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span> <span class="comment"> */</span></div><div class="line"><a name="l00462"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a81b7136cf92fb242b8554e9555249d95"> 462</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a81b7136cf92fb242b8554e9555249d95">activate_license</a>( $license_key ) {</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">Framework::get_instance</a>()->current_user_can( <span class="stringliteral">'manage_licenses'</span> ) ) {</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'You do not have a permission to perform this action.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  }</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span> </div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span> </div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  <span class="keywordflow">if</span> ( isset( $licenses_data[ $license_key ] ) ) {</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'This license is already activated.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  }</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span> </div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  $response = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">perform_remote_license_call</a>( $license_key, self::EDD_ACTION_ACTIVATE_LICENSE );</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span> </div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  <span class="keywordflow">if</span> ( ! $response[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'success'</span>] ) {</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4c415d2fcd4d64f10b86790d96e7d91">get_license_key_status_message</a>( $response[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'error'</span>] ) );</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  }</div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span> </div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <span class="keywordflow">if</span> ( ! $response[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'success'</span>] ) {</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'Could not get information on products associated with this license.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  }</div><div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $e->getMessage() );</div><div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  }</div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span> </div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  unset( $response[<span class="stringliteral">'_raw'</span>] );</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span> </div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  $licenses_data[ $license_key ] = $response;</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span> </div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $licenses_data );</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span> </div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  <span class="keywordflow">if</span> ( CoreHelpers::is_network_admin() ) {</div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span>  delete_site_transient( <span class="stringliteral">'update_plugins '</span> );</div><div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  delete_transient( <span class="stringliteral">'update_plugins'</span> );</div><div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  }</div><div class="line"><a name="l00498"></a><span class="lineno"> 498</span> </div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  <span class="keywordflow">return</span> $response;</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  }</div><div class="line"><a name="l00501"></a><span class="lineno"> 501</span> <span class="comment"></span></div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span> <span class="comment"> /**</span></div><div class="line"><a name="l00503"></a><span class="lineno"> 503</span> <span class="comment"> * AJAX request wrapper for the deactivate_license() method.</span></div><div class="line"><a name="l00504"></a><span class="lineno"> 504</span> <span class="comment"> *</span></div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span> <span class="comment"> *</span></div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span> <span class="comment"> * @param array $payload</span></div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span> <span class="comment"> *</span></div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00510"></a><span class="lineno"> 510</span> <span class="comment"> *</span></div><div class="line"><a name="l00511"></a><span class="lineno"> 511</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span> <span class="comment"> */</span></div><div class="line"><a name="l00513"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a805dedc6569a5861315146fcaa028301"> 513</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a805dedc6569a5861315146fcaa028301">ajax_deactivate_license</a>( array $payload ) {</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  $payload = wp_parse_args( $payload, [</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  <span class="stringliteral">'key'</span> => <span class="keyword">false</span>,</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  <span class="stringliteral">'force_removal'</span> => <span class="keyword">false</span>,</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span>  ] );</div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span> </div><div class="line"><a name="l00519"></a><span class="lineno"> 519</span>  <span class="keywordflow">if</span> ( ! $payload[<span class="stringliteral">'key'</span>] ) {</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'Missing license key.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  }</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span> </div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00524"></a><span class="lineno"> 524</span> </div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  $license_key = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html#afd0a3e9021de0ca766baecac9988efc8">Encryption::get_instance</a>()->decrypt( $payload[<span class="stringliteral">'key'</span>] );</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span> </div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  <span class="keywordflow">if</span> ( empty( $licenses_data[ $license_key ] ) ) {</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'The license key is invalid.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  }</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span> </div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a3a1688ab1689359b4fb87a4ad84498f5">deactivate_license</a>( $license_key, (<span class="keywordtype">bool</span>) $payload[<span class="stringliteral">'force_removal'</span>] );</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  }</div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span> <span class="comment"></span></div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span> <span class="comment"> /**</span></div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span> <span class="comment"> * Deactivates license.</span></div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span> <span class="comment"> *</span></div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span> <span class="comment"> * @since 1.0.7 Added $force_removal parameter.</span></div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span> <span class="comment"> *</span></div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span> <span class="comment"> * @param string $license_key</span></div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span> <span class="comment"> * @param bool $force_removal (optional) Forces removal of license from the local licenses object even if deactivation request fails. Default: false.</span></div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span> <span class="comment"> *</span></div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span> <span class="comment"> *</span></div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00546"></a><span class="lineno"> 546</span> <span class="comment"> */</span></div><div class="line"><a name="l00547"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a3a1688ab1689359b4fb87a4ad84498f5"> 547</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a3a1688ab1689359b4fb87a4ad84498f5">deactivate_license</a>( $license_key, $force_removal = <span class="keyword">false</span> ) {</div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span> </div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  $response = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">perform_remote_license_call</a>( $license_key, self::EDD_ACTION_DEACTIVATE_LICENSE );</div><div class="line"><a name="l00552"></a><span class="lineno"> 552</span> </div><div class="line"><a name="l00553"></a><span class="lineno"> 553</span>  <span class="keywordflow">if</span> ( ! $force_removal && ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#a744ef7454e48c5521c4c3ad3cf1b700b">Arr::get</a>( $response, <span class="stringliteral">'_raw.success'</span> ) ) {</div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  <span class="comment">// Unsuccessful deactivation can happen when the license has expired, in which case we should treat it as a "success" and remove from our list.</span></div><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  <span class="comment">// If the license hasn't expired, then there is a problem deactivating it, and we should throw an exception.</span></div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#a744ef7454e48c5521c4c3ad3cf1b700b">Arr::get</a>( $response, <span class="stringliteral">'expiry'</span> ) || ! $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9ec623c84087ce697e2b28b0e73d0e20">is_expired_license</a>( <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#a744ef7454e48c5521c4c3ad3cf1b700b">Arr::get</a>( $response, <span class="stringliteral">'expiry'</span> ) ) ) {</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'Failed to deactivate license.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  }</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  }</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  <span class="keywordflow">if</span> ( ! $force_removal ) {</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $e->getMessage() );</div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span>  }</div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span>  }</div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span> </div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  unset( $licenses_data[ $license_key ] );</div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span> </div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  <span class="keywordflow">if</span> ( CoreHelpers::is_network_admin() ) {</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  delete_site_transient( <span class="stringliteral">'update_plugins '</span> );</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  delete_transient( <span class="stringliteral">'update_plugins'</span> );</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>  }</div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span> </div><div class="line"><a name="l00574"></a><span class="lineno"> 574</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $licenses_data );</div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  }</div><div class="line"><a name="l00576"></a><span class="lineno"> 576</span> <span class="comment"></span></div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span> <span class="comment"> /**</span></div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span> <span class="comment"> * Adds additional data to the license object for use in the frontend.</span></div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span> <span class="comment"> * - Encrypts license key</span></div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span> <span class="comment"> * - Formats expiration date or message if license is expired</span></div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span> <span class="comment"> *</span></div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00583"></a><span class="lineno"> 583</span> <span class="comment"> *</span></div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span> <span class="comment"> * @param $license</span></div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span> <span class="comment"> *</span></div><div class="line"><a name="l00586"></a><span class="lineno"> 586</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span> <span class="comment"> */</span></div><div class="line"><a name="l00588"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a53e09af1b1cc05c2e1fd12fcf9e3abdd"> 588</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a53e09af1b1cc05c2e1fd12fcf9e3abdd">modify_license_data_for_frontend_output</a>( $license ) {</div><div class="line"><a name="l00589"></a><span class="lineno"> 589</span>  $expiry = ! empty( $license[<span class="stringliteral">'expiry'</span>] ) ? $license[<span class="stringliteral">'expiry'</span>] : <span class="stringliteral">'invalid'</span>;</div><div class="line"><a name="l00590"></a><span class="lineno"> 590</span>  $expired = <span class="keyword">false</span>;</div><div class="line"><a name="l00591"></a><span class="lineno"> 591</span> </div><div class="line"><a name="l00592"></a><span class="lineno"> 592</span>  <span class="keywordflow">if</span> ( ! ctype_alpha( $expiry ) ) {</div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  $expired = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9ec623c84087ce697e2b28b0e73d0e20">is_expired_license</a>( $expiry );</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span> </div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>  $expiry = $expired</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>  ? human_time_diff( $expiry, current_time( <span class="stringliteral">'timestamp'</span> ) ) . <span class="charliteral">' '</span> . esc_html_x( <span class="stringliteral">'ago'</span>, <span class="stringliteral">'Indicates "time ago"'</span>, <span class="stringliteral">'gk-gravityview'</span> )</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  : date_i18n( get_option( <span class="stringliteral">'date_format'</span> ), $expiry );</div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span> </div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  }</div><div class="line"><a name="l00600"></a><span class="lineno"> 600</span> </div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span>  $encrypted_key = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html#afd0a3e9021de0ca766baecac9988efc8">Encryption::get_instance</a>()->encrypt( $license[<span class="stringliteral">'key'</span>], <span class="keyword">false</span>, <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html#af431b7d2fae5f1104a28f35a6b467216">Core::get_request_unique_string</a>() );</div><div class="line"><a name="l00603"></a><span class="lineno"> 603</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00604"></a><span class="lineno"> 604</span>  LoggerFramework::get_instance()->error( <span class="stringliteral">'Failed to encrypt license key: '</span> . $e->getMessage() );</div><div class="line"><a name="l00605"></a><span class="lineno"> 605</span> </div><div class="line"><a name="l00606"></a><span class="lineno"> 606</span>  $encrypted_key = <span class="stringliteral">'key_encryption_failed'</span>;</div><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  }</div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span> </div><div class="line"><a name="l00609"></a><span class="lineno"> 609</span>  <span class="keywordflow">return</span> array_merge( $license, [</div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span>  <span class="stringliteral">'expiry'</span> => $expiry,</div><div class="line"><a name="l00611"></a><span class="lineno"> 611</span>  <span class="stringliteral">'expired'</span> => $expired,</div><div class="line"><a name="l00612"></a><span class="lineno"> 612</span>  <span class="stringliteral">'key'</span> => $encrypted_key,</div><div class="line"><a name="l00613"></a><span class="lineno"> 613</span>  <span class="stringliteral">'masked_key'</span> => $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a840fc43621978f6441c91c6cf29828b1">mask_license_key</a>( $license[<span class="stringliteral">'key'</span>] )</div><div class="line"><a name="l00614"></a><span class="lineno"> 614</span>  ] );</div><div class="line"><a name="l00615"></a><span class="lineno"> 615</span>  }</div><div class="line"><a name="l00616"></a><span class="lineno"> 616</span> <span class="comment"></span></div><div class="line"><a name="l00617"></a><span class="lineno"> 617</span> <span class="comment"> /**</span></div><div class="line"><a name="l00618"></a><span class="lineno"> 618</span> <span class="comment"> * Masks part of the license key</span></div><div class="line"><a name="l00619"></a><span class="lineno"> 619</span> <span class="comment"> *</span></div><div class="line"><a name="l00620"></a><span class="lineno"> 620</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00621"></a><span class="lineno"> 621</span> <span class="comment"> *</span></div><div class="line"><a name="l00622"></a><span class="lineno"> 622</span> <span class="comment"> * @param string $license_key</span></div><div class="line"><a name="l00623"></a><span class="lineno"> 623</span> <span class="comment"> *</span></div><div class="line"><a name="l00624"></a><span class="lineno"> 624</span> <span class="comment"> * @return string</span></div><div class="line"><a name="l00625"></a><span class="lineno"> 625</span> <span class="comment"> */</span></div><div class="line"><a name="l00626"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a840fc43621978f6441c91c6cf29828b1"> 626</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a840fc43621978f6441c91c6cf29828b1">mask_license_key</a>( $license_key ) {</div><div class="line"><a name="l00627"></a><span class="lineno"> 627</span>  $length = strlen( $license_key );</div><div class="line"><a name="l00628"></a><span class="lineno"> 628</span>  $visible_count = (int) round( $length / 8 );</div><div class="line"><a name="l00629"></a><span class="lineno"> 629</span>  $hidden_count = $length - ( $visible_count * 4 );</div><div class="line"><a name="l00630"></a><span class="lineno"> 630</span> </div><div class="line"><a name="l00631"></a><span class="lineno"> 631</span>  <span class="keywordflow">return</span> sprintf( <span class="stringliteral">'%s%s%s'</span>,</div><div class="line"><a name="l00632"></a><span class="lineno"> 632</span>  substr( $license_key, 0, $visible_count ),</div><div class="line"><a name="l00633"></a><span class="lineno"> 633</span>  str_repeat( <span class="stringliteral">'✽'</span>, $hidden_count ),</div><div class="line"><a name="l00634"></a><span class="lineno"> 634</span>  substr( $license_key, ( $visible_count * -1 ), $visible_count )</div><div class="line"><a name="l00635"></a><span class="lineno"> 635</span>  );</div><div class="line"><a name="l00636"></a><span class="lineno"> 636</span>  }</div><div class="line"><a name="l00637"></a><span class="lineno"> 637</span> <span class="comment"></span></div><div class="line"><a name="l00638"></a><span class="lineno"> 638</span> <span class="comment"> /**</span></div><div class="line"><a name="l00639"></a><span class="lineno"> 639</span> <span class="comment"> * Saves new or removes existing hardcoded licenses from the license data.</span></div><div class="line"><a name="l00640"></a><span class="lineno"> 640</span> <span class="comment"> *</span></div><div class="line"><a name="l00641"></a><span class="lineno"> 641</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00642"></a><span class="lineno"> 642</span> <span class="comment"> *</span></div><div class="line"><a name="l00643"></a><span class="lineno"> 643</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00644"></a><span class="lineno"> 644</span> <span class="comment"> */</span></div><div class="line"><a name="l00645"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a6a230a94ab4f510cdd453a7c06d83b4f"> 645</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a6a230a94ab4f510cdd453a7c06d83b4f">process_hardcoded_licenses</a>() {</div><div class="line"><a name="l00646"></a><span class="lineno"> 646</span>  $hardcoded_license_keys = [];</div><div class="line"><a name="l00647"></a><span class="lineno"> 647</span> </div><div class="line"><a name="l00648"></a><span class="lineno"> 648</span>  <span class="keywordflow">foreach</span> ( self::HARDCODED_LICENSE_CONSTANTS as $constant ) {</div><div class="line"><a name="l00649"></a><span class="lineno"> 649</span>  <span class="keywordflow">if</span> ( ! defined( $constant ) ) {</div><div class="line"><a name="l00650"></a><span class="lineno"> 650</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00651"></a><span class="lineno"> 651</span>  }</div><div class="line"><a name="l00652"></a><span class="lineno"> 652</span> </div><div class="line"><a name="l00653"></a><span class="lineno"> 653</span>  <span class="keywordflow">if</span> ( is_array( constant( $constant ) ) ) {</div><div class="line"><a name="l00654"></a><span class="lineno"> 654</span>  $hardcoded_license_keys = array_merge( $hardcoded_license_keys, constant( $constant ) );</div><div class="line"><a name="l00655"></a><span class="lineno"> 655</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00656"></a><span class="lineno"> 656</span>  $hardcoded_license_keys[] = constant( $constant );</div><div class="line"><a name="l00657"></a><span class="lineno"> 657</span>  }</div><div class="line"><a name="l00658"></a><span class="lineno"> 658</span>  }</div><div class="line"><a name="l00659"></a><span class="lineno"> 659</span> </div><div class="line"><a name="l00660"></a><span class="lineno"> 660</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00661"></a><span class="lineno"> 661</span> </div><div class="line"><a name="l00662"></a><span class="lineno"> 662</span>  <span class="comment">// Remove any licenses that are no longer hardcoded.</span></div><div class="line"><a name="l00663"></a><span class="lineno"> 663</span>  $removed_hardcoded_licenses = 0;</div><div class="line"><a name="l00664"></a><span class="lineno"> 664</span> </div><div class="line"><a name="l00665"></a><span class="lineno"> 665</span>  <span class="keywordflow">foreach</span> ( $licenses_data as $key => $license ) {</div><div class="line"><a name="l00666"></a><span class="lineno"> 666</span>  <span class="keywordflow">if</span> ( ! empty( $license[<span class="stringliteral">'hardcoded'</span>] ) && ! in_array( $key, $hardcoded_license_keys, <span class="keyword">true</span> ) ) {</div><div class="line"><a name="l00667"></a><span class="lineno"> 667</span>  $removed_hardcoded_licenses++;</div><div class="line"><a name="l00668"></a><span class="lineno"> 668</span> </div><div class="line"><a name="l00669"></a><span class="lineno"> 669</span>  unset( $licenses_data[ $key ] );</div><div class="line"><a name="l00670"></a><span class="lineno"> 670</span>  }</div><div class="line"><a name="l00671"></a><span class="lineno"> 671</span>  }</div><div class="line"><a name="l00672"></a><span class="lineno"> 672</span> </div><div class="line"><a name="l00673"></a><span class="lineno"> 673</span>  <span class="keywordflow">if</span> ( $removed_hardcoded_licenses ) {</div><div class="line"><a name="l00674"></a><span class="lineno"> 674</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $licenses_data );</div><div class="line"><a name="l00675"></a><span class="lineno"> 675</span>  }</div><div class="line"><a name="l00676"></a><span class="lineno"> 676</span> </div><div class="line"><a name="l00677"></a><span class="lineno"> 677</span>  <span class="keywordflow">if</span> ( empty( $hardcoded_license_keys ) ) {</div><div class="line"><a name="l00678"></a><span class="lineno"> 678</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00679"></a><span class="lineno"> 679</span>  }</div><div class="line"><a name="l00680"></a><span class="lineno"> 680</span> </div><div class="line"><a name="l00681"></a><span class="lineno"> 681</span>  <span class="comment">// Add any new hardcoded licenses.</span></div><div class="line"><a name="l00682"></a><span class="lineno"> 682</span>  $license_keys_to_check = array_values( array_diff( $hardcoded_license_keys, array_keys( $licenses_data ) ) );</div><div class="line"><a name="l00683"></a><span class="lineno"> 683</span> </div><div class="line"><a name="l00684"></a><span class="lineno"> 684</span>  <span class="keywordflow">if</span> ( empty( $license_keys_to_check ) ) {</div><div class="line"><a name="l00685"></a><span class="lineno"> 685</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00686"></a><span class="lineno"> 686</span>  }</div><div class="line"><a name="l00687"></a><span class="lineno"> 687</span> </div><div class="line"><a name="l00688"></a><span class="lineno"> 688</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00689"></a><span class="lineno"> 689</span>  $checked_licenses = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05">check_licenses</a>( $license_keys_to_check );</div><div class="line"><a name="l00690"></a><span class="lineno"> 690</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00691"></a><span class="lineno"> 691</span>  LoggerFramework::get_instance()->error( <span class="stringliteral">"Failed to check hardcoded licenses. {$e->getMessage()}."</span> );</div><div class="line"><a name="l00692"></a><span class="lineno"> 692</span> </div><div class="line"><a name="l00693"></a><span class="lineno"> 693</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00694"></a><span class="lineno"> 694</span>  }</div><div class="line"><a name="l00695"></a><span class="lineno"> 695</span> </div><div class="line"><a name="l00696"></a><span class="lineno"> 696</span>  <span class="keywordflow">foreach</span> ( $checked_licenses as $key => $license ) {</div><div class="line"><a name="l00697"></a><span class="lineno"> 697</span>  <span class="keywordflow">if</span> ( ! $license[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'success'</span>] ) {</div><div class="line"><a name="l00698"></a><span class="lineno"> 698</span>  LoggerFramework::get_instance()->warning( <span class="stringliteral">"Hardcoded license {$key} is invalid."</span> );</div><div class="line"><a name="l00699"></a><span class="lineno"> 699</span> </div><div class="line"><a name="l00700"></a><span class="lineno"> 700</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00701"></a><span class="lineno"> 701</span>  }</div><div class="line"><a name="l00702"></a><span class="lineno"> 702</span> </div><div class="line"><a name="l00703"></a><span class="lineno"> 703</span>  unset( $license[<span class="stringliteral">'_raw'</span>] );</div><div class="line"><a name="l00704"></a><span class="lineno"> 704</span> </div><div class="line"><a name="l00705"></a><span class="lineno"> 705</span>  $license[<span class="stringliteral">'hardcoded'</span>] = <span class="keyword">true</span>;</div><div class="line"><a name="l00706"></a><span class="lineno"> 706</span> </div><div class="line"><a name="l00707"></a><span class="lineno"> 707</span>  $licenses_data[ $key ] = $license;</div><div class="line"><a name="l00708"></a><span class="lineno"> 708</span>  }</div><div class="line"><a name="l00709"></a><span class="lineno"> 709</span> </div><div class="line"><a name="l00710"></a><span class="lineno"> 710</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $licenses_data );</div><div class="line"><a name="l00711"></a><span class="lineno"> 711</span>  }</div><div class="line"><a name="l00712"></a><span class="lineno"> 712</span> <span class="comment"></span></div><div class="line"><a name="l00713"></a><span class="lineno"> 713</span> <span class="comment"> /**</span></div><div class="line"><a name="l00714"></a><span class="lineno"> 714</span> <span class="comment"> * Migrates licenses for products that do not have Foundation integrated.</span></div><div class="line"><a name="l00715"></a><span class="lineno"> 715</span> <span class="comment"> *</span></div><div class="line"><a name="l00716"></a><span class="lineno"> 716</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00717"></a><span class="lineno"> 717</span> <span class="comment"> *</span></div><div class="line"><a name="l00718"></a><span class="lineno"> 718</span> <span class="comment"> * @param bool $force_migration Whether to force migration even if it was done before.</span></div><div class="line"><a name="l00719"></a><span class="lineno"> 719</span> <span class="comment"> *</span></div><div class="line"><a name="l00720"></a><span class="lineno"> 720</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00721"></a><span class="lineno"> 721</span> <span class="comment"> */</span></div><div class="line"><a name="l00722"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9c70ebedf6f698c0219908f23650a84f"> 722</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9c70ebedf6f698c0219908f23650a84f">migrate_legacy_licenses</a>( $force_migration = <span class="keyword">false</span> ) {</div><div class="line"><a name="l00723"></a><span class="lineno"> 723</span>  $logger = LoggerFramework::get_instance();</div><div class="line"><a name="l00724"></a><span class="lineno"> 724</span> </div><div class="line"><a name="l00725"></a><span class="lineno"> 725</span>  $migration_status_id = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">Framework::ID</a> . <span class="stringliteral">'/legacy-licenses-migrated'</span>;</div><div class="line"><a name="l00726"></a><span class="lineno"> 726</span> </div><div class="line"><a name="l00727"></a><span class="lineno"> 727</span>  $save_migration_status_in_db = <span class="keyword">function</span> () use ( $migration_status_id ) {</div><div class="line"><a name="l00728"></a><span class="lineno"> 728</span>  update_site_option( $migration_status_id, current_time( <span class="stringliteral">'timestamp'</span> ) );</div><div class="line"><a name="l00729"></a><span class="lineno"> 729</span>  };</div><div class="line"><a name="l00730"></a><span class="lineno"> 730</span> </div><div class="line"><a name="l00731"></a><span class="lineno"> 731</span>  <span class="keywordflow">if</span> ( get_site_option( $migration_status_id ) && ! $force_migration ) {</div><div class="line"><a name="l00732"></a><span class="lineno"> 732</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00733"></a><span class="lineno"> 733</span>  }</div><div class="line"><a name="l00734"></a><span class="lineno"> 734</span> </div><div class="line"><a name="l00735"></a><span class="lineno"> 735</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00736"></a><span class="lineno"> 736</span> </div><div class="line"><a name="l00737"></a><span class="lineno"> 737</span>  $license_keys_to_migrate = [];</div><div class="line"><a name="l00738"></a><span class="lineno"> 738</span> </div><div class="line"><a name="l00739"></a><span class="lineno"> 739</span>  $db_options = [</div><div class="line"><a name="l00740"></a><span class="lineno"> 740</span>  <span class="stringliteral">'gravityformsaddon_gravityview-importer_settings'</span>,</div><div class="line"><a name="l00741"></a><span class="lineno"> 741</span>  <span class="stringliteral">'gravityformsaddon_gravityview_app_settings'</span>,</div><div class="line"><a name="l00742"></a><span class="lineno"> 742</span>  <span class="stringliteral">'gravityformsaddon_gravityview-inline-edit_settings'</span>,</div><div class="line"><a name="l00743"></a><span class="lineno"> 743</span>  <span class="stringliteral">'gravityformsaddon_gravitycharts_settings'</span>,</div><div class="line"><a name="l00744"></a><span class="lineno"> 744</span>  <span class="stringliteral">'gravityformsaddon_gk-gravityactions_settings'</span>,</div><div class="line"><a name="l00745"></a><span class="lineno"> 745</span>  <span class="stringliteral">'gravityformsaddon_gravityview-calendar_settings'</span>,</div><div class="line"><a name="l00746"></a><span class="lineno"> 746</span>  <span class="stringliteral">'gravityformsaddon_gravityexport_settings'</span>,</div><div class="line"><a name="l00747"></a><span class="lineno"> 747</span>  <span class="stringliteral">'gravityformsaddon_gravityview-entry-revisions_settings'</span>,</div><div class="line"><a name="l00748"></a><span class="lineno"> 748</span>  ];</div><div class="line"><a name="l00749"></a><span class="lineno"> 749</span> </div><div class="line"><a name="l00750"></a><span class="lineno"> 750</span>  <span class="keywordflow">foreach</span> ( $db_options as $option ) {</div><div class="line"><a name="l00751"></a><span class="lineno"> 751</span>  $license = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#a744ef7454e48c5521c4c3ad3cf1b700b">Arr::get</a>( get_option( $option, [] ), <span class="stringliteral">'license_key'</span> );</div><div class="line"><a name="l00752"></a><span class="lineno"> 752</span> </div><div class="line"><a name="l00753"></a><span class="lineno"> 753</span>  $option = str_replace( [ <span class="stringliteral">'gravityformsaddon_'</span>, <span class="stringliteral">'_settings'</span> ], <span class="stringliteral">''</span>, $option );</div><div class="line"><a name="l00754"></a><span class="lineno"> 754</span> </div><div class="line"><a name="l00755"></a><span class="lineno"> 755</span>  <span class="keywordflow">if</span> ( $license ) {</div><div class="line"><a name="l00756"></a><span class="lineno"> 756</span>  $license_keys_to_migrate[ $license ] = $option;</div><div class="line"><a name="l00757"></a><span class="lineno"> 757</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00758"></a><span class="lineno"> 758</span>  $logger->warning( <span class="stringliteral">"Legacy license not found for {$option}."</span> );</div><div class="line"><a name="l00759"></a><span class="lineno"> 759</span>  }</div><div class="line"><a name="l00760"></a><span class="lineno"> 760</span>  }</div><div class="line"><a name="l00761"></a><span class="lineno"> 761</span> </div><div class="line"><a name="l00762"></a><span class="lineno"> 762</span>  <span class="keywordflow">if</span> ( empty( $license_keys_to_migrate ) ) {</div><div class="line"><a name="l00763"></a><span class="lineno"> 763</span>  $save_migration_status_in_db();</div><div class="line"><a name="l00764"></a><span class="lineno"> 764</span> </div><div class="line"><a name="l00765"></a><span class="lineno"> 765</span>  $logger->info( <span class="stringliteral">'Did not find any legacy licenses to migrate.'</span> );</div><div class="line"><a name="l00766"></a><span class="lineno"> 766</span> </div><div class="line"><a name="l00767"></a><span class="lineno"> 767</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00768"></a><span class="lineno"> 768</span>  }</div><div class="line"><a name="l00769"></a><span class="lineno"> 769</span> </div><div class="line"><a name="l00770"></a><span class="lineno"> 770</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00771"></a><span class="lineno"> 771</span>  $checked_licenses = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05">check_licenses</a>( array_keys( $license_keys_to_migrate ) );</div><div class="line"><a name="l00772"></a><span class="lineno"> 772</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00773"></a><span class="lineno"> 773</span>  $logger->error( <span class="stringliteral">"Failed to check legacy licenses. {$e->getMessage()}."</span> );</div><div class="line"><a name="l00774"></a><span class="lineno"> 774</span> </div><div class="line"><a name="l00775"></a><span class="lineno"> 775</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00776"></a><span class="lineno"> 776</span>  }</div><div class="line"><a name="l00777"></a><span class="lineno"> 777</span> </div><div class="line"><a name="l00778"></a><span class="lineno"> 778</span>  <span class="keywordflow">foreach</span> ( $checked_licenses as $key => $license ) {</div><div class="line"><a name="l00779"></a><span class="lineno"> 779</span>  <span class="keywordflow">if</span> ( ! $license[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'success'</span>] ) {</div><div class="line"><a name="l00780"></a><span class="lineno"> 780</span>  $logger->warning( <span class="stringliteral">"Legacy license {$key} is invalid."</span> );</div><div class="line"><a name="l00781"></a><span class="lineno"> 781</span> </div><div class="line"><a name="l00782"></a><span class="lineno"> 782</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00783"></a><span class="lineno"> 783</span>  }</div><div class="line"><a name="l00784"></a><span class="lineno"> 784</span> </div><div class="line"><a name="l00785"></a><span class="lineno"> 785</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00786"></a><span class="lineno"> 786</span>  $license = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a81b7136cf92fb242b8554e9555249d95">activate_license</a>( $key );</div><div class="line"><a name="l00787"></a><span class="lineno"> 787</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00788"></a><span class="lineno"> 788</span>  $logger->error( <span class="stringliteral">"Failed to activate legacy license {$key}. {$e->getMessage()}."</span> );</div><div class="line"><a name="l00789"></a><span class="lineno"> 789</span> </div><div class="line"><a name="l00790"></a><span class="lineno"> 790</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00791"></a><span class="lineno"> 791</span>  }</div><div class="line"><a name="l00792"></a><span class="lineno"> 792</span> </div><div class="line"><a name="l00793"></a><span class="lineno"> 793</span>  $logger->info( <span class="stringliteral">"Migrated legacy license for {$license_keys_to_migrate[$key]}."</span> );</div><div class="line"><a name="l00794"></a><span class="lineno"> 794</span> </div><div class="line"><a name="l00795"></a><span class="lineno"> 795</span>  $licenses_data[ $key ] = $license;</div><div class="line"><a name="l00796"></a><span class="lineno"> 796</span>  }</div><div class="line"><a name="l00797"></a><span class="lineno"> 797</span> </div><div class="line"><a name="l00798"></a><span class="lineno"> 798</span>  $save_migration_status_in_db();</div><div class="line"><a name="l00799"></a><span class="lineno"> 799</span> </div><div class="line"><a name="l00800"></a><span class="lineno"> 800</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $licenses_data );</div><div class="line"><a name="l00801"></a><span class="lineno"> 801</span>  }</div><div class="line"><a name="l00802"></a><span class="lineno"> 802</span> <span class="comment"></span></div><div class="line"><a name="l00803"></a><span class="lineno"> 803</span> <span class="comment"> /**</span></div><div class="line"><a name="l00804"></a><span class="lineno"> 804</span> <span class="comment"> * Rechecks all licenses and updates the database.</span></div><div class="line"><a name="l00805"></a><span class="lineno"> 805</span> <span class="comment"> *</span></div><div class="line"><a name="l00806"></a><span class="lineno"> 806</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00807"></a><span class="lineno"> 807</span> <span class="comment"> *</span></div><div class="line"><a name="l00808"></a><span class="lineno"> 808</span> <span class="comment"> * @param bool $skip_cache Whether to skip returning products from cache.</span></div><div class="line"><a name="l00809"></a><span class="lineno"> 809</span> <span class="comment"> *</span></div><div class="line"><a name="l00810"></a><span class="lineno"> 810</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00811"></a><span class="lineno"> 811</span> <span class="comment"> */</span></div><div class="line"><a name="l00812"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a0fdc10e3583ceee28476ba0b0654f3dc"> 812</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a0fdc10e3583ceee28476ba0b0654f3dc">recheck_all_licenses</a>( $skip_cache = <span class="keyword">false</span> ) {</div><div class="line"><a name="l00813"></a><span class="lineno"> 813</span>  $cache_id = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">Framework::ID</a> . <span class="stringliteral">'/licenses'</span>;</div><div class="line"><a name="l00814"></a><span class="lineno"> 814</span> </div><div class="line"><a name="l00815"></a><span class="lineno"> 815</span>  $last_validation = get_site_transient( $cache_id );</div><div class="line"><a name="l00816"></a><span class="lineno"> 816</span> </div><div class="line"><a name="l00817"></a><span class="lineno"> 817</span>  <span class="keywordflow">if</span> ( $last_validation && ! $skip_cache ) {</div><div class="line"><a name="l00818"></a><span class="lineno"> 818</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00819"></a><span class="lineno"> 819</span>  }</div><div class="line"><a name="l00820"></a><span class="lineno"> 820</span> </div><div class="line"><a name="l00821"></a><span class="lineno"> 821</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00822"></a><span class="lineno"> 822</span> </div><div class="line"><a name="l00823"></a><span class="lineno"> 823</span>  $revalidated_licenses = [];</div><div class="line"><a name="l00824"></a><span class="lineno"> 824</span> </div><div class="line"><a name="l00825"></a><span class="lineno"> 825</span>  <span class="keywordflow">if</span> ( empty( $licenses_data ) ) {</div><div class="line"><a name="l00826"></a><span class="lineno"> 826</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00827"></a><span class="lineno"> 827</span>  }</div><div class="line"><a name="l00828"></a><span class="lineno"> 828</span> </div><div class="line"><a name="l00829"></a><span class="lineno"> 829</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00830"></a><span class="lineno"> 830</span>  $license_check_result = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05">check_licenses</a>( array_keys( $licenses_data ) );</div><div class="line"><a name="l00831"></a><span class="lineno"> 831</span> </div><div class="line"><a name="l00832"></a><span class="lineno"> 832</span>  <span class="keywordflow">foreach</span> ( $license_check_result as $key => $license ) {</div><div class="line"><a name="l00833"></a><span class="lineno"> 833</span>  <span class="keywordflow">if</span> ( ! $license[<span class="stringliteral">'_raw'</span>][<span class="stringliteral">'success'</span>] ) {</div><div class="line"><a name="l00834"></a><span class="lineno"> 834</span>  LoggerFramework::get_instance()->warning( <span class="stringliteral">"License {$key} is invalid."</span> );</div><div class="line"><a name="l00835"></a><span class="lineno"> 835</span> </div><div class="line"><a name="l00836"></a><span class="lineno"> 836</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00837"></a><span class="lineno"> 837</span>  }</div><div class="line"><a name="l00838"></a><span class="lineno"> 838</span> </div><div class="line"><a name="l00839"></a><span class="lineno"> 839</span>  unset( $license[<span class="stringliteral">'_raw'</span>] );</div><div class="line"><a name="l00840"></a><span class="lineno"> 840</span> </div><div class="line"><a name="l00841"></a><span class="lineno"> 841</span>  <span class="keywordflow">if</span> ( ! empty( $licenses_data[ $key ][<span class="stringliteral">'hardcoded'</span>] ) ) {</div><div class="line"><a name="l00842"></a><span class="lineno"> 842</span>  $license[<span class="stringliteral">'hardcoded'</span>] = <span class="keyword">true</span>;</div><div class="line"><a name="l00843"></a><span class="lineno"> 843</span>  }</div><div class="line"><a name="l00844"></a><span class="lineno"> 844</span> </div><div class="line"><a name="l00845"></a><span class="lineno"> 845</span>  $revalidated_licenses[ $key ] = $license;</div><div class="line"><a name="l00846"></a><span class="lineno"> 846</span>  }</div><div class="line"><a name="l00847"></a><span class="lineno"> 847</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00848"></a><span class="lineno"> 848</span>  LoggerFramework::get_instance()->error( <span class="stringliteral">"Failed to revalidate all licenses. {$e->getMessage()}."</span> );</div><div class="line"><a name="l00849"></a><span class="lineno"> 849</span>  }</div><div class="line"><a name="l00850"></a><span class="lineno"> 850</span> </div><div class="line"><a name="l00851"></a><span class="lineno"> 851</span>  set_site_transient( $cache_id, current_time( <span class="stringliteral">'timestamp'</span> ), DAY_IN_SECONDS );</div><div class="line"><a name="l00852"></a><span class="lineno"> 852</span> </div><div class="line"><a name="l00853"></a><span class="lineno"> 853</span>  <span class="keywordflow">if</span> ( ! empty( $revalidated_licenses ) ) {</div><div class="line"><a name="l00854"></a><span class="lineno"> 854</span>  $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">save_licenses_data</a>( $revalidated_licenses );</div><div class="line"><a name="l00855"></a><span class="lineno"> 855</span>  }</div><div class="line"><a name="l00856"></a><span class="lineno"> 856</span>  }</div><div class="line"><a name="l00857"></a><span class="lineno"> 857</span> <span class="comment"></span></div><div class="line"><a name="l00858"></a><span class="lineno"> 858</span> <span class="comment"> /**</span></div><div class="line"><a name="l00859"></a><span class="lineno"> 859</span> <span class="comment"> * Optionally adds notices to installed plugins when license is invalid or expired.</span></div><div class="line"><a name="l00860"></a><span class="lineno"> 860</span> <span class="comment"> *</span></div><div class="line"><a name="l00861"></a><span class="lineno"> 861</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00862"></a><span class="lineno"> 862</span> <span class="comment"> *</span></div><div class="line"><a name="l00863"></a><span class="lineno"> 863</span> <span class="comment"> * @param string $plugin_name</span></div><div class="line"><a name="l00864"></a><span class="lineno"> 864</span> <span class="comment"> * @param array $plugin_data</span></div><div class="line"><a name="l00865"></a><span class="lineno"> 865</span> <span class="comment"> *</span></div><div class="line"><a name="l00866"></a><span class="lineno"> 866</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l00867"></a><span class="lineno"> 867</span> <span class="comment"> */</span></div><div class="line"><a name="l00868"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad98b7c89ba835941712901d12a323a70"> 868</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad98b7c89ba835941712901d12a323a70">display_license_info_on_plugins_page</a>( $plugin_name, $plugin_data ) {</div><div class="line"><a name="l00869"></a><span class="lineno"> 869</span>  <span class="keyword">static</span> $products_data;</div><div class="line"><a name="l00870"></a><span class="lineno"> 870</span> </div><div class="line"><a name="l00871"></a><span class="lineno"> 871</span>  <span class="keywordflow">if</span> ( is_multisite() && ! CoreHelpers::is_network_admin() ) {</div><div class="line"><a name="l00872"></a><span class="lineno"> 872</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00873"></a><span class="lineno"> 873</span>  }</div><div class="line"><a name="l00874"></a><span class="lineno"> 874</span> </div><div class="line"><a name="l00875"></a><span class="lineno"> 875</span>  $is_active = CoreHelpers::is_network_admin() ? is_plugin_active_for_network( $plugin_name ) : is_plugin_active( $plugin_name );</div><div class="line"><a name="l00876"></a><span class="lineno"> 876</span> </div><div class="line"><a name="l00877"></a><span class="lineno"> 877</span>  <span class="keywordflow">if</span> ( ! $is_active ) {</div><div class="line"><a name="l00878"></a><span class="lineno"> 878</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00879"></a><span class="lineno"> 879</span>  }</div><div class="line"><a name="l00880"></a><span class="lineno"> 880</span> </div><div class="line"><a name="l00881"></a><span class="lineno"> 881</span>  $licenses_data = $this-><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">get_licenses_data</a>();</div><div class="line"><a name="l00882"></a><span class="lineno"> 882</span> </div><div class="line"><a name="l00883"></a><span class="lineno"> 883</span>  <span class="keywordflow">if</span> ( ! $products_data ) {</div><div class="line"><a name="l00884"></a><span class="lineno"> 884</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00885"></a><span class="lineno"> 885</span>  $products_data = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_product_manager.html#aeeb76432d095288ac056df22cca56d16">ProductManager::get_instance</a>()->get_products_data( [ <span class="stringliteral">'key_by'</span> => <span class="stringliteral">'text_domain'</span> ] );</div><div class="line"><a name="l00886"></a><span class="lineno"> 886</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00887"></a><span class="lineno"> 887</span>  LoggerFramework::get_instance()->error( <span class="stringliteral">"Failed to get products on the plugins page. {$e->getMessage()}."</span> );</div><div class="line"><a name="l00888"></a><span class="lineno"> 888</span> </div><div class="line"><a name="l00889"></a><span class="lineno"> 889</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00890"></a><span class="lineno"> 890</span>  }</div><div class="line"><a name="l00891"></a><span class="lineno"> 891</span>  }</div><div class="line"><a name="l00892"></a><span class="lineno"> 892</span> </div><div class="line"><a name="l00893"></a><span class="lineno"> 893</span>  <span class="keywordflow">if</span> ( ! isset( $products_data[ $plugin_data[<span class="stringliteral">'TextDomain'</span>] ] ) ) {</div><div class="line"><a name="l00894"></a><span class="lineno"> 894</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00895"></a><span class="lineno"> 895</span>  }</div><div class="line"><a name="l00896"></a><span class="lineno"> 896</span> </div><div class="line"><a name="l00897"></a><span class="lineno"> 897</span>  $this_plugin = $products_data[ $plugin_data[<span class="stringliteral">'TextDomain'</span>] ];</div><div class="line"><a name="l00898"></a><span class="lineno"> 898</span> </div><div class="line"><a name="l00899"></a><span class="lineno"> 899</span>  $valid_licenses = [];</div><div class="line"><a name="l00900"></a><span class="lineno"> 900</span> </div><div class="line"><a name="l00901"></a><span class="lineno"> 901</span>  <span class="keywordflow">foreach</span> ( $this_plugin[<span class="stringliteral">'licenses'</span>] as $license_key ) {</div><div class="line"><a name="l00902"></a><span class="lineno"> 902</span>  <span class="keywordflow">if</span> ( ! isset( $licenses_data[ $license_key ] ) ) {</div><div class="line"><a name="l00903"></a><span class="lineno"> 903</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00904"></a><span class="lineno"> 904</span>  }</div><div class="line"><a name="l00905"></a><span class="lineno"> 905</span> </div><div class="line"><a name="l00906"></a><span class="lineno"> 906</span>  $valid_licenses[] = $license_key;</div><div class="line"><a name="l00907"></a><span class="lineno"> 907</span>  }</div><div class="line"><a name="l00908"></a><span class="lineno"> 908</span> </div><div class="line"><a name="l00909"></a><span class="lineno"> 909</span>  <span class="keywordflow">if</span> ( ! empty( $valid_licenses ) ) {</div><div class="line"><a name="l00910"></a><span class="lineno"> 910</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00911"></a><span class="lineno"> 911</span>  }</div><div class="line"><a name="l00912"></a><span class="lineno"> 912</span> </div><div class="line"><a name="l00913"></a><span class="lineno"> 913</span>  add_filter( <span class="stringliteral">"after_plugin_row_{$plugin_name}"</span>, <span class="keyword">function</span> ( $plugin_name, $plugin_data ) use ( $this_plugin ) {</div><div class="line"><a name="l00914"></a><span class="lineno"> 914</span>  <a class="code" href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a> = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">Framework::get_instance</a>()->get_link_to_product_search( $this_plugin[<span class="stringliteral">'id'</span>] );</div><div class="line"><a name="l00915"></a><span class="lineno"> 915</span> </div><div class="line"><a name="l00916"></a><span class="lineno"> 916</span>  $message = strtr(</div><div class="line"><a name="l00917"></a><span class="lineno"> 917</span>  esc_html_x( <span class="stringliteral">'This is an unlicensed product. Please [link]visit the licensing page[/link] to enter a valid license or to purchase a new one.'</span>, <span class="stringliteral">'Placeholders inside [] are not to be translated.'</span>, <span class="stringliteral">'gk-gravityview'</span> ),</div><div class="line"><a name="l00918"></a><span class="lineno"> 918</span>  [</div><div class="line"><a name="l00919"></a><span class="lineno"> 919</span>  <span class="stringliteral">'[link]'</span> => <span class="stringliteral">'<a href="'</span> . <a class="code" href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a> . <span class="stringliteral">'">'</span>,</div><div class="line"><a name="l00920"></a><span class="lineno"> 920</span>  <span class="stringliteral">'[/link]'</span> => <span class="stringliteral">'</a>'</span></div><div class="line"><a name="l00921"></a><span class="lineno"> 921</span>  ]</div><div class="line"><a name="l00922"></a><span class="lineno"> 922</span>  );</div><div class="line"><a name="l00923"></a><span class="lineno"> 923</span> </div><div class="line"><a name="l00924"></a><span class="lineno"> 924</span>  $screen = get_current_screen();</div><div class="line"><a name="l00925"></a><span class="lineno"> 925</span>  $columns = get_column_headers( $screen );</div><div class="line"><a name="l00926"></a><span class="lineno"> 926</span>  $colspan = ! is_countable( $columns ) ? 3 : count( $columns );</div><div class="line"><a name="l00927"></a><span class="lineno"> 927</span>  $plugin_slug = isset( $plugin_data[<span class="stringliteral">'slug'</span>] ) ? $plugin_data[<span class="stringliteral">'slug'</span>] : sanitize_title( $plugin_data[<span class="stringliteral">'Name'</span>] );</div><div class="line"><a name="l00928"></a><span class="lineno"> 928</span>  $plugin_name = $plugin_data[<span class="stringliteral">'Name'</span>];</div><div class="line"><a name="l00929"></a><span class="lineno"> 929</span> </div><div class="line"><a name="l00930"></a><span class="lineno"> 930</span>  echo <<<HTML</div><div class="line"><a name="l00931"></a><span class="lineno"> 931</span> <tr <span class="keyword">class</span>=<span class="stringliteral">"plugin-update-tr active gk-custom-plugin-update-message"</span> data-slug=<span class="stringliteral">"{$plugin_slug}11"</span> data-plugin=<span class="stringliteral">"{$plugin_name}"</span>></div><div class="line"><a name="l00932"></a><span class="lineno"> 932</span>  <td colspan=<span class="stringliteral">"{$colspan}"</span> <span class="keyword">class</span>=<span class="stringliteral">"plugin-update colspanchange"</span>></div><div class="line"><a name="l00933"></a><span class="lineno"> 933</span>  <div <span class="keyword">class</span>=<span class="stringliteral">"update-message notice inline notice-error notice-alt"</span>></div><div class="line"><a name="l00934"></a><span class="lineno"> 934</span>  <p>{$message}</p></div><div class="line"><a name="l00935"></a><span class="lineno"> 935</span>  </div></div><div class="line"><a name="l00936"></a><span class="lineno"> 936</span>  </td></div><div class="line"><a name="l00937"></a><span class="lineno"> 937</span> </tr></div><div class="line"><a name="l00938"></a><span class="lineno"> 938</span> <style>tr[data-slug=<span class="stringliteral">"{$plugin_slug}"</span>]:not(.gk-custom-plugin-update-message) td, tr[data-slug=<span class="stringliteral">"{$plugin_slug}"</span>]:not(.gk-custom-plugin-update-message) th { box-shadow: none !important; }</style></div><div class="line"><a name="l00939"></a><span class="lineno"> 939</span> HTML;</div><div class="line"><a name="l00940"></a><span class="lineno"> 940</span>  }, 11, 2 );</div><div class="line"><a name="l00941"></a><span class="lineno"> 941</span>  }</div><div class="line"><a name="l00942"></a><span class="lineno"> 942</span> <span class="comment"></span></div><div class="line"><a name="l00943"></a><span class="lineno"> 943</span> <span class="comment"> /**</span></div><div class="line"><a name="l00944"></a><span class="lineno"> 944</span> <span class="comment"> * Retrieves site data (plugin versions, integrations, etc.) to be sent along with the license check.</span></div><div class="line"><a name="l00945"></a><span class="lineno"> 945</span> <span class="comment"> *</span></div><div class="line"><a name="l00946"></a><span class="lineno"> 946</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l00947"></a><span class="lineno"> 947</span> <span class="comment"> *</span></div><div class="line"><a name="l00948"></a><span class="lineno"> 948</span> <span class="comment"> * @return array</span></div><div class="line"><a name="l00949"></a><span class="lineno"> 949</span> <span class="comment"> */</span></div><div class="line"><a name="l00950"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae9a925845e64c2db6557a836c1c297ab"> 950</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae9a925845e64c2db6557a836c1c297ab">get_site_data</a>() {</div><div class="line"><a name="l00951"></a><span class="lineno"> 951</span>  global $wpdb;</div><div class="line"><a name="l00952"></a><span class="lineno"> 952</span> </div><div class="line"><a name="l00953"></a><span class="lineno"> 953</span>  $data = [];</div><div class="line"><a name="l00954"></a><span class="lineno"> 954</span> </div><div class="line"><a name="l00955"></a><span class="lineno"> 955</span>  $theme_data = wp_get_theme();</div><div class="line"><a name="l00956"></a><span class="lineno"> 956</span>  $theme = $theme_data->Name . <span class="charliteral">' '</span> . $theme_data->Version;</div><div class="line"><a name="l00957"></a><span class="lineno"> 957</span> </div><div class="line"><a name="l00958"></a><span class="lineno"> 958</span>  $data[<span class="stringliteral">'php_version'</span>] = PHP_VERSION;</div><div class="line"><a name="l00959"></a><span class="lineno"> 959</span>  $data[<span class="stringliteral">'wp_version'</span>] = get_bloginfo( <span class="stringliteral">'version'</span> );</div><div class="line"><a name="l00960"></a><span class="lineno"> 960</span>  $data[<span class="stringliteral">'mysql_version'</span>] = $wpdb->db_version();</div><div class="line"><a name="l00961"></a><span class="lineno"> 961</span> </div><div class="line"><a name="l00962"></a><span class="lineno"> 962</span>  <span class="keywordflow">if</span> ( defined( <span class="stringliteral">'GV_PLUGIN_VERSION'</span> ) ) {</div><div class="line"><a name="l00963"></a><span class="lineno"> 963</span>  $data[<span class="stringliteral">'gv_version'</span>] = <a class="code" href="gravityview_8php.html#af38e1e6e2d8db296a4029b011c1649de">GV_PLUGIN_VERSION</a>;</div><div class="line"><a name="l00964"></a><span class="lineno"> 964</span>  }</div><div class="line"><a name="l00965"></a><span class="lineno"> 965</span> </div><div class="line"><a name="l00966"></a><span class="lineno"> 966</span>  <span class="keywordflow">if</span> ( class_exists( <span class="stringliteral">'GFForms'</span> ) ) {</div><div class="line"><a name="l00967"></a><span class="lineno"> 967</span>  $data[<span class="stringliteral">'gf_version'</span>] = GFForms::$version;</div><div class="line"><a name="l00968"></a><span class="lineno"> 968</span>  }</div><div class="line"><a name="l00969"></a><span class="lineno"> 969</span> </div><div class="line"><a name="l00970"></a><span class="lineno"> 970</span>  <span class="keywordflow">if</span> ( isset( $_SERVER[<span class="stringliteral">'SERVER_SOFTWARE'</span>] ) ) {</div><div class="line"><a name="l00971"></a><span class="lineno"> 971</span>  $data[<span class="stringliteral">'server'</span>] = $_SERVER[<span class="stringliteral">'SERVER_SOFTWARE'</span>];</div><div class="line"><a name="l00972"></a><span class="lineno"> 972</span>  }</div><div class="line"><a name="l00973"></a><span class="lineno"> 973</span> </div><div class="line"><a name="l00974"></a><span class="lineno"> 974</span>  $data[<span class="stringliteral">'multisite'</span>] = is_multisite();</div><div class="line"><a name="l00975"></a><span class="lineno"> 975</span>  $data[<span class="stringliteral">'theme'</span>] = $theme;</div><div class="line"><a name="l00976"></a><span class="lineno"> 976</span>  $data[<span class="stringliteral">'url'</span>] = is_multisite() ? network_home_url() : home_url();</div><div class="line"><a name="l00977"></a><span class="lineno"> 977</span>  $data[<span class="stringliteral">'beta'</span>] = SettingsFramework::get_instance()->get_plugin_setting( <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html#a0242c89b204631bde9edc65a9a731f47">Core::ID</a>, <span class="stringliteral">'beta'</span> );</div><div class="line"><a name="l00978"></a><span class="lineno"> 978</span> </div><div class="line"><a name="l00979"></a><span class="lineno"> 979</span>  <span class="comment">// GravityView view data.</span></div><div class="line"><a name="l00980"></a><span class="lineno"> 980</span>  $gravityview_posts = wp_count_posts( <span class="stringliteral">'gravityview'</span>, <span class="stringliteral">'readable'</span> );</div><div class="line"><a name="l00981"></a><span class="lineno"> 981</span> </div><div class="line"><a name="l00982"></a><span class="lineno"> 982</span>  $data[<span class="stringliteral">'view_count'</span>] = null;</div><div class="line"><a name="l00983"></a><span class="lineno"> 983</span>  $data[<span class="stringliteral">'view_first'</span>] = null;</div><div class="line"><a name="l00984"></a><span class="lineno"> 984</span>  $data[<span class="stringliteral">'view_latest'</span>] = null;</div><div class="line"><a name="l00985"></a><span class="lineno"> 985</span> </div><div class="line"><a name="l00986"></a><span class="lineno"> 986</span>  <span class="keywordflow">if</span> ( ! empty( $gravityview_posts->publish ) ) {</div><div class="line"><a name="l00987"></a><span class="lineno"> 987</span>  $data[<span class="stringliteral">'view_count'</span>] = $gravityview_posts->publish;</div><div class="line"><a name="l00988"></a><span class="lineno"> 988</span> </div><div class="line"><a name="l00989"></a><span class="lineno"> 989</span>  $first = get_posts( <span class="stringliteral">'numberposts=1&post_type=gravityview&post_status=publish&order=ASC'</span> );</div><div class="line"><a name="l00990"></a><span class="lineno"> 990</span>  $latest = get_posts( <span class="stringliteral">'numberposts=1&post_type=gravityview&post_status=publish&order=DESC'</span> );</div><div class="line"><a name="l00991"></a><span class="lineno"> 991</span> </div><div class="line"><a name="l00992"></a><span class="lineno"> 992</span>  <span class="keywordflow">if</span> ( $first = array_shift( $first ) ) {</div><div class="line"><a name="l00993"></a><span class="lineno"> 993</span>  $data[<span class="stringliteral">'view_first'</span>] = $first->post_date;</div><div class="line"><a name="l00994"></a><span class="lineno"> 994</span>  }</div><div class="line"><a name="l00995"></a><span class="lineno"> 995</span>  <span class="keywordflow">if</span> ( $latest = array_pop( $latest ) ) {</div><div class="line"><a name="l00996"></a><span class="lineno"> 996</span>  $data[<span class="stringliteral">'view_latest'</span>] = $latest->post_date;</div><div class="line"><a name="l00997"></a><span class="lineno"> 997</span>  }</div><div class="line"><a name="l00998"></a><span class="lineno"> 998</span>  }</div><div class="line"><a name="l00999"></a><span class="lineno"> 999</span> </div><div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>  <span class="comment">// Gravity Forms form data.</span></div><div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>  <span class="keywordflow">if</span> ( class_exists( <span class="stringliteral">'GFFormsModel'</span> ) ) {</div><div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>  $form_data = GFFormsModel::get_form_count();</div><div class="line"><a name="l01003"></a><span class="lineno"> 1003</span> </div><div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>  $data[<span class="stringliteral">'forms_total'</span>] = $form_data[<span class="stringliteral">'total'</span>];</div><div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>  $data[<span class="stringliteral">'forms_active'</span>] = $form_data[<span class="stringliteral">'active'</span>];</div><div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>  $data[<span class="stringliteral">'forms_inactive'</span>] = $form_data[<span class="stringliteral">'inactive'</span>];</div><div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>  $data[<span class="stringliteral">'forms_trash'</span>] = $form_data[<span class="stringliteral">'trash'</span>];</div><div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>  }</div><div class="line"><a name="l01009"></a><span class="lineno"> 1009</span> </div><div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>  $plugins = CoreHelpers::get_installed_plugins();</div><div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>  <span class="keywordflow">foreach</span> ( $plugins as &$plugin ) {</div><div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>  $plugin = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#ae9086678b5774d046aca4ed8effe2c0a">Arr::only</a>( $plugin, [ <span class="stringliteral">'name'</span>, <span class="stringliteral">'version'</span>, <span class="stringliteral">'active'</span>, <span class="stringliteral">'network_activated'</span> ] );</div><div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>  $plugin = array_filter( $plugin ); <span class="comment">// Don't include active/network activated if false</span></div><div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>  }</div><div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> </div><div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>  $data[<span class="stringliteral">'plugins'</span>] = $plugins;</div><div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>  $data[<span class="stringliteral">'locale'</span>] = get_locale();</div><div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> </div><div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>  <span class="keywordflow">return</span> $data;</div><div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>  }</div><div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> <span class="comment"></span></div><div class="line"><a name="l01022"></a><span class="lineno"> 1022</span> <span class="comment"> /**</span></div><div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> <span class="comment"> * Optionally updates the Licenses submenu badge count if any of the products are unlicensed.</span></div><div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> <span class="comment"> *</span></div><div class="line"><a name="l01025"></a><span class="lineno"> 1025</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> <span class="comment"> *</span></div><div class="line"><a name="l01027"></a><span class="lineno"> 1027</span> <span class="comment"> * @return void</span></div><div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> <span class="comment"> */</span></div><div class="line"><a name="l01029"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab490260b22eefc9b8d661f3a28e3c27b"> 1029</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab490260b22eefc9b8d661f3a28e3c27b">update_submenu_badge_count</a>() {</div><div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">Framework::get_instance</a>()->current_user_can( <span class="stringliteral">'manage_licenses'</span> ) ) {</div><div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>  }</div><div class="line"><a name="l01033"></a><span class="lineno"> 1033</span> </div><div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>  $products_data = <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_product_manager.html#aeeb76432d095288ac056df22cca56d16">ProductManager::get_instance</a>()->get_products_data();</div><div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>  LoggerFramework::get_instance()->warning( <span class="stringliteral">'Unable to get products when adding a badge count for unlicensed products.'</span> );</div><div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> </div><div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>  }</div><div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> </div><div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>  <a class="code" href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a> = 0;</div><div class="line"><a name="l01043"></a><span class="lineno"> 1043</span> </div><div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>  <span class="keywordflow">foreach</span> ( $products_data as $product ) {</div><div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>  <span class="keywordflow">if</span> ( $product[<span class="stringliteral">'active'</span>] && empty( $product[<span class="stringliteral">'licenses'</span>] ) ) {</div><div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>  <a class="code" href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a>++;</div><div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>  }</div><div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>  }</div><div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div><div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>  <span class="keywordflow">if</span> ( ! <a class="code" href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a> ) {</div><div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>  }</div><div class="line"><a name="l01053"></a><span class="lineno"> 1053</span> </div><div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>  add_filter( <span class="stringliteral">'gk/foundation/admin-menu/submenu/'</span> . <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">Framework::ID</a> . <span class="stringliteral">'/counter'</span>, <span class="keyword">function</span> ( $count ) use ( <a class="code" href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a> ) {</div><div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>  <span class="keywordflow">return</span> (<span class="keywordtype">int</span>) $count + <a class="code" href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a>;</div><div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>  } );</div><div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>  }</div><div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> <span class="comment"></span></div><div class="line"><a name="l01059"></a><span class="lineno"> 1059</span> <span class="comment"> /**</span></div><div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> <span class="comment"> * Determines if the license has expired.</span></div><div class="line"><a name="l01061"></a><span class="lineno"> 1061</span> <span class="comment"> *</span></div><div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> <span class="comment"> * @since 1.0.0</span></div><div class="line"><a name="l01063"></a><span class="lineno"> 1063</span> <span class="comment"> *</span></div><div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> <span class="comment"> * @param int|string $expiry Unix time or 'lifetime'.</span></div><div class="line"><a name="l01065"></a><span class="lineno"> 1065</span> <span class="comment"> *</span></div><div class="line"><a name="l01066"></a><span class="lineno"> 1066</span> <span class="comment"> * @return bool</span></div><div class="line"><a name="l01067"></a><span class="lineno"> 1067</span> <span class="comment"> */</span></div><div class="line"><a name="l01068"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9ec623c84087ce697e2b28b0e73d0e20"> 1068</a></span>  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9ec623c84087ce697e2b28b0e73d0e20">is_expired_license</a>( $expiry ) {</div><div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>  <span class="keywordflow">if</span> ( <span class="stringliteral">'lifetime'</span> === $expiry ) {</div><div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>  }</div><div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> </div><div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>  <span class="keywordflow">return</span> $expiry < current_time( <span class="stringliteral">'timestamp'</span> );</div><div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>  }</div><div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> }</div><div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a9ec623c84087ce697e2b28b0e73d0e20"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9ec623c84087ce697e2b28b0e73d0e20">GravityKit\GravityView\Foundation\Licenses\LicenseManager\is_expired_license</a></div><div class="ttdeci">is_expired_license( $expiry)</div><div class="ttdoc">Determines if the license has expired. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l01068">LicenseManager.php:1068</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core_html_a0242c89b204631bde9edc65a9a731f47"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html#a0242c89b204631bde9edc65a9a731f47">GravityKit\GravityView\Foundation\Core\ID</a></div><div class="ttdeci">const ID</div><div class="ttdef"><b>Definition:</b> <a href="_core_8php_source.html#l00028">Core.php:28</a></div></div>
<div class="ttc" id="post__image_8php_html_acf215f34a917d014776ce684a9ee8909"><div class="ttname"><a href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a></div><div class="ttdeci">$url</div><div class="ttdef"><b>Definition:</b> <a href="post__image_8php_source.html#l00025">post_image.php:25</a></div></div>
<div class="ttc" id="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_html"><div class="ttname"><a href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses.html">GravityKit\GravityView\Foundation\Licenses</a></div><div class="ttdoc">GPL-2.0-or-later </div><div class="ttdef"><b>Definition:</b> <a href="_e_d_d_8php_source.html#l00009">EDD.php:9</a></div></div>
<div class="ttc" id="gravityview_8php_html_af38e1e6e2d8db296a4029b011c1649de"><div class="ttname"><a href="gravityview_8php.html#af38e1e6e2d8db296a4029b011c1649de">GV_PLUGIN_VERSION</a></div><div class="ttdeci">const GV_PLUGIN_VERSION(! GravityKit\GravityView\Foundation\meets_min_php_version_requirement(__FILE__, '7.2.0'))</div><div class="ttdoc">Constants. </div><div class="ttdef"><b>Definition:</b> <a href="gravityview_8php_source.html#l00034">gravityview.php:34</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework_html_ac4772ddb7b5b92e757c483bc606f4d16"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#ac4772ddb7b5b92e757c483bc606f4d16">GravityKit\GravityView\Foundation\Licenses\Framework\AJAX_ROUTER</a></div><div class="ttdeci">const AJAX_ROUTER</div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_framework_8php_source.html#l00021">Licenses/Framework.php:21</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a5dcfac1f8e328d6adc4f7b832fd93b66"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a5dcfac1f8e328d6adc4f7b832fd93b66">GravityKit\GravityView\Foundation\Licenses\LicenseManager\ajax_get_licenses_data</a></div><div class="ttdeci">ajax_get_licenses_data(array $payload)</div><div class="ttdoc">AJAX request wrapper for the get_licenses_data() method. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00124">LicenseManager.php:124</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a0fdc10e3583ceee28476ba0b0654f3dc"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a0fdc10e3583ceee28476ba0b0654f3dc">GravityKit\GravityView\Foundation\Licenses\LicenseManager\recheck_all_licenses</a></div><div class="ttdeci">recheck_all_licenses( $skip_cache=false)</div><div class="ttdoc">Rechecks all licenses and updates the database. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00812">LicenseManager.php:812</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_aa482cabcb47c4cc51bad202f08c96926"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa482cabcb47c4cc51bad202f08c96926">GravityKit\GravityView\Foundation\Licenses\LicenseManager\$_licenses_data</a></div><div class="ttdeci">$_licenses_data</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00046">LicenseManager.php:46</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a7f65edc8d73d046f3097394631358e6c"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a7f65edc8d73d046f3097394631358e6c">GravityKit\GravityView\Foundation\Licenses\LicenseManager\EDD_LICENSES_API_VERSION</a></div><div class="ttdeci">const EDD_LICENSES_API_VERSION</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00024">LicenseManager.php:24</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_af185f845cce2e9e6657423774195049c"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#af185f845cce2e9e6657423774195049c">GravityKit\GravityView\Foundation\Licenses\LicenseManager\check_license</a></div><div class="ttdeci">check_license( $license_key)</div><div class="ttdoc">Checks license key for validity. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00401">LicenseManager.php:401</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_aeeb76432d095288ac056df22cca56d16"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aeeb76432d095288ac056df22cca56d16">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_instance</a></div><div class="ttdeci">static get_instance()</div><div class="ttdoc">Returns class instance. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00055">LicenseManager.php:55</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a805dedc6569a5861315146fcaa028301"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a805dedc6569a5861315146fcaa028301">GravityKit\GravityView\Foundation\Licenses\LicenseManager\ajax_deactivate_license</a></div><div class="ttdeci">ajax_deactivate_license(array $payload)</div><div class="ttdoc">AJAX request wrapper for the deactivate_license() method. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00513">LicenseManager.php:513</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a6a230a94ab4f510cdd453a7c06d83b4f"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a6a230a94ab4f510cdd453a7c06d83b4f">GravityKit\GravityView\Foundation\Licenses\LicenseManager\process_hardcoded_licenses</a></div><div class="ttdeci">process_hardcoded_licenses()</div><div class="ttdoc">Saves new or removes existing hardcoded licenses from the license data. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00645">LicenseManager.php:645</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a369e10ea8657a5e643ba09c0e8e8c849"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a369e10ea8657a5e643ba09c0e8e8c849">GravityKit\GravityView\Foundation\Licenses\LicenseManager\EDD_ACTION_CHECK_LICENSE</a></div><div class="ttdeci">const EDD_ACTION_CHECK_LICENSE</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00026">LicenseManager.php:26</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr_html_a744ef7454e48c5521c4c3ad3cf1b700b"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#a744ef7454e48c5521c4c3ad3cf1b700b">GravityKit\GravityView\Foundation\Helpers\Arr\get</a></div><div class="ttdeci">static get( $array, $key, $default=null)</div><div class="ttdoc">{} </div><div class="ttdef"><b>Definition:</b> <a href="_arr_8php_source.html#l00099">Arr.php:99</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ac350be23da328a6f5429313efc9b96e4"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac350be23da328a6f5429313efc9b96e4">GravityKit\GravityView\Foundation\Licenses\LicenseManager\$_instance</a></div><div class="ttdeci">static $_instance</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00039">LicenseManager.php:39</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ae9a925845e64c2db6557a836c1c297ab"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae9a925845e64c2db6557a836c1c297ab">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_site_data</a></div><div class="ttdeci">get_site_data()</div><div class="ttdoc">Retrieves site data (plugin versions, integrations, etc.) to be sent along with the license check...</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00950">LicenseManager.php:950</a></div></div>
<div class="ttc" id="namespace_g_f_forms_model_html"><div class="ttname"><a href="namespace_g_f_forms_model.html">GFFormsModel</a></div></div>
<div class="ttc" id="namespace_g_f_forms_html"><div class="ttname"><a href="namespace_g_f_forms.html">GFForms</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ae56aa7212a228b470bc42f4172f2a971"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae56aa7212a228b470bc42f4172f2a971">GravityKit\GravityView\Foundation\Licenses\LicenseManager\ajax_activate_license</a></div><div class="ttdeci">ajax_activate_license(array $payload)</div><div class="ttdoc">AJAX request wrapper for the activate_license() method. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00439">LicenseManager.php:439</a></div></div>
<div class="ttc" id="namespace_exception_html"><div class="ttname"><a href="namespace_exception.html">Exception</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ae4c415d2fcd4d64f10b86790d96e7d91"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4c415d2fcd4d64f10b86790d96e7d91">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_license_key_status_message</a></div><div class="ttdeci">get_license_key_status_message( $status)</div><div class="ttdoc">Returns license status message based on the EDD status code. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00267">LicenseManager.php:267</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption_html_afd0a3e9021de0ca766baecac9988efc8"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html#afd0a3e9021de0ca766baecac9988efc8">GravityKit\GravityView\Foundation\Encryption\Encryption\get_instance</a></div><div class="ttdeci">static get_instance( $secret_key='')</div><div class="ttdoc">Returns class instance. </div><div class="ttdef"><b>Definition:</b> <a href="_encryption_8php_source.html#l00067">Encryption.php:67</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a4be4055f3361d4800e16bc2e2e38cda6"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a4be4055f3361d4800e16bc2e2e38cda6">GravityKit\GravityView\Foundation\Licenses\LicenseManager\init</a></div><div class="ttdeci">init()</div><div class="ttdoc">Initializes the class. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00070">LicenseManager.php:70</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ad98b7c89ba835941712901d12a323a70"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad98b7c89ba835941712901d12a323a70">GravityKit\GravityView\Foundation\Licenses\LicenseManager\display_license_info_on_plugins_page</a></div><div class="ttdeci">display_license_info_on_plugins_page( $plugin_name, $plugin_data)</div><div class="ttdoc">Optionally adds notices to installed plugins when license is invalid or expired. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00868">LicenseManager.php:868</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a53e09af1b1cc05c2e1fd12fcf9e3abdd"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a53e09af1b1cc05c2e1fd12fcf9e3abdd">GravityKit\GravityView\Foundation\Licenses\LicenseManager\modify_license_data_for_frontend_output</a></div><div class="ttdeci">modify_license_data_for_frontend_output( $license)</div><div class="ttdoc">Adds additional data to the license object for use in the frontend. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00588">LicenseManager.php:588</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_aa0d9e6bdbcefa670a4654ea933889633"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#aa0d9e6bdbcefa670a4654ea933889633">GravityKit\GravityView\Foundation\Licenses\LicenseManager\save_licenses_data</a></div><div class="ttdeci">save_licenses_data(array $licenses_data)</div><div class="ttdoc">Saves license data in the database. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00181">LicenseManager.php:181</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ae4dd6986d662e0e453abae7cef94b714"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae4dd6986d662e0e453abae7cef94b714">GravityKit\GravityView\Foundation\Licenses\LicenseManager\HARDCODED_LICENSE_CONSTANTS</a></div><div class="ttdeci">const HARDCODED_LICENSE_CONSTANTS</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00032">LicenseManager.php:32</a></div></div>
<div class="ttc" id="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr_html"><div class="ttname"><a href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html">Arr</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_settings_1_1_framework_html"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_settings_1_1_framework.html">GravityKit\GravityView\Foundation\Settings\Framework</a></div><div class="ttdef"><b>Definition:</b> <a href="_settings_2_framework_8php_source.html#l00019">Settings/Framework.php:19</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ae6fd73f4e5232aa53ff202bd89ad9e05"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ae6fd73f4e5232aa53ff202bd89ad9e05">GravityKit\GravityView\Foundation\Licenses\LicenseManager\check_licenses</a></div><div class="ttdeci">check_licenses(array $license_keys)</div><div class="ttdoc">Checks multiples license keys for validity. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00420">LicenseManager.php:420</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a840fc43621978f6441c91c6cf29828b1"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a840fc43621978f6441c91c6cf29828b1">GravityKit\GravityView\Foundation\Licenses\LicenseManager\mask_license_key</a></div><div class="ttdeci">mask_license_key( $license_key)</div><div class="ttdoc">Masks part of the license key. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00626">LicenseManager.php:626</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ac5c13046d31ae77efff3158b3e7b00aa"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5c13046d31ae77efff3158b3e7b00aa">GravityKit\GravityView\Foundation\Licenses\LicenseManager\EDD_LICENSES_API_ENDPOINT</a></div><div class="ttdeci">const EDD_LICENSES_API_ENDPOINT</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00022">LicenseManager.php:22</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers_html_a22cd5177237699ccc3fb619f730ddbaf"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html#a22cd5177237699ccc3fb619f730ddbaf">GravityKit\GravityView\Foundation\Licenses\Helpers\query_api</a></div><div class="ttdeci">static query_api( $url, array $args=[])</div><div class="ttdoc">Performs remote call to GravityKit&#39;s EDD API. </div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_helpers_8php_source.html#l00026">Licenses/Helpers.php:26</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a9c70ebedf6f698c0219908f23650a84f"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9c70ebedf6f698c0219908f23650a84f">GravityKit\GravityView\Foundation\Licenses\LicenseManager\migrate_legacy_licenses</a></div><div class="ttdeci">migrate_legacy_licenses( $force_migration=false)</div><div class="ttdoc">Migrates licenses for products that do not have Foundation integrated. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00722">LicenseManager.php:722</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a331c951bc102db41f8866d4530ee2380"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a331c951bc102db41f8866d4530ee2380">GravityKit\GravityView\Foundation\Licenses\LicenseManager\EDD_ACTION_DEACTIVATE_LICENSE</a></div><div class="ttdeci">const EDD_ACTION_DEACTIVATE_LICENSE</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00030">LicenseManager.php:30</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework_html_aeeb76432d095288ac056df22cca56d16"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#aeeb76432d095288ac056df22cca56d16">GravityKit\GravityView\Foundation\Licenses\Framework\get_instance</a></div><div class="ttdeci">static get_instance()</div><div class="ttdoc">Returns class instance. </div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_framework_8php_source.html#l00098">Licenses/Framework.php:98</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a96616b367f78702ad0346468704b8d74"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a96616b367f78702ad0346468704b8d74">GravityKit\GravityView\Foundation\Licenses\LicenseManager\perform_remote_license_call</a></div><div class="ttdeci">perform_remote_license_call( $license, $edd_action)</div><div class="ttdoc">Performs remote call to the EDD API. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00301">LicenseManager.php:301</a></div></div>
<div class="ttc" id="form-buttons_8php_html_a6b7991b2dafe144e5429e104df48b0f8"><div class="ttname"><a href="form-buttons_8php.html#a6b7991b2dafe144e5429e104df48b0f8">$update_count</a></div><div class="ttdeci">$update_count</div><div class="ttdef"><b>Definition:</b> <a href="form-buttons_8php_source.html#l00075">form-buttons.php:75</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework_html_a0242c89b204631bde9edc65a9a731f47"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_framework.html#a0242c89b204631bde9edc65a9a731f47">GravityKit\GravityView\Foundation\Licenses\Framework\ID</a></div><div class="ttdeci">const ID</div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_framework_8php_source.html#l00019">Licenses/Framework.php:19</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ab490260b22eefc9b8d661f3a28e3c27b"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab490260b22eefc9b8d661f3a28e3c27b">GravityKit\GravityView\Foundation\Licenses\LicenseManager\update_submenu_badge_count</a></div><div class="ttdeci">update_submenu_badge_count()</div><div class="ttdoc">Optionally updates the Licenses submenu badge count if any of the products are unlicensed. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l01029">LicenseManager.php:1029</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ad1f0314a7a26232c837ab95e21b3ebec"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ad1f0314a7a26232c837ab95e21b3ebec">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_product_licenses</a></div><div class="ttdeci">get_product_licenses( $id)</div><div class="ttdoc">Returns licenses for a product. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00250">LicenseManager.php:250</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_product_manager_html_aeeb76432d095288ac056df22cca56d16"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_product_manager.html#aeeb76432d095288ac056df22cca56d16">GravityKit\GravityView\Foundation\Licenses\ProductManager\get_instance</a></div><div class="ttdeci">static get_instance()</div><div class="ttdoc">Returns class instance. </div><div class="ttdef"><b>Definition:</b> <a href="_product_manager_8php_source.html#l00041">ProductManager.php:41</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_adccdd12c5b599cc38455d77a920c4a5d"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#adccdd12c5b599cc38455d77a920c4a5d">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_product_license_map</a></div><div class="ttdeci">get_product_license_map( $key_by='id')</div><div class="ttdoc">Returns an object keyed by product ID and associated licenses. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00209">LicenseManager.php:209</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ab1b4f36cb6ed5e588e4462ede02314e7"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ab1b4f36cb6ed5e588e4462ede02314e7">GravityKit\GravityView\Foundation\Licenses\LicenseManager\get_licenses_data</a></div><div class="ttdeci">get_licenses_data()</div><div class="ttdoc">Retrieves license data from the database. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00156">LicenseManager.php:156</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_ac5bf82555dad6a9907dc926fc13326a3"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#ac5bf82555dad6a9907dc926fc13326a3">GravityKit\GravityView\Foundation\Licenses\LicenseManager\EDD_ACTION_ACTIVATE_LICENSE</a></div><div class="ttdeci">const EDD_ACTION_ACTIVATE_LICENSE</div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00028">LicenseManager.php:28</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a9395ed09b58eb3c8de70223326fc95de"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a9395ed09b58eb3c8de70223326fc95de">GravityKit\GravityView\Foundation\Licenses\LicenseManager\configure_ajax_routes</a></div><div class="ttdeci">configure_ajax_routes(array $routes)</div><div class="ttdoc">Configures AJAX routes handled by this class. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00105">LicenseManager.php:105</a></div></div>
<div class="ttc" id="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption_html"><div class="ttname"><a href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_encryption_1_1_encryption.html">Encryption</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html">GravityKit\GravityView\Foundation\Licenses\LicenseManager</a></div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00021">LicenseManager.php:21</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a81b7136cf92fb242b8554e9555249d95"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a81b7136cf92fb242b8554e9555249d95">GravityKit\GravityView\Foundation\Licenses\LicenseManager\activate_license</a></div><div class="ttdeci">activate_license( $license_key)</div><div class="ttdoc">Activates license. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00462">LicenseManager.php:462</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_core_html"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_core.html">GravityKit\GravityView\Foundation\Helpers\Core</a></div><div class="ttdef"><b>Definition:</b> <a href="_helpers_2_core_8php_source.html#l00014">Helpers/Core.php:14</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr_html_ae9086678b5774d046aca4ed8effe2c0a"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_helpers_1_1_arr.html#ae9086678b5774d046aca4ed8effe2c0a">GravityKit\GravityView\Foundation\Helpers\Arr\only</a></div><div class="ttdeci">static only( $array, $keys)</div><div class="ttdoc">{} </div><div class="ttdef"><b>Definition:</b> <a href="_arr_8php_source.html#l00180">Arr.php:180</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core_html_af431b7d2fae5f1104a28f35a6b467216"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html#af431b7d2fae5f1104a28f35a6b467216">GravityKit\GravityView\Foundation\Core\get_request_unique_string</a></div><div class="ttdeci">static get_request_unique_string()</div><div class="ttdoc">Returns a unique value that was generated for this request. </div><div class="ttdef"><b>Definition:</b> <a href="_core_8php_source.html#l00693">Core.php:693</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager_html_a3a1688ab1689359b4fb87a4ad84498f5"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_license_manager.html#a3a1688ab1689359b4fb87a4ad84498f5">GravityKit\GravityView\Foundation\Licenses\LicenseManager\deactivate_license</a></div><div class="ttdeci">deactivate_license( $license_key, $force_removal=false)</div><div class="ttdoc">Deactivates license. </div><div class="ttdef"><b>Definition:</b> <a href="_license_manager_8php_source.html#l00547">LicenseManager.php:547</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_logger_1_1_framework_html"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_logger_1_1_framework.html">GravityKit\GravityView\Foundation\Logger\Framework</a></div><div class="ttdoc">Logging framework for GravityKit. </div><div class="ttdef"><b>Definition:</b> <a href="_logger_2_framework_8php_source.html#l00024">Logger/Framework.php:24</a></div></div>
<div class="ttc" id="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core_html"><div class="ttname"><a href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_core.html">Core</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
$( 'a.anchor[id^=_filters],a.anchor[id^=_actions]' ).each( function() {
$( this )
.text('#')
.attr( 'href', function() {
return '#' + $( this ).attr( 'id' );
}).prependTo( $( this ).parent('dt' ).next('dd') );
});
});
</script>
</body>
</html>