Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fetching Alexa rank #17579

Merged
merged 1 commit into from May 19, 2021
Merged

Fix fetching Alexa rank #17579

merged 1 commit into from May 19, 2021

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented May 18, 2021

Description:

Seems Alexa has changes the site were we fetch the rank from. It now contains a lot javascript which can't be parsed correctly, resulting in a lot warnings. Added libxml_use_internal_errors(true) to ignore them.
Also the markup changed so I tried to adjust the xpath handing to fetch the correct value again.

fixes #17578

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels May 18, 2021
@diosmosis
Copy link
Member

Doesn't seem to work for me. If I try to get the stats for google.com, the rank is not parsed (the xpath fails, and $value is set to NULL).

@sgiehl
Copy link
Member Author

sgiehl commented May 19, 2021

Oh. Seems I accidentally committed a ! in the if condition that shouldn't have been there... Should work now.

@diosmosis diosmosis merged commit 4cc2342 into 4.x-dev May 19, 2021
@diosmosis diosmosis deleted the fixalexastats branch May 19, 2021 17:04
@diosmosis diosmosis added this to the 4.3.1 milestone May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alexa.php(40): Warning - DOMDocument::loadHTML(): Unexpected end tag
2 participants