Changeset 13279
- Timestamp:
- 03/05/2024 01:17:22 PM (14 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats-calculator.php
r13268 r13279 66 66 public function for_event( WP_Post $event ): Event_Stats { 67 67 $stats = new Event_Stats(); 68 global $wpdb ;68 global $wpdb, $gp_table_prefix; 69 69 70 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 70 71 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery 71 72 // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching … … 79 80 count(*) as total, 80 81 count(distinct user_id) as users 81 from {$ wpdb->base_prefix}event_actions82 from {$gp_table_prefix}event_actions 82 83 where event_id = %d 83 84 group by locale with rollup -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats-listener.php
r13270 r13279 76 76 /** @var GP_Translation_Set $translation_set Translation set */ 77 77 $translation_set = ( new GP_Translation_Set() )->find_one( array( 'id' => $translation->translation_set_id ) ); 78 global $wpdb ;78 global $wpdb, $gp_table_prefix; 79 79 80 80 foreach ( $events as $event ) { 81 81 // A given user can only do one action on a specific translation. 82 82 // So we insert ignore, which will keep only the first action. 83 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 83 84 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery 84 85 // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching 85 86 $wpdb->query( 86 87 $wpdb->prepare( 87 "insert ignore into {$ wpdb->base_prefix}event_actions (event_id, locale, user_id, original_id, action, happened_at) values (%d, %s, %d, %d, %s, %s)",88 "insert ignore into {$gp_table_prefix}event_actions (event_id, locale, user_id, original_id, action, happened_at) values (%d, %s, %d, %d, %s, %s)", 88 89 array( 89 90 // Start unique key. -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/wporg-gp-translation-events.php
r13269 r13279 73 73 74 74 public function activate() { 75 global $ wpdb;75 global $gp_table_prefix; 76 76 $create_table = " 77 CREATE TABLE `{$ wpdb->base_prefix}event_actions` (77 CREATE TABLE `{$gp_table_prefix}event_actions` ( 78 78 `translate_event_actions_id` int(11) unsigned NOT NULL AUTO_INCREMENT, 79 79 `event_id` int(10) NOT NULL COMMENT 'Post_ID of the translation_event post in the wp_posts table',
Note: See TracChangeset
for help on using the changeset viewer.