Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a download report button #3319

Merged
merged 6 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions assets/css/status-report.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
}

.ep-copy-button-wrapper {
align-items: center;
display: inline-flex;
margin: 0.5rem 0 1rem;
}

Expand Down
3 changes: 3 additions & 0 deletions includes/classes/Screen/StatusReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public function render_reports() {
?>
<p><?php esc_html_e( 'This screen provides a list of information related to ElasticPress and synced content that can be helpful during troubleshooting. This list can also be copy/pasted and shared as needed.', 'elasticpress' ); ?></p>
<p class="ep-copy-button-wrapper">
<a download="elasticpress-report.txt" href="data:text/plain;charset=utf-8,<?php echo rawurlencode( implode( "\n\n", $copy_paste_output ) ); ?>" class="button button-primary" id="ep-download-report">
<?php esc_html_e( 'Download report', 'elasticpress' ); ?>
</a>
<button class="button" data-clipboard-text="<?php echo esc_attr( implode( "\n\n", $copy_paste_output ) ); ?>" id="ep-copy-report" type="button">
<?php esc_html_e( 'Copy status report to clipboard', 'elasticpress' ); ?>
</button>
Expand Down