• Resolved roddyguy

    (@roddyguy)


    I have WP installed in a subdirectory. I just installed Ithemes Security and when I try to save settings I get:
    “An “invalid format” error prevented the request from completing as expected. The format of data returned could not be recognized. This could be due to a plugin/theme conflict or a server configuration issue.”

    Security Check also doesn’t work. Is there a config setting I need to set somewhere that will allow Itheme’s to work?

    I’m not concerned about the rest of the site. Just using WP for the blog and would like to protect that sub-folder.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter roddyguy

    (@roddyguy)

    I get this error: An “invalid format” error prevented the request from completing as expected. The format of data returned could not be recognized. This could be due to a plugin/theme conflict or a server configuration issue.

    Thread Starter roddyguy

    (@roddyguy)

    It had nothing to do will the sub-directory. It was a MEMORY problem.

    I solved by adding:
    define(‘WP_MEMORY_LIMIT’, ‘124M’);
    to wp-config.php

    @roddyguy

    Sounds like your issue occurred in the WordPress Dashboard. So should it not be:

    define(‘WP_MAX_MEMORY_LIMIT’, ‘124M’);

    @roddyguy

    … which is useless since the WordPress Dashboard by default sets WP_MAX_MEMORY_LIMIT to 256M.

    Thread Starter roddyguy

    (@roddyguy)

    Not sure what to tell you. What I said I did, fixed my problem.

    @roddyguy

    Hmmm, weird. So if you quote or remove the WP_MEMORY_LIMIT line in the wp-config.php file the issue returns ?

    Perhaps you did something else that fixed the issue …

    Thread Starter roddyguy

    (@roddyguy)

    If I comment out that line, Security Scan still works, but when trying to save Settings, I get – “An “invalid format” error prevented the request from completing as expected. The format of data returned could not be recognized. This could be due to a plugin/theme conflict or a server configuration issue.”

    When I put the line back, I do not get the error.

    @roddyguy

    Ok, here is the deal. All of the below assumes WordPress 4.7.3.

    There are 2 constants in WordPress that can be set in wp-config.php when it comes to allowing it an upper memory limit (PHP memory_limit parameter).

    The default WordPress memory limits (as defined in the wp-includes/default-constants.php file) are:

    Frontend -> 40 MB or 64 MB (multi site)
    Backend -> 256 MB

    … or any higher value if set by PHP (memory_limit parameter).

    The WP_MEMORY_LIMIT constant will (under 1 condition) affect BOTH frontend and backend.
    This is extremely important to understand because when setting WP_MEMORY_LIMIT to solve an error occurring in the backend you are actually affecting both (frontend and backend). This may not be what you want, even though it seems to fix the issue in the backend.
    The WP_MEMORY_LIMIT constant will only also apply to the backend if it is set to a value greater than (default) 256 MB.

    Ok, so next is the WP_MAX_MEMORY_LIMIT constant. The quote below is from the wp-includes/functions.php file:

    * The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory
    * limit available when in the administration back end. The default is 256M
    * (256 megabytes of memory) or the original memory_limit php.ini value if
    * this is higher.

    After reading the above there is only 1 conclusion:

    You cannot affect the max memory for the backend if you set WP_MEMORY_LIMIT to 124M.

    Though there is one important variable missing in your case. The default PHP memory_limit value for your PHP sessions. Using the phpinfo() command in a simple script should tell you this value. Or dig it up from somewhere in your hosting control panel.

    I’m seriously puzzled by this case ?? But I’m sure there is an explanation.
    My advise is to try the WP_MAX_MEMORY_LIMIT constant and set it to a value greater than 256M. If that solves the issue as well I think it is a better solution because the frontend memory limit is not affected. Remember volume is likely to be on the frontend side (site visitors).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP installed in Sub Directory’ is closed to new replies.