That’s extremely strange! I apologise for that!
Can you please contact me on team@magazine3.com ?
I will make sure that this issue gets fixed immediately!
Also, Was this the same case with 0.9.97.3 ?
Hi.
Same issue on my website. With 0.9.97.3 and 0.9.97.5.
Hey Yuriv,
Thank you for the information.
I understand your query, further, I would recommend you to contact us on team@magazine3.com.
our team will debug and make sure that everything is working fine for you.
I have updated to Version 0.9.97.6 (released 2 days ago) and issue remains.
Hey Yuriv,
Thank you for contacting us on team@magazine.com, I see that one of our team members is assisting you on this query and requires further information, could you check your e-mail and revert back with the same.
Hey Eric_draven,
I would recommend you to contact us at team@magazine3.com.
Our team will debug and make sure that everything is working fine for you.
Thread Starter
YuriV
(@yuriv)
Hi ampforwp,
We provided WP-credentials but the team needed FTP-access as well. Because of our security policy we can’t provide this access. We’re using an older version of the plugin right now and hope this issue will be fixed in one of your future updates.
Regards, Yuri
Hi @yuriv, Which version? I tried 0.9.97.3.
I’ve found that ugly url with ?q= in link rel=”amphtml” produced by ampforwp_url_purifier($url) function in templates/features.php this code:
if ( is_singular() && !empty($_SERVER['QUERY_STRING']) ) {
$query_arg = wp_parse_args($_SERVER['QUERY_STRING']);
$url = add_query_arg( $query_arg, $url);
}
I’m running the latest version of plugin and use NGINX web server.
-
This reply was modified 2 years, 9 months ago by
Mike.
-
This reply was modified 2 years, 9 months ago by
Mike.
Thread Starter
YuriV
(@yuriv)
Retried an update of the plugin this morning since I saw this in the changelog of 0.9.97.7:
Fixed: AMP renders with ?q after the /amp #2361
Unfortunately the problem still exists on my end. Rolled back to 0.9.96.
hey guys
can you replace the code in the if ( is_singular() && !empty($_SERVER['QUERY_STRING']) )
condition of function ampforwp_url_purifier($url)
as pointed by @mixar with the following code and check?
global $wp_query;
$query_arg = wp_parse_args($_SERVER['QUERY_STRING']);
$query_name = $wp_query->query['name'];
if(strpos($_SERVER['QUERY_STRING'],$query_name) && (isset($query_arg['q']) && strpos($query_arg['q'],$query_name))){
$query_arg = str_replace($query_name, '', $query_arg);
unset($query_arg['q']);
}
$url = add_query_arg( $query_arg, $url);
This should resolve the issue, please do let us know as we’ll be releasing an update soon along with this code.
Thanks @sejiro with you code all works fine. We don’t need additional global $wp_query;
because its already present in ampforwp_url_purifier($url)
function.