Admin Bar Menu Icon does not show if the URL is not English v1.15.0 #1968
Comments
|
If you've just created a new post there may be no data to report on just yet, in which case the plugin doesn't output any information in the toolbar. The same can occur using alphanumeric characters. If you'd like to open a WordPress support topic we can follow up with you in a few days to ensure everything is working as expected. I'll also check with the team whether we can add a more informative notice in situations whereby there is no data and we can revisit this GitHub issue if necessary. |
|
No, I talked about my all post. I have been checked with some of my old posts. When I change the URL to English everything works fine but when I revert it icon gone. I am not going to open a thread in WordPress. I wish the sit kit team will follow this issue here. |
|
Not a problem. I'll try and recreate the same experience using the same page title and slug. We'll keep you posted here. |
|
glad to hear that @jamesozzie |
|
@jamesozzie No problem at all, we're still investigating this. I have a post with the same slug setup, just awaiting additional traffic to report on. |
|
@kabirbd89 Thanks for your patience on this. I've been able to reproduce the same issue. Additional context from testing below:
|
|
Doing some testing on my end, I can see that when we send URLs to verify if they have data (and thus whether to show the admin-bar menu), we are using the encoded string version of these unicode characters which might be the issue. Still working on testing both Search Console and Analytics APIs. |
|
I have confirmed that at least in the case of the Analytics API we need to decode (likely |
|
@felixarntz this issue here is related to other work with URLs, however the URL checking approach and code path are unique for this check. For that reason we can handle this issue on its own. |
|
@adamsilverstein @felixarntz while the proposed change does address the issue with the admin bar, to me this seems like just a symptom of a larger issue and that we need to be decoding URLs everywhere they are passed in an API request. We should repurpose this issue to cover all API requests to Google APIs which are scoped to a specific URL. A few additional methods that seem relevant to attend to here would be:
Also, I think we may want to reconsider where we apply the site-kit-wp/includes/Modules/Analytics.php Lines 1621 to 1624 in eeb4417 That way it would be clear that the API would be getting the correct form. Initial testing seems to show that calling |
That makes sense.
Right... my goal was to limit applying decode to the places where a URL is passed in a request. @aaemnnosttv - What about moving it even higher up the stack to where we first extract the variable from the request - where we know it is encoded. By decoding the URL there, we will fix all the instances you mentioned, right? Eg. here site-kit-wp/includes/Context.php Line 194 in eeb4417
|
That would only affect the dashboard details view, which is admin only, so that wouldn't fix the URL used for the admin bar in this case when viewed from the front end. I think we need the reverse approach as the decoded URL is only needed when passing to the API. Everywhere else, the URL should be consistent with Because both Thoughts @felixarntz ? Are there any other places where a URL should be decoded before we make a request with it? |
Makes sense, I will update the IB accordingly. |
|
@aaemnnosttv IB updated - I verified this fix works as expected with the test URL. I noticed a missing call to |
|
IB |
|
@aaemnnosttv Let me know if you were able to find a way on how to QA the ticket. thanks! |
|
@asvinb (Hi!) - To QA this ticket you will need a page on your test site with a unicode path and some data. In my case, I use my personal site to create this data, then I can test locally by running my local "AS" the test domain. So:
|
|
@adamsilverstein do you have an account/view with this data already available that you could share to expedite the process? That way, we'd only need to update the custom URL, permalink structure, and a post's slug to test it. |
|
Hey @adamsilverstein |
|
Tested Installed latest develop build, activated and setup SK. Activated Analytics module and created a page with the name পোস্টের-নাম/ Confirmed the admin bar is displayed and functions properly: One thing to note, the URL is displayed below on the analytics details paged. https://hellogoodbye.today/%e0%a6%aa%e0%a7%8b%e0%a6%b8%e0%a7%8d%e0%a6%9f%e0%a7%87%e0%a6%b0-%e0%a6%a8%e0%a6%be%e0%a6%ae/ Passed QA |






Bug Description
Admin Bar Menu Icon does not show if the URL is not English.
Steps to reproduce
Additional Context
Acceptance Criteria
Implementation Brief
Change:
$dimension_filter->setExpressions( array( $args['page'] ) );to$dimension_filter->setExpressions( array( rawurldecode( $args['page'] ) ) );Note: we should be applying
esc_url_rawto the passedpagearg here. in the previous line, we should apply that before first using the variable.$args['page'] = str_replace( trim( $this->context->get_reference_site_url(), '/' ), '', $args['page'] );becomes$args['page'] = str_replace( trim( $this->context->get_reference_site_url(), '/' ), '', esc_url_raw( $args['page'] ) );Change:
$single_url_filter->setExpression( esc_url_raw( $args['page'] ) );to$single_url_filter->setExpression( rawurldecode( esc_url_raw( $args['page'] ) ) );QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: