the function do_settings_section($page) generate error “Allowed memory size of … bytes exhausted”

You seem to be creating a recursive loop. In stm_addmenu_auto_delete_event(), you register an admin page via add_menu_page() that has a callback of auto_delete_settings_callback: function stm_addmenu_auto_delete_event() { add_menu_page( ‘Automatic deletion’, ‘Automatic <br/> deletion’, ‘manage_options’, ‘manage-auto-delete-page’, ‘auto_delete_settings_callback’, In new_settings_auto_delete you register a settings field with a callback of auto_delete_settings_callback: function new_settings_auto_delete() { // … add_settings_field( ‘default_auto_delete_field’, ‘By … Read more

How to figure out correct wp_options to have autoload=’yes’

WP-Rocket was deactivated, but the wp-content/object-cache.php file was still present. This file redefined the wp_cache_add in such a way that the method didn’t work, so all requests to get a single option value were resulting in a query to the wp_options table. I deleted the wp-content/object-cache.php file and the page response time dropped to 2 … Read more

How to set an option for all sites in my Multisite network?

Excuse me if I’m misunderstanding you, but aren’t the functions add_site_option(), update_site_option() and get_site_option() pretty much, they fall back to single site functions, if not used in a multisite environment, only there for the purpose of having network-wide options. Update: Regarding your need to change a single site option for all sites in your network. … Read more