l3rady / wp-updates-notifier

Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates.
29 stars 22 forks source link

Ignored plugins not reminded in the following emails #10

Closed oavs closed 10 years ago

oavs commented 10 years ago

Hi, I am not a coder but I can figure some things. I tried to improve some of the content in the email as you will see below. I still have some issues with it and hoping you can solve them.

  1. Not receiving plugin notifications. For example when I receive (for first time) 1 x notification of plugin ABC 1 x notification of plugin XXX And If I choose to ignore the above updates and do not go ahead, next time around when I receive a notification it does not lists the same plugin/s updates (such as ABC and plugin XXX listed above) It only lists some other plugin is due for update.
  2. Why is it that test does not list all the plugins due for updates. It only lists them in the real email sent to the user.
  3. And also if I want to address the notification to the user (say Mr Jones), how is it done? I have tried without success. I can receive correct user name (Mr. Jones) when I send as test but when I sue the same code (.$current_user->user_firstname.) I do not receive in the real email that goes out to the user.

Test email has the same content as the main email. (why do we need two separate email contents (one for test and one for user)?)

This how I did for the test email:+1:

//OAVS WordPress user call begin 
 global $current_user;
 $current_user = wp_get_current_user();
//OAVS WordPress user call end
            if( isset($settings_errors[0]['type']) && $settings_errors[0]['type'] == "updated" ) {

                $clientwebsiteURL = sprintf(__("%s", "wp-updates-notifier"), site_url());
                $messageORDER .= sprintf( __( "%s to order", "wp-updates-notifier" ),  'http://www.shoppingwebsites.com.au/members/cart.php?gid=7' );
                $supportURL .= sprintf( __( "please contact us via support at %s ", "wp-updates-notifier" ), 'http://www.shoppingwebsites.com.au/members/submitticket.php?step=2&deptid=67' );
                $promoCode .= sprintf(__("2B3GLH5GXL"));

               self::send_notification_email(__("Dear Tester ".$current_user->user_firstname.",\n\nThis is an automatic incident notification to inform you that you have following updates at ".$clientwebsiteURL." website. These updates are optional (see FAQ's below) and you do not need to take any further action if you wish to do so.\n\n". $message ."\n\nWe are offering 10% promotional discount for all additional services such as maintenance, website updates, theme updates, plugin updates, backups, and security. Please see fees below.\n\nPlugin updates: $30.00 per incident.\nTheme updates: $60.00 per incident.\nAdditionally we will re-check and adjust if necessary your site security settings at no extra cost.\n\nIf you would like to go ahead with above upgrades, please click this link ".$messageORDER." and use the Promotiona Code: ". $promoCode ." at the order page. Please note that promotions applies only to this email update notification.\n\nFAQ's (Frequently Asked Questions):\nWill my website still work or function without these updates?\nYour website will work and function as normal however we cannot anticipiate what might happen later. Site updates is one way to insure that your website is up-to-date. Updates may increase security, fix bugs, add features and functionality. Your website run on a software. So you should update them just like you update your operating system (Windows or Mac OS). Please note that not all software updates include security patches, so it’s not always critical to update.\n\nHow often  do these updates occur?\nAgain we cannot be absolutely be sure of this. Updates such as plugins and themes are designed and notified by third party owners. When there is an update due we will let you know via email.\n\nSould I wait and accumulate more updates before I can go a head with the current updates?\nIt is entirely up to you how often and when you should update. If it is only 1 or 2 updates per incident required then it might be wiser to wait and accumulate more updates to get best value. Naturally it totally depends on the apparent level of severity and how it has impacted on your website.\n\nWhy should I update?\nSometimes plugin/theme updates are released expressly for a good reason. That is an old version of the plugin/theme doesn’t work with the latest version of website software. Conversely, new versions of plugins may not work with older versions of website software.\n\nIf there is anything else we can help you with or have any question regarding this email, ".$supportURL.".\n\nSite Administrator\n\nFaruk Ozturkmen\nSilk Aurora Pty Ltd trading as OAVS\nVersion 8.11.2013"
, "wp-updates-notifier")."\n");
//OAVS Test Notification email sent content end
l3rady commented 10 years ago

Ok to solve problem one is to add a setting that sets whether you get resent plugin updates the next time a plugin is due for an update regardless if you have been told already.

And for problem two, what you are doing looks very bespoke and not something I can sort for you directly. What I can do is add a number of filters for you in my code which will allow you to manipulate certain things and hopefully allow you to make the modifications you need without editing the core plugin code.

I am going to set them up as two separate issues and close this one

oavs commented 10 years ago

Great . Thank you for responding. I know you are busy and grateful for your answers and a great plugin.

I still need an answer to my #3 question. Which is... I want the wp-updates-notifier to send a personalized email . I can achieve this if the user is logged in. When the user not logged in their own WP admin it does not send the personalisation like 'Dear Mr. Brady...' How can I do this?

None of this works when I call it //xxxxxx WordPress user call begin global $current_user; $current_user = wp_get_current_user(); $current_user->user_firstname; //Added new $first_name = $user_info->first_name;//Added new $user_info = get_userdata(1);//Added new //get_currentuserinfo(); global $user_nickname;

........ $message = __("Dear ". $user_nickname ."<1> $user_login ". $user_login ." <2> ". $current_user->user_login ."<3> ". $current_user->display_name ."<4> 'display_name' <5> '. $user->first_name . ' <6> $first_name '$first_name' <7> ,\n\nThis is an automatic incident notification .....

In the above I have used multiple to find out which would work. None works when user NOT logged in. I am not a coder as you can see below this is what I am trying to achieve ===Actual email received from wp-updates-notifier ===== Dear <1> <2> xxxx - Website Designs<3> xxxxxx - Website Designs<4> ,

This is an automatic incident notification to inform you that you have following updates at http://www.xxxxxxxxx.com.au website. These updates are optional (see FAQ's below) and you do not need to take any further action if you wish not to do so.

Plugin updates: $30.00 per incident. Theme updates: $60.00 per incident. Additionally we will re-check and adjust if necessary your site security settings at no extra cost.

If you would like to go ahead with above upgrades, please click this link http://www.xxxxxxx.com.au/members/cart.php?gid=7 to order and use the Promotiona Code: 2B3GLH5GXL at the order page to take further 10 % discount. Please note that current promotion only applies to this email update notification.

FAQ's (Frequently Asked Questions): Will my website still work or function without these updates? Your website will work and function as normal however we cannot anticipate what might happen later. Site updates is one way to insure that your website is up-to-date. Updates may increase security, fix bugs, add features and functionality. Your website run on a software. So you should update them just like you update your operating system (Windows or Mac OS). Please note that not all software updates include security patches, so it’s not always critical to update.

How often do these updates occur? Again we cannot be absolutely be sure of this. Updates such as plugins and themes are designed and notified by third party owners. When there is an update due we will let you know via email.

Should I wait and accumulate more updates before I can go a head with the current updates? It is entirely up to you how often and when you should update. If it is only 1 or 2 updates per incident required then it might be wiser to wait and accumulate more updates to get best value. Naturally it totally depends on the apparent level of severity and how it has impacted on your website.

Why should I update? Sometimes plugin/theme updates are released expressly for a good reason. That is an old version of the plugin/theme doesn’t work with the latest version of website software. Conversely, new versions of plugins may not work with older versions of website software.

If there is anything else we can help you with or have any question regarding this email, please contact us via support at http://www.xxxxxxx.com.au/members/submitticket.php?step=2&deptid=67 .

Site Administrator

l3rady commented 10 years ago

@oavs when this plugin does it checks for updates, it does it in the background and so doesnt do the checks in the scope of the logged user.

If I get extra filters put into the plugin they will allow you to alter the copy of the email easily. Again what you are after is very bespoke and is out of the scope of what I want this plugin to do.

Once I have the filters in place and if you are still struggling to implement your desired features then I'd be available to help you for a fee.

Kind Regards

Scott