Skip to content

Commit 7e7a775

Browse files
committed
Enhance README.md to improve clarity and formatting of timestamp dataflow in super-admin-all-sites-menu plugin
1 parent a8c285c commit 7e7a775

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ A demo is available in [WordPress Playground](https://playground.wordpress.net/?
115115

116116
Let me break down the dataflow related to the timestamp in the super-admin-all-sites-menu plugin:
117117

118-
1. Initial Timestamp Creation:
118+
1. **Initial Timestamp Creation**:
119119
- In super-admin-all-sites-menu.php, a timestamp is generated when the plugin initializes
120120
- 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**:
122122
- The timestamp is passed to JavaScript via `wp_add_inline_script()` in super-admin-all-sites-menu.php around line 409:
123123
```php
124124
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
130130
// other data...
131131
]);
132132
```
133-
3. JavaScript Storage Check:
133+
3. **JavaScript Storage Check**:
134134
- In index.js, the `populateDB()` function compares timestamps:
135135
```javascript
136136
if (
@@ -141,7 +141,7 @@ Let me break down the dataflow related to the timestamp in the super-admin-all-s
141141
await db.delete();
142142
}
143143
```
144-
4. Database Population:
144+
4. **Database Population**:
145145
- If the IndexedDB is empty or was deleted due to timestamp mismatch:
146146
```javascript
147147
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
151151
});
152152
}
153153
```
154-
5. Timestamp Update Triggers:
154+
5. **Timestamp Update Triggers**:
155155
- The timestamp is updated when:
156156
- A site is added/deleted from the network
157157
- A plugin that affects the menu is activated/deactivated

0 commit comments

Comments
 (0)