Ticket #24 (new enhancement)

Opened 4 years ago

Last modified 13 months ago

allow working in a wp-cache enabled wordpress blog

Reported by: omry Owned by: omry
Priority: Normal Milestone:
Component: FireStats Version: 0.9.4-beta
Severity: Normal Keywords:
Cc:

Description

more info here

Attachments

Change History

  Changed 3 years ago by omry

  • milestone set to 1.3

  Changed 3 years ago by omry

  • milestone 1.3 deleted

Since wp-cache does not initialize WordPress core for the cached pages, its impossible to access any WordPress resources from the cached pages. this means that even if I modify FireStats to record the hits, the functionality of excluding hits from specific users on WordPress will be broken.

At this moment it seems unlikely that FireStats will support wp-cache, but I will this some more thought later.

follow-up: ↓ 6   Changed 3 years ago by omry

Those are instructions to get FireStats 1.2 working with wp-cache. this will probably be a bit easier in future versions.

1. install firestats as satellite.

2. edit firestats-wordpress.php (inside your plugins dir) like this:

comment line 21:

#add_action('wp_head', 'fs_add_wordpress', 1);

comment line 113:

#require_once($__path.'/php/db-hit.php');

3. open FireStats (standalone or the one in wordpress), go to the sites management tab and create a new generic PHP site for your blog.

clean on the help button next to it, it will tell you to add a php command similar to the following into the file you want to monitor:

<?php include('/home/omry/dev/php/firestats-1.2/php/db-hit.php');
fs_add_site_hit(1); ?>

(Note that it has the correct path for you and the correct site_id for the site you just created).

4. create a new file called firestats-wp-cache-hit.php inside your plugins dir, and put the PHP command from the help page into it.

5. last step: edit your theme header.php (inside wp-content/themes/YOUR_THEME), and add this inside the head section (<head>HERE</head>) :

<!--mclude wp-content/plugins/firestats-wp-cache-hit.php-->
<?php include_once(ABSPATH .
'wp-content/plugins/firestats-wp-cache-hit.php'); ?>
<!--/mclude-->`

that should do it, you will probably need to clear your wp-cache directory to make it start counting right away.

in reply to: ↑ 5   Changed 3 years ago by anonymous

Replying to omry:

Those are instructions to get FireStats 1.2 working with wp-cache. this will probably be a bit easier in future versions. 1. install firestats as satellite. 2. edit firestats-wordpress.php (inside your plugins dir) like this: comment line 21: {{{ #add_action('wp_head', 'fs_add_wordpress', 1); }}} comment line 113: {{{ #require_once($path.'/php/db-hit.php'); }}} 3. open FireStats (standalone or the one in wordpress), go to the sites management tab and create a new generic PHP site for your blog. clean on the help button next to it, it will tell you to add a php command similar to the following into the file you want to monitor: {{{ <?php include('/home/omry/dev/php/firestats-1.2/php/db-hit.php'); fs_add_site_hit(1); ?> }}} (Note that it has the correct path for you and the correct site_id for the site you just created). 4. create a new file called firestats-wp-cache-hit.php inside your plugins dir, and put the PHP command from the help page into it. 5. last step: edit your theme header.php (inside wp-content/themes/YOUR_THEME), and add this inside the head section (<head>HERE</head>) : {{{ <!--mclude wp-content/plugins/firestats-wp-cache-hit.php--> <?php include_once(ABSPATH . 'wp-content/plugins/firestats-wp-cache-hit.php'); ?> <!--/mclude-->` }}} that should do it, you will probably need to clear your wp-cache directory to make it start counting right away.

Thanks for that. Worked a treat.

  Changed 13 months ago by Phelsdessig

Awesome blog! Subscribed on rss. Regular will read it. Good job.

Add/Change #24 (allow working in a wp-cache enabled wordpress blog)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.