Title: Odd code on page
Last modified: August 22, 2016

---

# Odd code on page

 *  [milkovic](https://wordpress.org/support/users/milkovic/)
 * (@milkovic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/)
 * Recently my client updated their plugins on their WP Website and it broke the
   Content Protector shortcode. Here’s an example of what’s going on:
    [http://jaredkesslercreative.com/test/](http://jaredkesslercreative.com/test/)
 * Here’s the shortcode on the page:
    [content_protector password=”test” identifier
   =”protectMe” cookie_expires=”10000″ ajax=”false”]Testing[/content_protector]
 * Everything looks ok and I haven’t been able to figure out what’s going on. Any
   suggestions?
 * [https://wordpress.org/plugins/content-protector/](https://wordpress.org/plugins/content-protector/)

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

 *  [K. Tough](https://wordpress.org/support/users/kjvtough/)
 * (@kjvtough)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499112)
 * 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](https://wordpress.org/support/users/kjvtough/)
 * (@kjvtough)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499114)
 * Also, you should probably add a unit of time to your `cookies_expires` attribute(
   seconds, minutes, etc.).
 *  Thread Starter [milkovic](https://wordpress.org/support/users/milkovic/)
 * (@milkovic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499177)
 * 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: [http://jaredkesslercreative.com/test/](http://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](https://wordpress.org/support/users/kjvtough/)
 * (@kjvtough)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499180)
 * 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](https://wordpress.org/support/users/milkovic/)
 * (@milkovic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499201)
 * 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](https://wordpress.org/support/users/orbisius/)
 * (@orbisius)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499206)
 * Hi,
 * The Child Theme Creator doesn’t modify the content.
    The content can be modified
   by using the double Editors.
 * _[ [Signature moderated](http://codex.wordpress.org/Forum_Welcome#Signatures)
   Could you stop that please? ]_
 *  [K. Tough](https://wordpress.org/support/users/kjvtough/)
 * (@kjvtough)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499223)
 * 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.

 * ![](https://ps.w.org/content-protector/assets/icon-256x256.png?rev=2206760)
 * [Passster - Password Protect Pages and Content](https://wordpress.org/plugins/content-protector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-protector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-protector/)
 * [Active Topics](https://wordpress.org/support/plugin/content-protector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-protector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-protector/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [K. Tough](https://wordpress.org/support/users/kjvtough/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/odd-code-on-page/#post-5499223)
 * Status: not resolved