Version Description
- Improvement: Support for new addons.
- Fix: Strict Non-static method set_hit_count() and is_bot() fixed.
Download this release
Release Info
Developer | infinitewp |
Plugin | InfiniteWP Client |
Version | 1.2.9 |
Comparing to | |
See all releases |
Code changes from version 1.2.8 to 1.2.9
- addons/brokenlinks/brokenlinks.class.php +213 -0
- addons/file_editor/file_editor.class.php +286 -0
- addons/google_webmasters/google_webmasters.class.php +76 -0
- addons/wordfence/wordfence.class.php +59 -0
- core.class.php +79 -3
- init.php +204 -3
- readme.txt +5 -1
- stats.class.php +33 -2
addons/brokenlinks/brokenlinks.class.php
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(basename($_SERVER['SCRIPT_FILENAME']) == "brokenlinks.class.php"):
|
3 |
+
exit;
|
4 |
+
endif;
|
5 |
+
class IWP_MMB_BLC extends IWP_MMB_Core
|
6 |
+
{
|
7 |
+
|
8 |
+
function __construct()
|
9 |
+
{
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
/********
|
13 |
+
** Private function, Will return the wordfence is load or not
|
14 |
+
********/
|
15 |
+
private function _checkBLC() {
|
16 |
+
@include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
17 |
+
if ( is_plugin_active( 'broken-link-checker/broken-link-checker.php' ) ) {
|
18 |
+
$blc_file = WP_PLUGIN_DIR . '/broken-link-checker/includes/links.php';
|
19 |
+
if(file_exists($blc_file)){
|
20 |
+
@include_once($blc_file);
|
21 |
+
}else{
|
22 |
+
return false;
|
23 |
+
}
|
24 |
+
if (class_exists('blcLink')) {
|
25 |
+
return true;
|
26 |
+
} else {
|
27 |
+
return false;
|
28 |
+
}
|
29 |
+
} else {
|
30 |
+
return false;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
function blc_get_http_status($code){
|
35 |
+
$http_status_codes = array(
|
36 |
+
// [Informational 1xx]
|
37 |
+
100=>'Continue',
|
38 |
+
101=>'Switching Protocols',
|
39 |
+
// [Successful 2xx]
|
40 |
+
200=>'OK',
|
41 |
+
201=>'Created',
|
42 |
+
202=>'Accepted',
|
43 |
+
203=>'Non-Authoritative Information',
|
44 |
+
204=>'No Content',
|
45 |
+
205=>'Reset Content',
|
46 |
+
206=>'Partial Content',
|
47 |
+
// [Redirection 3xx]
|
48 |
+
300=>'Multiple Choices',
|
49 |
+
301=>'Moved Permanently',
|
50 |
+
302=>'Found',
|
51 |
+
303=>'See Other',
|
52 |
+
304=>'Not Modified',
|
53 |
+
305=>'Use Proxy',
|
54 |
+
//306=>'(Unused)',
|
55 |
+
307=>'Temporary Redirect',
|
56 |
+
// [Client Error 4xx]
|
57 |
+
400=>'Bad Request',
|
58 |
+
401=>'Unauthorized',
|
59 |
+
402=>'Payment Required',
|
60 |
+
403=>'Forbidden',
|
61 |
+
404=>'Not Found',
|
62 |
+
405=>'Method Not Allowed',
|
63 |
+
406=>'Not Acceptable',
|
64 |
+
407=>'Proxy Authentication Required',
|
65 |
+
408=>'Request Timeout',
|
66 |
+
409=>'Conflict',
|
67 |
+
410=>'Gone',
|
68 |
+
411=>'Length Required',
|
69 |
+
412=>'Precondition Failed',
|
70 |
+
413=>'Request Entity Too Large',
|
71 |
+
414=>'Request-URI Too Long',
|
72 |
+
415=>'Unsupported Media Type',
|
73 |
+
416=>'Requested Range Not Satisfiable',
|
74 |
+
417=>'Expectation Failed',
|
75 |
+
// [Server Error 5xx]
|
76 |
+
500=>'Internal Server Error',
|
77 |
+
501=>'Not Implemented',
|
78 |
+
502=>'Bad Gateway',
|
79 |
+
503=>'Service Unavailable',
|
80 |
+
504=>'Gateway Timeout',
|
81 |
+
505=>'HTTP Version Not Supported',
|
82 |
+
509=>'Bandwidth Limit Exceeded',
|
83 |
+
510=>'Not Extended',
|
84 |
+
);
|
85 |
+
if(array_key_exists($code, $http_status_codes)){
|
86 |
+
return $http_status_codes[$code];
|
87 |
+
}else{
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
function blc_get_all_links()
|
93 |
+
{
|
94 |
+
if($this->_checkBLC()){
|
95 |
+
global $wpdb;
|
96 |
+
$sql = "SELECT l.*,i.container_id,i.link_text FROM (SELECT link_id,url,redirect_count,http_code,status_text,broken,false_positive,dismissed FROM ".$wpdb->base_prefix."blc_links) AS l INNER JOIN (SELECT link_id,container_id,link_text FROM ".$wpdb->base_prefix."blc_instances) AS i ON l.link_id=i.link_id";
|
97 |
+
$success = $wpdb->get_results($sql);
|
98 |
+
if(!empty($success)){
|
99 |
+
foreach ($success as $link) {
|
100 |
+
$link->source = get_the_title($link->container_id);
|
101 |
+
if($link->status_text == '') $link->status_text = self::blc_get_http_status($link->http_code);
|
102 |
+
}
|
103 |
+
}else{
|
104 |
+
return 'nolinks';
|
105 |
+
}
|
106 |
+
return $success;
|
107 |
+
} else {
|
108 |
+
return array('error'=>"Broken Link Checker plugin is not activated");
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function blc_update_link($params){
|
113 |
+
if($this->_checkBLC()){
|
114 |
+
$link = new blcLink( intval($params['linkID']) );
|
115 |
+
$rez = $link->edit($params['newLink'],$params['newText']);
|
116 |
+
$rez['new_text']=$params['newText'];
|
117 |
+
$rez['old_link_id']=$params['linkID'];
|
118 |
+
$rez['linkType']=$params['linkType'];
|
119 |
+
return $rez;
|
120 |
+
} else {
|
121 |
+
return array('error'=>"Broken Link Checker plugin is not activated");
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
function blc_unlink($params){
|
126 |
+
if($this->_checkBLC()){
|
127 |
+
$link = new blcLink( intval($params['linkID']) );
|
128 |
+
if ( !$link->valid() ){
|
129 |
+
return "Oops, I can't find the link ". intval($params['linkID']) ;
|
130 |
+
}
|
131 |
+
$rez = $link->unlink();
|
132 |
+
$rez['old_link_id']=$params['linkID'];
|
133 |
+
$rez['linkType']=$params['linkType'];
|
134 |
+
return $rez;
|
135 |
+
} else {
|
136 |
+
return array('error'=>"Broken Link Checker plugin is not activated");
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
function blc_mark_as_not_broken($params){
|
141 |
+
if($this->_checkBLC()){
|
142 |
+
$link = new blcLink( intval($params['linkID']) );
|
143 |
+
if ( !$link->valid() ){
|
144 |
+
return "Oops, I can't find the link ". intval($params['linkID']) ;
|
145 |
+
}
|
146 |
+
//Make it appear "not broken"
|
147 |
+
$link->broken = false;
|
148 |
+
$link->false_positive = true;
|
149 |
+
$link->last_check_attempt = time();
|
150 |
+
$link->log = __("This link was manually marked as working by the user.", 'broken-link-checker');
|
151 |
+
|
152 |
+
//Save the changes
|
153 |
+
if ( $link->save() ){
|
154 |
+
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'marked'=>1);
|
155 |
+
} else {
|
156 |
+
$rez = array('error'=>'Action couldn\'t be completed');
|
157 |
+
}
|
158 |
+
return $rez;
|
159 |
+
} else {
|
160 |
+
return array('error'=>"Broken Link Checker plugin is not activated");
|
161 |
+
}
|
162 |
+
}
|
163 |
+
function blc_dismiss_link($params){
|
164 |
+
$rez = $this->blc_set_dismiss_status(true,$params);
|
165 |
+
return $rez;
|
166 |
+
}
|
167 |
+
function blc_undismiss_link($params){
|
168 |
+
$rez = $this->blc_set_dismiss_status(false,$params);
|
169 |
+
return $rez;
|
170 |
+
}
|
171 |
+
|
172 |
+
private function blc_set_dismiss_status($dismiss,$params){
|
173 |
+
if($this->_checkBLC()){
|
174 |
+
$link = new blcLink( intval($params['linkID']) );
|
175 |
+
if ( !$link->valid() ){
|
176 |
+
return "Oops, I can't find the link ". intval($params['linkID']) ;
|
177 |
+
}
|
178 |
+
$link->dismissed = $dismiss;
|
179 |
+
if ( $link->save() ){
|
180 |
+
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'dismissvalue_set'=>1);
|
181 |
+
} else {
|
182 |
+
$rez = array('error'=>'Action couldn\'t be completed');
|
183 |
+
}
|
184 |
+
return $rez;
|
185 |
+
} else {
|
186 |
+
return array('error'=>"Broken Link Checker plugin is not activated");
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
function blc_bulk_actions($params){
|
191 |
+
$result = array();
|
192 |
+
if($params['action'] == 'bulk_unlink'){
|
193 |
+
for ($i=0; $i < count($params['linkData']); $i++) {
|
194 |
+
$redefinedParams = array('linkID'=>$params['linkData'][$i][0],'linkType'=>$params['linkData'][$i][1]);
|
195 |
+
array_push($result, $this->blc_unlink($redefinedParams));
|
196 |
+
}
|
197 |
+
}else if($params['action'] == 'bulk_mark_not_broken'){
|
198 |
+
for ($i=0; $i < count($params['linkData']); $i++) {
|
199 |
+
$redefinedParams = array('linkID'=>$params['linkData'][$i][0],'linkType'=>$params['linkData'][$i][1]);
|
200 |
+
array_push($result, $this->blc_mark_as_not_broken($redefinedParams));
|
201 |
+
}
|
202 |
+
}else if($params['action'] == 'bulk_dismiss'){
|
203 |
+
for ($i=0; $i < count($params['linkData']); $i++) {
|
204 |
+
$redefinedParams = array('linkID'=>$params['linkData'][$i][0],'linkType'=>$params['linkData'][$i][1]);
|
205 |
+
array_push($result, $this->blc_dismiss_link($redefinedParams));
|
206 |
+
}
|
207 |
+
}
|
208 |
+
return array($result,$params['action']);
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
}
|
addons/file_editor/file_editor.class.php
ADDED
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// IWP_MMB_fileEditor
|
3 |
+
if(basename($_SERVER['SCRIPT_FILENAME']) == "file_editor.class.php"):
|
4 |
+
exit;
|
5 |
+
endif;
|
6 |
+
class IWP_MMB_fileEditor extends IWP_MMB_Core
|
7 |
+
{
|
8 |
+
function __construct()
|
9 |
+
{
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
|
13 |
+
function is_server_writable(){
|
14 |
+
if((!defined('FTP_HOST') || !defined('FTP_USER') || !defined('FTP_PASS')) && (get_filesystem_method(array(), ABSPATH) != 'direct'))
|
15 |
+
return false;
|
16 |
+
else
|
17 |
+
return true;
|
18 |
+
}
|
19 |
+
|
20 |
+
function iwp_mmb_direct_to_any_copy_dir($from, $to, $skip_list = array() ) {//FIX ME: directly call function in backup.class.php later
|
21 |
+
global $wp_filesystem;
|
22 |
+
|
23 |
+
$wp_temp_direct = new WP_Filesystem_Direct('');
|
24 |
+
|
25 |
+
|
26 |
+
$dirlist = $wp_temp_direct->dirlist($from);
|
27 |
+
|
28 |
+
$from = trailingslashit($from);
|
29 |
+
$to = trailingslashit($to);
|
30 |
+
|
31 |
+
$skip_regex = '';
|
32 |
+
foreach ( (array)$skip_list as $key => $skip_file )
|
33 |
+
$skip_regex .= preg_quote($skip_file, '!') . '|';
|
34 |
+
|
35 |
+
if ( !empty($skip_regex) )
|
36 |
+
$skip_regex = '!(' . rtrim($skip_regex, '|') . ')$!i';
|
37 |
+
|
38 |
+
foreach ( (array) $dirlist as $filename => $fileinfo ) {
|
39 |
+
if ( !empty($skip_regex) )
|
40 |
+
if ( preg_match($skip_regex, $from . $filename) )
|
41 |
+
continue;
|
42 |
+
|
43 |
+
if ( 'f' == $fileinfo['type'] ) {
|
44 |
+
if ( ! $this->iwp_mmb_direct_to_any_copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) ) {
|
45 |
+
// If copy failed, chmod file to 0644 and try again.
|
46 |
+
$wp_filesystem->chmod($to . $filename, 0644);
|
47 |
+
if ( ! $this->iwp_mmb_direct_to_any_copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) )
|
48 |
+
return new WP_Error('copy_failed', __('Could not copy file.'), $to . $filename);
|
49 |
+
}
|
50 |
+
} elseif ( 'd' == $fileinfo['type'] ) {
|
51 |
+
if ( !$wp_filesystem->is_dir($to . $filename) ) {
|
52 |
+
if ( !$wp_filesystem->mkdir($to . $filename, FS_CHMOD_DIR) )
|
53 |
+
return new WP_Error('mkdir_failed', __('Could not create directory.'), $to . $filename);
|
54 |
+
}
|
55 |
+
$result = $this->iwp_mmb_direct_to_any_copy_dir($from . $filename, $to . $filename, $skip_list);
|
56 |
+
if ( is_wp_error($result) )
|
57 |
+
return $result;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
return true;
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $mode = false){//FIX ME: directly call function in backup.class.php later
|
65 |
+
global $wp_filesystem;
|
66 |
+
if($wp_filesystem->method == 'direct'){
|
67 |
+
return $wp_filesystem->copy($source, $destination, $overwrite, $mode);
|
68 |
+
}
|
69 |
+
elseif($wp_filesystem->method == 'ftpext' || $wp_filesystem->method == 'ftpsockets'){
|
70 |
+
if ( ! $overwrite && $wp_filesystem->exists($destination) )
|
71 |
+
return false;
|
72 |
+
|
73 |
+
//put content
|
74 |
+
$source_handle = fopen($source, 'r');
|
75 |
+
if ( ! $source_handle )
|
76 |
+
return false;
|
77 |
+
|
78 |
+
|
79 |
+
$sample_content = fread($source_handle, (1024 * 1024 * 2));//1024 * 1024 * 2 => 2MB
|
80 |
+
fseek($source_handle, 0); //Skip back to the start of the file being written to
|
81 |
+
|
82 |
+
$type = $wp_filesystem->is_binary($sample_content) ? FTP_BINARY : FTP_ASCII;
|
83 |
+
unset($sample_content);
|
84 |
+
if($wp_filesystem->method == 'ftpext'){
|
85 |
+
$ret = @ftp_fput($wp_filesystem->link, $destination, $source_handle, $type);
|
86 |
+
}
|
87 |
+
elseif($wp_filesystem->method == 'ftpsockets'){
|
88 |
+
$wp_filesystem->ftp->SetType($type);
|
89 |
+
$ret = $wp_filesystem->ftp->fput($destination, $source_handle);
|
90 |
+
}
|
91 |
+
|
92 |
+
fclose($source_handle);
|
93 |
+
unlink($source);//to immediately save system space
|
94 |
+
|
95 |
+
$wp_filesystem->chmod($destination, $mode);
|
96 |
+
|
97 |
+
return $ret;
|
98 |
+
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
function get_file_editor_vars($abspath,$folderPath,$filePath,$ext){
|
103 |
+
if($filePath[0] == ""){
|
104 |
+
$filePath = untrailingslashit($filePath[1]);
|
105 |
+
}else{
|
106 |
+
$filePath = trailingslashit($filePath[0]).untrailingslashit($filePath[1]);
|
107 |
+
}
|
108 |
+
|
109 |
+
$folderName = $this->get_file_editor_folder_name($abspath,$folderPath);
|
110 |
+
if($folderName){
|
111 |
+
$folderPath = trailingslashit($folderName);
|
112 |
+
}else{
|
113 |
+
return false;
|
114 |
+
}
|
115 |
+
$tempFilePath = explode("/", $filePath);
|
116 |
+
$temp=0;
|
117 |
+
$tempPath=$folderPath;
|
118 |
+
for($i=0;$i<count($tempFilePath)-1;$i++){
|
119 |
+
$tempPath .= trailingslashit($tempFilePath[$i]);
|
120 |
+
if (is_dir($tempPath )) {
|
121 |
+
$temp = $i+1;
|
122 |
+
$folderPath = $tempPath;
|
123 |
+
}else{
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
if ($temp != (count($tempFilePath)-1)) {
|
128 |
+
array_splice($tempFilePath,0,$temp);
|
129 |
+
$temp = array_splice($tempFilePath,-1,1);
|
130 |
+
$fileName = $temp[0];
|
131 |
+
}else{
|
132 |
+
$temp = array_splice($tempFilePath,-1,1);
|
133 |
+
$fileName = $temp[0];
|
134 |
+
$tempFilePath = array();
|
135 |
+
}
|
136 |
+
$fileName = $this->get_file_editor_file_name($fileName,$ext);
|
137 |
+
$FILE = array('toPath'=>$folderPath,'toCreate'=>$tempFilePath,'name'=>$fileName);
|
138 |
+
return $FILE;
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
function get_file_editor_folder_name($abspath,$folderVar){
|
144 |
+
switch ($folderVar) {
|
145 |
+
case 'admin':
|
146 |
+
$folder = trailingslashit($abspath).'wp-admin';
|
147 |
+
break;
|
148 |
+
|
149 |
+
case 'content':
|
150 |
+
$folder = WP_CONTENT_DIR;
|
151 |
+
break;
|
152 |
+
|
153 |
+
case 'plugins':
|
154 |
+
$folder = WP_PLUGIN_DIR;
|
155 |
+
break;
|
156 |
+
|
157 |
+
case 'themes':
|
158 |
+
$folder = get_theme_root();
|
159 |
+
break;
|
160 |
+
|
161 |
+
case 'uploads':
|
162 |
+
$temp = wp_upload_dir();
|
163 |
+
$folder = $temp['basedir'];
|
164 |
+
break;
|
165 |
+
|
166 |
+
case 'includes':
|
167 |
+
$folder = trailingslashit($abspath).WPINC;
|
168 |
+
break;
|
169 |
+
|
170 |
+
case 'root':
|
171 |
+
$folder = trailingslashit($abspath);
|
172 |
+
break;
|
173 |
+
|
174 |
+
default:
|
175 |
+
$folder = false;
|
176 |
+
break;
|
177 |
+
}
|
178 |
+
return $folder;
|
179 |
+
}
|
180 |
+
|
181 |
+
function get_file_editor_file_name($filePath,$ext){
|
182 |
+
if(strrpos($filePath, '.')){
|
183 |
+
$EXT = substr($filePath,strrpos($filePath, '.')+1);
|
184 |
+
if($EXT == $ext) return $filePath;
|
185 |
+
else return $filePath.'.'.$ext;
|
186 |
+
}else return $filePath.'.'.$ext;
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
+
function file_editor_upload($params){
|
191 |
+
global $wpdb, $wp_filesystem;
|
192 |
+
include_once ABSPATH . 'wp-admin/includes/file.php';
|
193 |
+
extract($params);
|
194 |
+
if (!function_exists('gzinflate')) {
|
195 |
+
return array(
|
196 |
+
'error' => 'Gzip library functions are not available.'
|
197 |
+
);
|
198 |
+
}else{
|
199 |
+
$fileContent = gzinflate($fileContent);
|
200 |
+
}
|
201 |
+
if (!$this->is_server_writable()) {
|
202 |
+
return array(
|
203 |
+
'error' => 'Failed, please add FTP details'
|
204 |
+
);
|
205 |
+
}
|
206 |
+
|
207 |
+
$url = wp_nonce_url('index.php?page=iwp_no_page','iwp_fs_cred');
|
208 |
+
ob_start();
|
209 |
+
if (false === ($creds = request_filesystem_credentials($url, '', false, ABSPATH, null) ) ) {
|
210 |
+
return array(
|
211 |
+
'error' => 'Unable to get file system credentials'
|
212 |
+
); // stop processing here
|
213 |
+
}
|
214 |
+
ob_end_clean();
|
215 |
+
|
216 |
+
if ( ! WP_Filesystem($creds, ABSPATH) ) {
|
217 |
+
return array(
|
218 |
+
'error' => 'Unable to initiate file system. Please check you have entered valid FTP credentials.'
|
219 |
+
); // stop processing here
|
220 |
+
}
|
221 |
+
|
222 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php');//will be used to copy from temp directory
|
223 |
+
$temp_folder = untrailingslashit(get_temp_dir());
|
224 |
+
$temp_uniq = 'iwp_'.md5(microtime(1));//should be random
|
225 |
+
while (is_dir($temp_folder .'/'. $temp_uniq )) {
|
226 |
+
$temp_uniq = 'iwp_'.md5(microtime(1));
|
227 |
+
}
|
228 |
+
$new_temp_folder = trailingslashit($temp_folder .'/'. $temp_uniq);
|
229 |
+
$is_dir_created = mkdir($new_temp_folder);// new folder should be empty
|
230 |
+
if(!$is_dir_created){
|
231 |
+
return array(
|
232 |
+
'error' => 'Unable to create a temporary directory.'
|
233 |
+
);
|
234 |
+
}
|
235 |
+
|
236 |
+
$remote_abspath = $wp_filesystem->abspath();
|
237 |
+
if(!empty($remote_abspath)){
|
238 |
+
$remote_abspath = trailingslashit($remote_abspath);
|
239 |
+
}else{
|
240 |
+
return array(
|
241 |
+
'error' => 'Unable to locate WP root directory using file system.'
|
242 |
+
);
|
243 |
+
}
|
244 |
+
|
245 |
+
if($folderPath == 'root' && ($filePath == 'wp-config' || $filePath == 'wp-config.php' ) ){
|
246 |
+
return array(
|
247 |
+
'error' => 'wp-config file is not allowed.'
|
248 |
+
);
|
249 |
+
}
|
250 |
+
|
251 |
+
$file = $this->get_file_editor_vars($remote_abspath,$folderPath,$filePath,$ext);
|
252 |
+
if($file === false){
|
253 |
+
return array('error' => 'File path given is invalid.');
|
254 |
+
}
|
255 |
+
|
256 |
+
$new_temp_subfolders = $new_temp_folder;
|
257 |
+
for($i=0;$i<count($file['toCreate']);$i++){
|
258 |
+
$new_temp_subfolders .= trailingslashit($file['toCreate'][$i]);
|
259 |
+
$is_subdir_created = mkdir($new_temp_subfolders);// new folder should be empty
|
260 |
+
if(!$is_subdir_created){
|
261 |
+
return array(
|
262 |
+
'error' => 'Unable to create a temporary directory.'
|
263 |
+
);
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
$fileHandler = fopen($new_temp_subfolders.$file['name'],w);
|
268 |
+
fwrite($fileHandler,$fileContent);
|
269 |
+
fclose($fileHandler);
|
270 |
+
|
271 |
+
$copy_result = $this->iwp_mmb_direct_to_any_copy_dir($new_temp_folder, $file['toPath']);
|
272 |
+
|
273 |
+
if ( is_wp_error($copy_result) ){
|
274 |
+
$wp_temp_direct2 = new WP_Filesystem_Direct('');
|
275 |
+
$wp_temp_direct2->delete($new_temp_folder, true);
|
276 |
+
return $copy_result;
|
277 |
+
}
|
278 |
+
|
279 |
+
|
280 |
+
|
281 |
+
|
282 |
+
|
283 |
+
return 'success';
|
284 |
+
}
|
285 |
+
|
286 |
+
}
|
addons/google_webmasters/google_webmasters.class.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(basename($_SERVER['SCRIPT_FILENAME']) == "google_webmasters.class.php"):
|
3 |
+
exit;
|
4 |
+
endif;
|
5 |
+
|
6 |
+
|
7 |
+
if(!function_exists('iwp_mmb_create_webmasters_redirect_table')){
|
8 |
+
function iwp_mmb_create_webmasters_redirect_table(){
|
9 |
+
global $wpdb;
|
10 |
+
|
11 |
+
$IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION = get_site_option( 'iwp_webmasters_redirect_table_version' );
|
12 |
+
|
13 |
+
if(version_compare($IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION, '1.0') == -1){
|
14 |
+
|
15 |
+
$table_name = $wpdb->prefix . "iwp_redirects";
|
16 |
+
|
17 |
+
$sql = "
|
18 |
+
CREATE TABLE IF NOT EXISTS $table_name (
|
19 |
+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
20 |
+
`oldLink` varchar(255) NOT NULL,
|
21 |
+
`redirectLink` varchar(255) NOT NULL,
|
22 |
+
PRIMARY KEY (`id`),
|
23 |
+
UNIQUE KEY `oldLink` (`oldLink`)
|
24 |
+
) ENGINE=InnoDB ;
|
25 |
+
";
|
26 |
+
|
27 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
28 |
+
dbDelta( $sql );
|
29 |
+
|
30 |
+
$_NEW_IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION = '1.0';
|
31 |
+
}
|
32 |
+
|
33 |
+
if(!empty($_NEW_IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION)){
|
34 |
+
add_option( "iwp_webmasters_redirect_table_version", $_NEW_IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
class IWP_MMB_GWMT extends IWP_MMB_Core
|
41 |
+
{
|
42 |
+
|
43 |
+
function __construct()
|
44 |
+
{
|
45 |
+
parent::__construct();
|
46 |
+
}
|
47 |
+
|
48 |
+
function google_webmasters_redirect($params){
|
49 |
+
iwp_mmb_create_webmasters_redirect_table();
|
50 |
+
if($params['location']=='htaccess'){
|
51 |
+
$file = ABSPATH.'.htaccess';
|
52 |
+
file_put_contents($file, "\r\n\r\n"."#Redirecting from ".$params['oldLink']." to ".$params['newLink']."\r\nRedirect ".$params['oldLink']." ".$params['newLink'], FILE_APPEND | LOCK_EX);
|
53 |
+
return $params;
|
54 |
+
}else if($params['location']=='database'){
|
55 |
+
global $wpdb;
|
56 |
+
$success = $wpdb->insert($wpdb->base_prefix.'iwp_redirects',array('oldLink'=>rtrim($params['oldLink'],'/'),'redirectLink'=>$params['newLink']));
|
57 |
+
if($success)
|
58 |
+
return $params;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
function google_webmasters_redirect_again($params){
|
63 |
+
iwp_mmb_create_webmasters_redirect_table();
|
64 |
+
if($params['location']=='htaccess'){
|
65 |
+
|
66 |
+
}else if($params['location']=='database'){
|
67 |
+
global $wpdb;
|
68 |
+
$success = $wpdb->update( $wpdb->base_prefix.'iwp_redirects', array('redirectLink' => $params['newLink']), array('oldLink' => rtrim($params['originalLink'],'/'),'redirectLink'=>$params['oldLink']) );
|
69 |
+
if($success)
|
70 |
+
return $params;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
}
|
76 |
+
?>
|
addons/wordfence/wordfence.class.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(basename($_SERVER['SCRIPT_FILENAME']) == "wordfence.class.php"):
|
3 |
+
exit;
|
4 |
+
endif;
|
5 |
+
class IWP_WORDFENCE extends IWP_MMB_Core
|
6 |
+
{
|
7 |
+
function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
}
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Load the Load Previousa Scan Results from WordFence
|
14 |
+
*/
|
15 |
+
function load() {
|
16 |
+
if($this->_checkWordFence()) {
|
17 |
+
|
18 |
+
if(wfUtils::isScanRunning()){
|
19 |
+
return array('scan'=>'yes');
|
20 |
+
} else {
|
21 |
+
return wordfence::ajax_loadIssues_callback();
|
22 |
+
}
|
23 |
+
} else {
|
24 |
+
return array('warning'=>"Word Fence plugin is not activated");
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/*
|
29 |
+
* Start the new scan on WordFence
|
30 |
+
*/
|
31 |
+
function scan() {
|
32 |
+
if($this->_checkWordFence()) {
|
33 |
+
return wordfence::ajax_scan_callback();
|
34 |
+
} else {
|
35 |
+
return array('error'=>"Word Fence plugin is not activated");
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/*
|
40 |
+
* Private function, Will return the wordfence is load or not
|
41 |
+
*/
|
42 |
+
private function _checkWordFence() {
|
43 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
44 |
+
if ( is_plugin_active( 'wordfence/wordfence.php' ) ) {
|
45 |
+
@include_once(WP_PLUGIN_DIR . '/wordfence/wordfence.php');
|
46 |
+
if (class_exists('wordfence')) {
|
47 |
+
return true;
|
48 |
+
} else {
|
49 |
+
return false;
|
50 |
+
}
|
51 |
+
} else {
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
core.class.php
CHANGED
@@ -32,6 +32,7 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
32 |
var $links_instance;
|
33 |
var $user_instance;
|
34 |
var $backup_instance;
|
|
|
35 |
var $installer_instance;
|
36 |
var $iwp_mmb_multisite;
|
37 |
var $network_admin_install;
|
@@ -100,7 +101,7 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
100 |
$this->iwp_mmb_pre_init_filters['get_stats']['iwp_mmb_stats_filter'][] = 'iwp_mmb_pre_init_stats';
|
101 |
|
102 |
$_iwp_mmb_item_filter['pre_init_stats'] = array( 'core_update', 'hit_counter', 'comments', 'backups', 'posts', 'drafts', 'scheduled' );
|
103 |
-
$_iwp_mmb_item_filter['get'] = array( 'updates', 'errors' );
|
104 |
|
105 |
$this->iwp_mmb_pre_init_actions = array(
|
106 |
'backup_req' => 'iwp_mmb_get_backup_req',
|
@@ -162,7 +163,22 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
162 |
|
163 |
'wp_optimize' => 'iwp_mmb_wp_optimize',
|
164 |
|
165 |
-
'backup_repository' => 'iwp_mmb_backup_repository'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
);
|
167 |
|
168 |
add_action('rightnow_end', array( &$this, 'add_right_now_info' ));
|
@@ -312,7 +328,55 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
312 |
|
313 |
return $this->optimize_instance;
|
314 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
/**
|
317 |
* Gets an instance of the Comment class
|
318 |
*
|
@@ -465,7 +529,7 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
465 |
return $this->link_instance;
|
466 |
}
|
467 |
|
468 |
-
|
469 |
{
|
470 |
if (!isset($this->installer_instance)) {
|
471 |
$this->installer_instance = new IWP_MMB_Installer();
|
@@ -473,6 +537,18 @@ class IWP_MMB_Core extends IWP_MMB_Helper
|
|
473 |
return $this->installer_instance;
|
474 |
}
|
475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
/**
|
477 |
* Plugin install callback function
|
478 |
* Check PHP version
|
32 |
var $links_instance;
|
33 |
var $user_instance;
|
34 |
var $backup_instance;
|
35 |
+
var $wordfence_instance;
|
36 |
var $installer_instance;
|
37 |
var $iwp_mmb_multisite;
|
38 |
var $network_admin_install;
|
101 |
$this->iwp_mmb_pre_init_filters['get_stats']['iwp_mmb_stats_filter'][] = 'iwp_mmb_pre_init_stats';
|
102 |
|
103 |
$_iwp_mmb_item_filter['pre_init_stats'] = array( 'core_update', 'hit_counter', 'comments', 'backups', 'posts', 'drafts', 'scheduled' );
|
104 |
+
$_iwp_mmb_item_filter['get'] = array( 'updates', 'errors','plugins_status' );
|
105 |
|
106 |
$this->iwp_mmb_pre_init_actions = array(
|
107 |
'backup_req' => 'iwp_mmb_get_backup_req',
|
163 |
|
164 |
'wp_optimize' => 'iwp_mmb_wp_optimize',
|
165 |
|
166 |
+
'backup_repository' => 'iwp_mmb_backup_repository',
|
167 |
+
|
168 |
+
'get_all_links' => 'iwp_mmb_get_all_links',
|
169 |
+
'update_broken_link' => 'iwp_mmb_update_broken_link',
|
170 |
+
'unlink_broken_link' => 'iwp_mmb_unlink_broken_link',
|
171 |
+
'markasnot_broken_link' => 'iwp_mmb_markasnot_broken_link',
|
172 |
+
'dismiss_broken_link' => 'iwp_mmb_dismiss_broken_link',
|
173 |
+
'undismiss_broken_link' => 'iwp_mmb_undismiss_broken_link',
|
174 |
+
'bulk_actions_processor' => 'iwp_mmb_bulk_actions_processor',
|
175 |
+
|
176 |
+
'file_editor_upload' => 'iwp_mmb_file_editor_upload',
|
177 |
+
|
178 |
+
'put_redirect_url' => 'iwp_mmb_gwmt_redirect_url',
|
179 |
+
'put_redirect_url_again'=> 'iwp_mmb_gwmt_redirect_url_again',
|
180 |
+
'wordfence_scan' => 'iwp_mmb_wordfence_scan',
|
181 |
+
'wordfence_load' => 'iwp_mmb_wordfence_load'
|
182 |
);
|
183 |
|
184 |
add_action('rightnow_end', array( &$this, 'add_right_now_info' ));
|
328 |
|
329 |
return $this->optimize_instance;
|
330 |
}
|
331 |
+
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Gets an instance of the WP_BrokenLinks class
|
335 |
+
*
|
336 |
+
*/
|
337 |
+
function wp_blc_get_blinks()
|
338 |
+
{
|
339 |
+
global $iwp_mmb_plugin_dir;
|
340 |
+
require_once("$iwp_mmb_plugin_dir/addons/brokenlinks/brokenlinks.class.php");
|
341 |
+
if (!isset($this->blc_get_blinks)) {
|
342 |
+
$this->blc_get_blinks = new IWP_MMB_BLC();
|
343 |
+
}
|
344 |
+
|
345 |
+
return $this->blc_get_blinks;
|
346 |
+
}
|
347 |
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Gets an instance of the WP_BrokenLinks class
|
351 |
+
*
|
352 |
+
*/
|
353 |
+
function wp_google_webmasters_crawls()
|
354 |
+
{
|
355 |
+
global $iwp_mmb_plugin_dir;
|
356 |
+
require_once("$iwp_mmb_plugin_dir/addons/google_webmasters/google_webmasters.class.php");
|
357 |
+
if (!isset($this->get_google_webmasters_crawls)) {
|
358 |
+
$this->get_google_webmasters_crawls = new IWP_MMB_GWMT();
|
359 |
+
}
|
360 |
+
|
361 |
+
return $this->get_google_webmasters_crawls;
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Gets an instance of the fileEditor class
|
366 |
+
*
|
367 |
+
*/
|
368 |
+
function wp_get_file_editor()
|
369 |
+
{
|
370 |
+
global $iwp_mmb_plugin_dir;
|
371 |
+
require_once("$iwp_mmb_plugin_dir/addons/file_editor/file_editor.class.php");
|
372 |
+
if (!isset($this->get_file_editor)) {
|
373 |
+
$this->get_file_editor = new IWP_MMB_fileEditor();
|
374 |
+
}
|
375 |
+
|
376 |
+
return $this->get_file_editor;
|
377 |
+
}
|
378 |
+
|
379 |
+
|
380 |
/**
|
381 |
* Gets an instance of the Comment class
|
382 |
*
|
529 |
return $this->link_instance;
|
530 |
}
|
531 |
|
532 |
+
function get_installer_instance()
|
533 |
{
|
534 |
if (!isset($this->installer_instance)) {
|
535 |
$this->installer_instance = new IWP_MMB_Installer();
|
537 |
return $this->installer_instance;
|
538 |
}
|
539 |
|
540 |
+
/*
|
541 |
+
* Get an instance of WordFence
|
542 |
+
*/
|
543 |
+
function get_wordfence_instance()
|
544 |
+
{
|
545 |
+
if (!isset($this->wordfence_instance)) {
|
546 |
+
$this->wordfence_instance = new IWP_WORDFENCE();
|
547 |
+
}
|
548 |
+
return $this->wordfence_instance;
|
549 |
+
}
|
550 |
+
|
551 |
+
|
552 |
/**
|
553 |
* Plugin install callback function
|
554 |
* Check PHP version
|
init.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: InfiniteWP - Client
|
|
4 |
Plugin URI: http://infinitewp.com/
|
5 |
Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
|
6 |
Author: Revmakx
|
7 |
-
Version: 1.2.
|
8 |
Author URI: http://www.revmakx.com
|
9 |
*/
|
10 |
/************************************************************
|
@@ -26,7 +26,7 @@ Author URI: http://www.revmakx.com
|
|
26 |
**************************************************************/
|
27 |
|
28 |
if(!defined('IWP_MMB_CLIENT_VERSION'))
|
29 |
-
define('IWP_MMB_CLIENT_VERSION', '1.2.
|
30 |
|
31 |
|
32 |
if ( !defined('IWP_MMB_XFRAME_COOKIE')){
|
@@ -54,7 +54,6 @@ require_once("$iwp_mmb_plugin_dir/addons/comments/comments.class.php");
|
|
54 |
|
55 |
require_once("$iwp_mmb_plugin_dir/addons/post_links/link.class.php");
|
56 |
require_once("$iwp_mmb_plugin_dir/addons/post_links/post.class.php");
|
57 |
-
|
58 |
require_once("$iwp_mmb_plugin_dir/addons/wp_optimize/optimize.class.php");
|
59 |
|
60 |
require_once("$iwp_mmb_plugin_dir/api.php");
|
@@ -1004,6 +1003,189 @@ if( !function_exists('iwp_mmb_wp_optimize')){
|
|
1004 |
}
|
1005 |
|
1006 |
//WP-Optimize_end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1007 |
if( !function_exists('iwp_mmb_maintenance_mode')){
|
1008 |
function iwp_mmb_maintenance_mode( $params ) {
|
1009 |
global $wp_object_cache;
|
@@ -1169,6 +1351,22 @@ if(!function_exists('iwp_mmb_auto_print')){
|
|
1169 |
}
|
1170 |
}
|
1171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1172 |
$iwp_mmb_core = new IWP_MMB_Core();
|
1173 |
$mmb_core = 1;
|
1174 |
|
@@ -1184,6 +1382,9 @@ if (function_exists('register_deactivation_hook'))
|
|
1184 |
if (function_exists('add_action'))
|
1185 |
add_action('init', 'iwp_mmb_plugin_actions', 99999);
|
1186 |
|
|
|
|
|
|
|
1187 |
if (function_exists('add_filter'))
|
1188 |
add_filter('install_plugin_complete_actions','iwp_mmb_iframe_plugins_fix');
|
1189 |
|
4 |
Plugin URI: http://infinitewp.com/
|
5 |
Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
|
6 |
Author: Revmakx
|
7 |
+
Version: 1.2.9
|
8 |
Author URI: http://www.revmakx.com
|
9 |
*/
|
10 |
/************************************************************
|
26 |
**************************************************************/
|
27 |
|
28 |
if(!defined('IWP_MMB_CLIENT_VERSION'))
|
29 |
+
define('IWP_MMB_CLIENT_VERSION', '1.2.9');
|
30 |
|
31 |
|
32 |
if ( !defined('IWP_MMB_XFRAME_COOKIE')){
|
54 |
|
55 |
require_once("$iwp_mmb_plugin_dir/addons/post_links/link.class.php");
|
56 |
require_once("$iwp_mmb_plugin_dir/addons/post_links/post.class.php");
|
|
|
57 |
require_once("$iwp_mmb_plugin_dir/addons/wp_optimize/optimize.class.php");
|
58 |
|
59 |
require_once("$iwp_mmb_plugin_dir/api.php");
|
1003 |
}
|
1004 |
|
1005 |
//WP-Optimize_end
|
1006 |
+
|
1007 |
+
/*
|
1008 |
+
*WordFence Addon Start
|
1009 |
+
*/
|
1010 |
+
|
1011 |
+
if( !function_exists('iwp_mmb_wordfence_scan')){
|
1012 |
+
function iwp_mmb_wordfence_scan($params){
|
1013 |
+
global $iwp_mmb_core,$iwp_mmb_plugin_dir;
|
1014 |
+
require_once("$iwp_mmb_plugin_dir/addons/wordfence/wordfence.class.php");
|
1015 |
+
$iwp_mmb_core->get_wordfence_instance();
|
1016 |
+
|
1017 |
+
$return = $iwp_mmb_core->wordfence_instance->scan($params);
|
1018 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1019 |
+
iwp_mmb_response($return['error'], false);
|
1020 |
+
else {
|
1021 |
+
iwp_mmb_response($return, true);
|
1022 |
+
}
|
1023 |
+
}
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
if( !function_exists('iwp_mmb_wordfence_load')){
|
1027 |
+
function iwp_mmb_wordfence_load($params){
|
1028 |
+
global $iwp_mmb_core,$iwp_mmb_plugin_dir;
|
1029 |
+
require_once("$iwp_mmb_plugin_dir/addons/wordfence/wordfence.class.php");
|
1030 |
+
$iwp_mmb_core->get_wordfence_instance();
|
1031 |
+
|
1032 |
+
$return = $iwp_mmb_core->wordfence_instance->load($params);
|
1033 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1034 |
+
iwp_mmb_response($return['error'], false);
|
1035 |
+
else {
|
1036 |
+
iwp_mmb_response($return, true);
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
/*
|
1042 |
+
*WordFence Addon End
|
1043 |
+
*/
|
1044 |
+
|
1045 |
+
//WP-BrokenLinks start
|
1046 |
+
|
1047 |
+
if( !function_exists('iwp_mmb_get_all_links')){
|
1048 |
+
function iwp_mmb_get_all_links(){
|
1049 |
+
global $iwp_mmb_core;
|
1050 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1051 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_get_all_links($params);
|
1052 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1053 |
+
iwp_mmb_response($return['error'], false);
|
1054 |
+
else {
|
1055 |
+
iwp_mmb_response($return, true);
|
1056 |
+
}
|
1057 |
+
}
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
if( !function_exists('iwp_mmb_update_broken_link')){
|
1061 |
+
function iwp_mmb_update_broken_link($params){
|
1062 |
+
global $iwp_mmb_core;
|
1063 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1064 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_update_link($params);
|
1065 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1066 |
+
iwp_mmb_response($return['error'], false);
|
1067 |
+
else {
|
1068 |
+
iwp_mmb_response($return, true);
|
1069 |
+
}
|
1070 |
+
}
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
if( !function_exists('iwp_mmb_unlink_broken_link')){
|
1074 |
+
function iwp_mmb_unlink_broken_link($params){
|
1075 |
+
global $iwp_mmb_core;
|
1076 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1077 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_unlink($params);
|
1078 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1079 |
+
iwp_mmb_response($return['error'], false);
|
1080 |
+
else {
|
1081 |
+
iwp_mmb_response($return, true);
|
1082 |
+
}
|
1083 |
+
}
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
if( !function_exists('iwp_mmb_markasnot_broken_link')){
|
1087 |
+
function iwp_mmb_markasnot_broken_link($params){
|
1088 |
+
global $iwp_mmb_core;
|
1089 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1090 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_mark_as_not_broken($params);
|
1091 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1092 |
+
iwp_mmb_response($return['error'], false);
|
1093 |
+
else {
|
1094 |
+
iwp_mmb_response($return, true);
|
1095 |
+
}
|
1096 |
+
}
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
if( !function_exists('iwp_mmb_dismiss_broken_link')){
|
1100 |
+
function iwp_mmb_dismiss_broken_link($params){
|
1101 |
+
global $iwp_mmb_core;
|
1102 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1103 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_dismiss_link($params);
|
1104 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1105 |
+
iwp_mmb_response($return['error'], false);
|
1106 |
+
else {
|
1107 |
+
iwp_mmb_response($return, true);
|
1108 |
+
}
|
1109 |
+
}
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
if( !function_exists('iwp_mmb_undismiss_broken_link')){
|
1113 |
+
function iwp_mmb_undismiss_broken_link($params){
|
1114 |
+
global $iwp_mmb_core;
|
1115 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1116 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_undismiss_link($params);
|
1117 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1118 |
+
iwp_mmb_response($return['error'], false);
|
1119 |
+
else {
|
1120 |
+
iwp_mmb_response($return, true);
|
1121 |
+
}
|
1122 |
+
}
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
if( !function_exists('iwp_mmb_bulk_actions_processor')){
|
1126 |
+
function iwp_mmb_bulk_actions_processor($params){
|
1127 |
+
global $iwp_mmb_core;
|
1128 |
+
$iwp_mmb_core->wp_blc_get_blinks();
|
1129 |
+
$return = $iwp_mmb_core->blc_get_blinks->blc_bulk_actions($params);
|
1130 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1131 |
+
iwp_mmb_response($return['error'], false);
|
1132 |
+
else {
|
1133 |
+
iwp_mmb_response($return, true);
|
1134 |
+
}
|
1135 |
+
}
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
//WP-BrokenLinks end
|
1139 |
+
|
1140 |
+
//WP-GWMTools start
|
1141 |
+
|
1142 |
+
if( !function_exists('iwp_mmb_gwmt_redirect_url')){
|
1143 |
+
function iwp_mmb_gwmt_redirect_url($params){
|
1144 |
+
global $iwp_mmb_core;
|
1145 |
+
$iwp_mmb_core->wp_google_webmasters_crawls();
|
1146 |
+
$return = $iwp_mmb_core->get_google_webmasters_crawls->google_webmasters_redirect($params);
|
1147 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1148 |
+
iwp_mmb_response($return['error'], false);
|
1149 |
+
else {
|
1150 |
+
iwp_mmb_response($return, true);
|
1151 |
+
}
|
1152 |
+
}
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
if( !function_exists('iwp_mmb_gwmt_redirect_url_again')){
|
1156 |
+
function iwp_mmb_gwmt_redirect_url_again($params){
|
1157 |
+
global $iwp_mmb_core;
|
1158 |
+
$iwp_mmb_core->wp_google_webmasters_crawls();
|
1159 |
+
$return = $iwp_mmb_core->get_google_webmasters_crawls->google_webmasters_redirect_again($params);
|
1160 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1161 |
+
iwp_mmb_response($return['error'], false);
|
1162 |
+
else {
|
1163 |
+
iwp_mmb_response($return, true);
|
1164 |
+
}
|
1165 |
+
}
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
|
1169 |
+
//WP-GWMTools end
|
1170 |
+
|
1171 |
+
//fileEditor start
|
1172 |
+
|
1173 |
+
if( !function_exists('iwp_mmb_file_editor_upload')){
|
1174 |
+
function iwp_mmb_file_editor_upload($params){
|
1175 |
+
global $iwp_mmb_core;
|
1176 |
+
$iwp_mmb_core->wp_get_file_editor();
|
1177 |
+
$return = $iwp_mmb_core->get_file_editor->file_editor_upload($params);
|
1178 |
+
if (is_array($return) && array_key_exists('error', $return))
|
1179 |
+
iwp_mmb_response($return['error'], false);
|
1180 |
+
else {
|
1181 |
+
iwp_mmb_response($return, true);
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
|
1187 |
+
//fileEditor end
|
1188 |
+
|
1189 |
if( !function_exists('iwp_mmb_maintenance_mode')){
|
1190 |
function iwp_mmb_maintenance_mode( $params ) {
|
1191 |
global $wp_object_cache;
|
1351 |
}
|
1352 |
}
|
1353 |
|
1354 |
+
if(!function_exists('iwp_mmb_check_redirects')){
|
1355 |
+
function iwp_mmb_check_redirects(){
|
1356 |
+
global $wpdb;
|
1357 |
+
$current_url = ($_SERVER['SERVER_PORT']=='443'?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
1358 |
+
$current_url = rtrim($current_url,'/');
|
1359 |
+
$success = $wpdb -> get_col($wpdb->prepare("SELECT redirectLink FROM ".$wpdb->prefix."iwp_redirects WHERE oldLink = %s LIMIT 1",$current_url));
|
1360 |
+
if(count($success)){
|
1361 |
+
if(function_exists(wp_redirect)){
|
1362 |
+
wp_redirect($success[0]);
|
1363 |
+
}
|
1364 |
+
}
|
1365 |
+
}
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
|
1369 |
+
|
1370 |
$iwp_mmb_core = new IWP_MMB_Core();
|
1371 |
$mmb_core = 1;
|
1372 |
|
1382 |
if (function_exists('add_action'))
|
1383 |
add_action('init', 'iwp_mmb_plugin_actions', 99999);
|
1384 |
|
1385 |
+
if (function_exists('add_action'))
|
1386 |
+
add_action('wp_head', 'iwp_mmb_check_redirects', 99999);
|
1387 |
+
|
1388 |
if (function_exists('add_filter'))
|
1389 |
add_filter('install_plugin_complete_actions','iwp_mmb_iframe_plugins_fix');
|
1390 |
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: infinitewp
|
3 |
Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 3.8
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Install this plugin on unlimited sites and manage them all from a central dashboard.
|
@@ -48,6 +48,10 @@ Credits: [Vladimir Prelovac](http://prelovac.com/vladimir) for his worker plugin
|
|
48 |
|
49 |
== Changelog ==
|
50 |
|
|
|
|
|
|
|
|
|
51 |
= 1.2.8 =
|
52 |
* Fix: Minor security update
|
53 |
|
2 |
Contributors: infinitewp
|
3 |
Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 3.8.2
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Install this plugin on unlimited sites and manage them all from a central dashboard.
|
48 |
|
49 |
== Changelog ==
|
50 |
|
51 |
+
= 1.2.9 =
|
52 |
+
* Improvement: Support for new addons.
|
53 |
+
* Fix: Strict Non-static method set_hit_count() and is_bot() fixed.
|
54 |
+
|
55 |
= 1.2.8 =
|
56 |
* Fix: Minor security update
|
57 |
|
stats.class.php
CHANGED
@@ -343,6 +343,37 @@ class IWP_MMB_Stats extends IWP_MMB_Core
|
|
343 |
|
344 |
return $stats;
|
345 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
|
347 |
function pre_init_stats($params)
|
348 |
{
|
@@ -546,7 +577,7 @@ class IWP_MMB_Stats extends IWP_MMB_Core
|
|
546 |
return $stats;
|
547 |
}
|
548 |
|
549 |
-
function set_hit_count($fix_count = false)
|
550 |
{
|
551 |
global $iwp_mmb_core;
|
552 |
if ($fix_count || (!is_admin() && !IWP_MMB_Stats::is_bot())) {
|
@@ -610,7 +641,7 @@ class IWP_MMB_Stats extends IWP_MMB_Core
|
|
610 |
return get_option('iwp_client_user_hit_count');
|
611 |
}
|
612 |
|
613 |
-
function is_bot()
|
614 |
{
|
615 |
$agent = $_SERVER['HTTP_USER_AGENT'];
|
616 |
|
343 |
|
344 |
return $stats;
|
345 |
}
|
346 |
+
|
347 |
+
function get_plugins_status($stats=array(), $options = array()){
|
348 |
+
$installedPlugins = get_plugins( $plugin_folder );
|
349 |
+
$activePlugins = get_option( 'active_plugins' );
|
350 |
+
|
351 |
+
foreach ($installedPlugins as $installed=>$pluginDetails) {
|
352 |
+
$pluginData = array('isInstalled' => true);
|
353 |
+
$pluginData['name'] = $pluginDetails['Name'];
|
354 |
+
$pluginData['pluginURI'] = $pluginDetails['PluginURI'];
|
355 |
+
$pluginData['version'] = $pluginDetails['Version'];
|
356 |
+
$pluginData['description'] = $pluginDetails['Description'];
|
357 |
+
$pluginData['author'] = $pluginDetails['Author'];
|
358 |
+
$pluginData['authorURI'] = $pluginDetails['AuthorURI'];
|
359 |
+
$pluginData['textDomain'] = $pluginDetails['TextDomain'];
|
360 |
+
$pluginData['domainPath'] = $pluginDetails['DomainPath'];
|
361 |
+
$pluginData['network'] = $pluginDetails['Network'];
|
362 |
+
$pluginData['title'] = $pluginDetails['Title'];
|
363 |
+
$pluginData['authorName'] = $pluginDetails['AuthorName'];
|
364 |
+
// $pluginData['']
|
365 |
+
if (in_array($installed, $activePlugins)){
|
366 |
+
$pluginData['isActivated'] = true;
|
367 |
+
// $stats['plugins_status'][$installed] = array(true,true);
|
368 |
+
}else{
|
369 |
+
$pluginData['isActivated'] = false;
|
370 |
+
// $stats['plugins_status'][$installed] = array(true,false);
|
371 |
+
}
|
372 |
+
$stats['plugins_status'][$installed] = $pluginData;
|
373 |
+
}
|
374 |
+
|
375 |
+
return $stats;
|
376 |
+
}
|
377 |
|
378 |
function pre_init_stats($params)
|
379 |
{
|
577 |
return $stats;
|
578 |
}
|
579 |
|
580 |
+
public static function set_hit_count($fix_count = false)
|
581 |
{
|
582 |
global $iwp_mmb_core;
|
583 |
if ($fix_count || (!is_admin() && !IWP_MMB_Stats::is_bot())) {
|
641 |
return get_option('iwp_client_user_hit_count');
|
642 |
}
|
643 |
|
644 |
+
public static function is_bot()
|
645 |
{
|
646 |
$agent = $_SERVER['HTTP_USER_AGENT'];
|
647 |
|