PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.3
Code Manager v1.0.3
1.0.48 1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / freemius / templates / firewall-issues-js.php
code-manager / freemius / templates Last commit date
account 5 years ago debug 5 years ago forms 5 years ago js 5 years ago partials 5 years ago plugin-info 5 years ago account.php 5 years ago add-ons.php 5 years ago add-trial-to-pricing.php 5 years ago admin-notice.php 5 years ago ajax-loader.php 5 years ago auto-installation.php 5 years ago checkout.php 5 years ago connect.php 5 years ago contact.php 5 years ago debug.php 5 years ago email.php 5 years ago firewall-issues-js.php 5 years ago gdpr-optin-js.php 5 years ago index.php 5 years ago plugin-icon.php 5 years ago powered-by.php 5 years ago pricing.php 5 years ago secure-https-header.php 5 years ago sticky-admin-notice-js.php 5 years ago tabs-capture-js.php 5 years ago tabs.php 5 years ago
firewall-issues-js.php
59 lines
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>