Skip to content

Commit

Permalink
banishing delay_first_hit functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Adams committed Dec 17, 2016
1 parent b2b0490 commit 3ab5b7c
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 40 deletions.
2 changes: 0 additions & 2 deletions modules/base/classes/settings.php
Expand Up @@ -542,7 +542,6 @@ private function getDefaultSettingsArray() {
'session_param' => 's',
'site_session_param' => 'ss',
'last_request_param' => 'last_req',
'first_hit_param' => 'first_hit',
'feed_subscription_param' => 'sid',
'source_param' => 'source',
'graph_param' => 'graph',
Expand Down Expand Up @@ -580,7 +579,6 @@ private function getDefaultSettingsArray() {
'log_robots' => false,
'log_sessions' => true,
'log_dom_clicks' => true,
'delay_first_hit' => false,
'async_db' => false,
'clean_query_string' => true,
'fetch_refering_page_info' => true,
Expand Down
10 changes: 0 additions & 10 deletions modules/base/processRequest.php
Expand Up @@ -64,16 +64,6 @@ function action() {

function post() {

if ( owa_coreAPI::getSetting('base', 'delay_first_hit') ) {

// If not, then make sure that there is an inbound visitor_id
if ( ! $this->event->get( 'visitor_id' ) ) {
// Log request properties to a cookie for processing by a second request and return
owa_coreAPI::debug('Logging this request to first hit cookie.');
return $this->log_first_hit();
}
}

owa_coreAPI::debug('Logging '.$this->event->getEventType().' to event queue...');

return $this->addToEventQueue();
Expand Down
11 changes: 0 additions & 11 deletions modules/base/templates/options_general.tpl
Expand Up @@ -81,17 +81,6 @@
On</option>
</select>
</div>
</div>

<div class="setting" id="first_hit">
<div class="title">Delay First Hit</div>
<div class="description">This setting controls whether OWA should delay logging the first hit of new visitors until a secondary http request for a special web bug is made. This tactic is used to foil spiders/robots that spoof their user agents in an attempt to appear like a normal web browser.</div>
<div class="field">
<select name="<?php echo $this->getNs();?>config[base.delay_first_hit]">
<option value="0" <?php if ($config['delay_first_hit'] == false):?>SELECTED<?php endif;?>>Off</option>
<option value="1" <?php if ($config['delay_first_hit'] == true):?>SELECTED<?php endif;?>>On</option>
</select>
</div>
</div>

<div class="setting" id="p3p_policy">
Expand Down
1 change: 0 additions & 1 deletion mw_plugin.php
Expand Up @@ -170,7 +170,6 @@ function owa_singleton() {
$owa->setSetting( 'base', 'link_template', '%s&%s' );
$owa->setSetting( 'base', 'is_embedded', true );
$owa->setSetting( 'base', 'query_string_filters', 'returnto' );
$owa->setSetting( 'base', 'delay_first_hit', false );

if ( ! $wgOwaSiteId ) {
$wgOwaSiteId = md5($wgServer.$wgScriptPath);
Expand Down
16 changes: 2 additions & 14 deletions owa_caller.php
Expand Up @@ -179,22 +179,10 @@ function handleRequestFromUrl() {
*/
function placeHelperPageTags($echo = true, $options = array()) {

if(!owa_coreAPI::getRequestParam('is_robot')) {
if( ! owa_coreAPI::getRequestParam( 'is_robot' ) ) {

// check to see if first hit tag is needed
if ( isset( $options['delay_first_hit'] ) || owa_coreAPI::getSetting('base', 'delay_first_hit')) {

$service = owa_coreAPI::serviceSingleton();
//check for persistant cookie
$v = $service->request->getOwaCookie('v');

if (empty($v)) {

$options['first_hit_tag'] = true;
}
}

if ( ! class_exists( 'owa_template' ) ) {

require_once(OWA_BASE_CLASSES_DIR.'owa_template.php');
}

Expand Down
2 changes: 0 additions & 2 deletions wp_plugin.php
Expand Up @@ -221,8 +221,6 @@ function &owa_getInstance() {
$owa->setSetting( 'base', 'action_url', get_bloginfo('url').'/index.php?owa_specialAction' );
$owa->setSetting( 'base', 'api_url', get_bloginfo('url').'/index.php?owa_apiAction' );
$owa->setSetting( 'base', 'is_embedded', true );
// needed as old installs might have this turned on by default...
$owa->setSetting( 'base', 'delay_first_hit', false );

// Access WP current user object to check permissions
//$current_user = owa_getCurrentWpUser();
Expand Down

0 comments on commit 3ab5b7c

Please sign in to comment.