google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.22k stars 277 forks source link

Only consider public posts for Site Kit entities #1253

Closed jamesozzie closed 3 years ago

jamesozzie commented 4 years ago

Bug Description

Site Kit main dashboard don't work as expected with WP User Frontend activated, with the following issues:

Individual dashboards work fine

Site Kit version version 1.5.0 WP User Frontend version 3.1.17

First reported in WordPress support form, and reproducible from support:

Issue also reported on WP User Frontend support forum: https://wordpress.org/support/topic/conflict-with-site-kit-by-google/

t078npqtFD

Additional information:


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Update logic in Context::get_reference_entity when is_admin with a WP_Post instance (after googlesitekit-dashboard case)

QA Brief

Changelog entry

cole10up commented 4 years ago

@jamesozzie - Can you give this another try on your side? We've since released a hotfix and I see a new version of WP User Frontend. I have both new versions and unable to reproduce this.

Plugins and versions: image

SK Dashboard and page speed looking just fine. image

jamesozzie commented 4 years ago

@cole10up LGTM. I tested with WP User Frontend 3.1.17 & 3.1.18. No issues from my side.

kabirbd89 commented 4 years ago

But, I am still getting problem on my site. WP User Fronted 3.1.18 and Site kit 1.5.1.

kabirbd89 commented 4 years ago

Well got it, I tried it another website with fresh new install of both plugin and it was completely okey until I create a post form in WP User Fronted, Can you check again with a form. @jamesozzie

jamesozzie commented 4 years ago

@cole10up @kabirbd89 From testing today this same issue remains (without having to use a form).

I'll check other sites also

jamesozzie commented 4 years ago

@cole10up I'm able to reproduce the same error on one site but not with another. Both using the same WP & plugin versions. I'll dedicate some time to testing the various configurations next.

kabirbd89 commented 4 years ago

@jamesozzie I am thinking about a temporary solution in completely non professional way. Which is 302 redirection. does google mark it negatively ! any idea

jamesozzie commented 4 years ago

@kabirbd89 Apologies for the late response. That sounds like a question for the Webmaster Community experts I'm afraid. But rest assured we investigate this further.

jamesozzie commented 4 years ago

@aaemnnosttv Assigning this back while I take another look.

jamesozzie commented 4 years ago

@aaemnnosttv Performed some more testing on this today, no console errors and all 200 responses. Same issue persists and easily reproducible. I'll unassign now if you'd like to pick it up once more, additional details below.

Untitled-6

Debug.log ``` [09-Jun-2020 21:06:50 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:19 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:37 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:07:57 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:09:43 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:10:39 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:11:43 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:12:40 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:12:48 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:13:43 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:14:41 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:14:48 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:15:49 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:16:02 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:16:02 UTC] PHP Notice: AMP_Theme_Support::get_template_availability was called incorrectly. An expected parent was not found. Did you filter amp_supportable_templates to not honour the template hierarchy? Please see Debugging in WordPress for more information. (This message was added in version 1.4.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:16:02 UTC] PHP Notice: AMP_Theme_Support::get_template_availability was called incorrectly. An expected parent was not found. Did you filter amp_supportable_templates to not honour the template hierarchy? Please see Debugging in WordPress for more information. (This message was added in version 1.4.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:16:02 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:00 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:17:39 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:17:39 UTC] PHP Notice: AMP_Theme_Support::get_template_availability was called incorrectly. An expected parent was not found. Did you filter amp_supportable_templates to not honour the template hierarchy? Please see Debugging in WordPress for more information. (This message was added in version 1.4.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:17:39 UTC] PHP Notice: AMP_Theme_Support::get_template_availability was called incorrectly. An expected parent was not found. Did you filter amp_supportable_templates to not honour the template hierarchy? Please see Debugging in WordPress for more information. (This message was added in version 1.4.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:40 UTC] PHP Deprecated: woocommerce_price is deprecated since version 3.0! Use wc_price instead. in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 4713 [09-Jun-2020 21:17:48 UTC] PHP Notice: is_amp_endpoint was called incorrectly. is_amp_endpoint() was called before the parse_query hook was called. Please see Debugging in WordPress for more information. (This message was added in version 0.4.2.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "read_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 [09-Jun-2020 21:18:07 UTC] PHP Notice: map_meta_cap was called incorrectly. The post type shop_order is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.) in /var/www/vhosts/httpster.co/httpdocs/wp-includes/functions.php on line 5167 ```
Log HTTP Requests info
Request ``` { "method": "GET", "timeout": 10, "redirection": 5, "httpversion": "1.0", "user-agent": "WordPress/5.4.1; https://httpster.co", "reject_unsafe_urls": false, "blocking": true, "headers": { "Cache-Control": "no-cache" }, "cookies": { "wordpress_sec_ee6e16c025d59aba9cb1e509cd073efd": HIDDEN, "_ga": "GA1.2.27239061.1591633252", "_gid": "GA1.2.1649008805.1591633252", "wordpress_test_cookie": "WP Cookie check", "tk_ai": "woo:lqwHqZh+B+O/WaKaDUR66Mvq", "wordpress_logged_in_ee6e16c025d59aba9cb1e509cd073efd": HIDDEN, "wp-settings-1": "libraryContent=browse&editor=html&woosidebarsshowadvanced=1", "wp-settings-time-1": "1591732983", "wp-health-check-disable-plugins": "fed0d849a347eec25027f6b5c6b0bc8b" }, "body": null, "compress": false, "decompress": true, "sslverify": true, "sslcertificates": "/var/www/vhosts/httpster.co/httpdocs/wp-includes/certificates/ca-bundle.crt", "stream": false, "filename": null, "limit_response_size": null, "_redirection": 5 } ``` **Response** ``` { "headers": {}, "body": "\n\n\n\n\n\n\n\tDashboard ‹ Httpster Nerdware — WordPress\n\n\n\n\n\t\n\t\t\t\n\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\n\t\t\t\t\t\n\t\n\t\n \r\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\n\n\t\n\t\n\t\t\n\t\n\t\n
\n\n
\nSkip to main content\nSkip to toolbar\n
\n
\n\n
\n
\n
\n\n\t\t\n\n\t\t\n
\n\n
\n\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t

For more information:

Documentation on Dashboard

Support

\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab above the screen title.

\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimise this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.

Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.

\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.

Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.

Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a grey dotted-line rectangle appear in the location you want to place the box.

Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.

\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

The boxes on your Dashboard screen are:

At A Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.

Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.

Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started.

WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.

Welcome — Shows links for some of the most common tasks when setting up a new site.

\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n
\n\t\t
\n\t\tBoxes\n\t\t\n\t\t
\n\t\t\n\n
\n
\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t
\n\t\t\n
\n\t

Dashboard

\n\n\n\t
\n\t\t\t\tDismiss\n\t\t\t
\n\t

Welcome to WordPress!

\n\t

We’ve assembled some links to get you started:

\n\t
\n\t
\n\t\t\t\t\t

Get Started

\n\t\t\tCustomise Your Site\n\t\t\t\tCustomise Your Site\n\t\t\t\t\t\t\t\t

\n\t\t\t\tor, change your theme completely\t\t\t

\n\t\t\t
\n\t
\n\t\t

Next Steps

\n\t\t\n\t
\n\t
\n\t\t

More Actions

\n\t\t\n\t
\n\t
\n\t
\n\t\t
\n\n\t
\n\t
\n\t
\n\t
\n

Social Slider Widget News

\n
\n
\r\n
\r\n\t\t\t\t\r\n
    \r\n
  • \r\n
\r\n
\r\n
\r\n\t\t
\n
\n
\n

WPForms

\n
\n
\n\t\t
\n\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\tTotal Entries\t\t\t\t

\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

View all Form Entries inside WordPress Dashboard

\n\t\t\t\t\t

Form entries reports are not available.

\n\t\t\t\t\t

Form entries are not stored in Lite.

\n\t\t\t\t\t

Upgrade to Pro and get access to the reports.

\n\t\t\t\t\t

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tUpgrade to WPForms Pro\t\t\t\t\t\t\n\t\t\t\t\t

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\n\t\t
\n\n\t\t
\n\t\t\t

Total Entries by Form

\n\t\t
\n\n\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
Simple Contact Form3
\n\n\t\t\n\t\t\t\t
\n\n\t\t\t\t\n\t\t
\n
\n
\n

Site Health Status

\n
\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t\t\tResults are still loading…\t\t\t\t\t\t\t
\n\t\t
\n\n\t\t\t\t

\n\t\t\t\t\t\t\tYour site has critical issues that should be addressed as soon as possible to improve the performance or security of your website.\t\t\t\t\t

\n\t\t\n\t\t\t\t

\n\t\t\tTake a look at the 7 items on the site health check status page.\t\t

\n\t\t\n\t\t
\n
\n
\n

At a Glance

\n
\n\t
\n\t\n\t

WordPress 5.4.1 running generatepress child theme theme.

\t
\n\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n
\n
\n

Activity

\n
\n

No activity yet!

\n
\n
\n

Site Kit Summary

\n
\n\t\t\t\n\t\t\t\t
\n\t\t
\n
\n
\n

WooCommerce Status

\n\n
\n
\t
\n\t
\n\t
\n

Quick Draft Your Recent Drafts

\n
\n\n\t
\n\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\n\t\t

\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t

\n\n\t
\n\t
\n
\n
\n

WordPress Events and News

\n
\n\n\t
\n\t\t

\n\t\t\tThis widget requires JavaScript.\t\t

\n\n\t\t

\n\t\t\tAn error occurred. Please try again.\t\t

\n\n\t\t

\n\t
\n\n\t
\n\t\tLoading…\t
\n\n\t\t
\n\t\t
\n\t\t\t

\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t

\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t
\n\t\t
\n\n\t\t
    \n\t
    \n\n\t\n\t\n\n\t

    \n\t\tMeetups (opens in a new tab)\n\t\t|\n\n\t\tWordCamps (opens in a new tab)\n\t\t|\n\n\t\tNews (opens in a new tab)\t

    \n\n\t
    \n
    \n
    \t
    \n\t
    \n\t
    \t
    \n\t
    \n\t
    \t
    \n
    \n\n\t\t
    \n\n
    \n\n\n\t\n\n\t\n\n\t\n\n\t\n\t\n
    \n
    \n
    \n\n
    \n\t\t

    \n\t\tThank you for creating with WordPress.\t

    \n\t

    \n\t\tVersion 5.4.1\t

    \n\t
    \n
    \n\t\t\n\t\t\t
    \n\t
    \n\t
    \n\t\n\t\t\t
    \n\t\t\t
    \n\t\t

    Session expired

    \n\t\t

    Please log in again.\n\t\tThe login page will open in a new tab. After logging in you can close it and return to this page.

    \n\t
    \n\t
    \n\t
    \n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n\n\n\n", "response": { "code": 200, "message": "OK" }, "cookies": [ { "name": "wordpress_sec_ee6e16c025d59aba9cb1e509cd073efd", "value": HIDDEN, "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "_ga", "value": "GA1.2.27239061.1591633252", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "_gid", "value": "GA1.2.1649008805.1591633252", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "wordpress_test_cookie", "value": "WP Cookie check", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "tk_ai", "value": "woo:lqwHqZh B O/WaKaDUR66Mvq", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "wordpress_logged_in_ee6e16c025d59aba9cb1e509cd073efd", "value": HIDDEN, "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "wp-settings-1", "value": "libraryContent=browse&editor=html&woosidebarsshowadvanced=1", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "wp-settings-time-1", "value": "1591732983", "expires": null, "path": "/", "domain": null, "host_only": true }, { "name": "wp-health-check-disable-plugins", "value": "fed0d849a347eec25027f6b5c6b0bc8b", "expires": null, "path": "/", "domain": null, "host_only": true } ], "filename": null, "http_response": { "data": null, "headers": null, "status": null } } ```
    eugene-manuilov commented 3 years ago

    @felixarntz @aaemnnosttv

    Ok, i can confirm the issue is on our end and it happens because we select a random post when we try to get a reference entity and there is no such. In this particular case it gets a random post which is of wpuf_forms type and that post type is hidden (public = false). That's why lighthouse sees 404 response when it tries to examine public page of a hidden entity.

    Basically, what we need to do here is to update the line number 201 here: https://github.com/google/site-kit-wp/blob/0413b5fcc00e8773075edf9b4032487ee71e982f/includes/Context.php#L192-L206

    Instead of getting a random post using get_post() function, we need to check if there is a queried post first. If it exists, then it's safe to call get_post() function. If not, then we need to call get_posts( 'numberposts=1' ) instead and take the first post in the array if it is not empty. Finally, if get_posts returns an empty array, we need to return null and let PSI check homepage performance.

    PS: do we really need to get a random post there? This logic seems strange to me. IMO we need to fallback to the default value which is the homepage if there is no queried post. Let me know if I am missing something.

    aaemnnosttv commented 3 years ago

    Thanks for the explanation @eugene-manuilov ! Moving this forward to be prioritized.

    @felixarntz should we rename this issue since it doesn't seem to be specific to the frontend plugin?

    felixarntz commented 3 years ago

    @eugene-manuilov I think the problem here is not so much that we get a "random" post, but that the post may not be public. get_post() returns the current post currently being edited in the admin (if there is any), so that's all good I think. What we need to add here is checks get_post_type_object( $post->post_type )->public && ( $post->post_status === 'publish' || $post->post_status == 'inherit' && $post->post_type === 'attachment' ) - only if these are fulfilled, this is an entity for Site Kit purposes (every entity should have a public URL).

    Regardless of that, is this maybe a problem with the WP User Frontend plugin too? That plugin shouldn't be setting the $post global on the Site Kit dashboard I'd say.

    eugene-manuilov commented 3 years ago

    @felixarntz get_post() returns the current post but it doesn't guaranty that it's currently being edited in the admin. IMO we need to change how we get the current post because currently we use unreliable approach that can be broken by other plugins too.

    felixarntz commented 3 years ago

    @eugene-manuilov Maybe we could wrap it into a clause which checks that the get_current_screen() is the post editing screen? That would make it a bit more bullet-proof.

    However I'd argue even the current logic is correct - if a plugin sets the $post global somewhere that it affects the Site Kit dashboard, that plugin is clearly doing it wrong. But I agree with your concern, we only care for the current $post when editing a post in the admin, so let's add a check around it to only use that global when on the post edit screen.

    Regardless of that though, the checks for that post being publicly available should also be added.

    eugene-manuilov commented 3 years ago

    Yes, I agree with you, adding get_current_screen and post availability checks is what we need regardless of what other plugins do.

    felixarntz commented 3 years ago

    @aaemnnosttv IB mostly ✅ , one additional thing to add:

    cole10up commented 3 years ago

    Tested

    Installed latest SK, activated and completed setup. Activated Analytics modules.

    Downloaded WP Frontend here https://wordpress.org/plugins/wp-user-frontend/

    Activated WP Frontend and sipped setup

    Navigated to Post form in WP Frontend image

    Added a blank form: image

    Saved: image

    Navigated to SK Dashboard and checked SK entity data: image

    Navigated to post with data and checked entity data: image

    Navigated to post URL from 'More details' admin bar link image

    Checked entity data: image

    Noticed Entity data is showing forward and backward slashes in the URL section. Is this expected @aaemnnosttv @eugene-manuilov?

    image

    Sending to CR to confirm the above ^^

    felixarntz commented 3 years ago

    @cole10up The backslashes there are correct, they're only in the encoded JSON object.

    cole10up commented 3 years ago

    Looks good on my end per Felix's comment above.

    kabirbd89 commented 3 years ago

    everything okay except the post admin bar. The SK menu does not appear in the admin bar for post pages. is it intentional!

    sk menu issue in post page admin bar