Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Hi,

    I’m not very familiar with the AMP pages, as I don’t use them. After taking a quick look at a local test WordPress installation without using a validator, the markup this plugin generates on the AMP pages seems to be valid.

    Testing your web site is not an option. If you could please post the following information, then I could possibly provide a workaround or fix the plugin if there is a bug involved.

    First, please make sure you use the latest versions of WordPress, AMP, Creative-Commons-Configurator and the default 2016 theme. Deactivate all other plugins except AMP and Creative-Commons-Configurator and switch to the 2016 theme. Then, check the HTML source code of the AMP version of a public post and please provide the following information:

    * The part of the markup that is invalid.
    * The exact error message you get on the validator.
    * The expected HTML markup that would pass the validation. (Update: this is not mandatory, as I’ll possibly be able to identify the issue from the 2 above)

    Without more detailed feedback about the error, I’m afraid I won’t be able to identify a possible problem with the plugin and help you any further.

    Plugin Author George Notaras

    (@gnotaras)

    OK, I think I’ve figured out how to validate the AMP pages using the web browser’s developer tools. I can see various errors there and I’ll definitely have to check this more thoroughly at some point in the future in order to determine if my plugin is responsible for any of those. In the meantime, your detailed feedback will be much appreciated.

    I have added a bug report about this. Please note that it might take a while before I check this issue.

    Plugin Author George Notaras

    (@gnotaras)

    Hi,

    I checked this more thoroughly today using the online validator at https://validator.ampproject.org/ and noticed that there are indeed some validation errors with CC-Configurator’s output in the AMP pages:

    1) Its inline style is added in its own <style> block instead of the <style> block generated by the AMP plugin.
    2) Other validation errors with specific attributes of some HTML elements of the license block.

    All these had been overlooked.

    About the error with the inline style, I guess I’ll be able to fix this and make a new release soon or provide a workaround.

    About the other errors with the HTML attributes, I’m afraid these won’t be fixed any time soon, as they are going to require much research about the HTML markup that should be used instead and, possibly, significant changes of the code due to the complicated way in which the license block is generated. To be honest, there are no plans to touch this part of the plugin in the following months/years. Also, please note that the license block generated by this plugin is different than the license block provided by creativecommons.org. Please take all these into consideration and, if full HTML validation and full compliance with the HTML code as provided by creativecommons.org are major requirements, I’d highly recommend checking other plugins that generate CC licenses.

    Apart from the above, I cannot see any other problem. So, I will now close this topic. Please feel free to add more feedback about the validation errors.

    Plugin Author George Notaras

    (@gnotaras)

    The following code should prevent the plugin’s internal style from being added to the AMP page. You can put this code in the theme’s functions.php file:

    function no_internal_cc_style_on_amp_pages( $default ) {
        if ( function_exists('is_amp_endpoint') && is_amp_endpoint() ) {
            return '';
        }
        return $default;
    }
    add_filter('bccl_style', 'no_internal_cc_style_on_amp_pages');

    A similar solution will be implemented into the plugin in the future.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problems with Google's AMP’ is closed to new replies.