ignoring, hidding mu plugins when wp-cli is run

I’m the author of Mobile Smart Pro. I’m in the midst of testing WP-CLI with Mobile Smart Pro, and on line 27 of /wp-content/mu-plugins/ you should add the following test: if (!$mobile_smart) return $pluginList; So the section would look like: `function disablePlugins($pluginList) { if (is_admin()) return $pluginList; // only deactivate on front end global $mobile_smart; … Read more

Must use Plugin not updating HTML code in head

I have solved my problem by adding $myCode -> change_url(); and add_action(‘wp_head’, array($myCode, ‘print_header_scripts’)); <?php class some_code { function change_url() { $domain_name = $_SERVER[‘SERVER_NAME’]; $country_code = get_country_code(); if ($country_code == “PK”) { header(“location: http://///////////////”); exit(); } else if ($country_code == “AU” && $domain_name !== “au.cacricketbats.com”) { header(“location: https:///////////////////” . parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH)); exit(); } } function … Read more

Add OR in mu-plugin to check if one of multiple users is the logged in user

Your question boils down to simple PHP. It is basically how to avoid ‘AdminUser’ !== $user->user_login || ‘AdminUser2’ !== $user->user_login || ‘AdminUser3’ !== $user->user_login || ‘AdminUser4’ !== $user->user_login || etc. One way to solve this is use in_array() instead: $allowed_users = [ ‘AdminUser’, ‘AdminUser2’, ‘AdminUser3’, // etc ]; $user = wp_get_current_user(); if($user && isset($user->user_login) && … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)