PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 1.0.7
Adminify – White Label, Admin Menu Editor, Login Customizer v1.0.7
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / lib / freemius / templates / firewall-issues-js.php

firewall-issues-js.php in Adminify – White Label, Admin Menu Editor, Login Customizer 1.0.7, at lib/freemius/templates/firewall-issues-js.php

59 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * API connectivity issues (CloudFlare's firewall) handler for handling different
4 * scenarios selected by the user after connectivity issue is detected, by sending
5 * AJAX call to the server in order to make the actual actions.
6 *
7 * @package Freemius
8 * @copyright Copyright (c) 2015, Freemius, Inc.
9 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
10 * @since 1.0.9
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16 ?>
17 <script type="text/javascript">
18 jQuery( document ).ready(function( $ ) {
19 $( '#fs_firewall_issue_options a.fs-resolve' ).click(function() {
20 var
21 error_type = $( this ).attr( 'data-type' ),
22 notice = $( this ).parents( '.fs-notice' ),
23 ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
24
25 var data = {
26 action : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
27 error_type: error_type
28 };
29
30 if ( 'squid' === error_type ) {
31 data.hosting_company = prompt( 'What is the name or URL of your hosting company?' );
32 if ( null == data.hosting_company )
33 return false;
34
35 if ( '' === data.hosting_company ) {
36 alert( 'We won\'t be able to help without knowing your hosting company.' );
37 return false;
38 }
39 }
40
41 if ( 'retry_ping' === error_type ) {
42 data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
43 }
44
45 $( this ).css({'cursor': 'wait'});
46
47 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
48 $.post( ajaxurl, data, function( response ) {
49 if ( 1 == response ) {
50 // Refresh page on success.
51 location.reload();
52 } else if ( 'http' === response.substr( 0, 4 ) ) {
53 // Ping actually worked, redirect.
54 window.location = response;
55 }
56 });
57 });
58 });
59 </script>