WP_MEMORY_LIMIT or WP_MAX_MEMORY_LIMIT ?

the more you know

By default, WordPress enforces a memory limit of 40 MB. This means a single PHP script is allowed to use up to 40 MB of RAM. In certain cases, you may need to increase WordPress’ memory limit to run heavier plugins like WooCommerce or bbPress. To increase WordPress’ memory limit, you can define WP_MEMORY_LIMIT in your wp-config.php file using the line below.

define( 'WP_MEMORY_LIMIT', '256M' );

The setting above will allow WordPress to use up to 256 MB of RAM for each script, as long as the memory_limit setting in your php.ini file is 256 MB or greater. As is often the case with computing resources, setting a higher memory limit doesn’t necessarily increase the performance of your WordPress site. Since WP_MEMORY_LIMIT controls memory allocation PER SCRIPT, it’s actually in your best interest to set it as low as possible to reduce the chance of a rogue script saturating the RAM in your server.

Sometimes, it’s a good idea to tailor WordPress’ memory allocation separately for the frontend and backend. That’s where WP_MAX_MEMORY_LIMIT comes in. WP_MAX_MEMORY_LIMIT allows you to set a different memory limit for WordPress’ administration dashboard. This is useful because certain administration tasks require more RAM. Below is an example of how you can use WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT together.

define( 'WP_MEMORY_LIMIT', '64M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M');

The setting above will allocate up to 64 MB of RAM per PHP script for processes spawned from WordPress’ frontend, while administration-related scripts from the backend dashboard will be able to use up to 256 MB of RAM.

Height of CSS block containing floats

How to give that block the correct height? Read here.
How can I make a div grow its height when it has floats inside of it? I know that defining a value for the width and setting overflow to hidden works. The problem is that I need a div with the overflow visible.

The answer is this: In order for a parent to wrap around children elements which are floated, a new block formatting context needs to be set on the parent. This can be done with:

.wrap {
    display: flow-root;
}

or

.wrap {
    contain: layout;
}

The latter is a bit newer. Either of these have an advantage over overflow: auto; because they have the explicit purpose of creating a new block formatting context, while overflow: auto works as a side effect. Interestingly, flow-root can be also used alongside block or inline for better layout control. For example:

.wrap {
    display: inline flow-root;
}

Read more:

That’s all folks!
Have a nice day…

OceanWP v4.0 loses Google Fonts

Check this! All my OceanWP websites lost their default font and fell back to something Roman, so everything looked ugly! Basically all websites using OceanWP did no longer load their Google fonts after the update to version 4.0.

Solution: I had to manually enable the fonts again! How?
Go to WP Dashboard > Appearance > Customizer > Typography > Google Font Settings and enable Google Fonts – hit “publish” and done!

Looks like someone at OceanWP forgot to check backwards compatibility…

Have a nice day!

KB5043145 update breaks USB

DO NOT INSTALL THAT UPDATE!
(updated 12/10/2024 see at bottom of article)

At least on two of my computers, it completely disabled the USB ports, leaving me without mouse, keyboard, bluetooth and any way of giving any input to the computer to do anything.
Luckily I had Google Remote Desktop installed previously so I could take over the screen and fix the issue.

Not everyone, but others do have the same issue, see:
https://techcommunity.microsoft.com/t5/windows-insider-program/major-problem-with-version-23h2-for-x64-based-systems-kb5043145/m-p/4256541
I also posted my issue here:
https://www.elevenforum.com/t/kb5043145-windows-11-cumulative-update-preview-build-22621-4249-22h2-and-22631-4249-23h2-sept-26.28865/

So what happened:

Continue reading KB5043145 update breaks USB

OceanWP Header background image black

Did you try to control this with a function?
And did it stop working recently and is now only showing a blacked out area?
Did you use the hook ocean_page_header_background_image and the function as posted in the OceanWP docs?

Well… Just change your script to give back the image ID instead of the URL:

if ( is_singular( 'post' ) ) {
  // $bg_img = get_stylesheet_directory_uri() . '/img/my-image.jpg';
  $bg_img = 1394;
}

You’re welcome.
Have a nice day!

PS.
Also posted to support hoping maybe OceanWP can fix this, so we can use the image filename/URL again?

Accessing an old router

Would be a waste to toss an old wifi router that still works…
However it could be a problem to access the admin page because the HTML presenting it is so old that it just won’t show up in a modern browser. It just will not render correctly, tabs empty, buttons and links don’t show.
So, google to the rescue and land here.

My issue was with a Sitecom WL153 but the solution presented simply worked.

“My solution was to download and use an old version of Firefox Portable – no installation required and can run as an unprivileged user. I would suggest you search around for which versions of the browsers will work with your devices.”

For me the 2013 version of Firefox 25 worked like a charm…
Problem solved!

Have a nice day!