• Resolved therealgilles

    (@chamois_blanc)


    This plugin appears to be using window.sprintf here:

            checkPassiveVoicePercentage: function(e) {
    var t = r.getParagraphs(this.$wpbContentWrapper)
    , t = r.getPassiveVoicePercentage(t)
    , n = "problems"
    , o = window.sprintf(i18nLocale.passiveVoiceError, t + "%");

    WordPress plugins should never rely on the window unless it’s to use native browser functions, as one never knows how other JS code is going to modify it. Please fix.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    This loc string:

    "%s of the sentences contain passive voice, which is more than the recommended maximum of 10%"

    is most likely misformatted and should instead be:

    "%s of the sentences contain passive voice, which is more than the recommended maximum of 10%%"
    Thread Starter therealgilles

    (@chamois_blanc)

    Same problem in this loc string with 25%:

          'sentenceLengthError' => esc_html__( '%s%% of the sentences contain more than 20 words, which is more than the recommended maximum of 25%.', 'js_composer' ),
    Plugin Support Rohan Khandeparkar

    (@rohanvc)

    Hi,

    Thank you for sharing this with us. We have forwarded it to our development team for further evaluation, and they will take the necessary steps as needed.

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

The topic ‘Please do not use `window.sprintf`’ is closed to new replies.