• Hi there.

    I checked our website in semrush and got an issue about “unminified js” for javascript file …plugins/akismet/_inc/akismet-frontend.js? ver=1663161058 .

    What can you suggest to do to solve the issue?

    Is it possible to minify the js file and not lose anything?

    Thanks in advance,
    Vahan

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    Lack of minification reported by such tools isn’t really raising an issue per se, but more of an optimization suggestion.

    Our view is that Javascript in plugins shouldn’t be minified, as we feel it obfuscates the code for anyone looking to learn, or contribute. Akismet being bundled with WP, many would-be developers start their path to learning plugin development by reading through our plugin’s code.

    Note that there are many WP plugins , and server-level (Apache, nginx, etc) modules that can handle this automatically for your whole site.

    Thread Starter vahan889

    (@vahan889)

    Hi @stephdau .

    In such tools, any thing that needs to be done to make a website/page more optimized is usually called an “issue”, it’s not an error or a wrong thing, I know this. It means just need to do some actions to make the site more optimized.

    I think in plugins we can have a js file with two versions:
    – minified,
    – unminified (for developers if they need it),
    and on pages, load minified js, not unminified one.
    What do you think?

    I don’t need any other plugins if I know that the current “issue” can be solved with just one step.

    So, can we have akismet-frontend.js minified version and not lose anything?

    We appreciate the feedback, but we will not be shipping minified JavaScript in the plugin for the reasons that Stephane outlined.

    It’s my personal view that minified JavaScript decreases trust in a plugin, since it’s not clear to other developers and users exactly what the code is doing. Even if the unminified version is available, it’s not guaranteed that the minified version has not been altered by the plugin author or later by some malicious third party.

    Thread Starter vahan889

    (@vahan889)

    Hi @cfinke , thanks for the reply.

    I can understand some points of your reply.
    But if you don’t want to add minified JavaScript just for your personal viewing, then I have nothing to say․ But if we are debating whether it is right to have a minified version of JavaScript, then I disagree․

    When a plugin is installed on a website, every developer can customize every code in the plugin, and I don’t think it can be related to the credibility of the plugin. It cannot be related to who/where/when changed any code in the plugin.

    E.g WooCommerce plugin. Look at it: frontend js . This plugin has more than activity, more than downloads, but they have a minified js version for each js file. Don’t they know about plugin trust?

    What do you think?

    Thanks.

    When a plugin is installed on a website, every developer can customize every code in the plugin, and I don’t think it can be related to the credibility of the plugin. It cannot be related to who/where/when changed any code in the plugin.

    I’m speaking more of the trust that a developer can have that the code has not been modified from the unminified version when installing the plugin. If I were wanting to distribute malicious code, hiding it in the minified version of JavaScript while leaving the unminified version alone would be high on my list of options.

    If the theory is “It is best to serve minified JavaScript for downloads speeds (or whatever reason)”, then I think it is better to solve that problem at a single point with a server module or plugin that automatically minifies all JavaScript for the site rather than relying on each developer of each plugin to minify all of their JavaScript files.

    Thread Starter vahan889

    (@vahan889)

    Hi @cfinke ,

    I just want to clearly understand.

    How will this connect with you when someone adds some js code to the minified js file on your plugin after installation? (when you published your original minified js)

    It’s like a marketing decision: don’t add an optimized js file to solve problems with other plugins.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘akismet-frontend.js – Unminified js issue’ is closed to new replies.