How to disable/enable a plugin at a specific time

You can use deactivate_plugins() function to deactivate a plugin if ( ! wp_next_scheduled( ‘deactivate_plugin_conditional_hook’ ) ) { wp_schedule_event( time(), ‘twicedaily’, ‘deactivate_plugin_conditional_hook’ ); } add_action( ‘deactivate_plugin_conditional_hook’, ‘deactivate_plugin_conditional_2345678999343434’ ); function deactivate_plugin_conditional_2345678999343434() { $plugin_path=”plugin-folder/plugin-name.php”; if ( is_plugin_active($plugin_path) ) { deactivate_plugins($plugin_path); } } You can set custom event see here https://codex.wordpress.org/Function_Reference/wp_schedule_event Note: this is not tested code

Function settings_fields() not recognized (Uncaught Error: Call to undefined function settings_fields())

Nevermind guys, I found the problem by myself.. Original and wrong code: $this->pages = [ [ ‘page_title’ => ‘WT Domain Check’, ‘menu_title’ => ‘WTDomCheck’, ‘capability’ => ‘manage_options’, ‘menu_slug’ => ‘wtdomaincheck’, ‘callback’ => $this->LoadSettingTemplate(), ‘icon_url’ => ‘dashicons-store’, ‘position’ => 117 ] ]; Corrected line: ‘callback’ => array($this,’LoadSettingTemplate’),

Multisite converted to Single Site can’t add new plugins or new themes

Check your wp-config.php file and remove multisite code. remove code like define(‘WP_ALLOW_MULTISITE’, true); and define(‘MULTISITE’, true); define(‘SUBDOMAIN_INSTALL’, false); define(‘DOMAIN_CURRENT_SITE’, ‘yoursite.com’); define(‘PATH_CURRENT_SITE’, “https://wordpress.stackexchange.com/”); define(‘SITE_ID_CURRENT_SITE’, 1); define(‘BLOG_ID_CURRENT_SITE’, 1); Also, check your .htaccess file and remove those multisite.