Prior to this PR, the JS was open to collisions with other plugins. It wasn't namespacing the functions and such properly, so it would've caused issues if multiple plugins were using different versions of this package. It also was only kind of namespsacing things within persistence, in a more complicated way.
In this PR, namespacing is added to the JS and attributes used to identify the notice. This way the plugin using the package will only ever affect it's own notices.
It also updated the way persistence worked. Now, within the user preferences meta, the root key is stellarwp/admin-notices-$namespace. This means that the stored notification ids no longer need to be namespaced (saving a bit of room), and the user's notices can be reset simply by removing the array as a whole.
All in all, this makes the package better at avoiding plugin conflict and simplifies the persistence of dismissed notices.
Prior to this PR, the JS was open to collisions with other plugins. It wasn't namespacing the functions and such properly, so it would've caused issues if multiple plugins were using different versions of this package. It also was only kind of namespsacing things within persistence, in a more complicated way.
In this PR, namespacing is added to the JS and attributes used to identify the notice. This way the plugin using the package will only ever affect it's own notices.
It also updated the way persistence worked. Now, within the user preferences meta, the root key is
stellarwp/admin-notices-$namespace
. This means that the stored notification ids no longer need to be namespaced (saving a bit of room), and the user's notices can be reset simply by removing the array as a whole.All in all, this makes the package better at avoiding plugin conflict and simplifies the persistence of dismissed notices.