wpCentral - Version 1.4.1

Version Description

  • Added support and documentation links to the plugin notice.
  • Activate Plugins after installation
  • Use function call_user_func_array for more than one argument.
  • Check if the user account is suphp or non-suphp
Download this release

Release Info

Developer softacpriya
Plugin Icon 128x128 wpCentral
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.4 to 1.4.1

Files changed (6) hide show
  1. actions.php +14 -5
  2. file_actions.php +7 -2
  3. readme.txt +8 -2
  4. verify.php +3 -1
  5. wpc_functions.php +70 -5
  6. wpcentral.php +1 -4
actions.php CHANGED
@@ -74,7 +74,7 @@ function wpc_site_actions(){
74
  }
75
 
76
  if(wpc_optGET('plugins') || wpc_optGET('plugin')){
77
- $plugins = urldecode($_REQUEST['plugins']);
78
  $arr_plugins = explode(',', $plugins);
79
 
80
  if($request == 'activate'){//Activate
@@ -104,7 +104,7 @@ function wpc_site_actions(){
104
  }
105
  }elseif($request == 'install'){//Install Plugins
106
 
107
- $sources = urldecode($_REQUEST['sources']);
108
  $arr_sources = explode(',', $sources);
109
 
110
  $all_installed_plugins = array();
@@ -130,7 +130,16 @@ function wpc_site_actions(){
130
  @wpc_sunlink($download_dest);
131
 
132
  //Activate the installed plugin(s)
133
- $all_installed_plugins[] = wpc_get_plugin_path(ABSPATH.'wp-content/plugins/'.$plval, $plval);
 
 
 
 
 
 
 
 
 
134
  }
135
 
136
  //Activate the installed plugins
@@ -167,7 +176,7 @@ function wpc_site_actions(){
167
  }
168
  }elseif(wpc_optGET('themes') || wpc_optGET('theme')){
169
 
170
- $themes = urldecode(wpc_optGET('themes'));
171
  $arr_themes = explode(',', $themes);
172
 
173
  $active_theme = array_keys(wpc_get_active_theme());
@@ -201,7 +210,7 @@ function wpc_site_actions(){
201
 
202
  }elseif($request == 'install'){//Install Themes
203
 
204
- $sources = urldecode($_REQUEST['sources']);
205
  $arr_sources = explode(',', $sources);
206
 
207
  foreach($arr_themes as $thk => $thval){
74
  }
75
 
76
  if(wpc_optGET('plugins') || wpc_optGET('plugin')){
77
+ $plugins = urldecode(wpc_optREQ('plugins'));
78
  $arr_plugins = explode(',', $plugins);
79
 
80
  if($request == 'activate'){//Activate
104
  }
105
  }elseif($request == 'install'){//Install Plugins
106
 
107
+ $sources = urldecode(wpc_optREQ('sources'));
108
  $arr_sources = explode(',', $sources);
109
 
110
  $all_installed_plugins = array();
130
  @wpc_sunlink($download_dest);
131
 
132
  //Activate the installed plugin(s)
133
+ $pl_slug = $plval;
134
+ if(preg_match('/(.*?)\/(.*?)\.php/is', $plval)){
135
+ wpc_soft_preg_replace('/(.*?)\/(.*?)\.php/is', $plval, $pl_slug, 1, 1);
136
+ }
137
+
138
+ if(empty($pl_slug)){//This is the case for the default Hello Dolly plugin that comes installed with the initial WP package
139
+ continue;
140
+ }
141
+
142
+ $all_installed_plugins[] = wpc_get_plugin_path(ABSPATH.'wp-content/plugins/'.$pl_slug, $pl_slug);
143
  }
144
 
145
  //Activate the installed plugins
176
  }
177
  }elseif(wpc_optGET('themes') || wpc_optGET('theme')){
178
 
179
+ $themes = urldecode(wpc_optREQ('themes'));
180
  $arr_themes = explode(',', $themes);
181
 
182
  $active_theme = array_keys(wpc_get_active_theme());
210
 
211
  }elseif($request == 'install'){//Install Themes
212
 
213
+ $sources = urldecode(wpc_optREQ('sources'));
214
  $arr_sources = explode(',', $sources);
215
 
216
  foreach($arr_themes as $thk => $thval){
file_actions.php CHANGED
@@ -33,11 +33,16 @@ function wpc_file_actions(){
33
  die();
34
  }
35
 
36
- $args = urldecode(wpc_optREQ('args'));
 
37
 
38
  if(function_exists('wpc_'.$action)){
39
  if(!empty($args)){
40
- $func_response = call_user_func('wpc_'.$action, $args);
 
 
 
 
41
  }else{
42
  $func_response = call_user_func('wpc_'.$action);
43
  }
33
  die();
34
  }
35
 
36
+ $str_args = urldecode(wpc_optREQ('args'));
37
+ $args = explode(',', $str_args);
38
 
39
  if(function_exists('wpc_'.$action)){
40
  if(!empty($args)){
41
+ if(count($args) > 1){
42
+ $func_response = call_user_func_array('wpc_'.$action, $args);
43
+ }else{
44
+ $func_response = call_user_func('wpc_'.$action, $str_args);
45
+ }
46
  }else{
47
  $func_response = call_user_func('wpc_'.$action);
48
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: wpcentral, softaculous, sites, manage sites, backup, plugins, themes, mana
4
  Requires at least: 4.4
5
  Tested up to: 5.0.3
6
  Requires PHP: 5.3
7
- Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -22,7 +22,7 @@ Key Features:
22
 
23
  * You can also create Sets of common Plugins and Themes which you want to install on multiple websites together.
24
 
25
- * If you are worried about loosing your data anytime in the future, we, hereby, resolve all your stress by providing you with the backup feature of your websites. In an unfortunate event, when you loose your website or your website gets corrupted, you can even restore the backup taken previously.
26
 
27
  * A new WordPress update is out and you are all stressed up to update your websites? No worries, wpcentral helps you achieve the same without the need to go into the dashboard of each website separately.
28
 
@@ -40,6 +40,12 @@ Should you have any suggestions to improve wpcentral, want to see some related f
40
 
41
  == Changelog ==
42
 
 
 
 
 
 
 
43
  = 1.4 =
44
  * Added validation on TLS connections.
45
 
4
  Requires at least: 4.4
5
  Tested up to: 5.0.3
6
  Requires PHP: 5.3
7
+ Stable tag: 1.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
22
 
23
  * You can also create Sets of common Plugins and Themes which you want to install on multiple websites together.
24
 
25
+ * If you are worried about losing your data anytime in the future, we, hereby, resolve all your stress by providing you with the backup feature of your websites. In an unfortunate event, when you loose your website or your website gets corrupted, you can even restore the backup taken previously.
26
 
27
  * A new WordPress update is out and you are all stressed up to update your websites? No worries, wpcentral helps you achieve the same without the need to go into the dashboard of each website separately.
28
 
40
 
41
  == Changelog ==
42
 
43
+ = 1.4.1 =
44
+ * Added support and documentation links to the plugin notice.
45
+ * Activate Plugins after installation
46
+ * Use function call_user_func_array for more than one argument.
47
+ * Check if the user account is suphp or non-suphp
48
+
49
  = 1.4 =
50
  * Added validation on TLS connections.
51
 
verify.php CHANGED
@@ -34,7 +34,9 @@ function wpc_verify($auth_key = ''){
34
  }
35
  }
36
 
37
- $site_settings['wpc_backupdir'] = $wp_config['plugins_root_dir'].'/wp-central/'.wpc_srandstr(64);
 
 
38
 
39
  $return['data'] = $site_settings;
40
 
34
  }
35
  }
36
 
37
+ $site_settings['wpc_backupdir'] = $wp_config['plugins_root_dir'].'/wp-central/'.(!empty($auth_key) ? $auth_key : wpc_optREQ('auth_key'));
38
+
39
+ $site_settings['createdir'] = wpc_can_createdir($site_settings['wpc_backupdir']);
40
 
41
  $return['data'] = $site_settings;
42
 
wpc_functions.php CHANGED
@@ -2119,11 +2119,14 @@ function wpc_modal_dialog(){
2119
  <ol>
2120
  <li>Copy the connection key below</li>
2121
  <li>Log into your <a href="https://panel.wpcentral.co/" target="_blank">wpcentral</a> account</li>
2122
- <li>Click on Add website to add you website to wpcentral.</li>
2123
  <li>Enter this website\'s URL and paste the Connection key given below.</li>
 
2124
  </ol>
 
 
2125
 
2126
- <div style="text-align: center;font-weight: bold;"><p style="margin-bottom: 4px;margin-top: 20px;">wpcentral Connection Key</p></div>
2127
  <div style="padding: 10px;background-color: #fafafa;border: 1px solid black;border-radius: 10px;font-weight: bold;font-size: 14px;text-align: center;">'.wpc_get_connection_key().'</div>
2128
  </div>';
2129
 
@@ -2326,6 +2329,23 @@ function wpc_self_deactivate(){
2326
  return true;
2327
  }
2328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2329
  /**
2330
  * WPCentral action handler
2331
  *
@@ -2373,7 +2393,45 @@ function my_wpc_actions_init(){
2373
  include_once('file_actions.php');
2374
  wpc_file_actions();
2375
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2376
  }
 
 
2377
  }
2378
 
2379
  /**
@@ -2478,7 +2536,7 @@ function wpc_admin_notice(){
2478
 
2479
  .wpc_notice{
2480
  background-color: #fff;
2481
- height: 300px;
2482
  align-items: center;
2483
  display: flex;
2484
  text-align: center;
@@ -2490,7 +2548,7 @@ function wpc_admin_notice(){
2490
  </style>
2491
 
2492
  <div class="updated wpc_notice">
2493
- <div style="width:100%;">
2494
  <div class="wpc_main_head">
2495
  <img src="http://wpcentral.co/images/icon_dark.png" style="height:40px; padding:5px 0;">
2496
  <img src="http://wpcentral.co/images/logo_dark.png" alt="wpcentral" title="wpcentral" style="height:40px; padding:5px 0;">
@@ -2498,7 +2556,14 @@ function wpc_admin_notice(){
2498
  <div class="wpc_sub_head"><b>Go to <a href="https://panel.wpcentral.co" target="_blank">panel.wpcentral.co</a> and add your website with the following details: </b></div>
2499
  <div class="wpc_head"><br /><b>Website URL:</b></div><div>'.get_option('siteurl').'</div>
2500
  <div class="wpc_head"><br /><b>wpCentral Connection Key:</b></div><div>'.get_option('wpcentral_auth_key').'</div><br />
2501
- <div><a class="wpc_flat-butt wpc_sub_head" href="https://wpcentral.co" target="_blank">Learn More</a></div>
 
 
 
 
 
 
 
2502
  </div>
2503
  </div>';
2504
  }
2119
  <ol>
2120
  <li>Copy the connection key below</li>
2121
  <li>Log into your <a href="https://panel.wpcentral.co/" target="_blank">wpcentral</a> account</li>
2122
+ <li>Click on Add website to add your website to wpcentral.</li>
2123
  <li>Enter this website\'s URL and paste the Connection key given below.</li>
2124
+ <li>You can also follow our guide for the same <a href="https://wpcentral.co/docs/getting-started/adding-website-in-wpcentral/" target="_blank">here</a>.</li>
2125
  </ol>
2126
+
2127
+ <p style="font-weight:bold;">Note: Contact wpCentral Team at support@wpcentral.co for any issues</p>
2128
 
2129
+ <div style="text-align:center; font-weight:bold;"><p style="margin-bottom: 4px;margin-top: 20px;">wpcentral Connection Key</p></div>
2130
  <div style="padding: 10px;background-color: #fafafa;border: 1px solid black;border-radius: 10px;font-weight: bold;font-size: 14px;text-align: center;">'.wpc_get_connection_key().'</div>
2131
  </div>';
2132
 
2329
  return true;
2330
  }
2331
 
2332
+ /**
2333
+ * Test if we are able to create a directory
2334
+ *
2335
+ * @returns bool
2336
+ * @since 1.4
2337
+ */
2338
+ function wpc_test_createdir($path){
2339
+
2340
+ wpc_mkdir($path);
2341
+
2342
+ if(wpc_is_dir($path)){
2343
+ return true;
2344
+ }
2345
+
2346
+ return true;
2347
+ }
2348
+
2349
  /**
2350
  * WPCentral action handler
2351
  *
2393
  include_once('file_actions.php');
2394
  wpc_file_actions();
2395
  break;
2396
+
2397
+ case 'connectok':
2398
+ wpc_connectok();
2399
+ break;
2400
+
2401
+ case 'can_createdir':
2402
+ wpc_can_createdir();
2403
+ break;
2404
+ }
2405
+ }
2406
+
2407
+ function wpc_can_createdir($path = ''){
2408
+ global $wp_config;
2409
+
2410
+ if(empty($path)){
2411
+ $path = $wp_config['plugins_root_dir'].'/wp-central/'.wpc_optREQ('testpath');
2412
+ }
2413
+
2414
+ if(wpc_is_dir($path)){
2415
+ $path = $wp_config['plugins_root_dir'].'/wp-central/'.wpc_srandstr(16);
2416
+ }
2417
+
2418
+ wpc_mkdir($path);
2419
+
2420
+ $resp = 0;
2421
+ if(wpc_is_dir($path)){
2422
+ $resp = 1;
2423
+ }
2424
+
2425
+ @rmdir($path);
2426
+
2427
+ if(isset($_GET['testpath'])){
2428
+ $return = array();
2429
+ $return['can_create'] = $resp;
2430
+
2431
+ echo json_encode($return);
2432
  }
2433
+
2434
+ return $resp;
2435
  }
2436
 
2437
  /**
2536
 
2537
  .wpc_notice{
2538
  background-color: #fff;
2539
+ height: 320px;
2540
  align-items: center;
2541
  display: flex;
2542
  text-align: center;
2548
  </style>
2549
 
2550
  <div class="updated wpc_notice">
2551
+ <div style="width:100%;"><br />
2552
  <div class="wpc_main_head">
2553
  <img src="http://wpcentral.co/images/icon_dark.png" style="height:40px; padding:5px 0;">
2554
  <img src="http://wpcentral.co/images/logo_dark.png" alt="wpcentral" title="wpcentral" style="height:40px; padding:5px 0;">
2556
  <div class="wpc_sub_head"><b>Go to <a href="https://panel.wpcentral.co" target="_blank">panel.wpcentral.co</a> and add your website with the following details: </b></div>
2557
  <div class="wpc_head"><br /><b>Website URL:</b></div><div>'.get_option('siteurl').'</div>
2558
  <div class="wpc_head"><br /><b>wpCentral Connection Key:</b></div><div>'.get_option('wpcentral_auth_key').'</div><br />
2559
+ <div class="wpc_sub_head">
2560
+ <b>Note: Contact wpCentral Team for any issues at support@wpcentral.co</b>
2561
+ </div>
2562
+ <div>
2563
+ <p style="display:inline-block; padding:0 20px;"><a class="wpc_flat-butt wpc_sub_head" href="https://wpcentral.co" target="_blank">Visit Website</a></p>
2564
+
2565
+ <p style="display:inline-block; padding:0 20px;"><a class="wpc_flat-butt wpc_sub_head" href="https://wpcentral.co/docs/getting-started/adding-website-in-wpcentral/" target="_blank">View Connection Guide</a></p>
2566
+ </div><br />
2567
  </div>
2568
  </div>';
2569
  }
wpcentral.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wpCentral
4
  Plugin URI: https://wpcentral.co
5
  Description: wpCentral provides a centralized area where you can manage all your WordPress websites singularly, unitedly as well as efficiently.
6
- Version: 1.4
7
  Author: Softaculous Ltd.
8
  Author URI: https://wpcentral.co
9
  License: GPL2
@@ -32,15 +32,12 @@ include_once('wpc_functions.php');
32
 
33
  add_filter('all_plugins', 'wpc_plugin_info_filter', 10, 1);
34
  add_filter('all_plugins', 'wpc_plugins_list_filter', 10, 1);
35
- add_filter('plugin_row_meta', 'wpc_hide_plugin_details', 10, 2);
36
- add_filter('site_transient_update_plugins', 'wpc_parse_update_plugins', 10, 1);
37
 
38
  //WPC Activation Hook
39
  register_activation_hook(__FILE__, 'wpc_activation_hook');
40
  //WPC De-activation Hook
41
  register_deactivation_hook(__FILE__, 'wpc_deactivation_hook');
42
 
43
-
44
  //Add link to show the Connection key once the plugin is activated
45
  if(is_plugin_active($wpc_slug)){
46
  add_action('admin_init', 'wpc_enqueue_script');
3
  Plugin Name: wpCentral
4
  Plugin URI: https://wpcentral.co
5
  Description: wpCentral provides a centralized area where you can manage all your WordPress websites singularly, unitedly as well as efficiently.
6
+ Version: 1.4.1
7
  Author: Softaculous Ltd.
8
  Author URI: https://wpcentral.co
9
  License: GPL2
32
 
33
  add_filter('all_plugins', 'wpc_plugin_info_filter', 10, 1);
34
  add_filter('all_plugins', 'wpc_plugins_list_filter', 10, 1);
 
 
35
 
36
  //WPC Activation Hook
37
  register_activation_hook(__FILE__, 'wpc_activation_hook');
38
  //WPC De-activation Hook
39
  register_deactivation_hook(__FILE__, 'wpc_deactivation_hook');
40
 
 
41
  //Add link to show the Connection key once the plugin is activated
42
  if(is_plugin_active($wpc_slug)){
43
  add_action('admin_init', 'wpc_enqueue_script');