@@ -115,10 +115,10 @@ A demo is available in [WordPress Playground](https://playground.wordpress.net/?
115
115
116
116
Let me break down the dataflow related to the timestamp in the super-admin-all-sites-menu plugin:
117
117
118
- 1. Initial Timestamp Creation:
118
+ 1. ** Initial Timestamp Creation** :
119
119
- In super-admin-all-sites-menu.php, a timestamp is generated when the plugin initializes
120
120
- This is exposed via the `get_timestamp()` method of the main plugin class
121
- 2. PHP to JavaScript Transfer:
121
+ 2. ** PHP to JavaScript Transfer** :
122
122
- The timestamp is passed to JavaScript via `wp_add_inline_script()` in super-admin-all-sites-menu.php around line 409:
123
123
```php
124
124
wp_add_inline_script( 'super-admin-all-sites-menu', "const pluginAllSitesMenu = {$data};", 'before' );
@@ -130,7 +130,7 @@ Let me break down the dataflow related to the timestamp in the super-admin-all-s
130
130
// other data...
131
131
]);
132
132
```
133
- 3 . JavaScript Storage Check:
133
+ 3 . ** JavaScript Storage Check** :
134
134
- In index.js, the ` populateDB() ` function compares timestamps:
135
135
``` javascript
136
136
if (
@@ -141,7 +141,7 @@ Let me break down the dataflow related to the timestamp in the super-admin-all-s
141
141
await db .delete ();
142
142
}
143
143
```
144
- 4 . Database Population:
144
+ 4 . ** Database Population** :
145
145
- If the IndexedDB is empty or was deleted due to timestamp mismatch:
146
146
``` javascript
147
147
if ((await db .count ()) === 0 ) {
@@ -151,7 +151,7 @@ Let me break down the dataflow related to the timestamp in the super-admin-all-s
151
151
});
152
152
}
153
153
```
154
- 5 . Timestamp Update Triggers:
154
+ 5 . ** Timestamp Update Triggers** :
155
155
- The timestamp is updated when:
156
156
- A site is added/deleted from the network
157
157
- A plugin that affects the menu is activated/deactivated
0 commit comments