account_tab_key); if(isset($_POST['selfpushoptions']) && !empty($_POST['selfpushoptions'])){ if(! wp_verify_nonce( $_POST['_wpnonce'], 'selfpushoptions' )) { print 'Sorry, your nonce did not verify. Please try again.'; exit; } $postid = intval($_POST['selfpushoptions']); $disableBulkSend = $accountOptions[pw_mobile_app_settings::$disableBulkSend]; $disableNotificationCache = $accountOptions[pw_mobile_app_settings::$disableNotificationCache]; $postType = "post"; $postdata = get_post( $postid); $postType = $postdata->post_type; if(class_exists('WP_JSON_Posts')){ $wp_server_posts = new WP_JSON_Posts(new WP_JSON_Server() ); $response = $wp_server_posts->get_post($postid, 'view'); if(isset($response) && isset($response->data)){ $wppost = $response->data; } $title = $wppost['title']; $excerpt = $wppost['pwapp_excerpt']; }else if(class_exists('WP_REST_Posts_Controller')){ //TODO: handle page $wp_server_posts = new WP_REST_Posts_Controller($postdata->post_type); $request = array(); $request['id'] = $postid; $response = $wp_server_posts->get_item($request); //print_r($response); if(isset($response) && isset($response->data)){ $wppost = $response->data; } $title = $wppost['title']['rendered']; $excerpt = $wppost['excerpt']['rendered']; } $postimage = $wppost['featuredimage']; if(empty($postimage)){ $postimage = $wppost['pwapp_post_image']; } $postlink = $wppost['link']; $cache = "yes"; if(isset($disableNotificationCache) && $disableNotificationCache == 'yes'){ $cache = "no"; } if(!empty($title)){ if(isset($_POST['immediate']) && $_POST['immediate'] == '1'){ _e('Push notification Logs','androapp'); echo "
";

                            require_once PW_MOBILE_PATH.'gcm/send_message.php';

                            sendPushNotification(array("post_id" => $postid, 
                                "title" => $title, "excerpt" =>$excerpt,
                                "postImage" => $postimage, "link" => $postlink, "cache" => $cache,
                                "postType" => $postType,
                                "notification_type" => "stack"), 
                            $accountOptions[ANDROAPP_GCM_API_KEY], !($disableBulkSend == '1'));
                            echo "
"; }else{ $this->schedule_push_notification($postid, $title, $excerpt, $postimage, $postlink, $cache, $postType, $accountOptions[ANDROAPP_GCM_API_KEY], !($disableBulkSend == 1)); $this->show_success_message("Scheduled Push Notification"); } }else{ echo "

Invalid Post Id

"; } } ?>


: ()

:


Push Notifications in Queue

'; echo "Post IdTitleExcerptImage Link" . "Post LinkCached on DeviceBulk Send "; $pushPostCount = 0; foreach($crons as $key => $value){ if(is_array($value)){ //print_r($value); foreach($value as $k => $v){ if($k == 'send_push_notification_after_publish'){ $pushPostCount++; //print_r($vv); echo ""; foreach ($v as $kk => $vv){ foreach ($vv['args'] as $ka => $va){ if($ka > 5 && $ka < 9){ continue; } echo "$va"; } } echo ""; } } } } echo ""; echo "

You have $pushPostCount posts in queue

"; if(DISABLE_WP_CRON){ echo "Your cron is disabled, push notification will be attempted when you hit wp-cron.php manually"; } ?>

prefix . 'androapp_stats'; $time = "7days"; if(isset($_GET['time'])){ $time = sanitize_text_field($_GET['time']); } $date = date('Y-m-d', strtotime('-6 days')); $date .= " 00:00:00"; $todate = null; $last7days = "". __('Last 7 Days','androapp').""; $thismonth = "". __('This Month','androapp').""; $lastmonth = "". __('Last Month','androapp').""; $alltime = "". __('All Time','androapp').""; if(empty($time) || $time == "7days"){ $last7days = "".__('Last 7 Days','androapp').""; } if($time == "currentmonth"){ $m = date('m'); $y = date('Y'); $date = $y."-".$m."-01 00:00:00"; $thismonth = "".__('This Month','androapp').""; }else if($time == 'lastmonth'){ $m = date('m'); $y = date('Y'); $todate = $y."-".$m."-01 00:00:00"; $m = intval($m) - 1; if($m == 0){ $m = 12; } if($m < 10){ $m = "0".strval($m); }else{ $m = strval($m); } $date = $y."-".$m."-01 00:00:00"; $lastmonth = "".__('Last Month','androapp').""; }else if($time == 'alltime'){ $date = null; $alltime = "".__('All Time','androapp').""; } $query = "SELECT * FROM $stats_table"; if(!empty($date)){ $query .= " where created_at > '$date'"; } if(!empty($todate)){ $query.= " and created_at < '$todate'"; } //echo "Query ".$query; $result = $wpdb->get_results($query); //echo "
"; print_r($result); echo "
"; echo $last7days . $thismonth . $lastmonth.$alltime; if(empty($result)){ echo "

".__('No Records found for the duration','androapp')." "; }else{ ?> "; echo "" . "" . ""; } ?>
* *
$row->title$row->created_at$row->eligible$row->bulk_sent$row->success$row->notRegistered$row->ios_eligible$row->ios_bulk_sent$row->ios_sent$row->ios_notRegistered$row->mismatchsenderid$row->other$row->status
*Bulk Sent might not reflect the exact send count as it does not take care of un-installs and other errors.