Support » Plugin: WordPress Popular Posts » Disable / filter HTML comment

  • Resolved leanderbraunschweig

    (@leanderbraunschweig)


    Hi Hector,

    what a great plugin, thanks so much for this. Especially appreciate the wiki / documentation and the wpp_custom_html-filter to fully customize the output…!

    I came across the HTML comment (used for debugging purposes? see line 159 in src/Output.php)

    <!-- WordPress Popular Posts v5.2.4 -->

    and was wondering if you could add an option to disable it via filter or option on the settings page?

    Thanks again for your time and efforts, kind regards

    Henning

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi @leanderbraunschweig,

    Thanks for the compliments. I’m glad to know you found the documentation (and the plugin) useful!

    That HTML comment is there for debugging purposes, yes. It makes it easier for me to locate WPP on the page and to tell exactly which version is installed on the user’s site.

    With that being said, and while it won’t completely remove the HTML comment, setting WP_DEBUG to false will remove the version number from the HTML comment.

    If you don’t mind me asking, why do you want the HTML comment to be removed?

    Thread Starter leanderbraunschweig

    (@leanderbraunschweig)

    Hey Héctor,

    If you don’t mind me asking, why do you want the HTML comment to be removed?

    I just try to keep things as clean and lean as possible and plugin comments tend to clutter the code – this is very opinionated for sure so this just reflects my preferences…

    A filter would allow to suppress the comment output for advanced users without harming the debugging process for >95% of all sites.

    Your thoughts on this?

    Thanks & regards,
    Henning

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Yeah, can’t say I disagree with you on this. I’m also a fan of clean, uncluttered code myself (which is why, for example, I avoid using page builder plugins in projects whenever I can hahaha.)

    Alright, I’ll keep your suggestion into consideration: Implement a filter hook to remove HTML comments (or remove them altogether).

    Thread Starter leanderbraunschweig

    (@leanderbraunschweig)

    Thanks Héctor, looking forward!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.