Version Description
- 2018-02-20
Download this release
Release Info
Developer | codeinwp |
Plugin | Orbit Fox by ThemeIsle |
Version | 2.4.1 |
Comparing to | |
See all releases |
Code changes from version 2.4.0 to 2.4.1
- CHANGELOG.md +6 -0
- core/app/abstract/class-orbit-fox-module-abstract.php +9 -0
- core/app/class-orbit-fox-admin.php +5 -4
- core/app/class-orbit-fox-global-settings.php +1 -1
- core/app/helpers/class-orbit-fox-render-helper.php +11 -2
- core/app/views/partials/module-panel-tpl.php +1 -1
- core/app/views/partials/module-tile-tpl.php +28 -1
- core/assets/css/orbit-fox-admin.css +2 -2
- core/assets/js/orbit-fox-admin.js +159 -130
- core/includes/class-orbit-fox.php +1 -1
- obfx_modules/uptime-monitor/init.php +9 -5
- readme.md +7 -0
- readme.txt +7 -0
- themeisle-companion.php +1 -1
- themeisle-hash.json +1 -1
- vendor/autoload.php +1 -1
- vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-endpoints.php +2 -2
- vendor/composer/autoload_real.php +5 -5
- vendor/composer/installed.json +4 -4
CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
### v2.4.0 - 2018-02-16
|
3 |
**Changes:**
|
4 |
* Adds a new module for uptime monitor of your website.
|
1 |
|
2 |
+
### v2.4.1 - 2018-02-20
|
3 |
+
**Changes:**
|
4 |
+
* Added intent confirmation for uptime monitor.
|
5 |
+
* Register site to endpoint only if we have a valid email address.
|
6 |
+
* UX improvements for module activation.
|
7 |
+
|
8 |
### v2.4.0 - 2018-02-16
|
9 |
**Changes:**
|
10 |
* Adds a new module for uptime monitor of your website.
|
core/app/abstract/class-orbit-fox-module-abstract.php
CHANGED
@@ -63,6 +63,15 @@ abstract class Orbit_Fox_Module_Abstract {
|
|
63 |
*/
|
64 |
protected $notices = array();
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
/**
|
67 |
* Flags if module should autoload.
|
68 |
*
|
63 |
*/
|
64 |
protected $notices = array();
|
65 |
|
66 |
+
/**
|
67 |
+
* Confirm intent array. It should contain a title and a subtitle for the confirm intent modal.
|
68 |
+
*
|
69 |
+
* @since 2.4.1
|
70 |
+
* @access public
|
71 |
+
* @var array $confirm_intent Stores an array of the modal with 'title' and 'subtitle' keys.
|
72 |
+
*/
|
73 |
+
public $confirm_intent = array();
|
74 |
+
|
75 |
/**
|
76 |
* Flags if module should autoload.
|
77 |
*
|
core/app/class-orbit-fox-admin.php
CHANGED
@@ -352,10 +352,11 @@ class Orbit_Fox_Admin {
|
|
352 |
}
|
353 |
|
354 |
$data = array(
|
355 |
-
'slug'
|
356 |
-
'name'
|
357 |
-
'description'
|
358 |
-
'checked'
|
|
|
359 |
);
|
360 |
$tiles .= $rdh->get_partial( 'module-tile', $data );
|
361 |
$tiles .= '<div class="divider"></div>';
|
352 |
}
|
353 |
|
354 |
$data = array(
|
355 |
+
'slug' => $slug,
|
356 |
+
'name' => $module->name,
|
357 |
+
'description' => $module->description,
|
358 |
+
'checked' => $checked,
|
359 |
+
'confirm_intent' => $module->confirm_intent,
|
360 |
);
|
361 |
$tiles .= $rdh->get_partial( 'module-tile', $data );
|
362 |
$tiles .= '<div class="divider"></div>';
|
core/app/class-orbit-fox-global-settings.php
CHANGED
@@ -62,13 +62,13 @@ class Orbit_Fox_Global_Settings {
|
|
62 |
'obfx_modules',
|
63 |
array(
|
64 |
'social-sharing',
|
|
|
65 |
'companion-legacy',
|
66 |
'elementor-widgets',
|
67 |
'template-directory',
|
68 |
'menu-icons',
|
69 |
'mystock-import',
|
70 |
'beaver-widgets',
|
71 |
-
'uptime-monitor',
|
72 |
)
|
73 |
);
|
74 |
}// End if().
|
62 |
'obfx_modules',
|
63 |
array(
|
64 |
'social-sharing',
|
65 |
+
'uptime-monitor',
|
66 |
'companion-legacy',
|
67 |
'elementor-widgets',
|
68 |
'template-directory',
|
69 |
'menu-icons',
|
70 |
'mystock-import',
|
71 |
'beaver-widgets',
|
|
|
72 |
)
|
73 |
);
|
74 |
}// End if().
|
core/app/helpers/class-orbit-fox-render-helper.php
CHANGED
@@ -203,11 +203,17 @@ class Orbit_Fox_Render_Helper {
|
|
203 |
* @since 1.0.0
|
204 |
* @access private
|
205 |
* @param array $option The option from the module.
|
|
|
206 |
* @return mixed
|
207 |
*/
|
208 |
-
private function field_text( $option = array() ) {
|
|
|
|
|
|
|
|
|
|
|
209 |
$field_value = $this->set_field_value( $option );
|
210 |
-
$field = '<input class="form-input ' . $option['class'] . '" type="
|
211 |
$field = $this->wrap_element( $option, $field );
|
212 |
|
213 |
return $field;
|
@@ -337,6 +343,9 @@ class Orbit_Fox_Render_Helper {
|
|
337 |
case 'text':
|
338 |
return $this->field_text( $option );
|
339 |
break;
|
|
|
|
|
|
|
340 |
case 'textarea':
|
341 |
return $this->field_textarea( $option );
|
342 |
break;
|
203 |
* @since 1.0.0
|
204 |
* @access private
|
205 |
* @param array $option The option from the module.
|
206 |
+
* @param bool $is_email Render an email input instead of text.
|
207 |
* @return mixed
|
208 |
*/
|
209 |
+
private function field_text( $option = array(), $is_email = false ) {
|
210 |
+
$input_type = 'text';
|
211 |
+
if ( $is_email === true ) {
|
212 |
+
$input_type = 'email';
|
213 |
+
}
|
214 |
+
|
215 |
$field_value = $this->set_field_value( $option );
|
216 |
+
$field = '<input class="form-input ' . $option['class'] . '" type="' . esc_attr( $input_type ) . '" id="' . $option['id'] . '" name="' . $option['name'] . '" placeholder="' . $option['placeholder'] . '" value="' . $field_value . '">';
|
217 |
$field = $this->wrap_element( $option, $field );
|
218 |
|
219 |
return $field;
|
343 |
case 'text':
|
344 |
return $this->field_text( $option );
|
345 |
break;
|
346 |
+
case 'email':
|
347 |
+
return $this->field_text( $option, true );
|
348 |
+
break;
|
349 |
case 'textarea':
|
350 |
return $this->field_textarea( $option );
|
351 |
break;
|
core/app/views/partials/module-panel-tpl.php
CHANGED
@@ -60,7 +60,7 @@ if ( ! $active ) {
|
|
60 |
</div>
|
61 |
<div class="panel-footer text-right">
|
62 |
<button class="btn obfx-mod-btn-cancel" disabled>Cancel</button>
|
63 |
-
<button class="btn btn-primary obfx-mod-btn-save" disabled>Save</button>
|
64 |
</div>
|
65 |
</fieldset>
|
66 |
</form>
|
60 |
</div>
|
61 |
<div class="panel-footer text-right">
|
62 |
<button class="btn obfx-mod-btn-cancel" disabled>Cancel</button>
|
63 |
+
<button type="submit" class="btn btn-primary obfx-mod-btn-save" disabled>Save</button>
|
64 |
</div>
|
65 |
</fieldset>
|
66 |
</form>
|
core/app/views/partials/module-tile-tpl.php
CHANGED
@@ -22,6 +22,26 @@ if ( ! isset( $checked ) ) {
|
|
22 |
$checked = '';
|
23 |
}
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
$noance = wp_create_nonce( 'obfx_activate_mod_' . $slug );
|
26 |
|
27 |
?>
|
@@ -38,9 +58,16 @@ $noance = wp_create_nonce( 'obfx_activate_mod_' . $slug );
|
|
38 |
<div class="tile-action">
|
39 |
<div class="form-group">
|
40 |
<label class="form-switch">
|
41 |
-
<input class="
|
42 |
<i class="form-icon"></i><?php echo __( 'Activate', 'themeisle-companion' ); ?>
|
43 |
</label>
|
|
|
|
|
|
|
|
|
|
|
44 |
</div>
|
45 |
</div>
|
|
|
46 |
</div>
|
|
22 |
$checked = '';
|
23 |
}
|
24 |
|
25 |
+
$toggle_class = 'obfx-mod-switch';
|
26 |
+
|
27 |
+
if ( ! empty( $confirm_intent ) ) {
|
28 |
+
|
29 |
+
$toggle_class .= ' obfx-mod-confirm-intent';
|
30 |
+
$modal = '
|
31 |
+
<div id="' . esc_attr( $slug ) . '" class="modal">
|
32 |
+
<a href="#close" class="close-confirm-intent modal-overlay" aria-label="Close"></a>
|
33 |
+
<div class="modal-container">
|
34 |
+
<div class="modal-header">
|
35 |
+
<a href="#" class="btn btn-clear float-right close-confirm-intent" aria-label="Close"></a>
|
36 |
+
</div>
|
37 |
+
<div class="modal-body">' . wp_kses_post( $confirm_intent ) . '</div>
|
38 |
+
<div class="modal-footer">
|
39 |
+
<button class="btn btn-primary accept-confirm-intent">' . __( 'Got it!', 'themeisle-companion' ) . '</button>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>';
|
43 |
+
}
|
44 |
+
|
45 |
$noance = wp_create_nonce( 'obfx_activate_mod_' . $slug );
|
46 |
|
47 |
?>
|
58 |
<div class="tile-action">
|
59 |
<div class="form-group">
|
60 |
<label class="form-switch">
|
61 |
+
<input class="<?php echo esc_attr( $toggle_class ); ?>" type="checkbox" name="<?php echo $slug; ?>" value="<?php echo $noance; ?>" <?php echo $checked; ?> >
|
62 |
<i class="form-icon"></i><?php echo __( 'Activate', 'themeisle-companion' ); ?>
|
63 |
</label>
|
64 |
+
<?php
|
65 |
+
if ( ! empty( $modal ) ) {
|
66 |
+
echo wp_kses_post( $modal );
|
67 |
+
}
|
68 |
+
?>
|
69 |
</div>
|
70 |
</div>
|
71 |
+
|
72 |
</div>
|
73 |
+
|
core/assets/css/orbit-fox-admin.css
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* Extends Spectre.css Library
|
9 |
*/
|
10 |
/*
|
11 |
-
Version: 2.4.
|
12 |
*/
|
13 |
|
14 |
/* Document
|
@@ -2616,7 +2616,7 @@ html {
|
|
2616 |
|
2617 |
.obfx-wrapper .modal-container {
|
2618 |
display: block;
|
2619 |
-
padding:
|
2620 |
border-radius: 0.2rem;
|
2621 |
background: #fff;
|
2622 |
box-shadow: 0 0.4rem 1rem rgba(69, 77, 93, 0.3);
|
8 |
* Extends Spectre.css Library
|
9 |
*/
|
10 |
/*
|
11 |
+
Version: 2.4.1
|
12 |
*/
|
13 |
|
14 |
/* Document
|
2616 |
|
2617 |
.obfx-wrapper .modal-container {
|
2618 |
display: block;
|
2619 |
+
padding: 1rem .8rem;
|
2620 |
border-radius: 0.2rem;
|
2621 |
background: #fff;
|
2622 |
box-shadow: 0 0.4rem 1rem rgba(69, 77, 93, 0.3);
|
core/assets/js/orbit-fox-admin.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @subpackage Orbit_Fox/admin/js
|
9 |
*/
|
10 |
|
11 |
-
var obfx_admin = function( $ ) {
|
12 |
'use strict';
|
13 |
/**
|
14 |
* All of the code for your admin-facing JavaScript source
|
@@ -38,147 +38,176 @@ var obfx_admin = function( $ ) {
|
|
38 |
* practising this, we should strive to set a better example in our own work.
|
39 |
*/
|
40 |
$(
|
41 |
-
function() {
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
);
|
49 |
|
50 |
$(
|
51 |
-
function() {
|
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 |
} else {
|
82 |
-
|
|
|
83 |
}
|
84 |
-
}
|
85 |
-
|
86 |
-
}
|
87 |
-
);
|
88 |
-
|
89 |
-
$( '.obfx-toast-dismiss' ).on(
|
90 |
-
'click', function() {
|
91 |
-
$( this ).closest( '.obfx-mod-toast' ).slideUp(
|
92 |
-
400, function() {
|
93 |
-
$( this ).removeClass( 'toast-success' );
|
94 |
-
$( this ).removeClass( 'toast-error' );
|
95 |
-
$( this ).removeClass( 'toast-warning' );
|
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 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
-
|
156 |
-
|
157 |
-
form_data = JSON.stringify( maped_array );
|
158 |
-
|
159 |
-
var ajax_data = {
|
160 |
-
'action': 'obfx_update_module_options',
|
161 |
-
'data': form_data
|
162 |
-
};
|
163 |
-
|
164 |
-
$.post(
|
165 |
-
'admin-ajax.php', ajax_data, function( response ) {
|
166 |
-
module_form.find( '.obfx-mod-btn-save' ).removeClass( 'loading' );
|
167 |
-
if ( response.type ) {
|
168 |
-
module_form.closest( '.panel' ).find( '.obfx-mod-toast' ).addClass( 'toast-' + response.type );
|
169 |
-
module_form.closest( '.panel' ).find( '.obfx-mod-toast span' ).html( response.message );
|
170 |
-
module_form.closest( '.panel' ).find( '.obfx-mod-toast' ).show();
|
171 |
-
setTimeout(
|
172 |
-
function() {
|
173 |
-
module_form.closest( '.panel' ).find( '.obfx-toast-dismiss' ).trigger( 'click' );
|
174 |
-
}, 2000
|
175 |
-
);
|
176 |
-
}
|
177 |
-
}, 'json'
|
178 |
-
);
|
179 |
|
180 |
-
|
181 |
-
|
182 |
|
183 |
}
|
184 |
);
|
8 |
* @subpackage Orbit_Fox/admin/js
|
9 |
*/
|
10 |
|
11 |
+
var obfx_admin = function ( $ ) {
|
12 |
'use strict';
|
13 |
/**
|
14 |
* All of the code for your admin-facing JavaScript source
|
38 |
* practising this, we should strive to set a better example in our own work.
|
39 |
*/
|
40 |
$(
|
41 |
+
function () {
|
42 |
+
// if ( $( '#toplevel_page_jetpack' ).length ) {
|
43 |
+
// var obfx_menu = $( '#toplevel_page_obfx_menu' ).clone().wrap( '<p/>' ).parent().html();
|
44 |
+
// $( '#toplevel_page_obfx_menu' ).remove();
|
45 |
+
// $( '#toplevel_page_jetpack' ).before( obfx_menu );
|
46 |
+
// }
|
47 |
}
|
48 |
);
|
49 |
|
50 |
$(
|
51 |
+
function () {
|
52 |
+
$( '.obfx-mod-switch' ).on(
|
53 |
+
'click', function () {
|
54 |
+
var switch_ref = $( this );
|
55 |
+
var checked = switch_ref.is( ':checked' );
|
56 |
+
var name = switch_ref.attr( 'name' );
|
57 |
+
var noance = switch_ref.val();
|
58 |
+
var formSwitch = $( switch_ref ).parent();
|
59 |
+
$( formSwitch ).addClass( 'loading' );
|
60 |
+
if ( $( this ).hasClass( 'obfx-mod-confirm-intent' ) ) {
|
61 |
+
var modal = $( '.modal#' + name );
|
62 |
+
}
|
63 |
+
|
64 |
+
var post_data = {
|
65 |
+
noance: noance,
|
66 |
+
name: name,
|
67 |
+
checked: checked
|
68 |
+
};
|
69 |
+
var json_data = JSON.stringify( post_data );
|
70 |
+
|
71 |
+
var ajax_data = {
|
72 |
+
'action': 'obfx_update_module_active_status',
|
73 |
+
'data': json_data
|
74 |
+
};
|
75 |
+
|
76 |
+
$.post(
|
77 |
+
'admin-ajax.php', ajax_data, function ( response ) {
|
78 |
+
formSwitch.removeClass( 'loading' );
|
79 |
+
if ( response.type === 'success' ) {
|
80 |
+
if ( checked ) {
|
81 |
+
$( '#obfx-mod-' + name ).slideDown();
|
82 |
+
$( '#obfx-mod-' + name ).find( 'fieldset' ).removeAttr( 'disabled' );
|
83 |
+
if ( modal ) {
|
84 |
+
modal.addClass( 'active' );
|
85 |
}
|
86 |
} else {
|
87 |
+
$( '#obfx-mod-' + name ).hide();
|
88 |
+
$( '#obfx-mod-' + name ).find( 'fieldset' ).attr( 'disabled', true );
|
89 |
}
|
90 |
+
} else {
|
91 |
+
switch_ref.attr( 'checked', !switch_ref.attr( 'checked' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
+
}, 'json'
|
94 |
+
);
|
95 |
+
}
|
96 |
+
);
|
97 |
+
|
98 |
+
$( '.accept-confirm-intent, .close-confirm-intent' ).on(
|
99 |
+
'click', function () {
|
100 |
+
var modal = $( this ).closest( '.modal' );
|
101 |
+
modal.removeClass( 'active' );
|
102 |
+
var switch_ref = modal.prev().find( 'input' );
|
103 |
+
var name = switch_ref.attr( 'name' );
|
104 |
+
var optionsPanel = $( '#obfx-mod-' + name );
|
105 |
+
optionsPanel.find( '.btn-expand' ).click();
|
106 |
+
optionsPanel.find( 'input:first-of-type' ).focus();
|
107 |
+
}
|
108 |
+
);
|
109 |
+
|
110 |
+
$( '.close-confirm-intent' ).on(
|
111 |
+
'click', function () {
|
112 |
+
var modal = $( this ).closest( '.modal' );
|
113 |
+
modal.removeClass( 'active' );
|
114 |
+
}
|
115 |
+
);
|
116 |
+
|
117 |
+
$( '.obfx-toast-dismiss' ).on(
|
118 |
+
'click', function () {
|
119 |
+
$( this ).closest( '.obfx-mod-toast' ).slideUp(
|
120 |
+
400, function () {
|
121 |
+
$( this ).removeClass( 'toast-success' );
|
122 |
+
$( this ).removeClass( 'toast-error' );
|
123 |
+
$( this ).removeClass( 'toast-warning' );
|
124 |
}
|
125 |
+
);
|
126 |
+
}
|
127 |
+
);
|
128 |
+
|
129 |
+
$( '.btn-expand' ).on(
|
130 |
+
'click', function () {
|
131 |
+
if ( $( this ).hasClass( 'active' ) ) {
|
132 |
+
$( this ).removeClass( 'active' );
|
133 |
+
$( this ).closest( '.panel-header' ).siblings( '.obfx-module-form' ).removeClass( 'active' );
|
134 |
+
$( this ).closest( '.panel.options' ).css( 'height', '75px' );
|
135 |
+
} else {
|
136 |
+
$( this ).addClass( 'active' );
|
137 |
+
$( this ).closest( '.panel-header' ).siblings( '.obfx-module-form' ).addClass( 'active' );
|
138 |
+
$( this ).closest( '.panel.options' ).css( 'height', ( $( this ).closest( '.panel-header' ).siblings( '.obfx-module-form' ).height() * 1 + 80 ) + 'px' );
|
139 |
}
|
140 |
+
}
|
141 |
+
);
|
142 |
+
|
143 |
+
$( '.obfx-module-form' ).on(
|
144 |
+
'submit', function ( e ) {
|
145 |
+
e.preventDefault();
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
);
|
149 |
+
|
150 |
+
$( '.obfx-module-form' ).on(
|
151 |
+
'keyup change', 'input, select, textarea', function () {
|
152 |
+
$( this ).closest( 'form' ).find( '[class*="obfx-mod-btn"]:disabled' ).removeAttr( 'disabled' );
|
153 |
+
}
|
154 |
+
);
|
155 |
+
|
156 |
+
$( '.obfx-mod-btn-cancel' ).on(
|
157 |
+
'click', function () {
|
158 |
+
$( this ).closest( 'form' ).trigger( 'reset' );
|
159 |
+
$( this ).closest( 'form' ).find( '[class*="obfx-mod-btn"]' ).attr( 'disabled', true );
|
160 |
+
}
|
161 |
+
);
|
162 |
+
|
163 |
+
$( '.obfx-mod-btn-save' ).on(
|
164 |
+
'click', function () {
|
165 |
+
var module_form = $( this ).closest( 'form' );
|
166 |
+
module_form.find( '[class*="obfx-mod-btn"]' ).attr( 'disabled', true );
|
167 |
+
module_form.find( '.obfx-mod-btn-save' ).addClass( 'loading' );
|
168 |
+
module_form.find( $( 'input:checkbox:not(:checked)' ) ).each(
|
169 |
+
function () {
|
170 |
+
var input = $( '<input />' );
|
171 |
+
input.attr( 'type', 'hidden' );
|
172 |
+
input.attr( 'name', $( this ).attr( 'name' ) );
|
173 |
+
input.attr( 'value', '0' );
|
174 |
+
var form = $( this )[ 0 ].form;
|
175 |
+
$( form ).append( input );
|
176 |
+
}
|
177 |
+
);
|
178 |
+
var form_data = module_form.serializeArray();
|
179 |
+
var maped_array = {};
|
180 |
+
$.each(
|
181 |
+
form_data, function ( i, elem ) {
|
182 |
+
maped_array[ elem.name ] = elem.value;
|
183 |
+
}
|
184 |
+
);
|
185 |
+
|
186 |
+
form_data = JSON.stringify( maped_array );
|
187 |
+
|
188 |
+
var ajax_data = {
|
189 |
+
'action': 'obfx_update_module_options',
|
190 |
+
'data': form_data
|
191 |
+
};
|
192 |
+
|
193 |
+
$.post(
|
194 |
+
'admin-ajax.php', ajax_data, function ( response ) {
|
195 |
+
module_form.find( '.obfx-mod-btn-save' ).removeClass( 'loading' );
|
196 |
+
if ( response.type ) {
|
197 |
+
module_form.closest( '.panel' ).find( '.obfx-mod-toast' ).addClass( 'toast-' + response.type );
|
198 |
+
module_form.closest( '.panel' ).find( '.obfx-mod-toast span' ).html( response.message );
|
199 |
+
module_form.closest( '.panel' ).find( '.obfx-mod-toast' ).show();
|
200 |
+
setTimeout(
|
201 |
+
function () {
|
202 |
+
module_form.closest( '.panel' ).find( '.obfx-toast-dismiss' ).trigger( 'click' );
|
203 |
+
}, 2000
|
204 |
+
);
|
205 |
}
|
206 |
+
}, 'json'
|
207 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
+
}
|
210 |
+
);
|
211 |
|
212 |
}
|
213 |
);
|
core/includes/class-orbit-fox.php
CHANGED
@@ -69,7 +69,7 @@ class Orbit_Fox {
|
|
69 |
|
70 |
$this->plugin_name = 'orbit-fox';
|
71 |
|
72 |
-
$this->version = '2.4.
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
69 |
|
70 |
$this->plugin_name = 'orbit-fox';
|
71 |
|
72 |
+
$this->version = '2.4.1';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
obfx_modules/uptime-monitor/init.php
CHANGED
@@ -30,7 +30,7 @@ class Uptime_Monitor_OBFX_Module extends Orbit_Fox_Module_Abstract {
|
|
30 |
parent::__construct();
|
31 |
$this->name = __( 'Uptime Monitor', 'themeisle-companion' );
|
32 |
$this->description = __( 'A module to notify when you website goes down.', 'themeisle-companion' );
|
33 |
-
|
34 |
}
|
35 |
|
36 |
/**
|
@@ -71,14 +71,17 @@ class Uptime_Monitor_OBFX_Module extends Orbit_Fox_Module_Abstract {
|
|
71 |
* @access public
|
72 |
*/
|
73 |
public function activate() {
|
|
|
|
|
|
|
|
|
|
|
74 |
$monitor_url = $this->monitor_url . '/api/monitor/create';
|
75 |
$url = home_url();
|
76 |
-
$email = $this->get_option( 'monitor_email' );
|
77 |
$args = array(
|
78 |
'body' => array( 'url' => $url, 'email' => $email )
|
79 |
);
|
80 |
$response = wp_remote_post( $monitor_url, $args );
|
81 |
-
|
82 |
}
|
83 |
|
84 |
/**
|
@@ -99,6 +102,7 @@ class Uptime_Monitor_OBFX_Module extends Orbit_Fox_Module_Abstract {
|
|
99 |
* @access public
|
100 |
*/
|
101 |
public function deactivate() {
|
|
|
102 |
$monitor_url = $this->monitor_url . '/api/monitor/remove';
|
103 |
$url = home_url();
|
104 |
$args = array(
|
@@ -173,8 +177,8 @@ class Uptime_Monitor_OBFX_Module extends Orbit_Fox_Module_Abstract {
|
|
173 |
'name' => 'monitor_email',
|
174 |
'title' => 'Notification email',
|
175 |
'description' => 'Email where we should notify you when the site goes down.',
|
176 |
-
'type' => '
|
177 |
-
'default' =>
|
178 |
'placeholder' => 'Add your email.',
|
179 |
)
|
180 |
);
|
30 |
parent::__construct();
|
31 |
$this->name = __( 'Uptime Monitor', 'themeisle-companion' );
|
32 |
$this->description = __( 'A module to notify when you website goes down.', 'themeisle-companion' );
|
33 |
+
$this->confirm_intent = '<h4>' . __( 'One more step...', 'themeisle-companion' ) . '</h4><p>' . __( 'In order to use the uptime service, we will need your e-mail address, where we will send downtime alerts.', 'themeisle-companion' ) . '</p>';
|
34 |
}
|
35 |
|
36 |
/**
|
71 |
* @access public
|
72 |
*/
|
73 |
public function activate() {
|
74 |
+
$email = sanitize_email( $this->get_option( 'monitor_email' ) );
|
75 |
+
if ( ! is_email( $email ) ) {
|
76 |
+
return;
|
77 |
+
}
|
78 |
+
|
79 |
$monitor_url = $this->monitor_url . '/api/monitor/create';
|
80 |
$url = home_url();
|
|
|
81 |
$args = array(
|
82 |
'body' => array( 'url' => $url, 'email' => $email )
|
83 |
);
|
84 |
$response = wp_remote_post( $monitor_url, $args );
|
|
|
85 |
}
|
86 |
|
87 |
/**
|
102 |
* @access public
|
103 |
*/
|
104 |
public function deactivate() {
|
105 |
+
|
106 |
$monitor_url = $this->monitor_url . '/api/monitor/remove';
|
107 |
$url = home_url();
|
108 |
$args = array(
|
177 |
'name' => 'monitor_email',
|
178 |
'title' => 'Notification email',
|
179 |
'description' => 'Email where we should notify you when the site goes down.',
|
180 |
+
'type' => 'email',
|
181 |
+
'default' => '',
|
182 |
'placeholder' => 'Add your email.',
|
183 |
)
|
184 |
);
|
readme.md
CHANGED
@@ -89,6 +89,13 @@ Activating the Orbit Fox Companion plugin is just like any other plugin. If you'
|
|
89 |
5. Social Sharing Module
|
90 |
|
91 |
## Changelog ##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
### 2.4.0 - 2018-02-16 ###
|
93 |
|
94 |
* Adds a new module for uptime monitor of your website.
|
89 |
5. Social Sharing Module
|
90 |
|
91 |
## Changelog ##
|
92 |
+
### 2.4.1 - 2018-02-20 ###
|
93 |
+
|
94 |
+
* Added intent confirmation for uptime monitor.
|
95 |
+
* Register site to endpoint only if we have a valid email address.
|
96 |
+
* UX improvements for module activation.
|
97 |
+
|
98 |
+
|
99 |
### 2.4.0 - 2018-02-16 ###
|
100 |
|
101 |
* Adds a new module for uptime monitor of your website.
|
readme.txt
CHANGED
@@ -89,6 +89,13 @@ Activating the Orbit Fox Companion plugin is just like any other plugin. If you'
|
|
89 |
5. Social Sharing Module
|
90 |
|
91 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.4.0 - 2018-02-16 =
|
93 |
|
94 |
* Adds a new module for uptime monitor of your website.
|
89 |
5. Social Sharing Module
|
90 |
|
91 |
== Changelog ==
|
92 |
+
= 2.4.1 - 2018-02-20 =
|
93 |
+
|
94 |
+
* Added intent confirmation for uptime monitor.
|
95 |
+
* Register site to endpoint only if we have a valid email address.
|
96 |
+
* UX improvements for module activation.
|
97 |
+
|
98 |
+
|
99 |
= 2.4.0 - 2018-02-16 =
|
100 |
|
101 |
* Adds a new module for uptime monitor of your website.
|
themeisle-companion.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Orbit Fox Companion
|
16 |
* Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
|
17 |
* Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, and newly added Elementor/BeaverBuilder page builder widgets on each release.
|
18 |
-
* Version: 2.4.
|
19 |
* Author: Themeisle
|
20 |
* Author URI: https://themeisle.com
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: Orbit Fox Companion
|
16 |
* Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
|
17 |
* Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, and newly added Elementor/BeaverBuilder page builder widgets on each release.
|
18 |
+
* Version: 2.4.1
|
19 |
* Author: Themeisle
|
20 |
* Author URI: https://themeisle.com
|
21 |
* License: GPL-2.0+
|
themeisle-hash.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"class-autoloader.php":"57e533b653d235e76cb9953720e4f5e9","index.php":"39ab8276fb0e4bd3fcab3270822c5977","themeisle-companion.php":"
|
1 |
+
{"class-autoloader.php":"57e533b653d235e76cb9953720e4f5e9","index.php":"39ab8276fb0e4bd3fcab3270822c5977","themeisle-companion.php":"92263ab7feb9b1783e7d0f035d271c75","uninstall.php":"7abf753a29e0eb3a844c8a0ba9493b7c"}
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit910fcd2dac85fa9f6166ab7a9b5045b2::getLoader();
|
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-endpoints.php
CHANGED
@@ -235,7 +235,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Endpoints' ) ) :
|
|
235 |
|
236 |
// fetch the calculated hashes.
|
237 |
if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
|
238 |
-
return new WP_Error( 'themeisle_sdk_hash_not_found', sprintf(
|
239 |
}
|
240 |
|
241 |
$hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
|
@@ -296,7 +296,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Endpoints' ) ) :
|
|
296 |
$value = sanitize_text_field( $data[ $param ] );
|
297 |
if ( empty( $value ) ) {
|
298 |
return new WP_Error(
|
299 |
-
'themeisle_' . $param . '_invalid', sprintf(
|
300 |
'status' => 403,
|
301 |
)
|
302 |
);
|
235 |
|
236 |
// fetch the calculated hashes.
|
237 |
if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
|
238 |
+
return new WP_Error( 'themeisle_sdk_hash_not_found', sprintf( '%s not found', self::HASH_FILE ) );
|
239 |
}
|
240 |
|
241 |
$hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
|
296 |
$value = sanitize_text_field( $data[ $param ] );
|
297 |
if ( empty( $value ) ) {
|
298 |
return new WP_Error(
|
299 |
+
'themeisle_' . $param . '_invalid', sprintf( 'Invalid %', $param ), array(
|
300 |
'status' => 403,
|
301 |
)
|
302 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit0a8b01582ba1f6dc622a30d8baec64ad
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit0a8b01582ba1f6dc622a30d8baec64ad
|
|
42 |
|
43 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
44 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
45 |
-
|
46 |
}
|
47 |
|
48 |
return $loader;
|
49 |
}
|
50 |
}
|
51 |
|
52 |
-
function
|
53 |
{
|
54 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
55 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit910fcd2dac85fa9f6166ab7a9b5045b2
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit910fcd2dac85fa9f6166ab7a9b5045b2', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit910fcd2dac85fa9f6166ab7a9b5045b2', 'loadClassLoader'));
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
42 |
|
43 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
44 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
45 |
+
composerRequire910fcd2dac85fa9f6166ab7a9b5045b2($fileIdentifier, $file);
|
46 |
}
|
47 |
|
48 |
return $loader;
|
49 |
}
|
50 |
}
|
51 |
|
52 |
+
function composerRequire910fcd2dac85fa9f6166ab7a9b5045b2($fileIdentifier, $file)
|
53 |
{
|
54 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
55 |
require $file;
|
vendor/composer/installed.json
CHANGED
@@ -6,15 +6,15 @@
|
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
-
"time": "2018-
|
18 |
"type": "library",
|
19 |
"installation-source": "dist",
|
20 |
"autoload": {
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
9 |
+
"reference": "9d866559c6090f0e7e70fe3e5a4be8672461a11a"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/9d866559c6090f0e7e70fe3e5a4be8672461a11a",
|
14 |
+
"reference": "9d866559c6090f0e7e70fe3e5a4be8672461a11a",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
+
"time": "2018-02-16 16:31:29",
|
18 |
"type": "library",
|
19 |
"installation-source": "dist",
|
20 |
"autoload": {
|