Viewing 7 replies - 1 through 7 (of 7 total)
  • K. Tough

    (@kjvtough)

    Hi, milkovic.

    I’m wondering if one of the other plugins might be running wpautop() on the form code. Can you go into screens/access_form.php and remove any line breaks from any HTML element in the form HTML code and see if that helps.

    -K

    K. Tough

    (@kjvtough)

    Also, you should probably add a unit of time to your cookies_expires attribute (seconds, minutes, etc.).

    Thread Starter milkovic

    (@milkovic)

    Hi,

    I searched and found one <br> in access_form.php and removed it. I also added a unit to the time (minutes).

    Unfortunately, it’s still the same: https://jaredkesslercreative.com/test/

    There are four other plugins active on the site:
    1. All In One SEO Pack
    2. Easy Google Fonts
    3. Google XML Sitemaps
    4. Orbisius Child Theme Creator

    Do you know of any incompatibilities with those plugins? Or do you have any other thoughts?

    Thanks!

    K. Tough

    (@kjvtough)

    It’s not the <br /> that needed to be removed, it’s the actual carriage returns; that’s why there’s no change. For example, find this line in access_form.php:

    <div id="content-protector-incorrect-password<?php echo $identifier; ?>"
          class="content-protector-incorrect-password"><?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_error_message',
           CONTENT_PROTECTOR_DEFAULT_ERROR_MESSAGE ); ?></div>

    and make it all one line like this:

    <div id="content-protector-incorrect-password<?php echo $identifier; ?>" class="content-protector-incorrect-password"><?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_error_message', CONTENT_PROTECTOR_DEFAULT_ERROR_MESSAGE ); ?></div>

    Now do that for all of the <div>, <img>, and <input> elements in the form.

    I would file a ticket w/ the Orbisius Child Theme Creator developers; that’s the only plugin I could see manipulating your post output.

    Thread Starter milkovic

    (@milkovic)

    Ok, I tried that and it doesn’t seem to work either. Code is below if you want to see what I did.

    Btw, during that process I noticed this message on the top:
    Editing content-protector/screens/access_form.php (inactive)

    Is that supposed to say “inactive”?

    Here’s what I adjusted:

    <?php if ( !isset( $is_ajax_processed ) ) { ?><div id="content-protector<?php echo $identifier; ?>" class="content-protector-access-form"><?php } ?>
        <form id="content-protector-access-form<?php echo $identifier; ?>" method="post" action="">
            <?php
            // Error message on unsuccessful attempt. Check $_POST['content-protector-ident'] to make sure
            // we're showing the error message on the right Content Protector access form
            if ( ( isset( $_POST['content-protector-ident'] ) ) && ( $_POST['content-protector-ident'] == $ident ) ) { ?>
                <div id="content-protector-incorrect-password<?php echo $identifier; ?>” class="content-protector-incorrect-password"><?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_error_message', CONTENT_PROTECTOR_DEFAULT_ERROR_MESSAGE ); ?></div>
            <?php } ?>
            <?php if ( !( ( $captcha ) && ( $captcha_instr_mode == 2 ) ) ) { ?>
                <div id="content-protector-form-instructions<?php echo $identifier; ?>"class="content-protector-form-instructions"><?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_form_instructions’, CONTENT_PROTECTOR_DEFAULT_FORM_INSTRUCTIONS ); ?></div>
            <?php } ?>
            <?php if ( $captcha ) { ?>
                <?php if ( $captcha_instr_mode > 0 ) { ?>
                    <div for="content-protector-captcha-instructions<?php echo $identifier; ?>"id="content-protector-captcha-instructions<?php echo $identifier; ?>” class="content-protector-form-instructions"><?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_captcha_instructions’, CONTENT_PROTECTOR_DEFAULT_CAPTCHA_INSTRUCTIONS ); ?></div>
                <?php } ?>
                <img id="content-protector-captcha-img<?php echo $identifier; ?>" class="content-protector-captcha-img"
                     src="<?php echo $this->__generateCaptchaDataUri( $password ); ?>"/>
                <input name="content-protector-captcha" id="content-protector-captcha<?php echo $identifier; ?>"
                       type="hidden" value="1"/>
            <?php } ?>
            <input name="content-protector-password" id="content-protector-password<?php echo $identifier; ?>"
                   class="content-protector-password" type="password" value=""/>
            <?php if ( strlen( trim( $cookie_expires ) ) > 0 ) { ?>
                <input name="content-protector-expires" id="content-protector-expires<?php echo $identifier; ?>"
                       type="hidden" value="<?php echo $cookie_expires; ?>"/>
            <?php } ?>
            <input name="content-protector-token" id="content-protector-token<?php echo $identifier; ?>" type="hidden"
                   value="<?php echo $this->__hashPassword( $password ); ?>"/>
            <input name="content-protector-ident" id="content-protector-ident<?php echo $identifier; ?>" type="hidden"
                   value="<?php echo $ident; ?>"/>
            <input name="content-protector-submit" id="content-protector-submit<?php echo $identifier; ?>"
                   class="content-protector-form-submit" type="submit"
                   value="<?php echo get_option( CONTENT_PROTECTOR_HANDLE . '_form_submit_label', CONTENT_PROTECTOR_DEFAULT_FORM_SUBMIT_LABEL ); ?>"/>
        </form>
    <?php if ( !isset( $is_ajax_processed ) ) { ?></div><?php } ?>
    <?php if ( $ajax ) { ?>
        <script type="text/javascript">
            jQuery( document ).ready( function () {
                jQuery( "#content-protector-access-form<?php echo $identifier; ?>" ).ajaxForm(
                    {
                        target: "#content-protector<?php echo $identifier; ?>",
                        data: {
                            post_id: "<?php echo $post_id; ?>",
                            identifier: "<?php echo $identifier; ?>",
                            ajax_security: "<?php echo wp_create_nonce( "view_" . CONTENT_PROTECTOR_HANDLE . "_" . $post_id . $identifier ); ?>",
                            action: "contentProtectorProcessFormAjax"
                        },
                        url: contentProtectorAjax.ajaxurl,
                        beforeSubmit: contentProtectorBeforeSubmit,
                        success: contentProtectorSuccess,
                        error: contentProtectorError
                    }
                 );
            } );
        </script>
    <?php } ?>
    orbisius

    (@orbisius)

    Hi,

    The Child Theme Creator doesn’t modify the content.
    The content can be modified by using the double Editors.

    [ Signature moderated Could you stop that please? ]

    K. Tough

    (@kjvtough)

    Hi, milkovic.

    You need to do that for all of the form elements, including <input> and <img>. Also, when I look at the page source, I don’t see any changes in the form code at all. Are you sure you’re saving your changes?

    Before you do that, could you try disabling all of your plugins except Content Protector and see if that works? If that does, try enabling the other plugins one by one until the form breaks. The last plugin enabled is where your problem will be.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Odd code on page’ is closed to new replies.