Skip to content

Commit 5c7d828

Browse files
committed
Admin/Styles changes
* Better contrast for "modified text" * Rewritten clear cache JS * Fixed jquery migrate warnings * Buttons styles
1 parent 3767795 commit 5c7d828

15 files changed

+1007
-276
lines changed

includes/admin/class-admin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public function admin_enqueue_scripts() {
230230
)
231231
);
232232
wp_register_style(
233-
'tptn-admin-ui-css',
234-
TOP_TEN_PLUGIN_URL . 'includes/admin/css/top-10-admin.min.css',
233+
'top-ten-admin-css',
234+
TOP_TEN_PLUGIN_URL . 'includes/admin/css/admin-styles.min.css',
235235
array(),
236236
TOP_TEN_VERSION
237237
);

includes/admin/class-dashboard.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function admin_enqueue_scripts( $hook ) {
222222
'charttitle' => __( 'Daily Visits', 'top-10' ),
223223
)
224224
);
225-
wp_enqueue_style( 'tptn-admin-ui-css', );
225+
wp_enqueue_style( 'top-ten-admin-css' );
226226
}
227227
}
228228

includes/admin/class-statistics.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct() {
5555
public function admin_enqueue_scripts( $hook ) {
5656
if ( $hook === $this->parent_id ) {
5757
wp_enqueue_script( 'top-ten-admin-js' );
58-
wp_enqueue_style( 'tptn-admin-ui-css', );
58+
wp_enqueue_style( 'top-ten-admin-css' );
5959
}
6060
}
6161

includes/admin/class-tools-page.php

+13-4
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ public function network_admin_menu() {
9292
public function admin_enqueue_scripts( $hook ) {
9393
if ( $hook === $this->parent_id ) {
9494
wp_enqueue_script( 'top-ten-admin-js' );
95-
wp_enqueue_style( 'tptn-admin-ui-css', );
95+
wp_enqueue_style( 'top-ten-admin-css' );
9696
wp_localize_script(
9797
'top-ten-admin-js',
98-
'tptn_admin_data',
98+
'top_ten_admin_data',
9999
array(
100-
'security' => wp_create_nonce( 'tptn-admin' ),
100+
'ajax_url' => admin_url( 'admin-ajax.php' ),
101+
'security' => wp_create_nonce( 'tptn-admin' ),
102+
'confirm_message' => esc_html__( 'Are you sure you want to clear the cache?', 'top-10' ),
103+
'fail_message' => esc_html__( 'Failed to clear cache. Please try again.', 'top-10' ),
104+
'request_fail_message' => esc_html__( 'Request failed: ', 'top-10' ),
101105
)
102106
);
103107
}
@@ -181,7 +185,12 @@ public function render_page() {
181185

182186
<h2 style="padding-left:0px"><?php esc_html_e( 'Clear cache', 'top-10' ); ?></h2>
183187
<p>
184-
<input type="button" name="cache_clear" id="cache_clear" value="<?php esc_attr_e( 'Clear cache', 'top-10' ); ?>" class="button button-secondary" onclick="return clearCache();" />
188+
<?php
189+
printf(
190+
'<button type="button" name="tptn_cache_clear" class="button button-secondary tptn_cache_clear" aria-label="%1$s">%1$s</button>',
191+
esc_html__( 'Clear cache', 'top-10' )
192+
);
193+
?>
185194
</p>
186195
<p class="description">
187196
<?php esc_html_e( 'Clear the Top 10 cache. This will also be cleared automatically when you save the settings page.', 'top-10' ); ?>

0 commit comments

Comments
 (0)