Btw, the visual link is ok the way it is (showing only “/content-link”), but the actual href is broken.
The problem is within widget_front.view.php on line 44. Outputting the target URL should add the home_url() back to it, like so
<a href="<?php echo home_url( esc_url($target['url']) ); ?>" target="_blank">
home_url() returns the correct subfolder site in a multisite environment.
As a side note, the sanitization of the referrer URL doesn’t take domain mapping into account. The check strpos( $referrer, home_url() ) === false ) should maybe compare $referrer and $target, too – not just home_url(), as this returns the unmapped multisite URL.
Thoughts?
Anonymous User 7658014
(@anonymized_7658014)
@captain.crash I’m not the author, but I think this might be worth an issue at the GitHub repo. Would you mind? 🙂
Also, line 74 within statify_frontend.class.php doubles the subfolder of a multisite install, because $target already contains the subfolder via $_SERVER['REQUEST_URI'] and home_url() adds it again.
$data['target'] = home_url($target, 'relative');
Overall, it seems the plugin is not multisite ready, although it claims to be.
@caspar: You’re probably right and I’ve looked there before, but since there is only one issue by the plugin author himself, I decided to post it here, where much more activity appears.
If only I could find the checkbox that hides my posts from the plugin author’s view…
Anonymous User 7658014
(@anonymized_7658014)
You sound like you know what you’re doing, so don’t be shy posting an issue there! 🙂 Decent collaboration is always welcome, I’m sure.
@caspar: Sergej told me, you and him would have a look. Any news on this?
Anonymous User 7658014
(@anonymized_7658014)
I don’t no of any news on this issue, but I’ll gladly help creating an according GitHub issue, so we can finally resolve it. Can the problem be summarized like the following?
In a multisite environment, links inside the dashboard widget pointing to sub-sites are currently broken. They should use home_url() as well as domain mapping into account.
Yes, that pretty much sums it up.
A simple example complementing my posts 3. and 5. above. Let’s say
http://domain.com/subsite/testpage
gets mapped to
http://subsite.com/testpage
BUT links to the frontend within the admin area stay unmapped!
Statify only saves the absolute path in the DB /testpage – which is ok, I guess.
Currently, the admin widget links to just /testpage which results in
http://domain.com/testpage (missing /subsite)
but should prefix /testpage with home_url() to make it
http://domain.com/subsite/testpage
And, see side note in post 3. above, clicking from the admin on
http://domain.com/subsite/testpage
which gets mapped to
http://subsite.com/testpage
currently qualifies as a valid stat entry since referrer and target don’t share the same domain, however, these cases should not get logged.
Thanks again.
Anonymous User 7658014
(@anonymized_7658014)
We’re working on the issue, will post updates here soon. Would you be willing to test any results once we’re done?
https://github.com/pluginkollektiv/statify/issues/9