| 1 |
<?php |
| 2 |
/** |
| 3 |
* Render the Debug section on the ISC Tools page |
| 4 |
* |
| 5 |
* @var integer $storage_size size of the storage |
| 6 |
*/ |
| 7 |
|
| 8 |
?> |
| 9 |
<p class="description"><?php esc_html_e( 'ISC keeps an internal index of image URLs and IDs from the media library to limit the number of database requests in the frontend.', 'image-source-control-isc' ); ?> |
| 10 |
<br/><?php esc_html_e( 'Click the button above to clear that index.', 'image-source-control-isc' ); ?> |
| 11 |
<a href="<?php echo esc_url( ISC\Admin_Utils::get_manual_url( 'tools-clear-index' ) ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Manual', 'image-source-control-isc' ); ?></a> |
| 12 |
</p> |
| 13 |
<p> |
| 14 |
<?php |
| 15 |
printf( |
| 16 |
// translators: %d is the number of images in storage |
| 17 |
esc_html__( '%d images in storage', 'image-source-control-isc' ), |
| 18 |
(int) $storage_size |
| 19 |
); |
| 20 |
?> |
| 21 |
</p> |
| 22 |
<button id="isc-clear-storage" class="button button-secondary"><?php esc_html_e( 'clear storage', 'image-source-control-isc' ); ?></button> |
| 23 |
<div id="isc-clear-storage-feedback"></div> |
| 24 |
<?php |
| 25 |
// if the WordPress debug mode is enabled, show the button to dump the storage |
| 26 |
if ( $storage_size > 0 && defined( 'WP_DEBUG' ) && WP_DEBUG ) : |
| 27 |
?> |
| 28 |
<br/> |
| 29 |
<button id="isc-show-storage" class="button button-secondary"><?php esc_html_e( 'show storage', 'image-source-control-isc' ); ?></button> |
| 30 |
<pre id="isc-show-storage-output"></pre> |
| 31 |
<?php |
| 32 |
endif; ?> |