• Resolved kleinefrage

    (@kleinefrage)


    Last time the support gave me this code, because the redirection time from mobile devices to AMP was huge:
    add_filter( ‘amp_mobile_client_side_redirection’, ‘__return_false’ );

    I put this code into Plugin-Editor, but since version 2.2.0 i have no permission to put the code in through plugin-editor.

    I installed now the Code Snippet-Plugin to put it in (support said it to me), but how to put this code just for the AMP-Plugin? I see no options for this in the Code Snippet-Plugin. There is just Code-Insert for the whole side, but not for separate plugins.

    • This topic was modified 4 years, 5 months ago by kleinefrage.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @kleinefrage

    AMP plugin does not add any permission restriction on plugin editor, you may want to contact your hosting provider to check if they have added any restrictions

    Also, the code snippet should not be added in the AMP plugins file, you can add that into your active themes functions.php or in a custom plugin

    Please check this custom plugin link : https://gist.github.com/westonruter/e5032d805625f0f743237708c43d3783

    You will also find installation instructions for the same in comment below

    Hope this helps!

    Thread Starter kleinefrage

    (@kleinefrage)

    Hello Milind,

    i think the problem is solved now. Before you wrote, i put the code in Code Snippet Plugin for the whole site. And its working. But is it ok to put it for the whole site and not separating it just for the plugin?

    Thanks for info. So wordpress is responsible for the permission. Ah, thanks. But why not putting it in the AMP plugin file? Yes the problem is i have no access to funktions.php or such files. The only access i have in the past was to the plugin-editor. But now also this is over.

    So i should in the future asking the wordpress-support. But they saying me, that they cant change permission and they said to me that for the plugin-editor permission restriction AMP-Plugin-Developers are responsible. Before version 2.2.0 i could change files through plugin-editor in AMP. This permission is just existing since version 2.2.0. But as you said i shouldnt change it through AMP-Plugin file, its in anyways now irrelevant.

    And now to the link you gave me: I think until know i couldnt be able to put this link through this methods cause my permissions are missing. So i am glad that it worked in code snippets.

    • This reply was modified 4 years, 5 months ago by kleinefrage.
    • This reply was modified 4 years, 5 months ago by kleinefrage.
    • This reply was modified 4 years, 5 months ago by kleinefrage.
    Plugin Support Milind More

    (@milindmore22)

    Hello @kleinefrage

    Glad that worked out for you, yes that should be active for the whole site.

    If you add any code snippet in a plugin or in a theme file it will be discarded when you update that plugin or theme, so it’s safe to add it in child themes functions.php or in a custom plugin.

    Plugin Support Milind More

    (@milindmore22)

    We hope our suggestion is helpful, I’ll mark this as resolved Open a new support topic if you face further issues, also feel free to leave a plugin review, we would love to hear your feedback.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cant put the code in’ is closed to new replies.