Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
60740a8
Factor in IDs of posts in query for computing ETag
ShyamGadde Dec 5, 2024
2239317
Factor in last modified of posts in The Loop
ShyamGadde Dec 5, 2024
3c7842b
Merge logic to get posts in The Loop
ShyamGadde Dec 5, 2024
3c57a1d
Factor in active theme and current template
ShyamGadde Dec 5, 2024
6a5e421
Add missing `@global` tags
ShyamGadde Dec 5, 2024
cc8e252
Add null checks for global variables
ShyamGadde Dec 5, 2024
72f4e54
Add temporary fix for test cases
ShyamGadde Dec 5, 2024
8651d05
Add `queried_object` to ETag data
ShyamGadde Dec 7, 2024
f66012e
Merge branch 'trunk' into update/incorporate-page-state-for-etag
ShyamGadde Dec 7, 2024
56cbe8e
Use dependency injection instead of relying on globals
ShyamGadde Dec 9, 2024
38d0097
Update test_od_get_current_url_metrics_etag
ShyamGadde Dec 9, 2024
d61a8bc
Fix failing test cases due to missing globals
ShyamGadde Dec 9, 2024
072140b
Introduce filter `od_current_url_metrics_etag_active_theme` to improv…
ShyamGadde Dec 9, 2024
4ffb79f
Update test_od_get_current_url_metrics_etag
ShyamGadde Dec 9, 2024
1794cff
Factor in Block Template object
ShyamGadde Dec 9, 2024
3c3a1a3
Merge branch 'trunk' into update/incorporate-page-state-for-etag
ShyamGadde Dec 9, 2024
65dc803
Merge branch 'trunk' into update/incorporate-page-state-for-etag
ShyamGadde Dec 10, 2024
1c0bdac
Remove unnecessary filter `od_current_url_metrics_etag_active_theme`
ShyamGadde Dec 10, 2024
e562726
Merge branch 'trunk' into update/incorporate-page-state-for-etag
ShyamGadde Dec 12, 2024
6d80095
Merge branch 'trunk' into update/incorporate-page-state-for-etag
ShyamGadde Dec 12, 2024
73e4519
Refine `$current_template` assignment logic for block and classic themes
ShyamGadde Dec 12, 2024
59879f0
Update `$current_template` type for static analysis compliance
ShyamGadde Dec 12, 2024
df306e1
Fix indentation
ShyamGadde Dec 12, 2024
c9c0dd8
Move global setup to set_up and cleanup to tear_down
ShyamGadde Dec 12, 2024
4632350
Replace `$GLOBALS` access with explicit global variable declarations
ShyamGadde Dec 12, 2024
5b4e791
Limit queried_object fields to id, type, and last_modified
ShyamGadde Dec 12, 2024
1073780
Use WP_Query method instead of global function for determining post type
ShyamGadde Dec 12, 2024
9a19113
Add isset checks for global variables
ShyamGadde Dec 13, 2024
03d1683
Merge branch 'trunk' into update/incorporate-page-state-for-etag
westonruter Dec 13, 2024
8325cb4
Avoid sleeping in favor of setting an old initial modified time
westonruter Dec 13, 2024
1b3ba00
Reuse post_modified_gmt in queried_object
westonruter Dec 13, 2024
a71fe76
Reuse active theme in test and reduce code duplication
westonruter Dec 14, 2024
03ef8c8
Align post type archive check with other `instanceof` validations
ShyamGadde Dec 14, 2024
73edbdb
Add helper od_get_current_theme_template() function
westonruter Dec 15, 2024
55d56d3
Refactor queried_posts data to have better guaranteed shape
westonruter Dec 15, 2024
63bb613
Avoid adding WP_Block_Template object directly to ETag data in favor …
westonruter Dec 15, 2024
18e0476
Refactor od_get_current_url_metrics_etag to use data provider and add…
westonruter Dec 15, 2024
57a0ba6
Remove unnecessary setting of template global
westonruter Dec 15, 2024
804d71e
Set absolute path to template
westonruter Dec 15, 2024
8fe2f8f
Make additional adjustments to template
westonruter Dec 15, 2024
1869689
Do not rely on WP_Query global being set
westonruter Dec 15, 2024
7c0cfe1
Work around strange user creation issue in factory
westonruter Dec 15, 2024
1fc20af
Add template conditional assertions
westonruter Dec 15, 2024
b083a29
Avoid using pretty permalink for author URL due to GHA testing problem
westonruter Dec 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing @global tags
Signed-off-by: Shyamsundar Gadde <shyamsundar.gadde@rtcamp.com>
  • Loading branch information
ShyamGadde committed Dec 5, 2024
commit 6a5e421b56ac24bce1e5f7274ea6e83e156f46f9
10 changes: 7 additions & 3 deletions plugins/optimization-detective/storage/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,17 @@ function od_get_url_metrics_slug( array $query_vars ): string {
/**
* Gets the current ETag for URL Metrics.
*
* The ETag is a hash based on the IDs of the registered tag visitors
* in the current environment. It is used for marking the URL Metrics as stale
* when its value changes.
* Generates a hash based on the IDs of registered tag visitors, queried posts,
* and theme information in the current environment. This ETag is used to assess
* if the URL Metrics are stale when its value changes.
*
* @since n.e.x.t
* @access private
*
* @global WP_Query $wp_the_query Global WP_Query instance.
* @global string $_wp_current_template_id Current template ID.
* @global string $template Template file path.
*
* @param OD_Tag_Visitor_Registry $tag_visitor_registry Tag visitor registry.
* @return non-empty-string Current ETag.
*/
Expand Down