wpCentral - Version 1.4.5

Version Description

  • wpCentral promotional notice on admin panel to be displayed only when the website is connected to wpCentral panel.
Download this release

Release Info

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

Code changes from version 1.4.4 to 1.4.5

Files changed (3) hide show
  1. readme.txt +5 -2
  2. wpc_functions.php +18 -12
  3. wpcentral.php +2 -2
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.2
6
Requires PHP: 5.3
7
- Stable tag: 1.4.4
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -28,7 +28,7 @@ Key Features:
28
29
Many more to come! We have a number of other features in our To Do list which we will be adding in the upcoming versions, so stay tuned!
30
31
- Should you have any suggestions to improve wpcentral, want to see some related features in wpcentral to help you in the websites management or if you have any queries, you can open a ticket with us at https://softaculous.deskuss.com.
32
33
== Installation ==
34
1. Upload the plugin folder to your /wp-content/plugins/ folder
@@ -40,6 +40,9 @@ Should you have any suggestions to improve wpcentral, want to see some related f
40
41
== Changelog ==
42
43
= 1.4.4 =
44
* wpCentral promotional notice on admin panel after a day has passed since the plugin was activated.
45
4
Requires at least: 4.4
5
Tested up to: 5.2
6
Requires PHP: 5.3
7
+ Stable tag: 1.4.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
28
29
Many more to come! We have a number of other features in our To Do list which we will be adding in the upcoming versions, so stay tuned!
30
31
+ Should you have any suggestions to improve wpcentral, want to see some related features in wpcentral to help you in the websites management or if you have any queries, you can open a ticket with us at https://softaculous.deskuss.com/open.php
32
33
== Installation ==
34
1. Upload the plugin folder to your /wp-content/plugins/ folder
40
41
== Changelog ==
42
43
+ = 1.4.5 =
44
+ * wpCentral promotional notice on admin panel to be displayed only when the website is connected to wpCentral panel.
45
+
46
= 1.4.4 =
47
* wpCentral promotional notice on admin panel after a day has passed since the plugin was activated.
48
wpc_functions.php CHANGED
@@ -2063,6 +2063,7 @@ function wpc_deactivation_hook(){
2063
delete_option('wpcentral_auth_key');
2064
delete_option('wpcentral_connected');
2065
delete_option('wpc_dismiss_notice_date');
2066
return true;
2067
}
2068
@@ -2902,30 +2903,35 @@ function wpc_maybe_promo($opts){
2902
2903
global $wpc_promo_opts;
2904
2905
- // There must be an interval
2906
if(empty($opts['interval'])){
2907
return false;
2908
}
2909
2910
// Are we to show a promo
2911
$opt_name = 'wpcentral_promo_time';
2912
- $promo_time = get_option($opt_name);
2913
2914
- // First time access
2915
- if(empty($promo_time)){
2916
- update_option($opt_name, time() + (!empty($opts['after']) ? $opts['after'] * 86400 : 0));
2917
- $promo_time = get_option($opt_name);
2918
- }
2919
2920
- // Is there interval elapsed
2921
- if(time() > $promo_time){
2922
- $wpc_promo_opts = $opts;
2923
- add_action('admin_notices', 'wpc_show_promo');
2924
}
2925
2926
// Are we to disable the promo
2927
if(isset($_GET['wpcentral_promo']) && (int)$_GET['wpcentral_promo'] == 0){
2928
update_option($opt_name, time() + ($opts['interval'] * 86400));
2929
die('DONE');
2930
- }
2931
}
2063
delete_option('wpcentral_auth_key');
2064
delete_option('wpcentral_connected');
2065
delete_option('wpc_dismiss_notice_date');
2066
+ delete_option('wpcentral_promo_time');
2067
return true;
2068
}
2069
2903
2904
global $wpc_promo_opts;
2905
2906
+ // There must be an interval after which the notice will appear again
2907
if(empty($opts['interval'])){
2908
return false;
2909
}
2910
2911
// Are we to show a promo
2912
$opt_name = 'wpcentral_promo_time';
2913
+ $promo_time = wpc_get_option($opt_name);
2914
2915
+ //Check if it is connected to wpCentral panel
2916
+ $connected = wpc_get_option('wpcentral_connected');
2917
2918
+ //Display only if the website is connected to wpCentral panel and a day has passed since the connection or 3 months have passed since the last dismissal
2919
+ if(!empty($connected)){
2920
+ if(empty($promo_time)){
2921
+ update_option($opt_name, time() + (!empty($opts['after']) ? $opts['after'] * 86400 : 0));
2922
+ $promo_time = wpc_get_option($opt_name);
2923
+ }
2924
+
2925
+ // Is there interval elapsed
2926
+ if(time() > $promo_time){
2927
+ $wpc_promo_opts = $opts;
2928
+ add_action('admin_notices', 'wpc_show_promo');
2929
+ }
2930
}
2931
2932
// Are we to disable the promo
2933
if(isset($_GET['wpcentral_promo']) && (int)$_GET['wpcentral_promo'] == 0){
2934
update_option($opt_name, time() + ($opts['interval'] * 86400));
2935
die('DONE');
2936
+ }
2937
}
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.4
7
Author: Softaculous Ltd.
8
Author URI: https://wpcentral.co
9
License: GPL2
@@ -66,7 +66,7 @@ if(is_plugin_active($wpc_slug)){
66
// Show wpCentral ratings notice
67
wpc_maybe_promo([
68
'after' => 1,// In days
69
- 'interval' => 30,// In days
70
'rating' => 'https://wordpress.org/plugins/wp-central/#reviews',
71
'twitter' => 'https://twitter.com/the_wpcentral?status='.rawurlencode('I love #wpCentral by @the_wpcentral team for my #WordPress site - '.home_url()),
72
'facebook' => 'https://www.facebook.com/wordpresscentral',
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.5
7
Author: Softaculous Ltd.
8
Author URI: https://wpcentral.co
9
License: GPL2
66
// Show wpCentral ratings notice
67
wpc_maybe_promo([
68
'after' => 1,// In days
69
+ 'interval' => 120,// In days
70
'rating' => 'https://wordpress.org/plugins/wp-central/#reviews',
71
'twitter' => 'https://twitter.com/the_wpcentral?status='.rawurlencode('I love #wpCentral by @the_wpcentral team for my #WordPress site - '.home_url()),
72
'facebook' => 'https://www.facebook.com/wordpresscentral',