Skip to content

Commit 6086338

Browse files
fix phpcs errors
1 parent d89a593 commit 6086338

File tree

2 files changed

+38
-36
lines changed

2 files changed

+38
-36
lines changed

src/class-jetpack-importer.php

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public function show_page(): void
2121
<div class="wrap" style="max-width: 820px;">
2222

2323
<?php if (isset($_GET['success']) && $_GET['success'] == 0) { ?>
24-
<div class="notice notice-error is-dismissible"><p><?php esc_html_e( 'Sorry, something went wrong in trying to retrieve your stats from WordPress.com. Please check whether your API key and blog URL are correct.', 'koko-analytics' ); ?></p></div>
24+
<div class="notice notice-error is-dismissible"><p><?php esc_html_e('Sorry, something went wrong in trying to retrieve your stats from WordPress.com. Please check whether your API key and blog URL are correct.', 'koko-analytics'); ?></p></div>
2525
<?php } ?>
2626

2727
<?php if (isset($_GET['success']) && $_GET['success'] == 1) { ?>
28-
<div class="notice notice-success is-dismissible"><p><?php esc_html_e( 'Big success! Your stats are now imported into Koko Analytics.', 'koko-analytics' ); ?></p></div>
28+
<div class="notice notice-success is-dismissible"><p><?php esc_html_e('Big success! Your stats are now imported into Koko Analytics.', 'koko-analytics'); ?></p></div>
2929
<?php } ?>
3030

31-
<h1><?php esc_html_e( 'Import analytics from JetPack Stats', 'koko-analytics' ); ?></h1>
32-
<p><?php esc_html_e( 'To import your historical analytics data from JetPack Stats into Koko Analytics, provide your WordPress.com API key and blog URL in the field below.', 'koko-analytics' ); ?></p>
31+
<h1><?php esc_html_e('Import analytics from JetPack Stats', 'koko-analytics'); ?></h1>
32+
<p><?php esc_html_e('To import your historical analytics data from JetPack Stats into Koko Analytics, provide your WordPress.com API key and blog URL in the field below.', 'koko-analytics'); ?></p>
3333

3434
<form method="post" onsubmit="return confirm('<?php esc_attr_e('Are you sure you want to import statistics between', 'koko-analytics'); ?> ' + this['date-start'].value + '<?php esc_attr_e(' and ', 'koko-analytics'); ?>' + this['date-end'].value + '<?php esc_attr_e('? This will overwrite any existing data in your Koko Analytics database tables.', 'koko-analytics'); ?>');" action="<?php echo esc_url(admin_url('index.php?page=koko-analytics&tab=jetpack_importer')); ?>">
3535

@@ -38,49 +38,49 @@ public function show_page(): void
3838

3939
<table class="form-table">
4040
<tr>
41-
<th><label for="wpcom-api-key"><?php esc_html_e( 'WordPress.com API key', 'koko-analytics' ); ?></label></th>
41+
<th><label for="wpcom-api-key"><?php esc_html_e('WordPress.com API key', 'koko-analytics'); ?></label></th>
4242
<td>
4343
<input id="wpcom-api-key" type="text" class="regular-text" name="wpcom-api-key" required>
44-
<p class="description"><?php printf(esc_html__( 'You can %1$sfind your WordPress.com API key here%2$s.', 'koko-analytics' ),'<a href="https://apikey.wordpress.com/" target="_blank">','</a>'); ?></p>
44+
<p class="description"><?php printf(esc_html__('You can %1$sfind your WordPress.com API key here%2$s.', 'koko-analytics'), '<a href="https://apikey.wordpress.com/" target="_blank">', '</a>'); ?></p>
4545
</td>
4646
</tr>
4747

4848
<tr>
49-
<th><label for="wpcom-blog-uri"><?php esc_html_e( 'Blog URL', 'koko-analytics' ); ?></label></th>
49+
<th><label for="wpcom-blog-uri"><?php esc_html_e('Blog URL', 'koko-analytics'); ?></label></th>
5050
<td>
5151
<input id="wpcom-blog-uri" type="text" class="regular-text" name="wpcom-blog-uri" value="<?php echo esc_attr(get_site_url()); ?>" required>
52-
<p class="description"><?php esc_html_e( 'The full URL to the root directory of your blog. Including the full path.', 'koko-analytics' ); ?></p>
52+
<p class="description"><?php esc_html_e('The full URL to the root directory of your blog. Including the full path.', 'koko-analytics'); ?></p>
5353
</td>
5454
</tr>
5555

5656
<tr>
57-
<th><label for="date-start"><?php esc_html_e( 'Start date', 'koko-analytics' ); ?></label></th>
57+
<th><label for="date-start"><?php esc_html_e('Start date', 'koko-analytics'); ?></label></th>
5858
<td>
5959
<input id="date-start" name="date-start" type="date" value="<?php echo esc_attr(date('Y-m-d', strtotime('-1 year'))); ?>" required>
60-
<p class="description"><?php esc_html_e( 'The earliest date for which to import data. You should probably set this to the date that you installed and activated Jetpack Stats.', 'koko-analytics' ); ?></p>
60+
<p class="description"><?php esc_html_e('The earliest date for which to import data. You should probably set this to the date that you installed and activated Jetpack Stats.', 'koko-analytics'); ?></p>
6161

6262
</td>
6363
</tr>
6464

6565
<tr>
66-
<th><label for="date-end"><?php esc_html_e( 'End date', 'koko-analytics' ); ?></label></th>
66+
<th><label for="date-end"><?php esc_html_e('End date', 'koko-analytics'); ?></label></th>
6767
<td>
6868
<input id="date-end" name="date-end" type="date" value="<?php echo esc_attr(date('Y-m-d')); ?>" required>
69-
<p class="description"><?php esc_html_e( 'The last date for which to import data. You should probably set this to just before the date that you installed and activated Koko Analytics.', 'koko-analytics' ); ?></p>
69+
<p class="description"><?php esc_html_e('The last date for which to import data. You should probably set this to just before the date that you installed and activated Koko Analytics.', 'koko-analytics'); ?></p>
7070

7171
</td>
7272
</tr>
7373
</table>
7474

7575
<p>
76-
<button type="submit" class="button"><?php esc_html_e( 'Import analytics data', 'koko-analytics' ); ?></button>
76+
<button type="submit" class="button"><?php esc_html_e('Import analytics data', 'koko-analytics'); ?></button>
7777
</p>
7878
</form>
7979

8080
<div class="ka-margin-m">
81-
<h3><?php esc_html_e( 'Things to know before running the import', 'koko-analytics' ); ?></h3>
82-
<p><?php esc_html_e( 'Importing data for a given date range will add to any existing data. The import process can not be reverted unless you reinstate a back-up of your database in its current state.', 'koko-analytics' ); ?></p>
83-
<p><?php esc_html_e( 'It\'s also important to know that JetPack doesn\'t provide data for the distinct number of visitors, so the data imported will only import the total number of pageviews for each post and therefore differ slightly from data collected by Koko Analytics itself.', 'koko-analytics' ); ?></p>
81+
<h3><?php esc_html_e('Things to know before running the import', 'koko-analytics'); ?></h3>
82+
<p><?php esc_html_e('Importing data for a given date range will add to any existing data. The import process can not be reverted unless you reinstate a back-up of your database in its current state.', 'koko-analytics'); ?></p>
83+
<p><?php esc_html_e('It\'s also important to know that JetPack doesn\'t provide data for the distinct number of visitors, so the data imported will only import the total number of pageviews for each post and therefore differ slightly from data collected by Koko Analytics itself.', 'koko-analytics'); ?></p>
8484
</div>
8585
</div>
8686
<?php
@@ -193,14 +193,16 @@ public function import_chunk(): void
193193
?>
194194
<style>body { background: #f0f0f1; color: #3c434a; font-family: sans-serif; font-size: 16px; line-height: 1.5; padding: 32px; }</style>
195195
<meta http-equiv="refresh" content="1; url=<?php echo esc_attr($url); ?>">
196-
<h1><?php esc_html_e( 'Liberating your data... Please wait.', 'koko-analytics' ); ?></h1>
197-
<p><?php printf(
198-
__('Importing stats between %1$s and %2$s.', 'koko-analytics'),
199-
'<strong>' . $chunk_start->format('Y-m-d') . '</strong>',
200-
'<strong>' . $chunk_end->format('Y-m-d') . '</strong>'
201-
);?></p>
202-
<p><?php esc_html_e( 'Please do not close this browser tab while the importer is running.', 'koko-analytics' ); ?></p>
203-
<p><?php printf( __( 'Estimated time left: %s seconds.', 'koko-analytics' ), round($chunks_left * 1.5) ); ?></p>
196+
<h1><?php esc_html_e('Liberating your data... Please wait.', 'koko-analytics'); ?></h1>
197+
<p>
198+
<?php printf(
199+
__('Importing stats between %1$s and %2$s.', 'koko-analytics'),
200+
'<strong>' . $chunk_start->format('Y-m-d') . '</strong>',
201+
'<strong>' . $chunk_end->format('Y-m-d') . '</strong>'
202+
);?>
203+
</p>
204+
<p><?php esc_html_e('Please do not close this browser tab while the importer is running.', 'koko-analytics'); ?></p>
205+
<p><?php printf(__('Estimated time left: %s seconds.', 'koko-analytics'), round($chunks_left * 1.5)); ?></p>
204206
<?php
205207
exit;
206208
}

src/views/settings-page.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@
204204
<?php if (! defined('KOKO_ANALYTICS_PRO_VERSION')) { ?>
205205
<div>
206206
<div class="ka-pro-cta ka-margin-m">
207-
<h2><?php esc_html_e( 'Upgrade to Koko Analytics Pro', 'koko-analytics' ); ?></h2>
208-
<p><?php printf(esc_html__( 'You are currently using the free version of Koko Analytics. There is a paid add-on called %1$sKoko Analytics Pro%2$s which adds several powerful features:', 'koko-analytics' ),'<a href="https://www.kokoanalytics.com/pricing/" target="_blank">','</a>'); ?></p>
207+
<h2><?php esc_html_e('Upgrade to Koko Analytics Pro', 'koko-analytics'); ?></h2>
208+
<p><?php printf(esc_html__('You are currently using the free version of Koko Analytics. There is a paid add-on called %1$sKoko Analytics Pro%2$s which adds several powerful features:', 'koko-analytics'), '<a href="https://www.kokoanalytics.com/pricing/" target="_blank">', '</a>'); ?></p>
209209
<ul class="ul-square">
210-
<li><?php esc_html_e( 'Track outbound link clicks', 'koko-analytics' ); ?></li>
211-
<li><?php esc_html_e( 'Track form submissions', 'koko-analytics' ); ?></li>
212-
<li><a href="https://www.kokoanalytics.com/kb/tracking-events/" target="_blank"><?php esc_html_e( 'Custom event tracking', 'koko-analytics' ); ?></a></li>
213-
<li><a href="https://www.kokoanalytics.com/2024/08/21/setting-up-email-reports-with-koko-analytics-pro/" target="_blank"><?php esc_html_e( 'Periodic email report of your most important statistics', 'koko-analytics' ); ?></a></li>
214-
<li><?php esc_html_e( 'Export dashboard view to CSV', 'koko-analytics' ); ?></li>
210+
<li><?php esc_html_e('Track outbound link clicks', 'koko-analytics'); ?></li>
211+
<li><?php esc_html_e('Track form submissions', 'koko-analytics'); ?></li>
212+
<li><a href="https://www.kokoanalytics.com/kb/tracking-events/" target="_blank"><?php esc_html_e('Custom event tracking', 'koko-analytics'); ?></a></li>
213+
<li><a href="https://www.kokoanalytics.com/2024/08/21/setting-up-email-reports-with-koko-analytics-pro/" target="_blank"><?php esc_html_e('Periodic email report of your most important statistics', 'koko-analytics'); ?></a></li>
214+
<li><?php esc_html_e('Export dashboard view to CSV', 'koko-analytics'); ?></li>
215215
</ul>
216-
<p><a class="button" href="https://www.kokoanalytics.com/pricing/" target="_blank"><?php esc_html_e( 'View pricing', 'koko-analytics' ); ?></a></p>
217-
<p><?php esc_html_e( 'By purchasing Koko Analytics Pro you get immediate access to these features while simultaneously supporting further development and maintenance of this free plugin.', 'koko-analytics' ); ?></p>
216+
<p><a class="button" href="https://www.kokoanalytics.com/pricing/" target="_blank"><?php esc_html_e('View pricing', 'koko-analytics'); ?></a></p>
217+
<p><?php esc_html_e('By purchasing Koko Analytics Pro you get immediate access to these features while simultaneously supporting further development and maintenance of this free plugin.', 'koko-analytics'); ?></p>
218218
</div>
219219
</div>
220220
<?php } // end if defined KOKO_ANALYTICS_PRO ?>
@@ -227,9 +227,9 @@
227227
<div>
228228
<h2><?php esc_html_e('Help', 'koko-analytics'); ?></h2>
229229
<ul class="ul-square">
230-
<li><?php printf(esc_html__( 'Have a look at our %1$sknowledge base%2$s for help with configuring and using Koko Analytics.', 'koko-analytics' ),'<a href="https://www.kokoanalytics.com/kb/" target="_blank">','</a>'); ?></li>
231-
<li><?php printf(esc_html__( 'Go through our %1$srepository of sample code snippets%2$s for inspiration on modifying the default Koko Analytics behavior.', 'koko-analytics' ),'<a href="https://github.com/ibericode/koko-analytics/tree/main/code-snippets" target="_blank">','</a>'); ?></li>
232-
<li><?php printf(esc_html__( 'Vote on %1$snew features you would like to have in Koko Analytics%2$s.', 'koko-analytics' ),'<a href="https://github.com/ibericode/koko-analytics/discussions?discussions_q=is%3Aopen+sort%3Atop" target="_blank">','</a>'); ?></li>
230+
<li><?php printf(esc_html__('Have a look at our %1$sknowledge base%2$s for help with configuring and using Koko Analytics.', 'koko-analytics'), '<a href="https://www.kokoanalytics.com/kb/" target="_blank">', '</a>'); ?></li>
231+
<li><?php printf(esc_html__('Go through our %1$srepository of sample code snippets%2$s for inspiration on modifying the default Koko Analytics behavior.', 'koko-analytics'), '<a href="https://github.com/ibericode/koko-analytics/tree/main/code-snippets" target="_blank">', '</a>'); ?></li>
232+
<li><?php printf(esc_html__('Vote on %1$snew features you would like to have in Koko Analytics%2$s.', 'koko-analytics'), '<a href="https://github.com/ibericode/koko-analytics/discussions?discussions_q=is%3Aopen+sort%3Atop" target="_blank">', '</a>'); ?></li>
233233
</ul>
234234
</div>
235235

0 commit comments

Comments
 (0)