askbug raport for admins

Solved5.31K viewsGeneraladmin Anspress feature mysql raport
0

Hello,

 

Does anyone made or know how to extract the followings from askbug, in order to build a raport:

  1. all the anspress participants email addresses
  2. total of new users registered during a week
  3. the total number of questions posted in a day
  4. average number of questions during a week
  5. top 3 viewed questions

I’ve tried something directly from mysql database, like:

  1. select user_nicename, user_email, user_registered from wp_users;

  2. select user_nicename, user_registered from wp_users WHERE user_registered  > (DATE(NOW()) – INTERVAL 7 DAY);

but for the rest of them I’m a little bit confused because (eg. number 3) I got all the posts, not only the questions and so on.

 

Thanks,

Question is closed for new answers.
selected answer

Applying directly to the mysql is not a good idea. It is better to use the standard functions

0

4) average number of questions during a week

$q = new WP_Query( array(
‘post_type’ => ‘question’,
‘posts_per_page’ => -1,
‘date_query’ => array(
‘after’ => ‘1 weeks ago’,
),
) );
while ( $q->have_posts() ) {
$q->the_post();
the_title();
}

maybe the code is not the most optimized, but it completely solves your problem.

You are viewing 1 out of 4 answers, click here to view all answers.