|
1 | 1 | <script> |
2 | | -function minijJS() { |
3 | | - $.ajax({ |
4 | | - url: '<?php echo admin_url(); ?>minijs.php', |
5 | | - beforeSend: function( xhr ) { |
6 | | - $('a#vv').text('Started in background...this may take a while'); |
7 | | - } |
8 | | -}) |
9 | | - .done(function( data ) { |
10 | | - //alert(data); |
11 | | - if ( data == 'done' ) { |
12 | | - $('a#vv').text('Done.'); |
13 | | - $('code#secod').remove(); |
14 | | - } else { |
15 | | - $('a#vv').text('Failed! Try again.'); |
16 | | - $('a#vv').removeClass('btn-default').addClass('btn-outline btn-danger'); |
17 | | - $('code#secod').text(data).addClass('btn-outline btn-danger active'); |
18 | | - } |
19 | | - }); |
20 | | -} |
| 2 | + function minijJS() { |
| 3 | + $.ajax({ |
| 4 | + url: '<?php echo admin_url(); ?>minijs.php', |
| 5 | + beforeSend: function (xhr) { |
| 6 | + $('a#vv').text('Started in background...this may take a while'); |
| 7 | + } |
| 8 | + }) |
| 9 | + .done(function (data) { |
| 10 | + //alert(data); |
| 11 | + if (data == 'done') { |
| 12 | + $('a#vv').text('Done.'); |
| 13 | + $('code#secod').remove(); |
| 14 | + } else { |
| 15 | + $('a#vv').text('Failed! Try again.'); |
| 16 | + $('a#vv').removeClass('btn-default').addClass('btn-outline btn-danger'); |
| 17 | + $('code#secod').text(data).addClass('btn-outline btn-danger active'); |
| 18 | + } |
| 19 | + }); |
| 20 | + } |
21 | 21 | </script> |
22 | 22 | <div class="row"> |
23 | | -<div class="panel"> |
24 | | -<div class="panel-heading"> |
25 | | -<h3 class="panel-title">Clear static cache</h3> |
26 | | -</div> |
27 | | -<div class="panel-body"> |
28 | | - <p>This cleans cache and puts live some changes. Empties full cache, js + css cache and ezsql's cache.</p> |
29 | | - <div> |
30 | | - <a class="btn btn-raised btn-primary pull-right" href="<?php echo admin_url('clean-cache'); ?>&clearit=1">Clean cache</a> |
31 | | - </div> |
32 | | - <p><code>It's a good practice to clean cache from time to time!</code></p> |
33 | | -</div> |
34 | | -</div> |
| 23 | + <div class="panel"> |
| 24 | + <div class="panel-heading"> |
| 25 | + <h3 class="panel-title">Clear static cache</h3> |
| 26 | + </div> |
| 27 | + <div class="panel-body"> |
| 28 | + <p>This cleans cache and puts live some changes. Empties full cache, js + css cache and ezsql's cache.</p> |
| 29 | + <div> |
| 30 | + <a class="btn btn-raised btn-primary pull-right" |
| 31 | + href="<?php echo admin_url('clean-cache'); ?>&clearit=1">Clean cache</a> |
| 32 | + </div> |
| 33 | + <p><code>It's a good practice to clean cache from time to time!</code></p> |
| 34 | + </div> |
| 35 | + </div> |
35 | 36 | </div> |
36 | 37 | <div class="row" style="padding:30px 0;"> |
37 | | -<div class="panel"> |
38 | | -<div class="panel-heading"> |
39 | | -<h3 class="panel-title">JS combined file</h3> |
40 | | -</div> |
41 | | -<div class="panel-body"> |
42 | | - <p>Once cache is cleared so is the file cache for minified javascripts.</p> |
43 | | - <div> |
44 | | - <a class="btn btn-raised btn-primary pull-right" id="vv" href="javascript:minijJS()">Rebuild Minified javascript</a> |
45 | | - </div> |
46 | | - <p><code id="secod">This process takes time and is server heavy but reduces by up to 20% the js file size.</code></p> |
47 | | - <p><a class="btn btn-raised btn-default" href="<?php echo tpl();?>styles/minjs.php" target="_blank">SEE FILE</a> (Opens in a new tab) Use ctrl/command + shift + r to clear the browser's file cache</p> |
48 | | -</div> |
49 | | -</div> |
| 38 | + <div class="panel"> |
| 39 | + <div class="panel-heading"> |
| 40 | + <h3 class="panel-title">JS combined file</h3> |
| 41 | + </div> |
| 42 | + <div class="panel-body"> |
| 43 | + <p>Once cache is cleared so is the file cache for minified javascripts.</p> |
| 44 | + <div> |
| 45 | + <a class="btn btn-raised btn-primary pull-right" id="vv" href="javascript:minijJS()">Rebuild Minified |
| 46 | + javascript</a> |
| 47 | + </div> |
| 48 | + <p><code id="secod">This process takes time and is server heavy but reduces by up to 20% the js file |
| 49 | + size.</code></p> |
| 50 | + <p><a class="btn btn-raised btn-default" href="<?php echo tpl(); ?>styles/minjs.php" target="_blank">SEE |
| 51 | + FILE</a> (Opens in a new tab) Use ctrl/command + shift + r to clear the browser's file cache</p> |
| 52 | + </div> |
| 53 | + </div> |
50 | 54 | </div> |
51 | 55 | <?php |
52 | | -if(_get('clearit')) { |
53 | | -$cInc = ABSPATH; |
54 | | -if( !defined( 'vSTATIC_FOLD' ) ) |
55 | | -define('vSTATIC_FOLD', '/cache/html/'); |
56 | | -require_once( CNC.'/fullcache.php' ); |
57 | | -$debug1 =FullCache::ClearAll(); |
58 | | -foreach ($debug1 as $d1) { |
59 | | -echo str_replace($cInc,'', $d1); |
60 | | -} |
61 | | -$debug = $db->clean_cache(); |
62 | | -foreach ($debug as $d) { |
63 | | -echo str_replace($cInc,'', $d); |
64 | | -} |
65 | | -$debug2 = $db->clean_cache(true); |
66 | | -foreach ($debug2 as $d2) { |
67 | | -echo str_replace($cInc,'', $d2);; |
68 | | -} |
69 | | -$jdebug = jc_purge(); |
70 | | -foreach ($jdebug as $dj) { |
71 | | -echo str_replace($cInc,'', $dj); |
| 56 | +if (_get('clearit')) { |
| 57 | + $cInc = ABSPATH; |
| 58 | + if (!defined('vSTATIC_FOLD')) |
| 59 | + define('vSTATIC_FOLD', '/cache/html/'); |
| 60 | + require_once(CNC . '/fullcache.php'); |
| 61 | + $debug1 = FullCache::ClearAll(); |
| 62 | + foreach ($debug1 as $d1) { |
| 63 | + echo str_replace($cInc, '', $d1); |
| 64 | + } |
| 65 | + $debug = $db->clean_cache(); |
| 66 | + foreach ($debug as $d) { |
| 67 | + if (not_empty($d)) { |
| 68 | + echo str_replace($cInc, '', $d); |
| 69 | + } |
| 70 | + } |
| 71 | + $debug2 = $db->clean_cache(true); |
| 72 | + foreach ($debug2 as $d2) { |
| 73 | + if (not_empty($d2)) { |
| 74 | + echo str_replace($cInc, '', $d2); |
| 75 | + } |
| 76 | + } |
| 77 | + $jdebug = jc_purge(); |
| 78 | + foreach ($jdebug as $dj) { |
| 79 | + if (not_empty($dj)) { |
| 80 | + echo str_replace($cInc, '', $dj); |
| 81 | + } |
| 82 | + } |
| 83 | + echo '<div class="msg-win">Cache cleared</div>'; |
72 | 84 | } |
73 | | -echo '<div class="msg-win">Cache cleared</div>'; |
74 | | -} |
75 | 85 | ?> |
0 commit comments