WP Engine Automated Migration - Version 1.88

Version Description

  • Callback improvements
Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 WP Engine Automated Migration
Version 1.88
Comparing to
See all releases

Version 1.88

admin.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('WPEAdmin')) :
5
+ class WPEAdmin {
6
+ public $bvmain;
7
+ function __construct($bvmain) {
8
+ $this->bvmain = $bvmain;
9
+ }
10
+
11
+ public function mainUrl($_params = '') {
12
+ if (function_exists('network_admin_url')) {
13
+ return network_admin_url('admin.php?page='.$this->bvmain->plugname.$_params);
14
+ } else {
15
+ return admin_url('admin.php?page='.$this->bvmain->plugname.$_params);
16
+ }
17
+ }
18
+
19
+ public function initHandler() {
20
+ if (!current_user_can('activate_plugins'))
21
+ return;
22
+
23
+ if (array_key_exists('bvnonce', $_REQUEST) &&
24
+ wp_verify_nonce($_REQUEST['bvnonce'], "bvnonce") &&
25
+ array_key_exists('blogvaultkey', $_REQUEST) &&
26
+ (strlen($_REQUEST['blogvaultkey']) == 64) &&
27
+ (array_key_exists('page', $_REQUEST) &&
28
+ $_REQUEST['page'] == $this->bvmain->plugname)) {
29
+ $keys = str_split($_REQUEST['blogvaultkey'], 32);
30
+ $this->bvmain->auth->updateKeys($keys[0], $keys[1]);
31
+ if (array_key_exists('redirect', $_REQUEST)) {
32
+ $location = $_REQUEST['redirect'];
33
+ wp_redirect($this->bvmain->appUrl().'/migration/'.$location);
34
+ exit();
35
+ }
36
+ }
37
+ if ($this->bvmain->isActivateRedirectSet()) {
38
+ wp_redirect($this->mainUrl());
39
+ }
40
+ }
41
+
42
+ public function menu() {
43
+ $brand = $this->bvmain->getBrandInfo();
44
+ if (!$brand || (!array_key_exists('hide', $brand) && !array_key_exists('hide_from_menu', $brand))) {
45
+ $bname = $this->bvmain->getBrandName();
46
+ add_menu_page($bname, $bname, 'manage_options', $this->bvmain->plugname,
47
+ array($this, 'adminPage'), plugins_url('assets/img/favicon.ico', __FILE__ ));
48
+ }
49
+ }
50
+
51
+ public function hidePluginDetails($plugin_metas, $slug) {
52
+ $brand = $this->bvmain->getBrandInfo();
53
+ $bvslug = $this->bvmain->slug;
54
+
55
+ if ($slug === $bvslug && $brand && array_key_exists('hide_plugin_details', $brand)){
56
+ foreach ($plugin_metas as $pluginKey => $pluginValue) {
57
+ if (strpos($pluginValue, sprintf('>%s<', translate('View details')))) {
58
+ unset($plugin_metas[$pluginKey]);
59
+ break;
60
+ }
61
+ }
62
+ }
63
+ return $plugin_metas;
64
+ }
65
+
66
+ public function settingsLink($links, $file) {
67
+ if ( $file == plugin_basename( dirname(__FILE__).'/wpengine.php' ) ) {
68
+ $links[] = '<a href="'.$this->mainUrl().'">'.__( 'Settings' ).'</a>';
69
+ }
70
+ return $links;
71
+ }
72
+
73
+ public function wpesecAdminMenu($hook) {
74
+ if ($hook === 'toplevel_page_wpengine') {
75
+ wp_register_style('bvwpe_normalize', plugins_url('assets/css/normalize.css',__FILE__ ));
76
+ wp_register_style('bvwpe_skeleton', plugins_url('assets/css/skeleton.css',__FILE__ ));
77
+ wp_register_style('bvwpe_form-styles', plugins_url('assets/css/form-styles.css',__FILE__ ));
78
+ wp_enqueue_style('bvwpe_normalize');
79
+ wp_enqueue_style('bvwpe_skeleton');
80
+ wp_enqueue_style('bvwpe_form-styles');
81
+ }
82
+ }
83
+
84
+ public function showErrors() {
85
+ $error = NULL;
86
+ if (array_key_exists('error', $_REQUEST)) {
87
+ $error = $_REQUEST['error'];
88
+ }
89
+ if ($error == "email") {
90
+ echo '<div style="padding-bottom:0.5px; color:red;"><p>Incorrect Email.</p></div>';
91
+ }
92
+ else if (($error == "custom") && isset($_REQUEST['bvnonce']) && wp_verify_nonce($_REQUEST['bvnonce'], "bvnonce")) {
93
+ echo '<div style="padding-bottom:0.5px;color: red;"><p>'.base64_decode($_REQUEST['message']).'</p></div>';
94
+ }
95
+ }
96
+
97
+ public function getPluginLogo() {
98
+ $brand = $this->bvmain->getBrandInfo();
99
+ if ($brand && array_key_exists('logo', $brand)) {
100
+ return $brand['logo'];
101
+ }
102
+ return $this->bvmain->logo;
103
+ }
104
+
105
+ public function getWebPage() {
106
+ $brand = $this->bvmain->getBrandInfo();
107
+ if ($brand && array_key_exists('webpage', $brand)) {
108
+ return $brand['webpage'];
109
+ }
110
+ return $this->bvmain->webpage;
111
+ }
112
+
113
+ public function siteInfoTags() {
114
+ $bvnonce = wp_create_nonce("bvnonce");
115
+ $secret = $this->bvmain->auth->defaultSecret();
116
+ $tags = "<input type='hidden' name='url' value='".$this->bvmain->info->wpurl()."'/>\n".
117
+ "<input type='hidden' name='homeurl' value='".$this->bvmain->info->homeurl()."'/>\n".
118
+ "<input type='hidden' name='siteurl' value='".$this->bvmain->info->siteurl()."'/>\n".
119
+ "<input type='hidden' name='dbsig' value='".$this->bvmain->lib->dbsig(false)."'/>\n".
120
+ "<input type='hidden' name='plug' value='".$this->bvmain->plugname."'/>\n".
121
+ "<input type='hidden' name='adminurl' value='".$this->mainUrl()."'/>\n".
122
+ "<input type='hidden' name='bvversion' value='".$this->bvmain->version."'/>\n".
123
+ "<input type='hidden' name='serverip' value='".$_SERVER["SERVER_ADDR"]."'/>\n".
124
+ "<input type='hidden' name='abspath' value='".ABSPATH."'/>\n".
125
+ "<input type='hidden' name='secret' value='".$secret."'/>\n".
126
+ "<input type='hidden' name='bvnonce' value='".$bvnonce."'/>\n";
127
+ return $tags;
128
+ }
129
+
130
+ public function activateWarning() {
131
+ global $hook_suffix;
132
+ if (!$this->bvmain->isConfigured() && $hook_suffix == 'index.php' ) {
133
+ ?>
134
+ <div id="message" class="updated" style="padding: 8px; font-size: 16px; background-color: #dff0d8">
135
+ <a class="button-primary" href="<?php echo $this->mainUrl(); ?>">Activate Migrate Guru</a>
136
+ &nbsp;&nbsp;&nbsp;<b>Almost Done:</b> Activate your Migrate Guru account to migrate your site.
137
+ </div>
138
+ <?php
139
+ }
140
+ }
141
+
142
+ public function adminPage() {
143
+ require_once dirname( __FILE__ ) . '/admin/main_page.php';
144
+ }
145
+
146
+ public function initBranding($plugins) {
147
+ $slug = $this->bvmain->slug;
148
+ $brand = $this->bvmain->getBrandInfo();
149
+ if ($brand) {
150
+ if (array_key_exists('hide', $brand)) {
151
+ unset($plugins[$slug]);
152
+ } else {
153
+ if (array_key_exists('name', $brand)) {
154
+ $plugins[$slug]['Name'] = $brand['name'];
155
+ }
156
+ if (array_key_exists('title', $brand)) {
157
+ $plugins[$slug]['Title'] = $brand['title'];
158
+ }
159
+ if (array_key_exists('description', $brand)) {
160
+ $plugins[$slug]['Description'] = $brand['description'];
161
+ }
162
+ if (array_key_exists('authoruri', $brand)) {
163
+ $plugins[$slug]['AuthorURI'] = $brand['authoruri'];
164
+ }
165
+ if (array_key_exists('author', $brand)) {
166
+ $plugins[$slug]['Author'] = $brand['author'];
167
+ }
168
+ if (array_key_exists('authorname', $brand)) {
169
+ $plugins[$slug]['AuthorName'] = $brand['authorname'];
170
+ }
171
+ if (array_key_exists('pluginuri', $brand)) {
172
+ $plugins[$slug]['PluginURI'] = $brand['pluginuri'];
173
+ }
174
+ }
175
+ }
176
+ return $plugins;
177
+ }
178
+ }
179
+ endif;
admin/main_page.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_error = NULL;
3
+ if (array_key_exists('error', $_REQUEST)) {
4
+ $_error = $_REQUEST['error'];
5
+ }
6
+ ?>
7
+ <div class="wrap">
8
+ <header>
9
+ <a href="http://wpengine.com/"><img src="<?php echo plugins_url($this->getPluginLogo(), __FILE__); ?>" width="180px" /></a>
10
+ <p class="poweredBy u-pull-right"><a href="http://blogvault.net"><img src="<?php echo plugins_url('../assets/img/blogvault-logo-120.png', __FILE__); ?>" width="140px"/></a></p>
11
+ </header>
12
+
13
+ <hr/>
14
+ <div class="row">
15
+
16
+ <div class="seven columns">
17
+ <form id="wpe_migrate_form" dummy=">" action="<?php echo $this->bvmain->appUrl(); ?>/home/migrate" onsubmit="document.getElementById('migratesubmit').disabled = true;" method="post" name="signup">
18
+ <h1>Migrate My Site to WP Engine</h1>
19
+ <p>The WP Engine Automated Migration plugin allows you to easily migrate your entire WordPress site from
20
+ your previous hosting service to WP Engine for free.</p>
21
+ <p>Take the information from the migration page of your <a href="http://my.wpengine.com">WP Engine User Portal</a>, and paste
22
+ those values into the fields below, and click "Migrate".</p>
23
+ <?php if ($_error == "email") {
24
+ echo '<div class="error" style="padding-bottom:0.5%;"><p>There is already an account with this email.</p></div>';
25
+ } else if ($_error == "blog") {
26
+ echo '<div class="error" style="padding-bottom:0.5%;"><p>Could not create an account. Please contact <a href="http://blogvault.net/contact/">blogVault Support</a><br />
27
+ <font color="red">NOTE: We do not support automated migration of locally hosted sites.</font></p></div>';
28
+ } else if (($_error == "custom") && isset($_REQUEST['bvnonce']) && wp_verify_nonce($_REQUEST['bvnonce'], "bvnonce")) {
29
+ echo '<div class="error" style="padding-bottom:0.5%;"><p>'.base64_decode($_REQUEST['message']).'</p></div>';
30
+ }
31
+ ?>
32
+ <input type="hidden" name="bvsrc" value="wpplugin" />
33
+ <input type="hidden" name="migrate" value="wpengine" />
34
+ <input type="hidden" name="type" value="sftp" />
35
+ <?php echo $this->siteInfoTags(); ?>
36
+ <div class="row">
37
+ <div class="six columns">
38
+ <label id='label_email'>Email</label>
39
+ <input class="u-full-width" type="text" id="email" name="email">
40
+ <p class="help-block"></p>
41
+ </div>
42
+ <div class="six columns">
43
+ <label class="control-label" for="input02">Destination Site URL</label>
44
+ <input type="text" class="u-full-width" name="newurl" placeholder="site.wpengine.com">
45
+ </div>
46
+ </div>
47
+ <div class="row">
48
+ <div class="six columns">
49
+ <label class="control-label" for="inputip"> SFTP Host/Server Address </label>
50
+ <input type="text" class="u-full-width" placeholder="ex. 123.456.789.101" name="address">
51
+ <p class="help-block"></p>
52
+ </div>
53
+ </div>
54
+ <div class="row">
55
+ <div class="six columns">
56
+ <label class="control-label" for="input01">SFTP Username</label>
57
+ <input type="text" class="u-full-width" placeholder="See WP Engine User Portal" name="username">
58
+ <p class="help-block"></p>
59
+ </div>
60
+ <div class="six columns">
61
+ <label class="control-label" for="input02">SFTP Password</label>
62
+ <input type="password" class="u-full-width" placeholder="See WP Engine User Portal" name="passwd">
63
+ </div>
64
+ </div>
65
+ <hr/>
66
+
67
+ <h3>Is Your Site Password Protected?</h3>
68
+ <p>If your current host or your WP Engine install is password protected, you'll need to enter that information here so
69
+ that the migration plugin can access all of your site.
70
+ </p>
71
+
72
+ <button name="password-protected" id="advanced-options-toggle" class="button" onclick="javascript; return false">My site is password protected</button>
73
+
74
+ <div id="password-auth" style="display:none">
75
+ <div id="source-auth" class="six columns">
76
+ <div class="row">
77
+ <div class="twelve columns">
78
+ <h3>Current</h3>
79
+ <label class="control-label" for="httpauth_src_user">User</label>
80
+ <input type="text" class="u-full-width" name="httpauth_src_user">
81
+ <p class="help-block"></p>
82
+ </div>
83
+ </div>
84
+ <div class="row">
85
+ <div class="twelve columns">
86
+ <label class="control-label" for="httpauth_src_password">Password</label>
87
+ <input type="password" class="u-full-width" name="httpauth_src_password">
88
+ <p class="help-block sourceAuthError error" style="display:none">It appears that your current site that does not exist on WP Engine is password protected. Please provide your username and password
89
+ for this password protection.</p>
90
+ </div>
91
+ </div>
92
+ </div>
93
+
94
+ <div id="dest-auth" class="six columns">
95
+ <div class="row">
96
+ <div class="twelve columns">
97
+ <h3>WP Engine</h3>
98
+ <label class="control-label" for="httpauth_dest_user">Username</label>
99
+ <input type="text" class="u-full-width" name="httpauth_dest_user">
100
+ <p class="help-block"></p>
101
+ </div>
102
+ </div>
103
+ <div class="row">
104
+ <div class="twelve columns">
105
+ <label class="control-label" for="httpauth_dest_password">Password</label>
106
+ <input type="password" class="u-full-width" name="httpauth_dest_password">
107
+ <p class="help-block destAuthError error" style="display:none">It appears that your site on WP Engine is password protected. Please provide your username and password
108
+ for the password protection.</p>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+
114
+ <hr/>
115
+ <div>
116
+ <input type="checkbox" name="consent" onchange="document.getElementById('migratesubmit').disabled = !this.checked;" value="1"/>I agree to WP Engine's <a href="https://wpengine.com/terms-of-service/" target="_blank" rel="noopener noreferrer">Terms of Service</a>
117
+ </div>
118
+ <br><input type='submit' disabled id='migratesubmit' value='Migrate' class="button button-primary">
119
+ </form>
120
+ </div>
121
+
122
+ <div class="five columns">
123
+ <h1>Resources</h1>
124
+ <div style="padding:10px; background-color:#FFF; margin-top:15px;">
125
+ <iframe src="//fast.wistia.net/embed/iframe/0rrkl3w1vu?videoFoam=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="500" height="313"></iframe><script src="//fast.wistia.net/assets/external/E-v1.js"></script>
126
+ <p><i>For full instructions and solutions to common errors, please visit our <a href="http://wpengine.com/support/wp-engine-automatic-migration/">WP Engine Automated Migration</a> support garage article.</i></p>
127
+ </div>
128
+ </div>
129
+ </div><!--row end-->
130
+ </div><!-- wrap ends here -->
131
+
132
+ <script type="text/javascript">
133
+ jQuery(document).ready(function () {
134
+ <?php if (array_key_exists('auth_required_dest', $_REQUEST)) { ?>
135
+ jQuery('#password-auth').show();
136
+ jQuery('.sourceAuthError').show();
137
+ jQuery('#dest-auth').addClass("attentionNeeded");
138
+ <?php } ?>
139
+
140
+ <?php if (array_key_exists('auth_required_source', $_REQUEST)) { ?>
141
+ jQuery('#password-auth').show();
142
+ jQuery('.destAuthError').show();
143
+ jQuery('#source-auth').addClass("attentionNeeded");
144
+ <?php } ?>
145
+ jQuery('#advanced-options-toggle').click(function() {
146
+ jQuery('#password-auth').toggle();
147
+ return false;
148
+ });
149
+ });
150
+ </script>
assets/css/form-styles.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Customer CSS can go here */
2
+
3
+ #password-auth{
4
+ margin-top:10px;
5
+ }
6
+
7
+ #attentionNeeded{
8
+ box-shadow: 0px 0px 30px #FF9C9C;
9
+ padding: 5px;
10
+ }
11
+
12
+ .error{
13
+ font-style:#FF0000;
14
+ }
assets/css/normalize.css ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */
2
+
3
+ /**
4
+ * 1. Set default font family to sans-serif.
5
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
6
+ * user zoom.
7
+ */
8
+
9
+ html {
10
+ font-family: sans-serif; /* 1 */
11
+ -ms-text-size-adjust: 100%; /* 2 */
12
+ -webkit-text-size-adjust: 100%; /* 2 */
13
+ }
14
+
15
+ /**
16
+ * Remove default margin.
17
+ */
18
+
19
+ body {
20
+ margin: 0;
21
+ }
22
+
23
+ /* HTML5 display definitions
24
+ ========================================================================== */
25
+
26
+ /**
27
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
28
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11
29
+ * and Firefox.
30
+ * Correct `block` display not defined for `main` in IE 11.
31
+ */
32
+
33
+ article,
34
+ aside,
35
+ details,
36
+ figcaption,
37
+ figure,
38
+ footer,
39
+ header,
40
+ hgroup,
41
+ main,
42
+ menu,
43
+ nav,
44
+ section,
45
+ summary {
46
+ display: block;
47
+ }
48
+
49
+ /**
50
+ * 1. Correct `inline-block` display not defined in IE 8/9.
51
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
52
+ */
53
+
54
+ audio,
55
+ canvas,
56
+ progress,
57
+ video {
58
+ display: inline-block; /* 1 */
59
+ vertical-align: baseline; /* 2 */
60
+ }
61
+
62
+ /**
63
+ * Prevent modern browsers from displaying `audio` without controls.
64
+ * Remove excess height in iOS 5 devices.
65
+ */
66
+
67
+ audio:not([controls]) {
68
+ display: none;
69
+ height: 0;
70
+ }
71
+
72
+ /**
73
+ * Address `[hidden]` styling not present in IE 8/9/10.
74
+ * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
75
+ */
76
+
77
+ [hidden],
78
+ template {
79
+ display: none;
80
+ }
81
+
82
+ /* Links
83
+ ========================================================================== */
84
+
85
+ /**
86
+ * Remove the gray background color from active links in IE 10.
87
+ */
88
+
89
+ a {
90
+ background-color: transparent;
91
+ }
92
+
93
+ /**
94
+ * Improve readability when focused and also mouse hovered in all browsers.
95
+ */
96
+
97
+ a:active,
98
+ a:hover {
99
+ outline: 0;
100
+ }
101
+
102
+ /* Text-level semantics
103
+ ========================================================================== */
104
+
105
+ /**
106
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
107
+ */
108
+
109
+ abbr[title] {
110
+ border-bottom: 1px dotted;
111
+ }
112
+
113
+ /**
114
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
115
+ */
116
+
117
+ b,
118
+ strong {
119
+ font-weight: bold;
120
+ }
121
+
122
+ /**
123
+ * Address styling not present in Safari and Chrome.
124
+ */
125
+
126
+ dfn {
127
+ font-style: italic;
128
+ }
129
+
130
+ /**
131
+ * Address variable `h1` font-size and margin within `section` and `article`
132
+ * contexts in Firefox 4+, Safari, and Chrome.
133
+ */
134
+
135
+ h1 {
136
+ font-size: 2em;
137
+ margin: 0.67em 0;
138
+ }
139
+
140
+ /**
141
+ * Address styling not present in IE 8/9.
142
+ */
143
+
144
+ mark {
145
+ background: #ff0;
146
+ color: #000;
147
+ }
148
+
149
+ /**
150
+ * Address inconsistent and variable font size in all browsers.
151
+ */
152
+
153
+ small {
154
+ font-size: 80%;
155
+ }
156
+
157
+ /**
158
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
159
+ */
160
+
161
+ sub,
162
+ sup {
163
+ font-size: 75%;
164
+ line-height: 0;
165
+ position: relative;
166
+ vertical-align: baseline;
167
+ }
168
+
169
+ sup {
170
+ top: -0.5em;
171
+ }
172
+
173
+ sub {
174
+ bottom: -0.25em;
175
+ }
176
+
177
+ /* Embedded content
178
+ ========================================================================== */
179
+
180
+ /**
181
+ * Remove border when inside `a` element in IE 8/9/10.
182
+ */
183
+
184
+ img {
185
+ border: 0;
186
+ }
187
+
188
+ /**
189
+ * Correct overflow not hidden in IE 9/10/11.
190
+ */
191
+
192
+ svg:not(:root) {
193
+ overflow: hidden;
194
+ }
195
+
196
+ /* Grouping content
197
+ ========================================================================== */
198
+
199
+ /**
200
+ * Address margin not present in IE 8/9 and Safari.
201
+ */
202
+
203
+ figure {
204
+ margin: 1em 40px;
205
+ }
206
+
207
+ /**
208
+ * Address differences between Firefox and other browsers.
209
+ */
210
+
211
+ hr {
212
+ -moz-box-sizing: content-box;
213
+ box-sizing: content-box;
214
+ height: 0;
215
+ }
216
+
217
+ /**
218
+ * Contain overflow in all browsers.
219
+ */
220
+
221
+ pre {
222
+ overflow: auto;
223
+ }
224
+
225
+ /**
226
+ * Address odd `em`-unit font size rendering in all browsers.
227
+ */
228
+
229
+ code,
230
+ kbd,
231
+ pre,
232
+ samp {
233
+ font-family: monospace, monospace;
234
+ font-size: 1em;
235
+ }
236
+
237
+ /* Forms
238
+ ========================================================================== */
239
+
240
+ /**
241
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
242
+ * styling of `select`, unless a `border` property is set.
243
+ */
244
+
245
+ /**
246
+ * 1. Correct color not being inherited.
247
+ * Known issue: affects color of disabled elements.
248
+ * 2. Correct font properties not being inherited.
249
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
250
+ */
251
+
252
+ button,
253
+ input,
254
+ optgroup,
255
+ select,
256
+ textarea {
257
+ color: inherit; /* 1 */
258
+ font: inherit; /* 2 */
259
+ margin: 0; /* 3 */
260
+ }
261
+
262
+ /**
263
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
264
+ */
265
+
266
+ button {
267
+ overflow: visible;
268
+ }
269
+
270
+ /**
271
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
272
+ * All other form control elements do not inherit `text-transform` values.
273
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
274
+ * Correct `select` style inheritance in Firefox.
275
+ */
276
+
277
+ button,
278
+ select {
279
+ text-transform: none;
280
+ }
281
+
282
+ /**
283
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
284
+ * and `video` controls.
285
+ * 2. Correct inability to style clickable `input` types in iOS.
286
+ * 3. Improve usability and consistency of cursor style between image-type
287
+ * `input` and others.
288
+ */
289
+
290
+ button,
291
+ html input[type="button"], /* 1 */
292
+ input[type="reset"],
293
+ input[type="submit"] {
294
+ -webkit-appearance: button; /* 2 */
295
+ cursor: pointer; /* 3 */
296
+ }
297
+
298
+ /**
299
+ * Re-set default cursor for disabled elements.
300
+ */
301
+
302
+ button[disabled],
303
+ html input[disabled] {
304
+ cursor: default;
305
+ }
306
+
307
+ /**
308
+ * Remove inner padding and border in Firefox 4+.
309
+ */
310
+
311
+ button::-moz-focus-inner,
312
+ input::-moz-focus-inner {
313
+ border: 0;
314
+ padding: 0;
315
+ }
316
+
317
+ /**
318
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
319
+ * the UA stylesheet.
320
+ */
321
+
322
+ input {
323
+ line-height: normal;
324
+ }
325
+
326
+ /**
327
+ * It's recommended that you don't attempt to style these elements.
328
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
329
+ *
330
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
331
+ * 2. Remove excess padding in IE 8/9/10.
332
+ */
333
+
334
+ input[type="checkbox"],
335
+ input[type="radio"] {
336
+ box-sizing: border-box; /* 1 */
337
+ padding: 0; /* 2 */
338
+ }
339
+
340
+ /**
341
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
342
+ * `font-size` values of the `input`, it causes the cursor style of the
343
+ * decrement button to change from `default` to `text`.
344
+ */
345
+
346
+ input[type="number"]::-webkit-inner-spin-button,
347
+ input[type="number"]::-webkit-outer-spin-button {
348
+ height: auto;
349
+ }
350
+
351
+ /**
352
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
353
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome
354
+ * (include `-moz` to future-proof).
355
+ */
356
+
357
+ input[type="search"] {
358
+ -webkit-appearance: textfield; /* 1 */
359
+ -moz-box-sizing: content-box;
360
+ -webkit-box-sizing: content-box; /* 2 */
361
+ box-sizing: content-box;
362
+ }
363
+
364
+ /**
365
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
366
+ * Safari (but not Chrome) clips the cancel button when the search input has
367
+ * padding (and `textfield` appearance).
368
+ */
369
+
370
+ input[type="search"]::-webkit-search-cancel-button,
371
+ input[type="search"]::-webkit-search-decoration {
372
+ -webkit-appearance: none;
373
+ }
374
+
375
+ /**
376
+ * Define consistent border, margin, and padding.
377
+ */
378
+
379
+ fieldset {
380
+ border: 1px solid #c0c0c0;
381
+ margin: 0 2px;
382
+ padding: 0.35em 0.625em 0.75em;
383
+ }
384
+
385
+ /**
386
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
387
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
388
+ */
389
+
390
+ legend {
391
+ border: 0; /* 1 */
392
+ padding: 0; /* 2 */
393
+ }
394
+
395
+ /**
396
+ * Remove default vertical scrollbar in IE 8/9/10/11.
397
+ */
398
+
399
+ textarea {
400
+ overflow: auto;
401
+ }
402
+
403
+ /**
404
+ * Don't inherit the `font-weight` (applied by a rule above).
405
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
406
+ */
407
+
408
+ optgroup {
409
+ font-weight: bold;
410
+ }
411
+
412
+ /* Tables
413
+ ========================================================================== */
414
+
415
+ /**
416
+ * Remove most spacing between table cells.
417
+ */
418
+
419
+ table {
420
+ border-collapse: collapse;
421
+ border-spacing: 0;
422
+ }
423
+
424
+ td,
425
+ th {
426
+ padding: 0;
427
+ }
assets/css/skeleton.css ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Skeleton V2.0.4
3
+ * Copyright 2014, Dave Gamache
4
+ * www.getskeleton.com
5
+ * Free to use under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ * 12/29/2014
8
+ */
9
+
10
+
11
+ /* Table of contents
12
+ ––––––––––––––––––––––––––––––––––––––––––––––––––
13
+ - Grid
14
+ - Base Styles
15
+ - Typography
16
+ - Links
17
+ - Buttons
18
+ - Forms
19
+ - Lists
20
+ - Code
21
+ - Tables
22
+ - Spacing
23
+ - Utilities
24
+ - Clearing
25
+ - Media Queries
26
+ */
27
+
28
+
29
+ /* Grid
30
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
31
+ .container {
32
+ position: relative;
33
+ width: 100%;
34
+ max-width: 960px;
35
+ margin: 0 auto;
36
+ padding: 0 20px;
37
+ box-sizing: border-box; }
38
+ .column,
39
+ .columns {
40
+ width: 100%;
41
+ float: left;
42
+ box-sizing: border-box; }
43
+
44
+ /* For devices larger than 400px */
45
+ @media (min-width: 400px) {
46
+ .container {
47
+ width: 85%;
48
+ padding: 0; }
49
+ }
50
+
51
+ /* For devices larger than 550px */
52
+ @media (min-width: 550px) {
53
+ .container {
54
+ width: 80%; }
55
+ .column,
56
+ .columns {
57
+ margin-left: 4%; }
58
+ .column:first-child,
59
+ .columns:first-child {
60
+ margin-left: 0; }
61
+
62
+ .one.column,
63
+ .one.columns { width: 4.66666666667%; }
64
+ .two.columns { width: 13.3333333333%; }
65
+ .three.columns { width: 22%; }
66
+ .four.columns { width: 30.6666666667%; }
67
+ .five.columns { width: 39.3333333333%; }
68
+ .six.columns { width: 48%; }
69
+ .seven.columns { width: 56.6666666667%; }
70
+ .eight.columns { width: 65.3333333333%; }
71
+ .nine.columns { width: 74.0%; }
72
+ .ten.columns { width: 82.6666666667%; }
73
+ .eleven.columns { width: 91.3333333333%; }
74
+ .twelve.columns { width: 100%; margin-left: 0; }
75
+
76
+ .one-third.column { width: 30.6666666667%; }
77
+ .two-thirds.column { width: 65.3333333333%; }
78
+
79
+ .one-half.column { width: 48%; }
80
+
81
+ /* Offsets */
82
+ .offset-by-one.column,
83
+ .offset-by-one.columns { margin-left: 8.66666666667%; }
84
+ .offset-by-two.column,
85
+ .offset-by-two.columns { margin-left: 17.3333333333%; }
86
+ .offset-by-three.column,
87
+ .offset-by-three.columns { margin-left: 26%; }
88
+ .offset-by-four.column,
89
+ .offset-by-four.columns { margin-left: 34.6666666667%; }
90
+ .offset-by-five.column,
91
+ .offset-by-five.columns { margin-left: 43.3333333333%; }
92
+ .offset-by-six.column,
93
+ .offset-by-six.columns { margin-left: 52%; }
94
+ .offset-by-seven.column,
95
+ .offset-by-seven.columns { margin-left: 60.6666666667%; }
96
+ .offset-by-eight.column,
97
+ .offset-by-eight.columns { margin-left: 69.3333333333%; }
98
+ .offset-by-nine.column,
99
+ .offset-by-nine.columns { margin-left: 78.0%; }
100
+ .offset-by-ten.column,
101
+ .offset-by-ten.columns { margin-left: 86.6666666667%; }
102
+ .offset-by-eleven.column,
103
+ .offset-by-eleven.columns { margin-left: 95.3333333333%; }
104
+
105
+ .offset-by-one-third.column,
106
+ .offset-by-one-third.columns { margin-left: 34.6666666667%; }
107
+ .offset-by-two-thirds.column,
108
+ .offset-by-two-thirds.columns { margin-left: 69.3333333333%; }
109
+
110
+ .offset-by-one-half.column,
111
+ .offset-by-one-half.columns { margin-left: 52%; }
112
+
113
+ }
114
+
115
+
116
+ /* Base Styles
117
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
118
+ /* NOTE
119
+ html is set to 62.5% so that all the REM measurements throughout Skeleton
120
+ are based on 10px sizing. So basically 1.5rem = 15px :) */
121
+ html {
122
+ font-size: 62.5%; }
123
+ body {
124
+ font-size: 1.5em; /* currently ems cause chrome bug misinterpreting rems on body element */
125
+ line-height: 1.6;
126
+ font-weight: 400;
127
+ color: #222; }
128
+
129
+
130
+ /* Typography
131
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
132
+ /* Removed in favor of WordPress defaults */
133
+
134
+
135
+ /* Links
136
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
137
+ a {
138
+ color: #1EAEDB; }
139
+ a:hover {
140
+ color: #0FA0CE; }
141
+
142
+
143
+ /* Buttons
144
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
145
+ /*Removed in favor of WordPress buttons
146
+
147
+
148
+ /* Forms
149
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
150
+ /* Removed Form Styles in favor of WordPress*/
151
+ label,
152
+ legend {
153
+ display: block;
154
+ margin-bottom: .5rem;
155
+ font-weight: 600; }
156
+
157
+ label > .label-body {
158
+ display: inline-block;
159
+ margin-left: .5rem;
160
+ font-weight: normal; }
161
+
162
+
163
+ /* Lists
164
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
165
+ ul {
166
+ list-style: circle inside; }
167
+ ol {
168
+ list-style: decimal inside; }
169
+ ol, ul {
170
+ padding-left: 0;
171
+ margin-top: 0; }
172
+ ul ul,
173
+ ul ol,
174
+ ol ol,
175
+ ol ul {
176
+ margin: 1.5rem 0 1.5rem 3rem;
177
+ font-size: 90%; }
178
+ li {
179
+ margin-bottom: 1rem; }
180
+
181
+
182
+ /* Code
183
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
184
+ code {
185
+ padding: .2rem .5rem;
186
+ margin: 0 .2rem;
187
+ font-size: 90%;
188
+ white-space: nowrap;
189
+ background: #F1F1F1;
190
+ border: 1px solid #E1E1E1;
191
+ border-radius: 4px; }
192
+ pre > code {
193
+ display: block;
194
+ padding: 1rem 1.5rem;
195
+ white-space: pre; }
196
+
197
+
198
+ /* Tables
199
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
200
+ th,
201
+ td {
202
+ padding: 12px 15px;
203
+ text-align: left;
204
+ border-bottom: 1px solid #E1E1E1; }
205
+ th:first-child,
206
+ td:first-child {
207
+ padding-left: 0; }
208
+ th:last-child,
209
+ td:last-child {
210
+ padding-right: 0; }
211
+
212
+
213
+ /* Spacing
214
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
215
+ button,
216
+ .button {
217
+ margin-bottom: 1rem; }
218
+ input,
219
+ textarea,
220
+ select,
221
+ fieldset {
222
+ margin-bottom: 1.5rem; }
223
+ pre,
224
+ blockquote,
225
+ dl,
226
+ figure,
227
+ table,
228
+ p,
229
+ ul,
230
+ ol,
231
+ form {
232
+ margin-bottom: 2.5rem; }
233
+
234
+
235
+ /* Utilities
236
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
237
+ .u-full-width {
238
+ width: 100%;
239
+ box-sizing: border-box; }
240
+ .u-max-full-width {
241
+ max-width: 100%;
242
+ box-sizing: border-box; }
243
+ .u-pull-right {
244
+ float: right; }
245
+ .u-pull-left {
246
+ float: left; }
247
+
248
+
249
+ /* Misc
250
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
251
+ hr {
252
+ margin-top: 1rem;
253
+ margin-bottom: 3.5rem;
254
+ border-width: 0;
255
+ border-top: 1px solid #E1E1E1; }
256
+
257
+
258
+ /* Clearing
259
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
260
+
261
+ /* Self Clearing Goodness */
262
+ .container:after,
263
+ .row:after,
264
+ .u-cf {
265
+ content: "";
266
+ display: table;
267
+ clear: both; }
268
+
269
+
270
+ /* Media Queries
271
+ –––––––––––––––––––––––––––––––––––––––––––––––––– */
272
+ /*
273
+ Note: The best way to structure the use of media queries is to create the queries
274
+ near the relevant code. For example, if you wanted to change the styles for buttons
275
+ on small devices, paste the mobile query code up in the buttons section and style it
276
+ there.
277
+ */
278
+
279
+
280
+ /* Larger than mobile */
281
+ @media (min-width: 400px) {}
282
+
283
+ /* Larger than phablet (also point when grid becomes active) */
284
+ @media (min-width: 550px) {}
285
+
286
+ /* Larger than tablet */
287
+ @media (min-width: 750px) {}
288
+
289
+ /* Larger than desktop */
290
+ @media (min-width: 1000px) {}
291
+
292
+ /* Larger than Desktop HD */
293
+ @media (min-width: 1200px) {}
assets/img/blogvault-logo-120.png ADDED
Binary file
assets/img/blogvault-logo.png ADDED
Binary file
assets/img/favicon.ico ADDED
Binary file
assets/img/screenshot-1.jpg ADDED
Binary file
assets/img/screenshot-2.jpg ADDED
Binary file
assets/img/wpengine-logo.png ADDED
Binary file
callback.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVCallback')) :
5
+
6
+ require_once dirname( __FILE__ ) . '/callback/response.php';
7
+
8
+ class BVCallback {
9
+ public $bvmain;
10
+ function __construct($bvmain) {
11
+ $this->bvmain = $bvmain;
12
+ }
13
+
14
+ public function serversig($full = false) {
15
+ $sig = sha1($_SERVER['SERVER_ADDR'].ABSPATH);
16
+ if ($full)
17
+ return $sig;
18
+ else
19
+ return substr($sig, 0, 6);
20
+ }
21
+
22
+ public function terminate($with_basic, $bvdebug = false) {
23
+ global $bvresp;
24
+ $public = $this->bvmain->auth->defaultPublic();
25
+ $bvresp->addStatus("signature", "Blogvault API");
26
+ $bvresp->addStatus("asymauth", "true");
27
+ $bvresp->addStatus("sha1", "true");
28
+ $bvresp->addStatus("dbsig", $this->bvmain->lib->dbsig(false));
29
+ $bvresp->addStatus("serversig", $this->serversig(false));
30
+ $bvresp->addStatus("public", substr($public, 0, 6));
31
+ if (array_key_exists('adajx', $_REQUEST)) {
32
+ $bvresp->addStatus("adajx", true);
33
+ }
34
+ if ($with_basic) {
35
+ $binfo = array();
36
+ $this->bvmain->info->basic($binfo);
37
+ $bvresp->addStatus("basic", $binfo);
38
+ $bvresp->addStatus("bvversion", $this->bvmain->version);
39
+ }
40
+
41
+ if ($bvdebug) {
42
+ $bvresp->addStatus("inreq", $_REQUEST);
43
+ }
44
+
45
+ $bvresp->finish();
46
+ exit;
47
+ }
48
+
49
+ public function processParams() {
50
+ if (array_key_exists('concat', $_REQUEST)) {
51
+ foreach ($_REQUEST['concat'] as $key) {
52
+ $concated = '';
53
+ $count = intval($_REQUEST[$key]);
54
+ for ($i = 1; $i <= $count; $i++) {
55
+ $concated .= $_REQUEST[$key."_bv_".$i];
56
+ }
57
+ $_REQUEST[$key] = $concated;
58
+ }
59
+ }
60
+ if (array_key_exists('b64', $_REQUEST)) {
61
+ foreach ($_REQUEST['b64'] as $key) {
62
+ if (is_array($_REQUEST[$key])) {
63
+ $_REQUEST[$key] = array_map('base64_decode', $_REQUEST[$key]);
64
+ } else {
65
+ $_REQUEST[$key] = base64_decode($_REQUEST[$key]);
66
+ }
67
+ }
68
+ }
69
+ if (array_key_exists('unser', $_REQUEST)) {
70
+ foreach ($_REQUEST['unser'] as $key) {
71
+ $_REQUEST[$key] = json_decode($_REQUEST[$key], TRUE);
72
+ }
73
+ }
74
+ if (array_key_exists('b642', $_REQUEST)) {
75
+ foreach ($_REQUEST['b642'] as $key) {
76
+ if (is_array($_REQUEST[$key])) {
77
+ $_REQUEST[$key] = array_map('base64_decode', $_REQUEST[$key]);
78
+ } else {
79
+ $_REQUEST[$key] = base64_decode($_REQUEST[$key]);
80
+ }
81
+ }
82
+ }
83
+ if (array_key_exists('dic', $_REQUEST)) {
84
+ foreach ($_REQUEST['dic'] as $key => $mkey) {
85
+ $_REQUEST[$mkey] = $_REQUEST[$key];
86
+ unset($_REQUEST[$key]);
87
+ }
88
+ }
89
+ if (array_key_exists('clacts', $_REQUEST)) {
90
+ foreach ($_REQUEST['clacts'] as $action) {
91
+ remove_all_actions($action);
92
+ }
93
+ }
94
+ if (array_key_exists('clallacts', $_REQUEST)) {
95
+ global $wp_filter;
96
+ foreach ( $wp_filter as $filter => $val ){
97
+ remove_all_actions($filter);
98
+ }
99
+ }
100
+ if (array_key_exists('memset', $_REQUEST)) {
101
+ $val = intval(urldecode($_REQUEST['memset']));
102
+ @ini_set('memory_limit', $val.'M');
103
+ }
104
+ }
105
+
106
+ public function recover() {
107
+ $recover = new BVRecover(base64_decode($_REQUEST['sig']), $_REQUEST['orig'],
108
+ $_REQUEST['keyname'], $_REQUEST["keysize"]);
109
+ if ($recover->validate() && ($recover->process() === 1)) {
110
+ $recover->processKeyExchange();
111
+ return 1;
112
+ }
113
+ return false;
114
+ }
115
+
116
+ public function preauth() {
117
+ global $bvresp;
118
+ if (array_key_exists('obend', $_REQUEST) && function_exists('ob_end_clean'))
119
+ @ob_end_clean();
120
+ if (array_key_exists('op_reset', $_REQUEST) && function_exists('output_reset_rewrite_vars'))
121
+ @output_reset_rewrite_vars();
122
+ if (array_key_exists('binhead', $_REQUEST)) {
123
+ header("Content-type: application/binary");
124
+ header('Content-Transfer-Encoding: binary');
125
+ }
126
+ if (array_key_exists('bvrcvr', $_REQUEST)) {
127
+ require_once dirname( __FILE__ ) . '/callback/recover.php';
128
+ if ($this->recover() !== 1) {
129
+ $bvresp->addStatus("statusmsg", 'failed authentication');
130
+ }
131
+ $this->terminate(false, array_key_exists('bvdbg', $_REQUEST));
132
+ return false;
133
+ }
134
+ return 1;
135
+ }
136
+
137
+ public function authenticate() {
138
+ global $bvresp;
139
+ $auth = $this->bvmain->auth;
140
+ $method = $_REQUEST['bvMethod'];
141
+ $time = intval($_REQUEST['bvTime']);
142
+ $version = $_REQUEST['bvVersion'];
143
+ $sig = $_REQUEST['sig'];
144
+ $public = $auth->publicParam();
145
+
146
+ $bvresp->addStatus("requestedsig", $sig);
147
+ $bvresp->addStatus("requestedtime", $time);
148
+ $bvresp->addStatus("requestedversion", $version);
149
+
150
+ $sig_match = $auth->validate($public, $method, $time, $version, $sig);
151
+ if ($sig_match === 1) {
152
+ return 1;
153
+ } else {
154
+ $bvresp->addStatus("sigmatch", substr($sig_match, 0, 6));
155
+ $bvresp->addStatus("statusmsg", 'failed authentication');
156
+ return false;
157
+ }
158
+ }
159
+
160
+ public function route($wing, $method) {
161
+ global $bvresp;
162
+ $bvresp->addStatus("callback", $method);
163
+ switch ($wing) {
164
+ case 'manage':
165
+ require_once dirname( __FILE__ ) . '/callback/wings/manage.php';
166
+ $module = new BVManageCallback();
167
+ break;
168
+ case 'fs':
169
+ require_once dirname( __FILE__ ) . '/callback/wings/fs.php';
170
+ $module = new BVFSCallback();
171
+ break;
172
+ case 'db':
173
+ require_once dirname( __FILE__ ) . '/callback/wings/db.php';
174
+ $module = new BVDBCallback();
175
+ break;
176
+ case 'info':
177
+ require_once dirname( __FILE__ ) . '/callback/wings/info.php';
178
+ $module = new BVInfoCallback();
179
+ break;
180
+ case 'dynsync':
181
+ require_once dirname( __FILE__ ) . '/callback/wings/dynsync.php';
182
+ $module = new BVDynSyncCallback();
183
+ break;
184
+ case 'ipstr':
185
+ require_once dirname( __FILE__ ) . '/callback/wings/ipstore.php';
186
+ $module = new BVIPStoreCallback();
187
+ break;
188
+ case 'auth':
189
+ require_once dirname( __FILE__ ) . '/callback/wings/auth.php';
190
+ $module = new BVAuthCallback();
191
+ break;
192
+ case 'fw':
193
+ require_once dirname( __FILE__ ) . '/callback/wings/fw.php';
194
+ $module = new BVFirewallCallback();
195
+ break;
196
+ case 'lp':
197
+ require_once dirname( __FILE__ ) . '/callback/wings/lp.php';
198
+ $module = new BVLoginProtectCallback();
199
+ break;
200
+ case 'monit':
201
+ require_once dirname( __FILE__ ) . '/callback/wings/monit.php';
202
+ $module = new BVMonitCallback();
203
+ break;
204
+ case 'brand':
205
+ require_once dirname( __FILE__ ) . '/callback/wings/brand.php';
206
+ $module = new BVBrandCallback();
207
+ break;
208
+ case 'pt':
209
+ require_once dirname( __FILE__ ) . '/callback/wings/protect.php';
210
+ $module = new BVProtectCallback();
211
+ break;
212
+ case 'act':
213
+ require_once dirname( __FILE__ ) . '/callback/wings/account.php';
214
+ $module = new BVAccountCallback();
215
+ break;
216
+ default:
217
+ require_once dirname( __FILE__ ) . '/callback/wings/misc.php';
218
+ $module = new BVMiscCallback();
219
+ break;
220
+ }
221
+ $rval = $module->process($method);
222
+ if ($rval === false) {
223
+ $bvresp->addStatus("statusmsg", "Bad Command");
224
+ $bvresp->addStatus("status", false);
225
+ }
226
+ return 1;
227
+ }
228
+
229
+ public function bvAdmExecuteWithoutUser() {
230
+ global $bvresp;
231
+ $bvresp->addStatus("bvadmwithoutuser", true);
232
+ $this->execute();
233
+ }
234
+
235
+ public function bvAdmExecuteWithUser() {
236
+ global $bvresp;
237
+ $bvresp->addStatus("bvadmwithuser", true);
238
+ $this->execute();
239
+ }
240
+
241
+ public function execute() {
242
+ global $bvresp;
243
+ $this->processParams();
244
+ if ($bvresp->startStream()) {
245
+ $this->route($_REQUEST['wing'], $_REQUEST['bvMethod']);
246
+ $bvresp->endStream();
247
+ }
248
+ $this->terminate(true, array_key_exists('bvdbg', $_REQUEST));
249
+ }
250
+ }
251
+ endif;
callback/response.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVResponse')) :
5
+
6
+ require_once dirname( __FILE__ ) . '/streams.php';
7
+
8
+ class BVResponse {
9
+ public $status;
10
+ public $stream;
11
+
12
+ function __construct() {
13
+ $this->status = array("blogvault" => "response");
14
+ }
15
+
16
+ public function addStatus($key, $value) {
17
+ $this->status[$key] = $value;
18
+ }
19
+
20
+ public function addArrayToStatus($key, $value) {
21
+ if (!isset($this->status[$key])) {
22
+ $this->status[$key] = array();
23
+ }
24
+ $this->status[$key][] = $value;
25
+ }
26
+
27
+ public function base64Encode($data, $chunk_size) {
28
+ if ($chunk_size) {
29
+ $out = "";
30
+ $len = strlen($data);
31
+ for ($i = 0; $i < $len; $i += $chunk_size) {
32
+ $out .= base64_encode(substr($data, $i, $chunk_size));
33
+ }
34
+ } else {
35
+ $out = base64_encode($data);
36
+ }
37
+ return $out;
38
+ }
39
+
40
+ public function finish() {
41
+ $response = "bvbvbvbvbv".serialize($this->status)."bvbvbvbvbv";
42
+ if (array_key_exists('bvb64resp', $_REQUEST)) {
43
+ $chunk_size = array_key_exists('bvb64cksize', $_REQUEST) ? intval($_REQUEST['bvb64cksize']) : false;
44
+ $response = "bvb64bvb64".$this->base64Encode($response, $chunk_size)."bvb64bvb64";
45
+ }
46
+ die($response);
47
+ }
48
+
49
+ public function writeStream($_string) {
50
+ if (strlen($_string) > 0) {
51
+ $chunk = "";
52
+ if (isset($_REQUEST['bvb64stream'])) {
53
+ $chunk_size = array_key_exists('bvb64cksize', $_REQUEST) ? intval($_REQUEST['bvb64cksize']) : false;
54
+ $_string = $this->base64Encode($_string, $chunk_size);
55
+ $chunk .= "BVB64" . ":";
56
+ }
57
+ $chunk .= (strlen($_string) . ":" . $_string);
58
+ if (isset($_REQUEST['checksum'])) {
59
+ if ($_REQUEST['checksum'] == 'crc32') {
60
+ $chunk = "CRC32" . ":" . crc32($_string) . ":" . $chunk;
61
+ } else if ($_REQUEST['checksum'] == 'md5') {
62
+ $chunk = "MD5" . ":" . md5($_string) . ":" . $chunk;
63
+ }
64
+ }
65
+ $this->stream->writeChunk($chunk);
66
+ }
67
+ }
68
+
69
+ public function startStream() {
70
+ global $bvcb;
71
+ $this->stream = new BVRespStream();
72
+ if (array_key_exists('apicall',$_REQUEST)) {
73
+ $this->stream = new BVHttpStream($_REQUEST['apihost'], intval($_REQUEST['apiport']), array_key_exists('apissl', $_REQUEST));
74
+ if (!$this->stream->connect()) {
75
+ $this->addStatus("httperror", "Cannot Open Connection to Host");
76
+ $this->addStatus("streamerrno", $this->stream->errno);
77
+ $this->addStatus("streamerrstr", $this->stream->errstr);
78
+ return false;
79
+ }
80
+ if (array_key_exists('acbmthd', $_REQUEST)) {
81
+ $url = $bvcb->bvmain->authenticatedUrl('/bvapi/'.$_REQUEST['acbmthd'], $_REQUEST['bvapicheck'], false);
82
+ if (array_key_exists('acbqry', $_REQUEST)) {
83
+ $url .= "&".$_REQUEST['acbqry'];
84
+ }
85
+ $this->stream->multipartChunkedPost($url);
86
+ } else {
87
+ $this->addStatus("httperror", "ApiCall method not present");
88
+ return false;
89
+ }
90
+ }
91
+ return true;
92
+ }
93
+
94
+ public function endStream() {
95
+ $this->stream->endStream();
96
+ if (array_key_exists('apicall', $_REQUEST)) {
97
+ $resp = $this->stream->getResponse();
98
+ if (array_key_exists('httperror', $resp)) {
99
+ $this->addStatus("httperror", $resp['httperror']);
100
+ } else {
101
+ $this->addStatus("respstatus", $resp['status']);
102
+ $this->addStatus("respstatus_string", $resp['status_string']);
103
+ }
104
+ }
105
+ }
106
+ }
107
+ endif;
callback/streams.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVRespStream')) :
5
+
6
+ class BVRespStream {
7
+ public function writeChunk($_string) {
8
+ echo "ckckckckck".$_string."ckckckckck";
9
+ }
10
+
11
+ public function endStream() {
12
+ echo "rerererere";
13
+ }
14
+ }
15
+
16
+ class BVHttpStream {
17
+ var $user_agent = 'BVHttpStream';
18
+ var $host;
19
+ var $port;
20
+ var $timeout = 20;
21
+ var $conn;
22
+ var $errno;
23
+ var $errstr;
24
+ var $boundary;
25
+ var $apissl;
26
+
27
+ /**
28
+ * PHP5 constructor.
29
+ */
30
+ function __construct($_host, $_port, $_apissl) {
31
+ $this->host = $_host;
32
+ $this->port = $_port;
33
+ $this->apissl = $_apissl;
34
+ }
35
+
36
+ public function connect() {
37
+ if ($this->apissl && function_exists('stream_socket_client')) {
38
+ $this->conn = stream_socket_client("ssl://".$this->host.":".$this->port, $errno, $errstr, $this->timeout);
39
+ } else {
40
+ $this->conn = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout);
41
+ }
42
+ if (!$this->conn) {
43
+ $this->errno = $errno;
44
+ $this->errstr = $errstr;
45
+ return false;
46
+ }
47
+ socket_set_timeout($this->conn, $this->timeout);
48
+ return true;
49
+ }
50
+
51
+ public function write($data) {
52
+ fwrite($this->conn, $data);
53
+ }
54
+
55
+ public function sendChunk($data) {
56
+ $this->write(sprintf("%x\r\n", strlen($data)));
57
+ $this->write($data);
58
+ $this->write("\r\n");
59
+ }
60
+
61
+ public function sendRequest($method, $url, $headers = array(), $body = null) {
62
+ $def_hdrs = array("Connection" => "keep-alive",
63
+ "Host" => $this->host);
64
+ $headers = array_merge($def_hdrs, $headers);
65
+ $request = strtoupper($method)." ".$url." HTTP/1.1\r\n";
66
+ if (null != $body) {
67
+ $headers["Content-length"] = strlen($body);
68
+ }
69
+ foreach($headers as $key=>$val) {
70
+ $request .= $key.":".$val."\r\n";
71
+ }
72
+ $request .= "\r\n";
73
+ if (null != $body) {
74
+ $request .= $body;
75
+ }
76
+ $this->write($request);
77
+ return $request;
78
+ }
79
+
80
+ public function post($url, $headers = array(), $body = "") {
81
+ if(is_array($body)) {
82
+ $b = "";
83
+ foreach($body as $key=>$val) {
84
+ $b .= $key."=".urlencode($val)."&";
85
+ }
86
+ $body = substr($b, 0, strlen($b) - 1);
87
+ }
88
+ $this->sendRequest("POST", $url, $headers, $body);
89
+ }
90
+
91
+ public function streamedPost($url, $headers = array()) {
92
+ $headers['Transfer-Encoding'] = "chunked";
93
+ $this->sendRequest("POST", $url, $headers);
94
+ }
95
+
96
+ public function multipartChunkedPost($url) {
97
+ $mph = array(
98
+ "Content-Disposition" => "form-data; name=bvinfile; filename=data",
99
+ "Content-Type" => "application/octet-stream"
100
+ );
101
+ $rnd = rand(100000, 999999);
102
+ $this->boundary = "----".$rnd;
103
+ $prologue = "--".$this->boundary."\r\n";
104
+ foreach($mph as $key=>$val) {
105
+ $prologue .= $key.":".$val."\r\n";
106
+ }
107
+ $prologue .= "\r\n";
108
+ $headers = array('Content-Type' => "multipart/form-data; boundary=".$this->boundary);
109
+ $this->streamedPost($url, $headers);
110
+ $this->sendChunk($prologue);
111
+ }
112
+
113
+ public function writeChunk($data) {
114
+ $this->sendChunk($data);
115
+ }
116
+
117
+ public function closeChunk() {
118
+ $this->sendChunk("");
119
+ }
120
+
121
+ public function endStream() {
122
+ $epilogue = "\r\n\r\n--".$this->boundary."--\r\n";
123
+ $this->sendChunk($epilogue);
124
+ $this->closeChunk();
125
+ }
126
+
127
+ public function getResponse() {
128
+ $response = array();
129
+ $response['headers'] = array();
130
+ $state = 1;
131
+ $conlen = 0;
132
+ stream_set_timeout($this->conn, 300);
133
+ while (!feof($this->conn)) {
134
+ $line = fgets($this->conn, 4096);
135
+ if (1 == $state) {
136
+ if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/', $line, $m)) {
137
+ $response['httperror'] = "Status code line invalid: ".htmlentities($line);
138
+ return $response;
139
+ }
140
+ $response['http_version'] = $m[1];
141
+ $response['status'] = $m[2];
142
+ $response['status_string'] = $m[3];
143
+ $state = 2;
144
+ } else if (2 == $state) {
145
+ # End of headers
146
+ if (2 == strlen($line)) {
147
+ if ($conlen > 0)
148
+ $response['body'] = fread($this->conn, $conlen);
149
+ return $response;
150
+ }
151
+ if (!preg_match('/([^:]+):\\s*(.*)/', $line, $m)) {
152
+ // Skip to the next header
153
+ continue;
154
+ }
155
+ $key = strtolower(trim($m[1]));
156
+ $val = trim($m[2]);
157
+ $response['headers'][$key] = $val;
158
+ if ($key == "content-length") {
159
+ $conlen = intval($val);
160
+ }
161
+ }
162
+ }
163
+ return $response;
164
+ }
165
+ }
166
+ endif;
callback/wings/auth.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVAuthCallback')) :
5
+ class BVAuthCallback {
6
+
7
+ function process($method) {
8
+ global $bvresp, $bvcb;
9
+ $auth = $bvcb->bvmain->auth;
10
+ switch ($method) {
11
+ case "addkeys":
12
+ $bvresp->addStatus("status", $auth->addKeys($_REQUEST['public'], $_REQUEST['secret']));
13
+ break;
14
+ case "updatekeys":
15
+ $bvresp->addStatus("status", $auth->updateKeys($_REQUEST['public'], $_REQUEST['secret']));
16
+ break;
17
+ case "rmkeys":
18
+ $bvresp->addStatus("status", $auth->rmKeys($_REQUEST['public']));
19
+ break;
20
+ default:
21
+ return false;
22
+ }
23
+ return true;
24
+ }
25
+ }
26
+ endif;
callback/wings/brand.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVBrandCallback')) :
5
+
6
+ class BVBrandCallback {
7
+ public function process($method) {
8
+ global $bvresp, $bvcb;
9
+ $info = $bvcb->bvmain->info;
10
+ $option_name = $bvcb->bvmain->brand_option;
11
+ switch($method) {
12
+ case 'setbrand':
13
+ $brandinfo = array();
14
+ if (array_key_exists('hide', $_REQUEST)) {
15
+ $brandinfo['hide'] = $_REQUEST['hide'];
16
+ } else {
17
+ $brandinfo['name'] = $_REQUEST['name'];
18
+ $brandinfo['title'] = $_REQUEST['title'];
19
+ $brandinfo['description'] = $_REQUEST['description'];
20
+ $brandinfo['pluginuri'] = $_REQUEST['pluginuri'];
21
+ $brandinfo['author'] = $_REQUEST['author'];
22
+ $brandinfo['authorname'] = $_REQUEST['authorname'];
23
+ $brandinfo['authoruri'] = $_REQUEST['authoruri'];
24
+ $brandinfo['menuname'] = $_REQUEST['menuname'];
25
+ $brandinfo['logo'] = $_REQUEST['logo'];
26
+ $brandinfo['webpage'] = $_REQUEST['webpage'];
27
+ $brandinfo['appurl'] = $_REQUEST['appurl'];
28
+ if (array_key_exists('hide_plugin_details', $_REQUEST)) {
29
+ $brandinfo['hide_plugin_details'] = $_REQUEST['hide_plugin_details'];
30
+ }
31
+ if (array_key_exists('hide_from_menu', $_REQUEST)) {
32
+ $brandinfo['hide_from_menu'] = $_REQUEST['hide_from_menu'];
33
+ }
34
+ }
35
+ $info->updateOption($option_name, $brandinfo);
36
+ $bvresp->addStatus("setbrand", $info->getOption($option_name));
37
+ break;
38
+ case 'rmbrand':
39
+ $info->deleteOption($option_name);
40
+ $bvresp->addStatus("rmbrand", !$info->getOption($option_name));
41
+ break;
42
+ default:
43
+ return false;
44
+ }
45
+ return true;
46
+ }
47
+ }
48
+ endif;
callback/wings/db.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVDBCallback')) :
5
+ class BVDBCallback {
6
+
7
+ public function getLastID($pkeys, $end_row) {
8
+ $last_ids = array();
9
+ foreach($pkeys as $pk) {
10
+ $last_ids[$pk] = $end_row[$pk];
11
+ }
12
+ return $last_ids;
13
+ }
14
+
15
+ public function getTableData($table, $tname, $rcount, $offset, $limit, $bsize, $filter, $pkeys, $include_rows = false) {
16
+ global $bvcb, $bvresp;
17
+ $tinfo = array();
18
+
19
+ $rows_count = $bvcb->bvmain->db->rowsCount($table);
20
+ $bvresp->addStatus('count', $rows_count);
21
+ if ($limit == 0) {
22
+ $limit = $rows_count;
23
+ }
24
+ $srows = 1;
25
+ while (($limit > 0) && ($srows > 0)) {
26
+ if ($bsize > $limit)
27
+ $bsize = $limit;
28
+ $rows = $bvcb->bvmain->db->getTableContent($table, '*', $filter, $bsize, $offset);
29
+ $srows = sizeof($rows);
30
+ $data = array();
31
+ $data["offset"] = $offset;
32
+ $data["size"] = $srows;
33
+ $data["md5"] = md5(serialize($rows));
34
+ array_push($tinfo, $data);
35
+ if (!empty($pkeys) && $srows > 0) {
36
+ $end_row = end($rows);
37
+ $last_ids = $this->getLastID($pkeys, $end_row);
38
+ $data['last_ids'] = $last_ids;
39
+ $bvresp->addStatus('last_ids', $last_ids);
40
+ }
41
+ if ($include_rows) {
42
+ $data["rows"] = $rows;
43
+ $str = serialize($data);
44
+ $bvresp->writeStream($str);
45
+ }
46
+ $offset += $srows;
47
+ $limit -= $srows;
48
+ }
49
+ $bvresp->addStatus('size', $offset);
50
+ $bvresp->addStatus('tinfo', $tinfo);
51
+ }
52
+
53
+ public function process($method) {
54
+ global $bvresp, $bvcb;
55
+ $db = $bvcb->bvmain->db;
56
+ switch ($method) {
57
+ case "gettbls":
58
+ $bvresp->addStatus("tables", $db->showTables());
59
+ break;
60
+ case "tblstatus":
61
+ $bvresp->addStatus("statuses", $db->showTableStatus());
62
+ break;
63
+ case "tablekeys":
64
+ $table = urldecode($_REQUEST['table']);
65
+ $bvresp->addStatus("table_keys", $db->tableKeys($table));
66
+ break;
67
+ case "describetable":
68
+ $table = urldecode($_REQUEST['table']);
69
+ $bvresp->addStatus("table_description", $db->describeTable($table));
70
+ break;
71
+ case "checktable":
72
+ $table = urldecode($_REQUEST['table']);
73
+ $type = urldecode($_REQUEST['type']);
74
+ $bvresp->addStatus("status", $db->checkTable($table, $type));
75
+ break;
76
+ case "repairtable":
77
+ $table = urldecode($_REQUEST['table']);
78
+ $bvresp->addStatus("status", $db->repairTable($table));
79
+ break;
80
+ case "gettcrt":
81
+ $table = urldecode($_REQUEST['table']);
82
+ $bvresp->addStatus("create", $db->showTableCreate($table));
83
+ break;
84
+ case "getrowscount":
85
+ $table = urldecode($_REQUEST['table']);
86
+ $bvresp->addStatus("count", $db->rowsCount($table));
87
+ break;
88
+ case "gettablecontent":
89
+ $table = urldecode($_REQUEST['table']);
90
+ $fields = urldecode($_REQUEST['fields']);
91
+ $filter = (array_key_exists('filter', $_REQUEST)) ? urldecode($_REQUEST['filter']) : "";
92
+ $limit = intval(urldecode($_REQUEST['limit']));
93
+ $offset = intval(urldecode($_REQUEST['offset']));
94
+ $pkeys = (array_key_exists('pkeys', $_REQUEST)) ? $_REQUEST['pkeys'] : array();
95
+ $bvresp->addStatus('timestamp', time());
96
+ $bvresp->addStatus('tablename', $table);
97
+ $rows = $db->getTableContent($table, $fields, $filter, $limit, $offset);
98
+ $srows = sizeof($rows);
99
+ if (!empty($pkeys) && $srows > 0) {
100
+ $end_row = end($rows);
101
+ $bvresp->addStatus('last_ids', $this->getLastID($pkeys, $end_row));
102
+ }
103
+ $bvresp->addStatus("rows", $rows);
104
+ break;
105
+ case "tableinfo":
106
+ $table = urldecode($_REQUEST['table']);
107
+ $offset = intval(urldecode($_REQUEST['offset']));
108
+ $limit = intval(urldecode($_REQUEST['limit']));
109
+ $bsize = intval(urldecode($_REQUEST['bsize']));
110
+ $filter = (array_key_exists('filter', $_REQUEST)) ? urldecode($_REQUEST['filter']) : "";
111
+ $rcount = intval(urldecode($_REQUEST['rcount']));
112
+ $tname = urldecode($_REQUEST['tname']);
113
+ $pkeys = (array_key_exists('pkeys', $_REQUEST)) ? $_REQUEST['pkeys'] : array();
114
+ $this->getTableData($table, $tname, $rcount, $offset, $limit, $bsize, $filter, $pkeys, false);
115
+ break;
116
+ case "uploadrows":
117
+ $table = urldecode($_REQUEST['table']);
118
+ $offset = intval(urldecode($_REQUEST['offset']));
119
+ $limit = intval(urldecode($_REQUEST['limit']));
120
+ $bsize = intval(urldecode($_REQUEST['bsize']));
121
+ $filter = (array_key_exists('filter', $_REQUEST)) ? urldecode($_REQUEST['filter']) : "";
122
+ $rcount = intval(urldecode($_REQUEST['rcount']));
123
+ $tname = urldecode($_REQUEST['tname']);
124
+ $pkeys = (array_key_exists('pkeys', $_REQUEST)) ? $_REQUEST['pkeys'] : array();
125
+ $this->getTableData($table, $tname, $rcount, $offset, $limit, $bsize, $filter, $pkeys, true);
126
+ break;
127
+ case "tblexists":
128
+ $bvresp->addStatus("tblexists", $db->isTablePresent($_REQUEST['tablename']));
129
+ break;
130
+ case "crttbl":
131
+ $bvresp->addStatus("crttbl", $db->createTable($_REQUEST['query'], $_REQUEST['tablename']));
132
+ break;
133
+ case "drptbl":
134
+ $bvresp->addStatus("drptbl", $db->dropBVTable($_REQUEST['name']));
135
+ break;
136
+ case "trttbl":
137
+ $bvresp->addStatus("trttbl", $db->truncateBVTable($_REQUEST['name']));
138
+ break;
139
+ default:
140
+ return false;
141
+ }
142
+ return true;
143
+ }
144
+ }
145
+ endif;
callback/wings/fs.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVFSCallback')) :
5
+ class BVFSCallback {
6
+ function fileStat($relfile) {
7
+ $absfile = ABSPATH.$relfile;
8
+ $fdata = array();
9
+ $fdata["filename"] = $relfile;
10
+ $stats = @stat($absfile);
11
+ if ($stats) {
12
+ foreach (preg_grep('#size|uid|gid|mode|mtime#i', array_keys($stats)) as $key ) {
13
+ $fdata[$key] = $stats[$key];
14
+ }
15
+ if (is_link($absfile)) {
16
+ $fdata["link"] = @readlink($absfile);
17
+ }
18
+ } else {
19
+ $fdata["failed"] = true;
20
+ }
21
+ return $fdata;
22
+ }
23
+
24
+ function scanFilesUsingGlob($initdir = "./", $offset = 0, $limit = 0, $bsize = 512, $recurse = true, $regex = '{.??,}*') {
25
+ global $bvresp;
26
+ $i = 0;
27
+ $dirs = array();
28
+ $dirs[] = $initdir;
29
+ $bfc = 0;
30
+ $bfa = array();
31
+ $current = 0;
32
+ $abspath = realpath(ABSPATH).'/';
33
+ $abslen = strlen($abspath);
34
+ # XNOTE: $recurse cannot be used directly here
35
+ while ($i < count($dirs)) {
36
+ $dir = $dirs[$i];
37
+
38
+ foreach (glob($abspath.$dir.$regex, GLOB_NOSORT | GLOB_BRACE) as $absfile) {
39
+ $relfile = substr($absfile, $abslen);
40
+ if (is_dir($absfile) && !is_link($absfile)) {
41
+ $dirs[] = $relfile."/";
42
+ }
43
+ $current++;
44
+ if ($offset >= $current)
45
+ continue;
46
+ if (($limit != 0) && (($current - $offset) > $limit)) {
47
+ $i = count($dirs);
48
+ break;
49
+ }
50
+ $bfa[] = $this->fileStat($relfile);
51
+ $bfc++;
52
+ if ($bfc == $bsize) {
53
+ $str = serialize($bfa);
54
+ $bvresp->writeStream($str);
55
+ $bfc = 0;
56
+ $bfa = array();
57
+ }
58
+ }
59
+ $regex = '{.??,}*';
60
+ $i++;
61
+ if ($recurse == false)
62
+ break;
63
+ }
64
+ if ($bfc != 0) {
65
+ $str = serialize($bfa);
66
+ $bvresp->writeStream($str);
67
+ }
68
+ }
69
+
70
+ function scanFiles($initdir = "./", $offset = 0, $limit = 0, $bsize = 512, $recurse = true) {
71
+ global $bvresp;
72
+ $i = 0;
73
+ $dirs = array();
74
+ $dirs[] = $initdir;
75
+ $bfc = 0;
76
+ $bfa = array();
77
+ $current = 0;
78
+ while ($i < count($dirs)) {
79
+ $dir = $dirs[$i];
80
+ $d = @opendir(ABSPATH.$dir);
81
+ if ($d) {
82
+ while (($file = readdir($d)) !== false) {
83
+ if ($file == '.' || $file == '..') { continue; }
84
+ $relfile = $dir.$file;
85
+ $absfile = ABSPATH.$relfile;
86
+ if (is_dir($absfile) && !is_link($absfile)) {
87
+ $dirs[] = $relfile."/";
88
+ }
89
+ $current++;
90
+ if ($offset >= $current)
91
+ continue;
92
+ if (($limit != 0) && (($current - $offset) > $limit)) {
93
+ $i = count($dirs);
94
+ break;
95
+ }
96
+ $bfa[] = $this->fileStat($relfile);
97
+ $bfc++;
98
+ if ($bfc == $bsize) {
99
+ $str = serialize($bfa);
100
+ $bvresp->writeStream($str);
101
+ $bfc = 0;
102
+ $bfa = array();
103
+ }
104
+ }
105
+ closedir($d);
106
+ }
107
+ $i++;
108
+ if ($recurse == false)
109
+ break;
110
+ }
111
+ if ($bfc != 0) {
112
+ $str = serialize($bfa);
113
+ $bvresp->writeStream($str);
114
+ }
115
+ }
116
+
117
+ function calculateMd5($absfile, $fdata, $offset, $limit, $bsize) {
118
+ if ($offset == 0 && $limit == 0) {
119
+ $md5 = md5_file($absfile);
120
+ } else {
121
+ if ($limit == 0)
122
+ $limit = $fdata["size"];
123
+ if ($offset + $limit < $fdata["size"])
124
+ $limit = $fdata["size"] - $offset;
125
+ $handle = fopen($absfile, "rb");
126
+ $ctx = hash_init('md5');
127
+ fseek($handle, $offset, SEEK_SET);
128
+ $dlen = 1;
129
+ while (($limit > 0) && ($dlen > 0)) {
130
+ if ($bsize > $limit)
131
+ $bsize = $limit;
132
+ $d = fread($handle, $bsize);
133
+ $dlen = strlen($d);
134
+ hash_update($ctx, $d);
135
+ $limit -= $dlen;
136
+ }
137
+ fclose($handle);
138
+ $md5 = hash_final($ctx);
139
+ }
140
+ return $md5;
141
+ }
142
+
143
+ function getFilesStats($files, $offset = 0, $limit = 0, $bsize = 102400, $md5 = false) {
144
+ global $bvresp;
145
+ foreach ($files as $file) {
146
+ $fdata = $this->fileStat($file);
147
+ $absfile = ABSPATH.$file;
148
+ if (!is_readable($absfile)) {
149
+ $bvresp->addArrayToStatus("missingfiles", $file);
150
+ continue;
151
+ }
152
+ if ($md5 === true) {
153
+ $fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
154
+ }
155
+ $bvresp->addArrayToStatus("stats", $fdata);
156
+ }
157
+ }
158
+
159
+ function uploadFiles($files, $offset = 0, $limit = 0, $bsize = 102400) {
160
+ global $bvresp;
161
+
162
+ foreach ($files as $file) {
163
+ if (!is_readable(ABSPATH.$file)) {
164
+ $bvresp->addArrayToStatus("missingfiles", $file);
165
+ continue;
166
+ }
167
+ $handle = fopen(ABSPATH.$file, "rb");
168
+ if (($handle != null) && is_resource($handle)) {
169
+ $fdata = $this->fileStat($file);
170
+ $_limit = $limit;
171
+ $_bsize = $bsize;
172
+ if ($_limit == 0)
173
+ $_limit = $fdata["size"];
174
+ if ($offset + $_limit > $fdata["size"])
175
+ $_limit = $fdata["size"] - $offset;
176
+ $fdata["limit"] = $_limit;
177
+ $sfdata = serialize($fdata);
178
+ $bvresp->writeStream($sfdata);
179
+ fseek($handle, $offset, SEEK_SET);
180
+ $dlen = 1;
181
+ while (($_limit > 0) && ($dlen > 0)) {
182
+ if ($_bsize > $_limit)
183
+ $_bsize = $_limit;
184
+ $d = fread($handle, $_bsize);
185
+ $dlen = strlen($d);
186
+ $bvresp->writeStream($d);
187
+ $_limit -= $dlen;
188
+ }
189
+ fclose($handle);
190
+ } else {
191
+ $bvresp->addArrayToStatus("unreadablefiles", $file);
192
+ }
193
+ }
194
+ }
195
+
196
+ function process($method) {
197
+ switch ($method) {
198
+ case "scanfilesglob":
199
+ $initdir = urldecode($_REQUEST['initdir']);
200
+ $offset = intval(urldecode($_REQUEST['offset']));
201
+ $limit = intval(urldecode($_REQUEST['limit']));
202
+ $bsize = intval(urldecode($_REQUEST['bsize']));
203
+ $regex = urldecode($_REQUEST['regex']);
204
+ $recurse = true;
205
+ if (array_key_exists('recurse', $_REQUEST) && $_REQUEST["recurse"] == "false") {
206
+ $recurse = false;
207
+ }
208
+ $this->scanFilesUsingGlob($initdir, $offset, $limit, $bsize, $recurse, $regex);
209
+ break;
210
+ case "scanfiles":
211
+ $initdir = urldecode($_REQUEST['initdir']);
212
+ $offset = intval(urldecode($_REQUEST['offset']));
213
+ $limit = intval(urldecode($_REQUEST['limit']));
214
+ $bsize = intval(urldecode($_REQUEST['bsize']));
215
+ $recurse = true;
216
+ if (array_key_exists('recurse', $_REQUEST) && $_REQUEST["recurse"] == "false") {
217
+ $recurse = false;
218
+ }
219
+ $this->scanFiles($initdir, $offset, $limit, $bsize, $recurse);
220
+ break;
221
+ case "getfilesstats":
222
+ $files = $_REQUEST['files'];
223
+ $offset = intval(urldecode($_REQUEST['offset']));
224
+ $limit = intval(urldecode($_REQUEST['limit']));
225
+ $bsize = intval(urldecode($_REQUEST['bsize']));
226
+ $md5 = false;
227
+ if (array_key_exists('md5', $_REQUEST)) {
228
+ $md5 = true;
229
+ }
230
+ $this->getFilesStats($files, $offset, $limit, $bsize, $md5);
231
+ break;
232
+ case "sendmanyfiles":
233
+ $files = $_REQUEST['files'];
234
+ $offset = intval(urldecode($_REQUEST['offset']));
235
+ $limit = intval(urldecode($_REQUEST['limit']));
236
+ $bsize = intval(urldecode($_REQUEST['bsize']));
237
+ $this->uploadFiles($files, $offset, $limit, $bsize);
238
+ break;
239
+ case "filelist":
240
+ $initdir = $_REQUEST['initdir'];
241
+ $glob_option = GLOB_MARK;
242
+ if(array_key_exists('onlydir', $_REQUEST)) {
243
+ $glob_option = GLOB_ONLYDIR;
244
+ }
245
+ $regex = "*";
246
+ if(array_key_exists('regex', $_REQUEST)){
247
+ $regex = $_REQUEST['regex'];
248
+ }
249
+ $directoryList = glob($initdir.$regex, $glob_option);
250
+ $this->getFilesStats($directoryList);
251
+ break;
252
+ default:
253
+ return false;
254
+ }
255
+ return true;
256
+ }
257
+ }
258
+ endif;
callback/wings/info.php ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVInfoCallback')) :
5
+ class BVInfoCallback {
6
+ public function getPosts($post_type, $count = 5) {
7
+ global $bvresp;
8
+ $output = array();
9
+ $args = array('numberposts' => $count, 'post_type' => $post_type);
10
+ $posts = get_posts($args);
11
+ $keys = array('post_title', 'guid', 'ID', 'post_date');
12
+ foreach ($posts as $post) {
13
+ $pdata = array();
14
+ $post_array = get_object_vars($post);
15
+ foreach ($keys as $key) {
16
+ $pdata[$key] = $post_array[$key];
17
+ }
18
+ $bvresp->addArrayToStatus("posts", $pdata);
19
+ }
20
+ }
21
+
22
+ public function getStats() {
23
+ global $bvresp;
24
+ $bvresp->addStatus("posts", get_object_vars(wp_count_posts()));
25
+ $bvresp->addStatus("pages", get_object_vars(wp_count_posts("page")));
26
+ $bvresp->addStatus("comments", get_object_vars(wp_count_comments()));
27
+ }
28
+
29
+ public function getPlugins() {
30
+ global $bvresp;
31
+ if (!function_exists('get_plugins')) {
32
+ require_once (ABSPATH."wp-admin/includes/plugin.php");
33
+ }
34
+ $plugins = get_plugins();
35
+ foreach ($plugins as $plugin_file => $plugin_data) {
36
+ $pdata = array(
37
+ 'file' => $plugin_file,
38
+ 'title' => $plugin_data['Title'],
39
+ 'version' => $plugin_data['Version'],
40
+ 'active' => is_plugin_active($plugin_file),
41
+ 'network' => $plugin_data['Network']
42
+ );
43
+ $bvresp->addArrayToStatus("plugins", $pdata);
44
+ }
45
+ }
46
+
47
+ public function themeToArray($theme) {
48
+ if (is_object($theme)) {
49
+ $pdata = array(
50
+ 'name' => $theme->Name,
51
+ 'title' => $theme->Title,
52
+ 'stylesheet' => $theme->get_stylesheet(),
53
+ 'template' => $theme->Template,
54
+ 'version' => $theme->Version
55
+ );
56
+ } else {
57
+ $pdata = array(
58
+ 'name' => $theme["Name"],
59
+ 'title' => $theme["Title"],
60
+ 'stylesheet' => $theme["Stylesheet"],
61
+ 'template' => $theme["Template"],
62
+ 'version' => $theme["Version"]
63
+ );
64
+ }
65
+ return $pdata;
66
+ }
67
+
68
+ public function getThemes() {
69
+ global $bvresp;
70
+ $themes = function_exists('wp_get_themes') ? wp_get_themes() : get_themes();
71
+ foreach($themes as $theme) {
72
+ $pdata = $this->themeToArray($theme);
73
+ $bvresp->addArrayToStatus("themes", $pdata);
74
+ }
75
+ $theme = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme();
76
+ $pdata = $this->themeToArray($theme);
77
+ $bvresp->addStatus("currenttheme", $pdata);
78
+ }
79
+
80
+ public function getSystemInfo() {
81
+ global $bvresp;
82
+ $sys_info = array(
83
+ 'serverip' => $_SERVER['SERVER_ADDR'],
84
+ 'host' => $_SERVER['HTTP_HOST'],
85
+ 'phpversion' => phpversion(),
86
+ 'AF_INET6' => defined('AF_INET6')
87
+ );
88
+ if (function_exists('get_current_user')) {
89
+ $sys_info['user'] = get_current_user();
90
+ }
91
+ if (function_exists('getmygid')) {
92
+ $sys_info['gid'] = getmygid();
93
+ }
94
+ if (function_exists('getmyuid')) {
95
+ $sys_info['uid'] = getmyuid();
96
+ }
97
+ if (function_exists('posix_getuid')) {
98
+ $sys_info['webuid'] = posix_getuid();
99
+ $sys_info['webgid'] = posix_getgid();
100
+ }
101
+ $bvresp->addStatus("sys", $sys_info);
102
+ }
103
+
104
+ public function getWpInfo() {
105
+ global $wp_version, $wp_db_version, $wp_local_package;
106
+ global $bvresp, $bvcb;
107
+ $upload_dir = wp_upload_dir();
108
+ $info = $bvcb->bvmain->info;
109
+
110
+ $wp_info = array(
111
+ 'dbprefix' => $bvcb->bvmain->db->dbprefix(),
112
+ 'wpmu' => $info->isMultisite(),
113
+ 'mainsite' => $info->isMainSite(),
114
+ 'name' => get_bloginfo('name'),
115
+ 'siteurl' => $info->siteurl(),
116
+ 'homeurl' => $info->homeurl(),
117
+ 'charset' => get_bloginfo('charset'),
118
+ 'wpversion' => $wp_version,
119
+ 'dbversion' => $wp_db_version,
120
+ 'abspath' => ABSPATH,
121
+ 'uploadpath' => $upload_dir['basedir'],
122
+ 'uploaddir' => wp_upload_dir(),
123
+ 'contentdir' => defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : null,
124
+ 'contenturl' => defined('WP_CONTENT_URL') ? WP_CONTENT_URL : null,
125
+ 'plugindir' => defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : null,
126
+ 'dbcharset' => defined('DB_CHARSET') ? DB_CHARSET : null,
127
+ 'disallow_file_edit' => defined('DISALLOW_FILE_EDIT'),
128
+ 'disallow_file_mods' => defined('DISALLOW_FILE_MODS'),
129
+ 'locale' => get_locale(),
130
+ 'wp_local_string' => $wp_local_package,
131
+ 'charset_collate' => $bvcb->bvmain->db->getCharsetCollate()
132
+ );
133
+ $bvresp->addStatus("wp", $wp_info);
134
+ }
135
+
136
+ public function getUsers($args = array(), $full) {
137
+ global $bvresp, $bvcb;
138
+ $results = array();
139
+ $users = get_users($args);
140
+ if ('true' == $full) {
141
+ $results = $bvcb->bvmain->lib->objectToArray($users);
142
+ } else {
143
+ foreach( (array) $users as $user) {
144
+ $result = array();
145
+ $result['user_email'] = $user->user_email;
146
+ $result['ID'] = $user->ID;
147
+ $result['roles'] = $user->roles;
148
+ $result['user_login'] = $user->user_login;
149
+ $result['display_name'] = $user->display_name;
150
+ $result['user_registered'] = $user->user_registered;
151
+ $result['user_status'] = $user->user_status;
152
+ $result['user_url'] = $user->url;
153
+
154
+ $results[] = $result;
155
+ }
156
+ }
157
+ $bvresp->addStatus("users", $results);
158
+ }
159
+
160
+ public function availableFunctions(&$info) {
161
+ if (extension_loaded('openssl')) {
162
+ $info['openssl'] = "1";
163
+ }
164
+ if (function_exists('is_ssl') && is_ssl()) {
165
+ $info['https'] = "1";
166
+ }
167
+ if (function_exists('openssl_public_encrypt')) {
168
+ $info['openssl_public_encrypt'] = "1";
169
+ }
170
+ if (function_exists('openssl_public_decrypt')) {
171
+ $info['openssl_public_decrypt'] = "1";
172
+ }
173
+ $info['sha1'] = "1";
174
+ $info['apissl'] = "1";
175
+ if (function_exists('base64_encode')) {
176
+ $info['b64encode'] = true;
177
+ }
178
+ if (function_exists('base64_decode')) {
179
+ $info['b64decode'] = true;
180
+ }
181
+ return $info;
182
+ }
183
+
184
+ public function servicesInfo(&$info) {
185
+ global $bvcb;
186
+ $bvinfo = $bvcb->bvmain->info;
187
+ $info['dynsync'] = $bvinfo->getOption('bvDynSyncActive');
188
+ $info['woodyn'] = $bvinfo->getOption('bvWooDynSync');
189
+ $info['dynplug'] = $bvinfo->getOption('bvdynplug');
190
+ $info['ptplug'] = $bvinfo->getOption('bvptplug');
191
+ $info['fw'] = $this->getFWConfig();
192
+ $info['lp'] = $this->getLPConfig();
193
+ $info['brand'] = $bvinfo->getOption($bvcb->bvmain->brand_option);
194
+ $info['badgeinfo'] = $bvinfo->getOption($bvcb->bvmain->badgeinfo);
195
+ }
196
+
197
+ public function getLPConfig() {
198
+ global $bvcb;
199
+ $config = array();
200
+ $bvinfo = $bvcb->bvmain->info;
201
+ $mode = $bvinfo->getOption('bvlpmode');
202
+ $cplimit = $bvinfo->getOption('bvlpcaptchalimit');
203
+ $tplimit = $bvinfo->getOption('bvlptempblocklimit');
204
+ $bllimit = $bvinfo->getOption('bvlpblockAllLimit');
205
+ $config['mode'] = intval($mode ? $mode : 1);
206
+ $config['captcha_limit'] = intval($cplimit ? $cplimit : 3);
207
+ $config['temp_block_limit'] = intval($tplimit? $tplimit : 6);
208
+ $config['block_all_limit'] = intval($bllimit ? $bllimit : 100);
209
+ return $config;
210
+ }
211
+
212
+ public function getFWConfig() {
213
+ global $bvcb;
214
+ $config = array();
215
+ $bvinfo = $bvcb->bvmain->info;
216
+ $mode = $bvinfo->getOption('bvfwmode');
217
+ $drules = $bvinfo->getOption('bvfwdisabledrules');
218
+ $rmode = $bvinfo->getOption('bvfwrulesmode');
219
+ $config['mode'] = intval($mode ? $mode : 1);
220
+ $config['disabled_rules'] = $drules ? $drules : array();
221
+ $config['rules_mode'] = intval($rmode ? $rmode : 1);
222
+ return $config;
223
+ }
224
+
225
+ public function dbconf(&$info) {
226
+ global $bvcb;
227
+ if (defined('DB_CHARSET'))
228
+ $info['dbcharset'] = DB_CHARSET;
229
+ $info['dbprefix'] = $bvcb->bvmain->db->dbprefix();
230
+ $info['charset_collate'] = $bvcb->bvmain->db->getCharsetCollate();
231
+ return $info;
232
+ }
233
+
234
+ public function activate() {
235
+ global $bvcb, $bvresp;
236
+ $resp = array();
237
+ $bvcb->bvmain->info->basic($resp);
238
+ $this->servicesInfo($resp);
239
+ $this->dbconf($resp);
240
+ $this->availableFunctions($resp);
241
+ $bvresp->addStatus('actinfo', $resp);
242
+ }
243
+
244
+ public function process($method) {
245
+ global $bvresp, $bvcb;
246
+ switch ($method) {
247
+ case "activateinfo":
248
+ $this->activate();
249
+ break;
250
+ case "gtpsts":
251
+ $count = 5;
252
+ if (array_key_exists('count', $_REQUEST))
253
+ $count = $_REQUEST['count'];
254
+ $this->getPosts($_REQUEST['post_type'], $count);
255
+ break;
256
+ case "gtsts":
257
+ $this->getStats();
258
+ break;
259
+ case "gtplgs":
260
+ $this->getPlugins();
261
+ break;
262
+ case "gtthms":
263
+ $this->getThemes();
264
+ break;
265
+ case "gtsym":
266
+ $this->getSystemInfo();
267
+ break;
268
+ case "gtwp":
269
+ $this->getWpInfo();
270
+ break;
271
+ case "getoption":
272
+ $bvresp->addStatus("option", $bvresp->getOption($_REQUEST['name']));
273
+ break;
274
+ case "gtusrs":
275
+ $full = false;
276
+ if (array_key_exists('full', $_REQUEST))
277
+ $full = true;
278
+ $this->getUsers($_REQUEST['args'], $full);
279
+ break;
280
+ case "gttrnsnt":
281
+ $transient = $bvcb->bvmain->info->getTransient($_REQUEST['name']);
282
+ if ($transient && array_key_exists('asarray', $_REQUEST))
283
+ $transient = $bvcb->bvmain->lib->objectToArray($transient);
284
+ $bvresp->addStatus("transient", $transient);
285
+ break;
286
+ default:
287
+ return false;
288
+ }
289
+ return true;
290
+ }
291
+ }
292
+ endif;
callback/wings/misc.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('BVMiscCallback')) :
5
+
6
+ class BVMiscCallback {
7
+
8
+ function process($method) {
9
+ global $bvcb, $bvresp;
10
+ $info = $bvcb->bvmain->info;
11
+ switch ($method) {
12
+ case "enablebadge":
13
+ $option = $bvcb->bvmain->badgeinfo;
14
+ $badgeinfo = array();
15
+ $badgeinfo['badgeurl'] = $_REQUEST['badgeurl'];
16
+ $badgeinfo['badgeimg'] = $_REQUEST['badgeimg'];
17
+ $badgeinfo['badgealt'] = $_REQUEST['badgealt'];
18
+ $info->updateOption($option, $badgeinfo);
19
+ $bvresp->addStatus("status", $info->getOption($option));
20
+ break;
21
+ case "disablebadge":
22
+ $option = $bvcb->bvmain->badgeinfo;
23
+ $info->deleteOption($option);
24
+ $bvresp->addStatus("status", !$info->getOption($option));
25
+ break;
26
+ case "getoption":
27
+ $bvresp->addStatus('getoption', $info->getOption($_REQUEST['opkey']));
28
+ break;
29
+ case "setdynplug":
30
+ $info->updateOption('bvdynplug', $_REQUEST['dynplug']);
31
+ $bvresp->addStatus("setdynplug", $info->getOption('bvdynplug'));
32
+ break;
33
+ case "unsetdynplug":
34
+ $info->deleteOption('bvdynplug');
35
+ $bvresp->addStatus("unsetdynplug", $info->getOption('bvdynplug'));
36
+ break;
37
+ case "setptplug":
38
+ $info->updateOption('bvptplug', $_REQUEST['ptplug']);
39
+ $bvresp->addStatus("setptplug", $info->getOption('bvptplug'));
40
+ break;
41
+ case "unsetptplug":
42
+ $info->deleteOption('bvptlug');
43
+ $bvresp->addStatus("unsetptplug", $info->getOption('bvptlug'));
44
+ break;
45
+ case "wpupplgs":
46
+ $bvresp->addStatus("wpupdateplugins", wp_update_plugins());
47
+ break;
48
+ case "wpupthms":
49
+ $bvresp->addStatus("wpupdatethemes", wp_update_themes());
50
+ break;
51
+ case "wpupcre":
52
+ $bvresp->addStatus("wpupdatecore", wp_version_check());
53
+ break;
54
+ case "rmmonitime":
55
+ $bvcb->bvmain->unSetMonitTime();
56
+ $bvresp->addStatus("rmmonitime", !$bvcb->bvmain->getMonitTime());
57
+ break;
58
+ case "phpinfo":
59
+ phpinfo();
60
+ die();
61
+ break;
62
+ case "dlttrsnt":
63
+ $bvresp->addStatus("dlttrsnt", $bvcb->bvmain->info->deleteTransient($_REQUEST['key']));
64
+ break;
65
+ default:
66
+ return false;
67
+ }
68
+ return true;
69
+ }
70
+ }
71
+ endif;
license.txt ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ WordPress - Web publishing software
2
+
3
+ Copyright 2015 by the contributors
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ This program incorporates work covered by the following copyright and
20
+ permission notices:
21
+
22
+ b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com -
23
+ http://tidakada.com
24
+
25
+ Wherever third party code has been used, credit has been given in the code's
26
+ comments.
27
+
28
+ b2 is released under the GPL
29
+
30
+ and
31
+
32
+ WordPress - Web publishing software
33
+
34
+ Copyright 2003-2010 by the contributors
35
+
36
+ WordPress is released under the GPL
37
+
38
+ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
39
+
40
+ GNU GENERAL PUBLIC LICENSE
41
+ Version 2, June 1991
42
+
43
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
44
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
45
+ Everyone is permitted to copy and distribute verbatim copies
46
+ of this license document, but changing it is not allowed.
47
+
48
+ Preamble
49
+
50
+ The licenses for most software are designed to take away your
51
+ freedom to share and change it. By contrast, the GNU General Public
52
+ License is intended to guarantee your freedom to share and change free
53
+ software--to make sure the software is free for all its users. This
54
+ General Public License applies to most of the Free Software
55
+ Foundation's software and to any other program whose authors commit to
56
+ using it. (Some other Free Software Foundation software is covered by
57
+ the GNU Lesser General Public License instead.) You can apply it to
58
+ your programs, too.
59
+
60
+ When we speak of free software, we are referring to freedom, not
61
+ price. Our General Public Licenses are designed to make sure that you
62
+ have the freedom to distribute copies of free software (and charge for
63
+ this service if you wish), that you receive source code or can get it
64
+ if you want it, that you can change the software or use pieces of it
65
+ in new free programs; and that you know you can do these things.
66
+
67
+ To protect your rights, we need to make restrictions that forbid
68
+ anyone to deny you these rights or to ask you to surrender the rights.
69
+ These restrictions translate to certain responsibilities for you if you
70
+ distribute copies of the software, or if you modify it.
71
+
72
+ For example, if you distribute copies of such a program, whether
73
+ gratis or for a fee, you must give the recipients all the rights that
74
+ you have. You must make sure that they, too, receive or can get the
75
+ source code. And you must show them these terms so they know their
76
+ rights.
77
+
78
+ We protect your rights with two steps: (1) copyright the software, and
79
+ (2) offer you this license which gives you legal permission to copy,
80
+ distribute and/or modify the software.
81
+
82
+ Also, for each author's protection and ours, we want to make certain
83
+ that everyone understands that there is no warranty for this free
84
+ software. If the software is modified by someone else and passed on, we
85
+ want its recipients to know that what they have is not the original, so
86
+ that any problems introduced by others will not reflect on the original
87
+ authors' reputations.
88
+
89
+ Finally, any free program is threatened constantly by software
90
+ patents. We wish to avoid the danger that redistributors of a free
91
+ program will individually obtain patent licenses, in effect making the
92
+ program proprietary. To prevent this, we have made it clear that any
93
+ patent must be licensed for everyone's free use or not licensed at all.
94
+
95
+ The precise terms and conditions for copying, distribution and
96
+ modification follow.
97
+
98
+ GNU GENERAL PUBLIC LICENSE
99
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
100
+
101
+ 0. This License applies to any program or other work which contains
102
+ a notice placed by the copyright holder saying it may be distributed
103
+ under the terms of this General Public License. The "Program", below,
104
+ refers to any such program or work, and a "work based on the Program"
105
+ means either the Program or any derivative work under copyright law:
106
+ that is to say, a work containing the Program or a portion of it,
107
+ either verbatim or with modifications and/or translated into another
108
+ language. (Hereinafter, translation is included without limitation in
109
+ the term "modification".) Each licensee is addressed as "you".
110
+
111
+ Activities other than copying, distribution and modification are not
112
+ covered by this License; they are outside its scope. The act of
113
+ running the Program is not restricted, and the output from the Program
114
+ is covered only if its contents constitute a work based on the
115
+ Program (independent of having been made by running the Program).
116
+ Whether that is true depends on what the Program does.
117
+
118
+ 1. You may copy and distribute verbatim copies of the Program's
119
+ source code as you receive it, in any medium, provided that you
120
+ conspicuously and appropriately publish on each copy an appropriate
121
+ copyright notice and disclaimer of warranty; keep intact all the
122
+ notices that refer to this License and to the absence of any warranty;
123
+ and give any other recipients of the Program a copy of this License
124
+ along with the Program.
125
+
126
+ You may charge a fee for the physical act of transferring a copy, and
127
+ you may at your option offer warranty protection in exchange for a fee.
128
+
129
+ 2. You may modify your copy or copies of the Program or any portion
130
+ of it, thus forming a work based on the Program, and copy and
131
+ distribute such modifications or work under the terms of Section 1
132
+ above, provided that you also meet all of these conditions:
133
+
134
+ a) You must cause the modified files to carry prominent notices
135
+ stating that you changed the files and the date of any change.
136
+
137
+ b) You must cause any work that you distribute or publish, that in
138
+ whole or in part contains or is derived from the Program or any
139
+ part thereof, to be licensed as a whole at no charge to all third
140
+ parties under the terms of this License.
141
+
142
+ c) If the modified program normally reads commands interactively
143
+ when run, you must cause it, when started running for such
144
+ interactive use in the most ordinary way, to print or display an
145
+ announcement including an appropriate copyright notice and a
146
+ notice that there is no warranty (or else, saying that you provide
147
+ a warranty) and that users may redistribute the program under
148
+ these conditions, and telling the user how to view a copy of this
149
+ License. (Exception: if the Program itself is interactive but
150
+ does not normally print such an announcement, your work based on
151
+ the Program is not required to print an announcement.)
152
+
153
+ These requirements apply to the modified work as a whole. If
154
+ identifiable sections of that work are not derived from the Program,
155
+ and can be reasonably considered independent and separate works in
156
+ themselves, then this License, and its terms, do not apply to those
157
+ sections when you distribute them as separate works. But when you
158
+ distribute the same sections as part of a whole which is a work based
159
+ on the Program, the distribution of the whole must be on the terms of
160
+ this License, whose permissions for other licensees extend to the
161
+ entire whole, and thus to each and every part regardless of who wrote it.
162
+
163
+ Thus, it is not the intent of this section to claim rights or contest
164
+ your rights to work written entirely by you; rather, the intent is to
165
+ exercise the right to control the distribution of derivative or
166
+ collective works based on the Program.
167
+
168
+ In addition, mere aggregation of another work not based on the Program
169
+ with the Program (or with a work based on the Program) on a volume of
170
+ a storage or distribution medium does not bring the other work under
171
+ the scope of this License.
172
+
173
+ 3. You may copy and distribute the Program (or a work based on it,
174
+ under Section 2) in object code or executable form under the terms of
175
+ Sections 1 and 2 above provided that you also do one of the following:
176
+
177
+ a) Accompany it with the complete corresponding machine-readable
178
+ source code, which must be distributed under the terms of Sections
179
+ 1 and 2 above on a medium customarily used for software interchange; or,
180
+
181
+ b) Accompany it with a written offer, valid for at least three
182
+ years, to give any third party, for a charge no more than your
183
+ cost of physically performing source distribution, a complete
184
+ machine-readable copy of the corresponding source code, to be
185
+ distributed under the terms of Sections 1 and 2 above on a medium
186
+ customarily used for software interchange; or,
187
+
188
+ c) Accompany it with the information you received as to the offer
189
+ to distribute corresponding source code. (This alternative is
190
+ allowed only for noncommercial distribution and only if you
191
+ received the program in object code or executable form with such
192
+ an offer, in accord with Subsection b above.)
193
+
194
+ The source code for a work means the preferred form of the work for
195
+ making modifications to it. For an executable work, complete source
196
+ code means all the source code for all modules it contains, plus any
197
+ associated interface definition files, plus the scripts used to
198
+ control compilation and installation of the executable. However, as a
199
+ special exception, the source code distributed need not include
200
+ anything that is normally distributed (in either source or binary
201
+ form) with the major components (compiler, kernel, and so on) of the
202
+ operating system on which the executable runs, unless that component
203
+ itself accompanies the executable.
204
+
205
+ If distribution of executable or object code is made by offering
206
+ access to copy from a designated place, then offering equivalent
207
+ access to copy the source code from the same place counts as
208
+ distribution of the source code, even though third parties are not
209
+ compelled to copy the source along with the object code.
210
+
211
+ 4. You may not copy, modify, sublicense, or distribute the Program
212
+ except as expressly provided under this License. Any attempt
213
+ otherwise to copy, modify, sublicense or distribute the Program is
214
+ void, and will automatically terminate your rights under this License.
215
+ However, parties who have received copies, or rights, from you under
216
+ this License will not have their licenses terminated so long as such
217
+ parties remain in full compliance.
218
+
219
+ 5. You are not required to accept this License, since you have not
220
+ signed it. However, nothing else grants you permission to modify or
221
+ distribute the Program or its derivative works. These actions are
222
+ prohibited by law if you do not accept this License. Therefore, by
223
+ modifying or distributing the Program (or any work based on the
224
+ Program), you indicate your acceptance of this License to do so, and
225
+ all its terms and conditions for copying, distributing or modifying
226
+ the Program or works based on it.
227
+
228
+ 6. Each time you redistribute the Program (or any work based on the
229
+ Program), the recipient automatically receives a license from the
230
+ original licensor to copy, distribute or modify the Program subject to
231
+ these terms and conditions. You may not impose any further
232
+ restrictions on the recipients' exercise of the rights granted herein.
233
+ You are not responsible for enforcing compliance by third parties to
234
+ this License.
235
+
236
+ 7. If, as a consequence of a court judgment or allegation of patent
237
+ infringement or for any other reason (not limited to patent issues),
238
+ conditions are imposed on you (whether by court order, agreement or
239
+ otherwise) that contradict the conditions of this License, they do not
240
+ excuse you from the conditions of this License. If you cannot
241
+ distribute so as to satisfy simultaneously your obligations under this
242
+ License and any other pertinent obligations, then as a consequence you
243
+ may not distribute the Program at all. For example, if a patent
244
+ license would not permit royalty-free redistribution of the Program by
245
+ all those who receive copies directly or indirectly through you, then
246
+ the only way you could satisfy both it and this License would be to
247
+ refrain entirely from distribution of the Program.
248
+
249
+ If any portion of this section is held invalid or unenforceable under
250
+ any particular circumstance, the balance of the section is intended to
251
+ apply and the section as a whole is intended to apply in other
252
+ circumstances.
253
+
254
+ It is not the purpose of this section to induce you to infringe any
255
+ patents or other property right claims or to contest validity of any
256
+ such claims; this section has the sole purpose of protecting the
257
+ integrity of the free software distribution system, which is
258
+ implemented by public license practices. Many people have made
259
+ generous contributions to the wide range of software distributed
260
+ through that system in reliance on consistent application of that
261
+ system; it is up to the author/donor to decide if he or she is willing
262
+ to distribute software through any other system and a licensee cannot
263
+ impose that choice.
264
+
265
+ This section is intended to make thoroughly clear what is believed to
266
+ be a consequence of the rest of this License.
267
+
268
+ 8. If the distribution and/or use of the Program is restricted in
269
+ certain countries either by patents or by copyrighted interfaces, the
270
+ original copyright holder who places the Program under this License
271
+ may add an explicit geographical distribution limitation excluding
272
+ those countries, so that distribution is permitted only in or among
273
+ countries not thus excluded. In such case, this License incorporates
274
+ the limitation as if written in the body of this License.
275
+
276
+ 9. The Free Software Foundation may publish revised and/or new versions
277
+ of the General Public License from time to time. Such new versions will
278
+ be similar in spirit to the present version, but may differ in detail to
279
+ address new problems or concerns.
280
+
281
+ Each version is given a distinguishing version number. If the Program
282
+ specifies a version number of this License which applies to it and "any
283
+ later version", you have the option of following the terms and conditions
284
+ either of that version or of any later version published by the Free
285
+ Software Foundation. If the Program does not specify a version number of
286
+ this License, you may choose any version ever published by the Free Software
287
+ Foundation.
288
+
289
+ 10. If you wish to incorporate parts of the Program into other free
290
+ programs whose distribution conditions are different, write to the author
291
+ to ask for permission. For software which is copyrighted by the Free
292
+ Software Foundation, write to the Free Software Foundation; we sometimes
293
+ make exceptions for this. Our decision will be guided by the two goals
294
+ of preserving the free status of all derivatives of our free software and
295
+ of promoting the sharing and reuse of software generally.
296
+
297
+ NO WARRANTY
298
+
299
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
300
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
301
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
302
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
303
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
304
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
305
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
306
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
307
+ REPAIR OR CORRECTION.
308
+
309
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
310
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
311
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
312
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
313
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
314
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
315
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
316
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
317
+ POSSIBILITY OF SUCH DAMAGES.
318
+
319
+ END OF TERMS AND CONDITIONS
320
+
321
+ How to Apply These Terms to Your New Programs
322
+
323
+ If you develop a new program, and you want it to be of the greatest
324
+ possible use to the public, the best way to achieve this is to make it
325
+ free software which everyone can redistribute and change under these terms.
326
+
327
+ To do so, attach the following notices to the program. It is safest
328
+ to attach them to the start of each source file to most effectively
329
+ convey the exclusion of warranty; and each file should have at least
330
+ the "copyright" line and a pointer to where the full notice is found.
331
+
332
+ <one line to give the program's name and a brief idea of what it does.>
333
+ Copyright (C) <year> <name of author>
334
+
335
+ This program is free software; you can redistribute it and/or modify
336
+ it under the terms of the GNU General Public License as published by
337
+ the Free Software Foundation; either version 2 of the License, or
338
+ (at your option) any later version.
339
+
340
+ This program is distributed in the hope that it will be useful,
341
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
342
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
343
+ GNU General Public License for more details.
344
+
345
+ You should have received a copy of the GNU General Public License along
346
+ with this program; if not, write to the Free Software Foundation, Inc.,
347
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
348
+
349
+ Also add information on how to contact you by electronic and paper mail.
350
+
351
+ If the program is interactive, make it output a short notice like this
352
+ when it starts in an interactive mode:
353
+
354
+ Gnomovision version 69, Copyright (C) year name of author
355
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
356
+ This is free software, and you are welcome to redistribute it
357
+ under certain conditions; type `show c' for details.
358
+
359
+ The hypothetical commands `show w' and `show c' should show the appropriate
360
+ parts of the General Public License. Of course, the commands you use may
361
+ be called something other than `show w' and `show c'; they could even be
362
+ mouse-clicks or menu items--whatever suits your program.
363
+
364
+ You should also get your employer (if you work as a programmer) or your
365
+ school, if any, to sign a "copyright disclaimer" for the program, if
366
+ necessary. Here is a sample; alter the names:
367
+
368
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
369
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
370
+
371
+ <signature of Ty Coon>, 1 April 1989
372
+ Ty Coon, President of Vice
373
+
374
+ This General Public License does not permit incorporating your program into
375
+ proprietary programs. If your program is a subroutine library, you may
376
+ consider it more useful to permit linking proprietary applications with the
377
+ library. If this is what you want to do, use the GNU Lesser General
378
+ Public License instead of this License.
379
+
380
+ WRITTEN OFFER
381
+
382
+ The source code for any program binaries or compressed scripts that are
383
+ included with WordPress can be freely obtained at the following URL:
384
+
385
+ https://wordpress.org/download/source/
main.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit;
3
+ if (!class_exists('WPEngine')) :
4
+
5
+ require_once dirname( __FILE__ ) . '/main/lib.php';
6
+ require_once dirname( __FILE__ ) . '/main/site_info.php';
7
+ require_once dirname( __FILE__ ) . '/main/auth.php';
8
+ require_once dirname( __FILE__ ) . '/main/db.php';
9
+
10
+ class WPEngine {
11
+ public $version = '1.88';
12
+ public $plugname = 'wpengine';
13
+ public $brandname = 'WPEngine Migration';
14
+ public $webpage = 'https://wpengine.com';
15
+ public $appurl = 'https://wpengine.blogvault.net';
16
+ public $slug = 'wp-site-migrate/wpengine.php';
17
+ public $plug_redirect = 'wperedirect';
18
+ public $badgeinfo = 'wpebadge';
19
+ public $logo = '../assets/img/wpengine-logo.png';
20
+
21
+ public $ip_header_option = 'wpeipheader';
22
+ public $brand_option = 'wpebrand';
23
+
24
+ public $lib;
25
+ public $info;
26
+ public $auth;
27
+ public $db;
28
+ function __construct() {
29
+ $this->lib = new WPELib();
30
+ $this->info = new WPESiteInfo($this->lib);
31
+ $this->auth = new WPEAuth($this->info);
32
+ $this->db = new WPEDb();
33
+ }
34
+
35
+ public function appUrl() {
36
+ if (defined('BV_APP_URL')) {
37
+ return BV_APP_URL;
38
+ } else {
39
+ $brand = $this->getBrandInfo();
40
+ if ($brand && array_key_exists('appurl', $brand)) {
41
+ return $brand['appurl'];
42
+ }
43
+ return $this->appurl;
44
+ }
45
+ }
46
+
47
+ public function getIPHeader() {
48
+ return $this->info->getOption($this->ip_header_option);
49
+ }
50
+
51
+ public function getBrandName() {
52
+ $brand = $this->getBrandInfo();
53
+ if ($brand && array_key_exists('menuname', $brand)) {
54
+ return $brand['menuname'];
55
+ }
56
+ return $this->brandname;
57
+ }
58
+
59
+ public function isMalcare() {
60
+ return $this->getBrandName() === 'MalCare - Pro';
61
+ }
62
+
63
+ public function isBlogvault() {
64
+ return $this->getBrandName() === 'BlogVault';
65
+ }
66
+
67
+ public function getBrandInfo() {
68
+ return $this->info->getOption($this->brand_option);
69
+ }
70
+
71
+ public function authenticatedUrl($method, $apicheck = null, $full = true) {
72
+ $_params = $this->auth->newAuthParams($this->version);
73
+ if ($apicheck) {
74
+ $_params['bvapicheck'] = $apicheck;
75
+ }
76
+ $qstr = http_build_query($_params);
77
+ if (!$full)
78
+ return $method."?".$qstr;
79
+ return $this->appUrl().$method."?".$qstr;
80
+ }
81
+
82
+ public function isConfigured() {
83
+ return $this->auth->defaultPublic();
84
+ }
85
+
86
+ public function getMonitTime() {
87
+ $time = $this->info->getOption('bvmonittime');
88
+ return ($time ? $time : 0);
89
+ }
90
+
91
+ public function unSetMonitTime() {
92
+ return $this->info->deleteOption('bvmonittime');
93
+ }
94
+
95
+ public function setMonitTime() {
96
+ return $this->info->updateOption('bvmonittime', time());
97
+ }
98
+
99
+ public function isActivePlugin() {
100
+ $expiry_time = time() - (3 * 24 * 3600);
101
+ return ($this->getMonitTime() > $expiry_time);
102
+ }
103
+
104
+ public function isProtectModuleEnabled() {
105
+ return ($this->info->getOption('bvptplug') === $this->plugname) &&
106
+ $this->isActivePlugin();
107
+ }
108
+
109
+ public function isDynSyncModuleEnabled() {
110
+ return ($this->info->getOption('bvdynplug') === $this->plugname) &&
111
+ $this->isActivePlugin();
112
+ }
113
+
114
+ public function pingbv($method) {
115
+ $body = array();
116
+ $this->info->basic($body);
117
+ $body['plug'] = $this->plugname;
118
+ $url = $this->authenticatedUrl($method);
119
+ $this->lib->http_request($url, $body);
120
+ }
121
+
122
+ public function setup($rand_secret) {
123
+ $this->info->updateOption('bvSecretKey', $rand_secret);
124
+ $this->info->updateOption($this->plug_redirect, 'yes');
125
+ $this->info->updateOption('bvActivateTime', time());
126
+ }
127
+
128
+ public function isActivateRedirectSet() {
129
+ if ($this->info->getOption($this->plug_redirect) === 'yes') {
130
+ $this->info->updateOption($this->plug_redirect, 'no');
131
+ return true;
132
+ }
133
+ return false;
134
+ }
135
+
136
+ public function activate() {
137
+ if (!isset($_REQUEST['blogvaultkey'])) {
138
+ ##BVKEYSLOCATE##
139
+ }
140
+ if ($this->isConfigured()) {
141
+ /* This informs the server about the activation */
142
+ $this->pingbv('/bvapi/activate');
143
+ } else {
144
+ $this->setup($this->lib->randString(32));
145
+ }
146
+ }
147
+
148
+ public function footerHandler() {
149
+ $bvfooter = $this->info->getOption($this->badgeinfo);
150
+ if ($bvfooter) {
151
+ echo '<div style="max-width:150px;min-height:70px;margin:0 auto;text-align:center;position:relative;">
152
+ <a href='.$bvfooter['badgeurl'].' target="_blank" ><img src="'.plugins_url($bvfooter['badgeimg'], __FILE__).'" alt="'.$bvfooter['badgealt'].'" /></a></div>';
153
+ }
154
+ }
155
+
156
+ public function deactivate() {
157
+ $this->pingbv('/bvapi/deactivate');
158
+ }
159
+
160
+ public static function uninstall() {
161
+ ##CLEARLPCONFIG##
162
+ ##CLEARFWCONFIG##
163
+ ##CLEARIPSTORE##
164
+ ##CLEARDYNSYNCCONFIG##
165
+ }
166
+ }
167
+ endif;
main/auth.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('WPEAuth')) :
5
+
6
+ class WPEAuth {
7
+ public $info;
8
+ function __construct($info) {
9
+ $this->info = $info;
10
+ }
11
+
12
+ public function defaultPublic() {
13
+ return $this->info->getOption('bvPublic');
14
+ }
15
+
16
+ public function defaultSecret() {
17
+ return $this->info->getOption('bvSecretKey');
18
+ }
19
+
20
+ public function allKeys() {
21
+ $keys = $this->info->getOption('bvkeys');
22
+ if (!is_array($keys)) {
23
+ $keys = array();
24
+ }
25
+ $public = $this->defaultPublic();
26
+ $secret = $this->defaultSecret();
27
+ if ($public)
28
+ $keys[$public] = $secret;
29
+ $keys['default'] = $secret;
30
+ return $keys;
31
+ }
32
+
33
+ public function publicParam() {
34
+ if (array_key_exists('pubkey', $_REQUEST)) {
35
+ return $_REQUEST['pubkey'];
36
+ } else {
37
+ return $this->defaultPublic();
38
+ }
39
+ }
40
+
41
+ public function secretForPublic($public = false) {
42
+ $bvkeys = $this->allKeys();
43
+ if ($public && array_key_exists($public, $bvkeys) && isset($bvkeys[$public]))
44
+ return $bvkeys[$public];
45
+ else
46
+ return $this->defaultSecret();
47
+ }
48
+
49
+ public function addKeys($public, $secret) {
50
+ $bvkeys = $this->info->getOption('bvkeys');
51
+ if ($bvkeys && is_array($bvkeys))
52
+ $bvkeys[$public] = $secret;
53
+ else
54
+ $bvkeys = array($public => $secret);
55
+ $this->info->updateOption('bvkeys', $bvkeys);
56
+ }
57
+
58
+ public function updateKeys($publickey, $secretkey) {
59
+ $this->info->updateOption('bvPublic', $publickey);
60
+ $this->info->updateOption('bvSecretKey', $secretkey);
61
+ $this->addKeys($publickey, $secretkey);
62
+ }
63
+
64
+ public function rmKeys($publickey) {
65
+ $bvkeys = $this->info->getOption('bvkeys');
66
+ if ($bvkeys && is_array($bvkeys)) {
67
+ unset($bvkeys[$publickey]);
68
+ $this->info->updateOption('bvkeys', $bvkeys);
69
+ return true;
70
+ }
71
+ return false;
72
+ }
73
+
74
+ public function validate($public, $method, $time, $version, $sig) {
75
+ $secret = $this->secretForPublic($public);
76
+ if ($time < intval($this->info->getOption('bvLastRecvTime')) - 300) {
77
+ return false;
78
+ }
79
+ if (array_key_exists('sha1', $_REQUEST)) {
80
+ $sig_match = sha1($method.$secret.$time.$version);
81
+ } else {
82
+ $sig_match = md5($method.$secret.$time.$version);
83
+ }
84
+ if ($sig_match !== $sig) {
85
+ return $sig_match;
86
+ }
87
+ $this->info->updateOption('bvLastRecvTime', $time);
88
+ return 1;
89
+ }
90
+
91
+ public function newAuthParams($version) {
92
+ $args = array();
93
+ $time = time();
94
+ $public = $this->publicParam();
95
+ $secret = $this->secretForPublic($public);
96
+
97
+ $sig = sha1($public.$secret.$time.$version);
98
+ $args['sig'] = $sig;
99
+ $args['bvTime'] = $time;
100
+ $args['bvPublic'] = $public;
101
+ $args['bvVersion'] = $version;
102
+ $args['sha1'] = '1';
103
+ return $args;
104
+ }
105
+ }
106
+ endif;
main/db.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('WPEDb')) :
5
+
6
+ class WPEDb {
7
+ function dbprefix() {
8
+ global $wpdb;
9
+ $prefix = $wpdb->base_prefix ? $wpdb->base_prefix : $wpdb->prefix;
10
+ return $prefix;
11
+ }
12
+
13
+ function prepare($query, $args) {
14
+ global $wpdb;
15
+ return $wpdb->prepare($query, $args);
16
+ }
17
+
18
+ function getSiteId() {
19
+ global $wpdb;
20
+ return $wpdb->siteid;
21
+ }
22
+
23
+ function getResult($query, $obj = ARRAY_A) {
24
+ global $wpdb;
25
+ return $wpdb->get_results($query, $obj);
26
+ }
27
+
28
+ function query($query) {
29
+ global $wpdb;
30
+ return $wpdb->query($query);
31
+ }
32
+
33
+ function getVar($query, $col = 0, $row = 0) {
34
+ global $wpdb;
35
+ return $wpdb->get_var($query, $col, $row);
36
+ }
37
+
38
+ function getCol($query, $col = 0) {
39
+ global $wpdb;
40
+ return $wpdb->get_col($query, $col);
41
+ }
42
+
43
+ function tableName($table) {
44
+ return $table[0];
45
+ }
46
+
47
+ function showTables() {
48
+ $tables = $this->getResult("SHOW TABLES", ARRAY_N);
49
+ return array_map(array($this, 'tableName'), $tables);
50
+ }
51
+
52
+ function showTableStatus() {
53
+ return $this->getResult("SHOW TABLE STATUS");
54
+ }
55
+
56
+ function tableKeys($table) {
57
+ return $this->getResult("SHOW KEYS FROM $table;");
58
+ }
59
+
60
+ function describeTable($table) {
61
+ return $this->getResult("DESCRIBE $table;");
62
+ }
63
+
64
+ function checkTable($table, $type) {
65
+ return $this->getResult("CHECK TABLE $table $type;");
66
+ }
67
+
68
+ function repairTable($table) {
69
+ return $this->getResult("REPAIR TABLE $table;");
70
+ }
71
+
72
+ function showTableCreate($table) {
73
+ return $this->getVar("SHOW CREATE TABLE $table;", 1);
74
+ }
75
+
76
+ function rowsCount($table) {
77
+ $count = $this->getVar("SELECT COUNT(*) FROM $table;");
78
+ return intval($count);
79
+ }
80
+
81
+ function createTable($query, $name) {
82
+ $table = $this->getBVTable($name);
83
+ if (!$this->isTablePresent($table)) {
84
+ if (array_key_exists('usedbdelta', $_REQUEST)) {
85
+ if (!function_exists('dbDelta'))
86
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
87
+ dbDelta($query);
88
+ } else {
89
+ $this->query($query);
90
+ }
91
+ }
92
+ return $this->isTablePresent($table);
93
+ }
94
+
95
+ function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
96
+ $query = "SELECT $fields from $table $filter";
97
+ if ($limit > 0)
98
+ $query .= " LIMIT $limit";
99
+ if ($offset > 0)
100
+ $query .= " OFFSET $offset";
101
+ $rows = $this->getResult($query);
102
+ return $rows;
103
+ }
104
+
105
+ function isTablePresent($table) {
106
+ return ($this->getVar("SHOW TABLES LIKE '$table'") === $table);
107
+ }
108
+
109
+ function getCharsetCollate() {
110
+ global $wpdb;
111
+ if (method_exists($wpdb, 'get_charset_collate')) {
112
+ return $wpdb->get_charset_collate();
113
+ }
114
+ return '';
115
+ }
116
+
117
+ function getWPTable($name) {
118
+ return ($this->dbprefix() . $name);
119
+ }
120
+
121
+ function getBVTable($name) {
122
+ return ($this->getWPTable("bv_" . $name));
123
+ }
124
+
125
+ function truncateBVTable($name) {
126
+ $table = $this->getBVTable($name);
127
+ if ($this->isTablePresent($table)) {
128
+ return $this->query("TRUNCATE TABLE $table;");
129
+ } else {
130
+ return false;
131
+ }
132
+ }
133
+
134
+ function deleteBVTableContent($name, $filter = "") {
135
+ $table = $this->getBVTable($name);
136
+ if ($this->isTablePresent($table)) {
137
+ return $this->query("DELETE FROM $table $filter;");
138
+ } else {
139
+ return false;
140
+ }
141
+ }
142
+
143
+ function dropBVTable($name) {
144
+ $table = $this->getBVTable($name);
145
+ if ($this->isTablePresent($table)) {
146
+ $this->query("DROP TABLE IF EXISTS $table;");
147
+ }
148
+ return !$this->isTablePresent($table);
149
+ }
150
+
151
+ function deleteRowsFromtable($name, $count = 1) {
152
+ $table = $this->getBVTable($name);
153
+ if ($this->isTablePresent($table)) {
154
+ return $this->getResult("DELETE FROM $table LIMIT $count;");
155
+ } else {
156
+ return false;
157
+ }
158
+ }
159
+
160
+ function replaceIntoBVTable($name, $value) {
161
+ global $wpdb;
162
+ $table = $this->getBVTable($name);
163
+ return $wpdb->replace($table, $value);
164
+ }
165
+ }
166
+ endif;
main/lib.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('WPELib')) :
5
+
6
+ class WPELib {
7
+ public function objectToArray($obj) {
8
+ return json_decode(json_encode($obj), true);
9
+ }
10
+
11
+ public function dbsig($full = false) {
12
+ if (defined('DB_USER') && defined('DB_NAME') &&
13
+ defined('DB_PASSWORD') && defined('DB_HOST')) {
14
+ $sig = sha1(DB_USER.DB_NAME.DB_PASSWORD.DB_HOST);
15
+ } else {
16
+ $sig = "bvnone".$this->randString(34);
17
+ }
18
+ if ($full)
19
+ return $sig;
20
+ else
21
+ return substr($sig, 0, 6);
22
+ }
23
+
24
+ public function randString($length) {
25
+ $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
26
+
27
+ $str = "";
28
+ $size = strlen($chars);
29
+ for( $i = 0; $i < $length; $i++ ) {
30
+ $str .= $chars[rand(0, $size - 1)];
31
+ }
32
+ return $str;
33
+ }
34
+
35
+ public function http_request($url, $body) {
36
+ $_body = array(
37
+ 'method' => 'POST',
38
+ 'timeout' => 15,
39
+ 'body' => $body);
40
+
41
+ return wp_remote_post($url, $_body);
42
+ }
43
+ }
44
+ endif;
main/site_info.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit;
4
+ if (!class_exists('WPESiteInfo')) :
5
+
6
+ class WPESiteInfo {
7
+ public function getOption($key) {
8
+ $res = false;
9
+ if (function_exists('get_site_option')) {
10
+ $res = get_site_option($key, false);
11
+ }
12
+ if ($res === false) {
13
+ $res = get_option($key, false);
14
+ }
15
+ return $res;
16
+ }
17
+
18
+ public function deleteOption($key) {
19
+ if (function_exists('delete_site_option')) {
20
+ return delete_site_option($key);
21
+ } else {
22
+ return delete_option($key);
23
+ }
24
+ }
25
+
26
+ public function updateOption($key, $value) {
27
+ if (function_exists('update_site_option')) {
28
+ return update_site_option($key, $value);
29
+ } else {
30
+ return update_option($key, $value);
31
+ }
32
+ }
33
+
34
+ public function setTransient($name, $value, $time) {
35
+ if (function_exists('set_site_transient')) {
36
+ return set_site_transient($name, $value, $time);
37
+ }
38
+ return false;
39
+ }
40
+
41
+ public function deleteTransient($name) {
42
+ if (function_exists('delete_site_transient')) {
43
+ return delete_site_transient($name);
44
+ }
45
+ return false;
46
+ }
47
+
48
+ public function getTransient($name) {
49
+ if (function_exists('get_site_transient')) {
50
+ return get_site_transient($name);
51
+ }
52
+ return false;
53
+ }
54
+
55
+ public function wpurl() {
56
+ if (function_exists('network_site_url'))
57
+ return network_site_url();
58
+ else
59
+ return get_bloginfo('wpurl');
60
+ }
61
+
62
+ public function siteurl() {
63
+ if (function_exists('site_url')) {
64
+ return site_url();
65
+ } else {
66
+ return get_bloginfo('wpurl');
67
+ }
68
+ }
69
+
70
+ public function homeurl() {
71
+ if (function_exists('home_url')) {
72
+ return home_url();
73
+ } else {
74
+ return get_bloginfo('url');
75
+ }
76
+ }
77
+
78
+ public function isMultisite() {
79
+ if (function_exists('is_multisite'))
80
+ return is_multisite();
81
+ return false;
82
+ }
83
+
84
+ public function isMainSite() {
85
+ if (!function_exists('is_main_site' ) || !$this->isMultisite())
86
+ return true;
87
+ return is_main_site();
88
+ }
89
+
90
+ public function basic(&$info) {
91
+ $info['wpurl'] = $this->wpurl();
92
+ $info['siteurl'] = $this->siteurl();
93
+ $info['homeurl'] = $this->homeurl();
94
+ $info['serverip'] = $_SERVER['SERVER_ADDR'];
95
+ $info['abspath'] = ABSPATH;
96
+ return $info;
97
+ }
98
+ }
99
+ endif;
readme.txt ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Engine Automated Migration ===
2
+ Contributors: wpengine, blogvault, akshatc, taylor4484
3
+ Tags: wpe, wpengine, migration
4
+ Requires at least: 4.0
5
+ Tested up to: 5.2.1
6
+ Stable tag: trunk
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ == Description ==
11
+
12
+ WP Engine Automated Migrations allows you to easily migrate your WordPress site to the WP Engine platform. All you need to do is provide the plugin your WP Engine SFTP credentials and let the tool do all the heavy lifting.
13
+
14
+ For full instructions and solutions to common errors, please visit our [WP Engine Automated Migrations](http://wpengine.com/support/wp-engine-automatic-migration/) support garage article.
15
+
16
+ = Developers =
17
+
18
+ * This tool will provide you an quick way to migrate sites, allowing you to work on your other projects while the plugin does all the heavy lifting.
19
+ * No need to worry about searching/replacing values in the database, the plugin does it for you.
20
+ * You can migrate multiple sites easily.
21
+
22
+ = Marketers =
23
+
24
+ * Worried about SEO? The plugin will keep all your links the same, making sure you do not lose any SEO.
25
+ * Minimal technical knowledge needed to migrate your site to WP Engine.
26
+
27
+ = Site Owners =
28
+
29
+ * Minimal technical knowledge needed to migrate your site to WP Engine.
30
+ * Focus on your business instead of migrating your site.
31
+ * No need to hire a third party migration team.
32
+
33
+ = Legal Requirements =
34
+
35
+ * By using this plugin, you are agreeing to our [Terms of Service](http://wpengine.com/terms-of-service/)
36
+
37
+ = * Please Note * =
38
+
39
+ This plugin will only migrate your site to [WP Engine](http://wpengine.com/). This will not migrate you to any other host.
40
+
41
+ == Installation ==
42
+
43
+ 1. Upload `wp-migrate-site` to the `/wp-content/plugins/` directory
44
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
45
+
46
+ If you have WordPress 2.7 or above you can simply go to 'Plugins' > 'Add New' in the WordPress admin and search for "WP Engine Migration Tool" and install/activate it from there.
47
+
48
+ == Frequently Asked Questions ==
49
+
50
+ 1) What information do I need to provide to the plugin?
51
+
52
+ You will have to provide the plugin your email address, destination url, SFTP host name, SFTP username, and SFTP password.
53
+
54
+ 2) Does this plugin work with Multisite?
55
+
56
+ Yes! This has been fully developed to work with Multisite. If moving a Multisite, make sure to Network Activate the plugin.
57
+
58
+ 3) Can I migrate a single WordPress install into a Multisite using this plugin?
59
+
60
+ No. This plugin is designed to migrate sites as is. This plugin will not support single WordPress sites being migrated into a Multisite or a Multisite sub-site being migrated to a single WordPress site.
61
+
62
+ 4) Are their any known incompatibilities?
63
+
64
+ Currently, you can not migrate a site from WordPress.com or any proprietary hosting solution. (Squarespace.com, Wix.com, and similar hosting providers)
65
+
66
+ 5) Other than running the plugin, anything else I need to do?
67
+
68
+ Once the migration completes, you will need to update your DNS to point to our servers. Keep in mind that you may also need to add any custom redirects to your WP Engine User Portal and migrate your SSL.
69
+
70
+ 6) How do I sign up for a WP Engine Account?
71
+
72
+ That's easy! [Signup here](http://wpengine.com/plans/).
73
+
74
+ == Screenshots ==
75
+
76
+ 1. Adding information to the WP Engine Migration Tool in the WP-Admin.
77
+ 2. WP Engine User Portal Migration Page, https://my.wpengine.com
78
+ 2. BlogVault dashboard showing live updates.
79
+
80
+ == Changelog ==
81
+ = 1.88 =
82
+ * Callback improvements
83
+
84
+ = 1.86 =
85
+ * Updating tested upto 5.1
86
+
87
+ = 1.84 =
88
+ * Disable form on submit
89
+
90
+ = 1.82 =
91
+ * Updating tested upto 5.0
92
+
93
+ = 1.77 =
94
+ * Adding function_exists for getmyuid and get_current_user functions
95
+
96
+ = 1.76 =
97
+ * Removing create_funtion for PHP 7.2 compatibility
98
+
99
+ = 1.72 =
100
+ * Adding Misc Callback
101
+
102
+ = 1.71 =
103
+ * Adding logout functionality in the plugin
104
+
105
+ = 1.69 =
106
+ * Adding support for chunked base64 encoding
107
+
108
+ = 1.68 =
109
+ * Updating upload rows
110
+
111
+ = 1.66 =
112
+ * Updating TOS and privacy policies
113
+
114
+ = 1.64 =
115
+ * Bug fixes for lp and fw
116
+
117
+ = 1.62 =
118
+ * SSL support in plugin for API calls
119
+ * Adding support for plugin branding
120
+
121
+ = 1.44 =
122
+ * Removed bv_manage_site
123
+ * Updated asym_key
124
+
125
+ = 1.41 =
126
+ * Better integrity checking
127
+ * Woo Commerce Dynamic sync support
128
+
129
+ = 1.40 =
130
+ * Manage sites straight from BlogVault dashboard
131
+
132
+ = 1.31 =
133
+ * Changing dynamic backups to be pull-based
134
+
135
+ = 1.30 =
136
+ * Using dbsig based authentication
137
+
138
+ = 1.22 =
139
+ * Adding support for GLOB based directory listings
140
+
141
+ = 1.21 =
142
+ * Adding support for PHP 5 style constructors
143
+
144
+ = 1.20 =
145
+ * Adding DB Signature and Server Signature to uniquely identify a site
146
+ * Adding the stats api to the WordPress Backup plugin.
147
+ * Sending tablename/rcount as part of the callback
148
+ * Updated UI and added helpful content to provide a better migration experience.
149
+
150
+ = 1.17 =
151
+ * Add support for repair table so that the backup plugin itself can be used to repair tables without needing PHPMyAdmin access
152
+ * Making the plugin to be available network wide.
153
+ * Adding support for 401 Auth checks on the source or destination
154
+
155
+ = 1.16 =
156
+ * Improving the Base64 Decode functionality so that it is extensible for any parameter in the future and backups can be completed for any site
157
+ * Separating out callbacks gettablecreate and getrowscount to make the backups more modular
158
+ * The plugin will now automatically ping the server once a day. This will ensure that we know if we are not doing the backup of a site where the plugin is activated.
159
+ * Use SHA1 for authentication instead of MD5
160
+
161
+ = 1.15 =
162
+ * First release of WP Engine Plugin
wpengine.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP Engine Automated Migration
4
+ Plugin URI: https://wpengine.com
5
+ Description: The easiest way to migrate your site to WP Engine
6
+ Author: WPEngine
7
+ Author URI: https://wpengine.com
8
+ Version: 1.88
9
+ Network: True
10
+ */
11
+
12
+ /* Copyright 2017 WPEngine Migration (email : support@blogvault.net)
13
+
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License, version 2, as
16
+ published by the Free Software Foundation.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
+ */
27
+
28
+ /* Global response array */
29
+
30
+ if (!defined('ABSPATH')) exit;
31
+ global $bvcb, $bvresp;
32
+
33
+ require_once dirname( __FILE__ ) . '/main.php';
34
+ $bvmain = new WPEngine();
35
+
36
+ register_uninstall_hook(__FILE__, array('WPEngine', 'uninstall'));
37
+ register_activation_hook(__FILE__, array($bvmain, 'activate'));
38
+ register_deactivation_hook(__FILE__, array($bvmain, 'deactivate'));
39
+
40
+ add_action('wp_footer', array($bvmain, 'footerHandler'), 100);
41
+
42
+ if (is_admin()) {
43
+ require_once dirname( __FILE__ ) . '/admin.php';
44
+ $bvadmin = new WPEAdmin($bvmain);
45
+ add_action('admin_init', array($bvadmin, 'initHandler'));
46
+ add_filter('all_plugins', array($bvadmin, 'initBranding'));
47
+ add_filter('plugin_row_meta', array($bvadmin, 'hidePluginDetails'), 10, 2);
48
+ if ($bvmain->info->isMultisite()) {
49
+ add_action('network_admin_menu', array($bvadmin, 'menu'));
50
+ } else {
51
+ add_action('admin_menu', array($bvadmin, 'menu'));
52
+ }
53
+ add_filter('plugin_action_links', array($bvadmin, 'settingsLink'), 10, 2);
54
+ ##ACTIVATEWARNING##
55
+ add_action('admin_enqueue_scripts', array($bvadmin, 'wpesecAdminMenu'));
56
+ }
57
+
58
+ if ((array_key_exists('bvreqmerge', $_POST)) || (array_key_exists('bvreqmerge', $_GET))) {
59
+ $_REQUEST = array_merge($_GET, $_POST);
60
+ }
61
+
62
+ if ((array_key_exists('bvplugname', $_REQUEST)) &&
63
+ stristr($_REQUEST['bvplugname'], $bvmain->plugname)) {
64
+ require_once dirname( __FILE__ ) . '/callback.php';
65
+ $bvcb = new BVCallback($bvmain);
66
+ $bvresp = new BVResponse();
67
+ if ($bvcb->preauth() === 1) {
68
+ if ($bvcb->authenticate() === 1) {
69
+ if (array_key_exists('afterload', $_REQUEST)) {
70
+ add_action('wp_loaded', array($bvcb, 'execute'));
71
+ } else if (array_key_exists('adajx', $_REQUEST)) {
72
+ add_action('wp_ajax_bvadm', array($bvcb, 'bvAdmExecuteWithUser'));
73
+ add_action('wp_ajax_nopriv_bvadm', array($bvcb, 'bvAdmExecuteWithoutUser'));
74
+ } else {
75
+ $bvcb->execute();
76
+ }
77
+ } else {
78
+ $bvcb->terminate(false, array_key_exists('bvdbg', $_REQUEST));
79
+ }
80
+ }
81
+ } else {
82
+ ##PROTECTMODULE##
83
+ ##DYNSYNCMODULE##
84
+ }