PluginProbe
Parse.ly / 2.1.1
Parse.ly v2.1.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / parsely-javascript.php

parsely-javascript.php in Parse.ly 2.1.1, at parsely-javascript.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * JavaScript file
4 *
5 * Main javascript file for plugin
6 *
7 * @category Components
8 * @package WordPress
9 * @subpackage Parse.ly
10 */
11
12 ?>
13
14 <?php
15 if ( ! isset( $parsely_options['apikey'] ) || empty( $parsely_options['apikey'] ) ) {
16 return;
17 }
18 ?>
19
20 <!-- START Parse.ly Include: Standard -->
21 <?php if ( ! empty( $parsely_options['api_secret'] ) ) : ?>
22 <script data-cfasync="false">
23
24 function uuidProfileCall() {
25 var rootUrl = 'https://api.parsely.com/v2/profile?apikey=<?php echo esc_html( $parsely_options['apikey'] ); ?>';
26 var uuid = '&uuid=' + PARSELY.config.parsely_site_uuid;
27 var requestUrl = rootUrl + uuid + '&url=' + window.location.href;
28 jQuery.ajax({
29 url: requestUrl,
30 dataType: "jsonp"
31 });
32 }
33
34 if (typeof PARSELY == 'object') {
35 var oldonload = PARSELY.onload;
36 if (typeof PARSELY.onload != 'function') {
37 PARSELY.onload = uuidProfileCall
38 }
39 else {
40 PARSELY.onload = function () {
41 if (oldonload) {
42 oldonload();
43 }
44 uuidProfileCall();
45 };
46 }
47 }
48
49 else {
50 PARSELY = {
51 onload: uuidProfileCall
52 }
53 }
54 </script>
55 <?php endif; ?>
56
57 <script data-cfasync="false" id="parsely-cfg" data-parsely-site="<?php echo esc_attr( $parsely_options['apikey'] ); ?>" src="//cdn.parsely.com/keys/<?php echo esc_attr( $parsely_options['apikey'] ); ?>/p.js"></script>
58
59 <!-- END Parse.ly Include: Standard -->
60