Notification Centre - What happened to Calculator widget? I only just noticed this today - Calculator is gone.

Is this an "improvement" with 10.13.5 which I installed just the other day, or did I break something?

I did notice Stocks appear in there as if by magic the other day - something I'm never ever going to need, but I hadn't spotted Calculator's disappearance until now.

 

Checked my partner's machine - same OS, very similar machine - lot &amp; lots of widgets...

 

So, maybe the question becomes, 'where do they live &amp; why can't my machine find them?'

Late edit:
I've found the calculator app, in
/System/Library/Frameworks/NotificationCenter.framework/PlugIns/com.apple.ncplugin.calculator.appex
so now I need to figure out a way to get the Notification Centre to recognise it again.

Per comments...
defaults read com.apple.notificationcenterui
gives

{
    TodayView =     {
        NoContent =         (
            "com.apple.reminders.RemindersNC"
        );
        keyWidget = "com.apple.ncplugin.calculator";
        order =         (
            "com.apple.reminders.RemindersNC",
            "com.apple.iTunes.today.TodayExtension",
            "com.apple.iCal.CalendarNC",
            "com.apple.ncplugin.weather",
            "com.parallels.desktop.console.Resource-Monitor",
            "com.apple.ncplugin.stocks"
        );
        preferences =         {
            "com.apple.nc.disclosures" =             {
                enabled = 1;
            };
            "com.apple.nc.today.date" =             {
                enabled = 1;
            };
            "com.apple.nc.today.dnd" =             {
                enabled = 1;
            };
            "com.apple.nc.today.summary" =             {
                enabled = 1;
            };
            "com.apple.nc.tomorrow.summary" =             {
                enabled = 1;
            };
        };
    };
    bannerTime = 5;
    "last-messagetrace-stamp" = "551957496.077987";


so they're missing there. Does that mean there's a defaults write to put them back?
When it comes to troubleshooting Notification Centre widgets, there are a number of options you can try. 

1. Use the Edit option within Notification Centre

This is really the first thing to try. Refer to Seamus' answer for the steps involved.

2. Check the Extensions preference pane

In summary:


Go to Apple > System Preferences... > Extensions
OPTIONAL: If you're having issues with 3rd party extensions, select the All option in the lefthand pane and then check the righthand side to enable any that aren't activated
Select the Today option in the lefthand pane
Now check the right-hand side list to confirm the widget(s) are enabled (if not, tick the relevant checkbox(es)
Exit System Preferences
Check your Notification Centre to see if the Widget(s) are active and/or functioning properly


3. Test another User account


Log in to another user account to test whether the Notification Centre (and any Widgets you're having problems with) are working properly. If you don't have another user account, you can log into the Guest account or create a new temporary account at Apple > System Preferences... > Users &amp; Groups


If the Notification Centre / Widgets work fine in the other Account, then try 4, 5, 6, 7, 8, 9 and 10 below
If the Notification Centre / Widgets do not work fine in the other Account, then use macOS Recovery to Reinstall macOS (NOTE: Ensure you have a full backup prior to doing this). Likewise, you can use macOS Recovery to restore from a Time Machine backup that was made prior to problems with Notification Centre (NOTE: Ensure you have a full current backup prior to doing this, so that you don't lose any recent documents, emails, photos, etc).



4. Use Widget Simulator to add it back again


Go to /System/Library/Frameworks/NotificationCenter.framework/Resources/
Launch the Widget Simulator 
Now go to /System/Library/Frameworks/NotificationCenter.framework/PlugIns/
Drag and drop the com.apple.ncplugin.calculator.appex file onto the Widget Simulator icon in the Dock
This should open the widget in a Simulator window
Click on the green + button:





Now check to see if the Calculator widget is back in your Notification Centre (or available to add back again)


5. If present, delete any relevant .plist files

NOTE: If you've tested another User Account and the Notification Centre / Widget is not working fine in that account, then do not proceed with this option.

If macOS has created a .plist file for a specific Widget you're having problems with, then delete it. To check this you need to access the relevant Notification Centre Plugin container for the user account in question. Using the Calculator widget as an example, you would go to:

~/Library/Containers/com.apple.ncplugin.calculator/Data/Library/Preferences


If you see a .plist file for the specific widget (e.g. com.apple.ncplugin.calculator.plist and/or com.apple.calculator.plist), then delete it and restart your Mac.

6. Swap the specific widget .appex file

Grab a known good copy of your widget from a Time Machine backup or another computer. In this case (i.e. a macOS High Sierra installation), the Calculator widget can even be replaced with one from macOS Sierra. 

To do this:


On another Mac or within a Time Machine backup, navigate to:
/System/Library/Frameworks/NotificationCenter.framework/PlugIns/
Copy the com.apple.ncplugin.calculator.appex file representing the Calculator widget 
Now past this into the problem Mac at the same location:
/System/Library/Frameworks/NotificationCenter.framework/PlugIns/


NOTE: To do this you will need to temporarily disable System Integrity Protection (SIP) on the Mac you're having problems with.

7. Sign out of and then back into iCloud

I guess the heading says it all. Go to Apple > System Preferences... > iCloud and sign out. Once you're signed out, then sign back in again.

8. Force a Spotlight reindex

There are various ways to do this. The easiest way is to:


Go to Apple > System Preferences > Spotlight
Select the Privacy tab
Drag your boot volume into the window
Wait a few minutes
Remove your boot volume so that it's no longer listed in the window
Exit System Preferences


NOTE: Reindexing your boot volume can take a long time. How long depends on the size of your drive and how much data is stored on it. 

9. Reset your password and create a new Keychain

Follow the steps here to reset your password first and then to create a new Keychain.

10. Create a new User account and migrate your data into that one

Obviously this will take a few hours, but this will definitely solve the problem (assuming that when you tested another user account at 3 above it worked fine). Essentially you're creating a new account and migrating all your data to that one instead.