WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Simple Firewall
[resolved] Awesome plugin except for added html into xml (10 posts)

  1. rwilki
    Member
    Posted 11 months ago #

    Love this plugin. Seems very effective and definitely easy to use!

    I use a shipping plugin that generates an xml file from orders. My editor is telling me that there's extra html code in the xml import and it can't complete the import.

    It worked fine last week and the only change I've made to the site was adding this plugin. I've tracked it down to the code here...

    Do you think there's an error in the code in the file (icwp-data-processor.php)

    static public function GenerateRandomString( $innLength = 10, $infBeginLetter = false ) {
    		$aChars = array( 'abcdefghijkmnopqrstuvwxyz' );
    		$aChars[] = 'ABCDEFGHJKLMNPQRSTUVWXYZ';
    		$sCharset = implode( '', $aChars );
    		if ( $infBeginLetter ) {
    			$sPassword = $sCharset[ ( rand() % strlen( $sCharset ) ) ];
    		}
    		else {
    			$sPassword = '';
    		}
    		$sCharset .= '023456789';

    Are we missing a "1"?

    Thanks,
    Bob

    http://wordpress.org/plugins/wp-simple-firewall/

  2. Paul G.
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Bob,

    The code above is missing a "1" and and "I" and "O" because they can be ambiguous and if I use this function to generate human-usable strings, I prefer not to have the ambiguity. So while it's missing this, it isn't a problem for the code at all.

    Do you have a copy of the HTML being output? This plugin doesn't out HTML except where it's needed basically.

    Now what you might have happening is a PHP Notice (not an error, but just a notice of something that could be done better) of some sort that is being printed out. If you can grab a copy of whatever text is being output, we can fix that quite quickly.

    Thanks!
    Paul.

  3. rwilki
    Member
    Posted 11 months ago #

    Thanks for the reply Paul. Here's the html being output. Once I removed your plugin, the problem went away. So, sadly, it's this plugin with my shipping plugin that's the problem.

    <?xml version="1.0" standalone="yes" ?>
    <!DOCTYPE html><!--
    abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono
    -->

    Thanks,
    Bob

  4. Paul G.
    Member
    Plugin Author

    Posted 11 months ago #

    Have you tried running exactly the same thing but with the Simple Fireall plugin turned off?

    You'll spot in the text there are characters in there that aren't in the function you copy-pasted at the start, such "1", "i", "l".
    I'm not sure this is as a result of the Simple Firewall. If you can definitely narrow the culprit down to this plugins I'll need to take a much closer look at your site.

    Thanks,
    Paul.

  5. rwilki
    Member
    Posted 11 months ago #

    Everything works fine with the plugin deactivated, but creates the extra html when activated.

    I can't reactivate the plugin unfortunately, because that will break the shipping import again...

    Is there a conflict with your plugin and woocommerce 2.x?

    Thanks,
    Bob

  6. Paul G.
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Bob,

    The only way I'd be able to fix this if there is an problem is to have access to the site that is causing this problem.

    Would that be possible in this case, or a test site that's setup similarly to this? I simply can't imagine how that html is being output by this plugin. Did you install this plugin directly from WordPress.org, and you're on the latest version?

    It's impossible to test all possible plugins in advance, and huge ones like woocommerce even less so.

    Let me know if you have a setup I could have access to, to see this in action.
    Thanks,
    Paul.

  7. rwilki
    Member
    Posted 11 months ago #

    Thanks for your time Paul. I appreciate it. It would take me so long to duplicate this site on another server, it's not really worth it. Your plugin is great and I really like it but this site is in production and I can't hand over the keys at this time.

    The developer of the plugin that was throwing errors is the one who pointed out one of two plugins as the potential problem. Unfortunately, it was yours that seemed to be the cause - or at least the one which doesn't play well with the rest of my site plugins.

    Thanks again,
    Bob

  8. Paul G.
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Bob,

    No problem, I completely understand.

    I appreciate that this is a live site and messing about with it isn't ideal. If it is the plugin that's causing the issue it might be worth determining which section of the plugin it is.

    Since each section of the plugin can be turned on and off independently, this is what I would do:

    1) Activate the plugin and turn off all the individual sections:
    firewall, comments, login protection, lockdown.
    2) Run a test to see where the plugin that has the problem still has the problem - it shouldn't do if all firewall sections are turned off.
    3) Activate 1 section on the Simple Firewall plugin.
    4) Run a test again and note if it fails.
    5) Deactivate the previous section and activate another.
    6) Run a test again and note if it fails.

    Then repeat steps 3-6 until all 4 sections of the plugin have been tested against the plugin that is reporting the problem.

    This would very clearly narrow down exactly where the code is that's causing the problem.

    If this was an option, I'd be really keen to hear the results of this.

    Let me know what you think.
    Paul.

  9. rwilki
    Member
    Posted 11 months ago #

    I sure will try this. Thanks for the explanation.

    Bob

  10. Paul G.
    Member
    Plugin Author

    Posted 9 months ago #

    I'm going to close up this ticket unless you've got anything more to add to this. I'd be keen to hear what your experience was if you tried out this test.

    Thanks!
    Paul.

Reply

You must log in to post.

About this Plugin

About this Topic