| @@ -81,9 +81,9 @@ | ||
| 81 | 81 | return self::$current_timestamp; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function create_date($count = '-7days'){ |
| 85 | - return date('Y-m-d', strtotime($count, self::timestamps())); | |
| 85 | + return gmdate('Y-m-d', strtotime($count, self::timestamps())); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function get_stats( $start_date, $end_date = null ){ |
| 89 | 89 | global $wpdb; |
| @@ -96,8 +96,9 @@ | ||
| 96 | 96 | |
| 97 | 97 | $query = "SELECT MAIN.`nx_id`, MAIN.`title`, MAIN.`type`, STATS.`views`, STATS.`clicks`, STATS.`CTR` FROM ( SELECT P.`nx_id`, title, type FROM {$wpdb->prefix}nx_posts as P LEFT JOIN {$wpdb->prefix}nx_stats as S ON P.`nx_id` = S.`nx_id` GROUP BY P.nx_id ) AS MAIN INNER JOIN ( SELECT *, (clicks/views)*100 as ctr FROM ( SELECT SUM(views) as views, SUM(clicks) as clicks, nx_id FROM {$wpdb->prefix}nx_stats WHERE created_at $extra_query GROUP BY nx_id ) as VCID ) as STATS |
| 98 | 98 | ON MAIN.`nx_id` = STATS.`nx_id`"; |
| 99 | 99 | |
| 100 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared -- False positive: the query is prepared via $this->wpdb->prepare(), which this sniff does not recognise, and only $wpdb->prefix table names are interpolated. Audited 2026-07-16. | |
| 100 | 101 | return $wpdb->get_results( $query ); |
| 101 | 102 | } |
| 102 | 103 | /** |
| 103 | 104 | * Calculate Total NotificationX Views |
| @@ -259,8 +260,9 @@ | ||
| 259 | 260 | * @return subject||String |
| 260 | 261 | */ |
| 261 | 262 | public function email_subject() { |
| 262 | 263 | $site_name = get_bloginfo( 'name' ); |
| 264 | + /* translators: %s: site name */ | |
| 263 | 265 | $subject = sprintf( __( 'Weekly Engagement Summary of “%s”', 'notificationx' ), $site_name ); |
| 264 | 266 | if( isset( $this->settings['reporting_subject'] ) && ! empty( $this->settings['reporting_subject'] ) ) { |
| 265 | 267 | $subject = stripcslashes( $this->settings['reporting_subject'] ); |
| 266 | 268 | } |