Skip to content

Commit

Permalink
code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Feb 23, 2024
1 parent ae3a37b commit ce02bdf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ function maybe_collect_request()
collect_request();
}

function extract_pageview_data() : array {
function extract_pageview_data(): array
{
// do nothing if a required parameter is missing
if (
!isset($_GET['p'])
|| !isset($_GET['nv'])
|| !isset($_GET['up']))
{
|| !isset($_GET['up'])
) {
return array();
}

Expand All @@ -49,7 +50,8 @@ function extract_pageview_data() : array {
);
}

function extract_event_data() : array {
function extract_event_data(): array
{
if (!isset($_GET['e']) || !isset($_GET['p']) || !isset($_GET['u']) || !isset($_GET['v'])) {
return array();
}
Expand Down Expand Up @@ -84,9 +86,9 @@ function collect_request()
} else {
\header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
}
} else {
} else {
\header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
}
}

\header('Content-Type: text/plain');

Expand Down
4 changes: 2 additions & 2 deletions src/views/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<p>
<?php $seconds_since_last_aggregation = (time() - (int) get_option('koko_analytics_last_aggregation_at', 0)); ?>
<?php esc_html_e('Last aggregation:', 'koko-analytics'); ?>
<span style="<?php echo $seconds_since_last_aggregation > 300 ? 'color: red;': ''; ?>">
<?php printf( __( '%d seconds ago', 'koko-analytics'), $seconds_since_last_aggregation ); ?>
<span style="<?php echo $seconds_since_last_aggregation > 300 ? 'color: red;' : ''; ?>">
<?php printf(__('%d seconds ago', 'koko-analytics'), $seconds_since_last_aggregation); ?>
</span>
</p>
<div class="ka-margin-m">
Expand Down

0 comments on commit ce02bdf

Please sign in to comment.