function nebula_login_errors($error) { $override = apply_filters('pre_nebula_login_errors', false, $error); if ($override !== false) { return $override; } if (!nebula_is_bot()) { $incorrect_username = ''; if (contains($error, array('The password you entered for the username'))) { $incorrect_username_start = strpos($error, "for the username ") + 17; $incorrect_username_stop = strpos($error, " is incorrect") - $incorrect_username_start; $incorrect_username = strip_tags(substr($error, $incorrect_username_start, $incorrect_username_stop)); } if ($incorrect_username != '') { ga_send_event('Login Error', 'Attempted User: '******'IP: ' . $_SERVER['REMOTE_ADDR']); } else { ga_send_event('Login Error', strip_tags($error), 'IP: ' . $_SERVER['REMOTE_ADDR']); } $error = 'Login Error.'; return $error; } }
<h2>Example</h2> <div class="row"> <div class="sixteen columns"> <?php if (nebula_is_bot()) { ?> <p style="font-size: 42px;"><strong>You are a robot!</strong></p> <?php } ?> <p>You are on a <?php echo nebula_get_device('type'); ?> which is a <?php echo nebula_get_device('formfactor'); ?> device. That means it <strong><?php echo nebula_is_desktop() ? 'is' : 'is not'; ?> </strong> a desktop device, it <strong><?php echo nebula_is_tablet() ? 'is' : 'is not'; ?> </strong> a tablet device, and it <strong><?php echo nebula_is_mobile() ? 'is' : 'is not'; ?> </strong> a mobile device.</p> <?php if (nebula_get_device('model') != '') { ?>
$relative_time = nebula_relative_time(); $time_description = implode(' ', $relative_time['description']); $time_range = $relative_time['standard'][0] . ':00' . $relative_time['ampm'] . ' - ' . $relative_time['standard'][2] . ':59' . $relative_time['ampm']; echo 'ga("set", gaCustomDimensions["relativeTime"], "' . ucwords($time_description) . ' (' . $time_range . ')");'; } //Session ID if (nebula_option('nebula_cd_sessionid')) { $session_info = is_debug() ? 'Dbg.' : ''; $session_info .= nebula_is_option_enabled('wireframing') ? 'Wr.' : ''; if (is_client()) { $session_info .= 'Cl.'; } elseif (is_dev()) { $session_info .= 'Dv.'; } $session_info .= is_user_logged_in() ? 'Li.' : ''; $session_info .= nebula_is_bot() ? 'Bt.' : ''; echo 'clientinfo.sessionid = new Date().getTime() + ".' . $session_info . '" + Math.random().toString(36).substring(5);'; echo 'ga("set", gaCustomDimensions["sessionID"], clientinfo.sessionid);'; } //WordPress User ID $current_user = wp_get_current_user(); if ($current_user && nebula_option('nebula_cd_userid')) { echo 'ga("set", gaCustomDimensions["userID"], "' . $current_user->ID . '");'; } //Staff if (nebula_option('nebula_cd_staff')) { $skip = false; if (is_dev()) { $usertype = 'Developer'; } elseif (is_client()) { $usertype = 'Client';