wpCentral - Version 1.4.4

Version Description

  • wpCentral promotional notice on admin panel after a day has passed since the plugin was activated.
Download this release

Release Info

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

Code changes from version 1.4.3 to 1.4.4

Files changed (3) hide show
  1. readme.txt +5 -2
  2. wpc_functions.php +158 -0
  3. wpcentral.php +13 -1
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.3
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://www.softaculous.com/support/open.php.
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.3 =
44
  * wpCentral notice on admin panel can now be dismissed manually.
45
  * Added remove directory file function.
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
 
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
 
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
+
46
  = 1.4.3 =
47
  * wpCentral notice on admin panel can now be dismissed manually.
48
  * Added remove directory file function.
wpc_functions.php CHANGED
@@ -2770,4 +2770,162 @@ function wpc_rmdir_recursive($path){
2770
  function wpc_resetfilelist(){
2771
  global $directorylist;
2772
  $directorylist = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2773
  }
2770
  function wpc_resetfilelist(){
2771
  global $directorylist;
2772
  $directorylist = array();
2773
+ }
2774
+
2775
+ /* Ratings Notice HTML
2776
+ *
2777
+ * @since 1.4.4
2778
+ */
2779
+ function wpc_show_promo(){
2780
+ global $wpc_promo_opts;
2781
+ $opts = $wpc_promo_opts;
2782
+
2783
+ echo '
2784
+ <style>
2785
+ .wpc_promo_button {
2786
+ background-color: #4CAF50; /* Green */
2787
+ border: none;
2788
+ color: white;
2789
+ padding: 6px 10px;
2790
+ text-align: center;
2791
+ text-decoration: none;
2792
+ display: inline-block;
2793
+ font-size: 13px;
2794
+ margin: 4px 2px;
2795
+ -webkit-transition-duration: 0.4s; /* Safari */
2796
+ transition-duration: 0.4s;
2797
+ cursor: pointer;
2798
+ }
2799
+
2800
+ .wpc_promo_button:focus{
2801
+ border: none;
2802
+ color: white;
2803
+ }
2804
+
2805
+ .wpc_promo_button1 {
2806
+ color: white;
2807
+ background-color: #4CAF50;
2808
+ border:3px solid #4CAF50;
2809
+ }
2810
+
2811
+ .wpc_promo_button1:hover {
2812
+ box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
2813
+ color: white;
2814
+ border:3px solid #4CAF50;
2815
+ }
2816
+
2817
+ .wpc_promo_button2 {
2818
+ color: white;
2819
+ background-color: #0085ba;
2820
+ }
2821
+
2822
+ .wpc_promo_button2:hover {
2823
+ box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
2824
+ color: white;
2825
+ }
2826
+
2827
+ .wpc_promo_button3 {
2828
+ color: white;
2829
+ background-color: #365899;
2830
+ }
2831
+
2832
+ .wpc_promo_button3:hover {
2833
+ box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
2834
+ color: white;
2835
+ }
2836
+
2837
+ .wpc_promo_button4 {
2838
+ color: white;
2839
+ background-color: rgb(66, 184, 221);
2840
+ }
2841
+
2842
+ .wpc_promo_button4:hover {
2843
+ box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
2844
+ color: white;
2845
+ }
2846
+
2847
+ .wpc_promo-close{
2848
+ float:right;
2849
+ text-decoration:none;
2850
+ margin: 5px 10px 0px 0px;
2851
+ }
2852
+
2853
+ .wpc_promo-close:hover{
2854
+ color: red;
2855
+ }
2856
+ </style>
2857
+
2858
+ <script>
2859
+ jQuery(document).ready( function() {
2860
+ (function($) {
2861
+ $("#wpc_promo .wpc_promo-close").click(function(){
2862
+ var data;
2863
+
2864
+ // Hide it
2865
+ $("#wpc_promo").hide();
2866
+
2867
+ // Save this preference
2868
+ $.post("'.admin_url('?wpcentral_promo=0').'", data, function(response) {
2869
+ //alert(response);
2870
+ });
2871
+ });
2872
+ })(jQuery);
2873
+ });
2874
+ </script>
2875
+
2876
+ <div class="notice notice-success" id="wpc_promo" style="min-height:90px">
2877
+ <a class="wpc_promo-close" href="javascript:" aria-label="Dismiss this Notice">
2878
+ <span class="dashicons dashicons-dismiss"></span> Dismiss
2879
+ </a>';
2880
+
2881
+ if(!empty($opts['image'])){
2882
+ echo '<a href="'.$opts['website'].'"><img src="'.$opts['image'].'" style="float:left; margin:10px 20px 10px 10px" width="67" /></a>';
2883
+ }
2884
+
2885
+ echo '
2886
+ <p style="font-size:13px">We are glad you like <a href="'.$opts['website'].'"><b>wpCentral</b></a> and have been using it since the past few days. It is time to take the next step !</p>
2887
+ <p>
2888
+ '.(empty($opts['rating']) ? '' : '<a class="wpc_promo_button wpc_promo_button2" target="_blank" href="'.$opts['rating'].'">Rate it 5★\'s</a>').'
2889
+ '.(empty($opts['facebook']) ? '' : '<a class="wpc_promo_button wpc_promo_button3" target="_blank" href="'.$opts['facebook'].'"><span class="dashicons dashicons-thumbs-up"></span> Facebook</a>').'
2890
+ '.(empty($opts['twitter']) ? '' : '<a class="wpc_promo_button wpc_promo_button4" target="_blank" href="'.$opts['twitter'].'"><span class="dashicons dashicons-twitter"></span> Tweet</a>').'
2891
+ '.(empty($opts['website']) ? '' : '<a class="wpc_promo_button wpc_promo_button4" target="_blank" href="'.$opts['website'].'">Visit our website</a>').'
2892
+ '.(empty($opts['support']) ? '' : '<a class="wpc_promo_button wpc_promo_button4" target="_blank" href="'.$opts['support'].'">wpCentral Support</a>').'
2893
+ </p>
2894
+ </div>';
2895
+ }
2896
+
2897
+ /* Show Ratings Notice
2898
+ *
2899
+ * @since 1.4.4
2900
+ */
2901
+ 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
  }
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.3
7
  Author: Softaculous Ltd.
8
  Author URI: https://wpcentral.co
9
  License: GPL2
@@ -62,4 +62,16 @@ if(is_plugin_active($wpc_slug)){
62
  }else{
63
  add_action('wp_ajax_nopriv_my_wpc_signon', 'my_wpc_signon');
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
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
62
  }else{
63
  add_action('wp_ajax_nopriv_my_wpc_signon', 'my_wpc_signon');
64
  }
65
+
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',
73
+ 'website' => 'https://wpcentral.co',
74
+ 'image' => 'https://wpcentral.co/images/icon_dark.png',
75
+ 'support' => 'https://softaculous.deskuss.com'
76
+ ]);
77
  }