900af8a7 by Jeff Balicki

cache

1 parent 8804f524
Showing 190 changed files with 322 additions and 1161 deletions
1 /* FVM 3 */
2 #fastvelocity-min{margin-top:10px}
3 #fastvelocity-min .clear{clear:both}
4 .fvm-settings label{font-size:15px;color:#222;padding-top:1px}
5 .fvm-settings span.note-info{font-size:15px;margin-left:8px;color:#666;font-style:italic}
6 .fvm-settings p.description{font-size:15px;color:#666;font-style:italic}
7 #tab-info h4{font-size:15px;margin-bottom:-10px}
8 .fvm-hide{max-height:1px;overflow:none;position:absolute;top:-9999px;left:-9999px;visibility:hidden}
9 .fvm-warning{font-weight:500;color:#A00}
10 h3.fvm-bold-green{font-weight:500;font-size:15px;color:#1196A3}
11 .fvm-bold-green{font-weight:500;color:#1196A3}
12 .fvm-label-special{line-height:38px}
13 .fvm-label-pad{line-height:21px}
14 .fvm-rowintro{padding-bottom:10px;font-size:15px}
15 table.fvm-settings td,table.fvm-settings td p,table.fvm-settings th{font-size:15px}
16 .fvm-wrapper{font-size:16px;padding:18px}
17 .fvm-wrapper h4{font-size:16px;margin:0;color:#1196A3}
18 .fvm-wrapper .accordion p,.fvm-wrapper .accordion code{font-size:16px;line-height:1.3}
19 .fvm-wrapper .accordion a, .fvm-wrapper .accordion a:hover { color: #0073aa; }
20 .fvm-code-full{width:100%;padding:8px;background:#F3F3F3;box-sizing:border-box;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:1.5;margin-bottom:15px}
21 #status .fvm-cache-stats{margin:10px 0 0}
22 #status textarea.row-log{display:block;margin:0;padding:6px;border:none;background:#23282d;color:#ccc;height:300px;max-width:100%;overflow:auto;line-height:1.5;font-size:.8125rem;white-space:pre;font-family:monospace}
23 #status textarea.row-log::-webkit-scrollbar{width:8px;height:8px;background-color:#222}
24 #status textarea.row-log::-webkit-scrollbar-thumb{background-color:#000}
25 #status textarea.row-log::-webkit-scrollbar-track{background-color:#999}
26
27 /* jQuery UI */
28 .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}
29 .ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}
30 .ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0;padding:.5em .5em .5em .7em;font-size:100%}
31 .ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}
32 .ui-widget{font-size:1em}
33 .ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}
34 .ui-widget-content a{color:#333}
35 .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:400;color:#454545}
36 .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:400;color:#2b2b2b}
37 .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #bbb;background:#0073aa;font-weight:400;color:#fff}
38 .ui-icon{width:16px;height:16px}
39 .ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_444444_256x240.png)}
40 .ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url(images/ui-icons_555555_256x240.png)}
41 .ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png)}
42 .ui-icon-triangle-1-e{background-position:-32px -16px}
43 .ui-icon-triangle-1-s{background-position:-65px -16px}
44 .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}
45 .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}
46 .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}
47 .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}
48 .ui-state-focus:focus{outline:none}
49
50 /* Mobile */
51 @media screen and (max-width:520px) {
52 .fvm-label-special { line-height: inherit; }
53 }
1 // get logs via ajax
2 function fvm_get_logs() {
3
4 // ajax request
5 jQuery( document ).ready(function() {
6 var data = { 'action': 'fvm_get_logs' };
7 jQuery.post(ajaxurl, data, function(resp) {
8 if(resp.success == 'OK') {
9
10 // logs
11 jQuery('.log-stats textarea').val(resp.log);
12 jQuery('.log-stats textarea').scrollTop(jQuery('.log-stats textarea')[0].scrollHeight);
13
14 } else {
15 // error log
16 console.error(resp.success);
17 }
18 });
19 });
20 }
21
22
23 jQuery( document ).ready(function() {
24
25 // help section
26 jQuery( ".accordion" ).accordion({ active: false, collapsible: true, heightStyle: "content" });
27
28 });
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 /*
3 Plugin Name: Fast Velocity Minify
4 Plugin URI: http://fastvelocity.com
5 Description: Improve your speed score on GTmetrix, Pingdom Tools and Google PageSpeed Insights by merging and minifying CSS and JavaScript files into groups, compressing HTML and other speed optimizations.
6 Author: Raul Peixoto
7 Author URI: http://fastvelocity.com
8 Text Domain: fast-velocity-minify
9 Version: 3.2.6
10 License: GPL2
11
12 ------------------------------------------------------------------------
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */
27
28 # Exit if accessed directly
29 if (!defined('ABSPATH')){ exit(); }
30
31 # Invalidate OPCache for current file on WP 5.5+
32 if(function_exists('wp_opcache_invalidate') && stripos(__FILE__, '/fvm.php') !== false) {
33 wp_opcache_invalidate(__FILE__, true);
34 }
35
36 # info, variables, paths
37 $fvm_var_file = __FILE__; # /home/path/plugins/pluginname/wpr.php
38 $fvm_var_basename = plugin_basename($fvm_var_file); # pluginname/wpr.php
39 $fvm_var_dir_path = plugin_dir_path($fvm_var_file); # /home/path/plugins/pluginname/
40 $fvm_var_url_path = plugins_url(dirname($fvm_var_basename)) . '/'; # https://example.com/wp-content/plugins/pluginname/
41 $fvm_var_plugin_version = get_file_data($fvm_var_file, array('Version' => 'Version'), false)['Version'];
42 $fvm_var_inc_dir = $fvm_var_dir_path . 'inc' . DIRECTORY_SEPARATOR; # /home/path/plugins/pluginname/inc/
43 $fvm_var_inc_lib = $fvm_var_dir_path . 'libs' . DIRECTORY_SEPARATOR; # /home/path/plugins/pluginname/libs/
44
45 # global functions for backend, frontend, ajax, etc
46 require_once($fvm_var_inc_dir . 'common.php');
47 require_once($fvm_var_inc_dir . 'updates.php');
48
49 # wp-cli support
50 if (defined('WP_CLI') && WP_CLI) {
51 require_once($fvm_var_inc_dir . 'wp-cli.php');
52 }
53
54 # get all options from database
55 $fvm_settings = fvm_get_settings();
56
57 # site url, domain name
58 $fvm_urls = array('wp_site_url'=>trailingslashit(site_url()), 'wp_domain'=>fvm_get_domain());
59
60
61 # only on backend
62 if(is_admin()) {
63
64 # admin functionality
65 require_once($fvm_var_inc_dir . 'admin.php');
66 require_once($fvm_var_inc_dir . 'serverinfo.php');
67
68 # both backend and frontend, as long as user can manage options
69 add_action('admin_bar_menu', 'fvm_admintoolbar', 100);
70 add_action('init', 'fvm_process_cache_purge_request');
71
72 # do admin stuff, as long as user can manage options
73 add_action('admin_init', 'fvm_save_settings');
74 add_action('admin_init', 'fvm_check_minimum_requirements');
75 add_action('admin_init', 'fvm_check_misconfiguration');
76 add_action('admin_init', 'fvm_update_changes');
77 add_action('admin_enqueue_scripts', 'fvm_add_admin_jscss');
78 add_action('admin_menu', 'fvm_add_admin_menu');
79 add_action('admin_notices', 'fvm_show_admin_notice_from_transient');
80 add_action('wp_ajax_fvm_get_logs', 'fvm_get_logs_callback');
81
82 # purge everything
83 add_action('switch_theme', 'fvm_purge_all');
84 add_action('customize_save', 'fvm_purge_all');
85 add_action('avada_clear_dynamic_css_cache', 'fvm_purge_all');
86 add_action('upgrader_process_complete', 'fvm_purge_all');
87 add_action('update_option_theme_mods_' . get_option('stylesheet'), 'fvm_purge_all');
88
89 }
90
91
92
93 # frontend only, any user permissions
94 if(!is_admin()) {
95
96 # frontend functionality
97 require_once($fvm_var_inc_dir . 'frontend.php');
98
99 # both back and front, as long as the option is enabled
100 add_action('init', 'fvm_disable_emojis');
101 add_action('wp_loaded', 'fvm_ajax_optimizer');
102
103 # both backend and frontend, as long as user can manage options
104 add_action('admin_bar_menu', 'fvm_admintoolbar', 100);
105 add_action('init', 'fvm_process_cache_purge_request');
106
107 # actions for frontend only
108 add_action('template_redirect', 'fvm_start_buffer', -PHP_INT_MAX);
109
110 }
111
1 <?php
2
3 # Exit if accessed directly
4 if (!defined('ABSPATH')){ exit(); }
5
6 # update routines for new fields and replacements
7 function fvm_update_changes() {
8
9 # current version
10 global $fvm_var_plugin_version;
11
12 # Version 3.0 routines start
13
14 # delete old FVM files
15 global $fvm_var_dir_path, $fvm_var_inc_lib, $fvm_var_inc_dir;
16
17 # prevent deleting if the paths are empty
18 # can happen when a user runs wp-cli on a child directory
19 if(isset($fvm_var_dir_path) && isset($fvm_var_inc_lib) && isset($fvm_var_inc_dir) && !empty($fvm_var_dir_path) && !empty($fvm_var_inc_lib) && !empty($fvm_var_inc_dir)) {
20
21 # must be inside a fast-velocity-minify directory
22 if (stripos($fvm_var_dir_path, 'fast-velocity-minify') !== false) {
23
24 # delete
25 if(file_exists($fvm_var_inc_dir.'functions-cache.php')) { @unlink($fvm_var_inc_dir.'functions-cache.php'); }
26 if(file_exists($fvm_var_inc_dir.'functions-cli.php')) { @unlink($fvm_var_inc_dir.'functions-cli.php'); }
27 if(file_exists($fvm_var_inc_dir.'functions-serverinfo.php')) { @unlink($fvm_var_inc_dir.'functions-serverinfo.php'); }
28 if(file_exists($fvm_var_inc_dir.'functions-upgrade.php')) { @unlink($fvm_var_inc_dir.'functions-upgrade.php'); }
29 if(file_exists($fvm_var_inc_dir.'functions.php')) { @unlink($fvm_var_inc_dir.'functions.php'); }
30 if(file_exists($fvm_var_dir_path.'fvm.css')) { @unlink($fvm_var_dir_path.'fvm.css'); }
31 if(file_exists($fvm_var_dir_path.'fvm.js')) { @unlink($fvm_var_dir_path.'fvm.js'); }
32 if(file_exists($fvm_var_inc_lib.'mrclay' . DIRECTORY_SEPARATOR . 'HTML.php')) {
33 @unlink($fvm_var_inc_lib.'mrclay' . DIRECTORY_SEPARATOR . 'HTML.php');
34 @unlink($fvm_var_inc_lib.'mrclay' . DIRECTORY_SEPARATOR . 'index.html');
35 @rmdir($fvm_var_inc_lib.'mrclay');
36 }
37
38 }
39 }
40
41 # Version 3.2 routines start
42 if (get_option("fastvelocity_plugin_version") !== false) {
43 if (version_compare($fvm_var_plugin_version, '3.2.0', '>=') && get_option("fastvelocity_min_ignore") !== false) {
44
45 # cleanup
46 delete_option('fastvelocity_min_change_cache_path');
47 delete_option('fastvelocity_min_change_cache_base_url');
48 delete_option('fastvelocity_min_fvm_cdn_url');
49 delete_option('fastvelocity_plugin_version');
50 delete_option('fvm-last-cache-update');
51 delete_option('fastvelocity_min_ignore');
52 delete_option('fastvelocity_min_blacklist');
53 delete_option('fastvelocity_min_ignorelist');
54 delete_option('fastvelocity_min_excludecsslist');
55 delete_option('fastvelocity_min_excludejslist');
56 delete_option('fastvelocity_min_enable_purgemenu');
57 delete_option('fastvelocity_min_default_protocol');
58 delete_option('fastvelocity_min_disable_js_merge');
59 delete_option('fastvelocity_min_disable_css_merge');
60 delete_option('fastvelocity_min_disable_js_minification');
61 delete_option('fastvelocity_min_disable_css_minification');
62 delete_option('fastvelocity_min_remove_print_mediatypes');
63 delete_option('fastvelocity_min_skip_html_minification');
64 delete_option('fastvelocity_min_strip_htmlcomments');
65 delete_option('fastvelocity_min_skip_cssorder');
66 delete_option('fastvelocity_min_skip_google_fonts');
67 delete_option('fastvelocity_min_skip_emoji_removal');
68 delete_option('fastvelocity_fvm_clean_header_one');
69 delete_option('fastvelocity_min_enable_defer_js');
70 delete_option('fastvelocity_min_exclude_defer_jquery');
71 delete_option('fastvelocity_min_force_inline_css');
72 delete_option('fastvelocity_min_force_inline_css_footer');
73 delete_option('fastvelocity_min_remove_googlefonts');
74 delete_option('fastvelocity_min_defer_for_pagespeed');
75 delete_option('fastvelocity_min_defer_for_pagespeed_optimize');
76 delete_option('fastvelocity_min_exclude_defer_login');
77 delete_option('fastvelocity_min_skip_defer_lists');
78 delete_option('fastvelocity_min_fvm_fix_editor');
79 delete_option('fastvelocity_min_loadcss');
80 delete_option('fastvelocity_min_fvm_removecss');
81 delete_option('fastvelocity_enabled_css_preload');
82 delete_option('fastvelocity_enabled_js_preload');
83 delete_option('fastvelocity_fontawesome_method');
84 delete_option('fastvelocity_gfonts_method');
85
86 }
87 }
88 # Version 3.2 routines end
89
90 }
1 <?php
2
3 # Exit if accessed directly
4 if (!defined('ABSPATH')){ exit(); }
5
6 ###################################################
7 # extend wp-cli to purge cache, usage: wp fvm purge
8 ###################################################
9
10 # only for wp-cli
11 if ( defined( 'WP_CLI' ) && WP_CLI ) {
12
13 class fastvelocity_WPCLI {
14
15 # purge files + cache
16 public function purge() {
17 WP_CLI::success( __( 'FVM and other caches were purged.', 'fast-velocity-minify' ) );
18 fvm_purge_static_files();
19 fvm_purge_others();
20
21 # purge everything
22 $cache = fvm_purge_static_files();
23 $others = fvm_purge_others();
24
25 # notices
26 WP_CLI::success( __( 'FVM: All Caches are now cleared.', 'fast-velocity-minify' ) .' ('.date("D, d M Y @ H:i:s e").')');
27 if(is_string($cache)) { WP_CLI::warning($cache); }
28 if(is_string($others)) { WP_CLI::success($others); }
29
30 }
31
32 # get cache size
33 public function stats() {
34 WP_CLI::error( __( 'This feature is currently under development.', 'fast-velocity-minify' ) );
35 }
36
37 }
38
39 # add commands
40 WP_CLI::add_command( 'fvm', 'fastvelocity_WPCLI' );
41
42 }
43
1 <?php
2
3 # server info
4 if( $active_tab == 'status' ) {
5 ?>
6 <div class="fvm-wrapper">
7
8 <div id="status">
9
10 <div style="height: 40px;"></div>
11 <h2 class="title"><?php _e( 'Latest Logs', 'fast-velocity-minify' ); ?></h2>
12 <h3 class="fvm-bold-green"><?php _e( 'In this section, you can check the latest logs for CSS and JS files', 'fast-velocity-minify' ); ?></h3>
13 <div class="row-log log-stats wpraiser-textarea"><textarea rows="10" cols="50" class="large-text code row-log log-css" disabled></textarea></div>
14
15 <div style="height: 40px;"></div>
16 <h2 class="title"><?php _e( 'Server Info', 'fast-velocity-minify' ); ?></h2>
17 <h3 class="fvm-bold-green"><?php _e( 'In this section, you can check some server stats and information', 'fast-velocity-minify' ); ?></h3>
18 <textarea rows="10" cols="50" class="large-text code row-log" disabled><?php fvm_get_generalinfo(); ?></textarea>
19
20
21 <script>fvm_get_logs();</script>
22 </div>
23
24 </div>
25 <?php
26
27 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php if( $active_tab == 'upgrade' ) { ?>
2
3 <div class="fvm-wrapper">
4
5 <h2 class="title">Upgrade Your Speed</h2>
6 <h3 class="fvm-bold-green">Would you like to improve your speed and google scores further?</h3>
7
8
9
10 </div>
11 <?php
12 }
1 <div class="wrap">
2 <h1>Fast Velocity Minify</h1>
3 <div style="height: 20px;"></div>
4
5 <?php
6 # get active tab, set default
7 $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'settings';
8 ?>
9
10 <h2 class="nav-tab-wrapper wp-clearfix">
11 <a href="?page=fvm" class="nav-tab <?php echo $active_tab == 'settings' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Settings', 'fast-velocity-minify' ); ?></a>
12 <a href="?page=fvm&tab=status" class="nav-tab <?php echo $active_tab == 'status' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Status', 'fast-velocity-minify' ); ?></a>
13 <?php /*<a href="?page=fvm&tab=upgrade" class="nav-tab <?php echo $active_tab == 'upgrade' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Upgrade', 'fast-velocity-minify' ); ?></a>*/ ?>
14 <a href="?page=fvm&tab=help" class="nav-tab <?php echo $active_tab == 'help' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Help', 'fast-velocity-minify' ); ?></a>
15 </h2>
16
17 <div id="fvm">
18
19 <?php
20 # settings
21 include_once($fvm_var_dir_path . 'layout' . DIRECTORY_SEPARATOR . 'admin-layout-settings.php');
22
23 # include other tabs
24 include_once($fvm_var_dir_path . 'layout' . DIRECTORY_SEPARATOR . 'admin-layout-status.php');
25 #include_once($fvm_var_dir_path . 'layout' . DIRECTORY_SEPARATOR . 'admin-layout-upgrade.php');
26 include_once($fvm_var_dir_path . 'layout' . DIRECTORY_SEPARATOR . 'admin-layout-help.php');
27 ?>
28
29 </div>
...\ No newline at end of file ...\ No newline at end of file
1
2 # replace
3 namespace MatthiasMullie > namespace FVM\MatthiasMullie
4 use MatthiasMullie > use FVM\MatthiasMullie
...\ No newline at end of file ...\ No newline at end of file
1 #!/usr/bin/env php
2 <?php
3 use MatthiasMullie\Minify;
4
5 // command line utility to minify CSS
6 if (file_exists(__DIR__ . '/../../../autoload.php')) {
7 // if composer install
8 require_once __DIR__ . '/../../../autoload.php';
9 } else {
10 require_once __DIR__ . '/../src/Minify.php';
11 require_once __DIR__ . '/../src/CSS.php';
12 require_once __DIR__ . '/../src/Exception.php';
13 }
14
15 error_reporting(E_ALL);
16 // check PHP setup for cli arguments
17 if (!isset($_SERVER['argv']) && !isset($argv)) {
18 fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
19 exit(1);
20 } elseif (!isset($argv)) {
21 $argv = $_SERVER['argv'];
22 }
23 // check if path to file given
24 if (!isset($argv[1])) {
25 fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
26 exit(1);
27 }
28 // check if script run in cli environment
29 if ('cli' !== php_sapi_name()) {
30 fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
31 exit(1);
32 }
33 // check if source file exists
34 if (!file_exists($argv[1])) {
35 fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
36 exit(1);
37 }
38
39 try {
40 $minifier = new Minify\CSS($argv[1]);
41 echo $minifier->minify();
42 } catch (Exception $e) {
43 fwrite(STDERR, $e->getMessage(), PHP_EOL);
44 exit(1);
45 }
1 #!/usr/bin/env php
2 <?php
3 use MatthiasMullie\Minify;
4
5 // command line utility to minify JS
6 if (file_exists(__DIR__ . '/../../../autoload.php')) {
7 // if composer install
8 require_once __DIR__ . '/../../../autoload.php';
9 } else {
10 require_once __DIR__ . '/../src/Minify.php';
11 require_once __DIR__ . '/../src/JS.php';
12 require_once __DIR__ . '/../src/Exception.php';
13 }
14
15 error_reporting(E_ALL);
16 // check PHP setup for cli arguments
17 if (!isset($_SERVER['argv']) && !isset($argv)) {
18 fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
19 exit(1);
20 } elseif (!isset($argv)) {
21 $argv = $_SERVER['argv'];
22 }
23 // check if path to file given
24 if (!isset($argv[1])) {
25 fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
26 exit(1);
27 }
28 // check if script run in cli environment
29 if ('cli' !== php_sapi_name()) {
30 fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
31 exit(1);
32 }
33 // check if source file exists
34 if (!file_exists($argv[1])) {
35 fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
36 exit(1);
37 }
38
39 try {
40 $minifier = new Minify\JS($argv[1]);
41 echo $minifier->minify();
42 } catch (Exception $e) {
43 fwrite(STDERR, $e->getMessage(), PHP_EOL);
44 exit(1);
45 }
1 in
2 public
3 extends
4 private
5 protected
6 implements
7 instanceof
...\ No newline at end of file ...\ No newline at end of file
1 do
2 in
3 let
4 new
5 var
6 case
7 else
8 enum
9 void
10 with
11 class
12 const
13 yield
14 delete
15 export
16 import
17 public
18 static
19 typeof
20 extends
21 package
22 private
23 function
24 protected
25 implements
26 instanceof
...\ No newline at end of file ...\ No newline at end of file
1 do
2 if
3 in
4 for
5 let
6 new
7 try
8 var
9 case
10 else
11 enum
12 eval
13 null
14 this
15 true
16 void
17 with
18 break
19 catch
20 class
21 const
22 false
23 super
24 throw
25 while
26 yield
27 delete
28 export
29 import
30 public
31 return
32 static
33 switch
34 typeof
35 default
36 extends
37 finally
38 package
39 private
40 continue
41 debugger
42 function
43 arguments
44 interface
45 protected
46 implements
47 instanceof
48 abstract
49 boolean
50 byte
51 char
52 double
53 final
54 float
55 goto
56 int
57 long
58 native
59 short
60 synchronized
61 throws
62 transient
63 volatile
...\ No newline at end of file ...\ No newline at end of file
1 +
2 -
3 *
4 /
5 %
6 =
7 +=
8 -=
9 *=
10 /=
11 %=
12 <<=
13 >>=
14 >>>=
15 &=
16 ^=
17 |=
18 &
19 |
20 ^
21 ~
22 <<
23 >>
24 >>>
25 ==
26 ===
27 !=
28 !==
29 >
30 <
31 >=
32 <=
33 &&
34 ||
35 !
36 .
37 [
38 ]
39 ?
40 :
41 ,
42 ;
43 (
44 )
45 {
46 }
...\ No newline at end of file ...\ No newline at end of file
1 +
2 -
3 *
4 /
5 %
6 =
7 +=
8 -=
9 *=
10 /=
11 %=
12 <<=
13 >>=
14 >>>=
15 &=
16 ^=
17 |=
18 &
19 |
20 ^
21 <<
22 >>
23 >>>
24 ==
25 ===
26 !=
27 !==
28 >
29 <
30 >=
31 <=
32 &&
33 ||
34 .
35 [
36 ]
37 ?
38 :
39 ,
40 ;
41 (
42 )
43 }
...\ No newline at end of file ...\ No newline at end of file
1 +
2 -
3 *
4 /
5 %
6 =
7 +=
8 -=
9 *=
10 /=
11 %=
12 <<=
13 >>=
14 >>>=
15 &=
16 ^=
17 |=
18 &
19 |
20 ^
21 ~
22 <<
23 >>
24 >>>
25 ==
26 ===
27 !=
28 !==
29 >
30 <
31 >=
32 <=
33 &&
34 ||
35 !
36 .
37 [
38 ?
39 :
40 ,
41 ;
42 (
43 {
1 <?php
2 /**
3 * Base Exception
4 *
5 * @deprecated Use Exceptions\BasicException instead
6 *
7 * @author Matthias Mullie <minify@mullie.eu>
8 */
9 namespace FVM\MatthiasMullie\Minify;
10
11 /**
12 * Base Exception Class
13 * @deprecated Use Exceptions\BasicException instead
14 *
15 * @package Minify
16 * @author Matthias Mullie <minify@mullie.eu>
17 */
18 abstract class Exception extends \Exception
19 {
20 }
1 <?php
2 /**
3 * Basic exception
4 *
5 * Please report bugs on https://github.com/matthiasmullie/minify/issues
6 *
7 * @author Matthias Mullie <minify@mullie.eu>
8 * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
9 * @license MIT License
10 */
11 namespace FVM\MatthiasMullie\Minify\Exceptions;
12
13 use FVM\MatthiasMullie\Minify\Exception;
14
15 /**
16 * Basic Exception Class
17 *
18 * @package Minify\Exception
19 * @author Matthias Mullie <minify@mullie.eu>
20 */
21 abstract class BasicException extends Exception
22 {
23 }
1 <?php
2 /**
3 * File Import Exception
4 *
5 * Please report bugs on https://github.com/matthiasmullie/minify/issues
6 *
7 * @author Matthias Mullie <minify@mullie.eu>
8 * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
9 * @license MIT License
10 */
11 namespace FVM\MatthiasMullie\Minify\Exceptions;
12
13 /**
14 * File Import Exception Class
15 *
16 * @package Minify\Exception
17 * @author Matthias Mullie <minify@mullie.eu>
18 */
19 class FileImportException extends BasicException
20 {
21 }
1 <?php
2 /**
3 * IO Exception
4 *
5 * Please report bugs on https://github.com/matthiasmullie/minify/issues
6 *
7 * @author Matthias Mullie <minify@mullie.eu>
8 * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
9 * @license MIT License
10 */
11 namespace FVM\MatthiasMullie\Minify\Exceptions;
12
13 /**
14 * IO Exception Class
15 *
16 * @package Minify\Exception
17 * @author Matthias Mullie <minify@mullie.eu>
18 */
19 class IOException extends BasicException
20 {
21 }
1 <?php
2
3 namespace FVM\MatthiasMullie\PathConverter;
4
5 /**
6 * Convert paths relative from 1 file to another.
7 *
8 * E.g.
9 * ../../images/icon.jpg relative to /css/imports/icons.css
10 * becomes
11 * ../images/icon.jpg relative to /css/minified.css
12 *
13 * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
14 *
15 * @author Matthias Mullie <pathconverter@mullie.eu>
16 * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
17 * @license MIT License
18 */
19 class Converter implements ConverterInterface
20 {
21 /**
22 * @var string
23 */
24 protected $from;
25
26 /**
27 * @var string
28 */
29 protected $to;
30
31 /**
32 * @param string $from The original base path (directory, not file!)
33 * @param string $to The new base path (directory, not file!)
34 * @param string $root Root directory (defaults to `getcwd`)
35 */
36 public function __construct($from, $to, $root = '')
37 {
38 $shared = $this->shared($from, $to);
39 if ($shared === '') {
40 // when both paths have nothing in common, one of them is probably
41 // absolute while the other is relative
42 $root = $root ?: getcwd();
43 $from = strpos($from, $root) === 0 ? $from : preg_replace('/\/+/', '/', $root.'/'.$from);
44 $to = strpos($to, $root) === 0 ? $to : preg_replace('/\/+/', '/', $root.'/'.$to);
45
46 // or traveling the tree via `..`
47 // attempt to resolve path, or assume it's fine if it doesn't exist
48 $from = @realpath($from) ?: $from;
49 $to = @realpath($to) ?: $to;
50 }
51
52 $from = $this->dirname($from);
53 $to = $this->dirname($to);
54
55 $from = $this->normalize($from);
56 $to = $this->normalize($to);
57
58 $this->from = $from;
59 $this->to = $to;
60 }
61
62 /**
63 * Normalize path.
64 *
65 * @param string $path
66 *
67 * @return string
68 */
69 protected function normalize($path)
70 {
71 // deal with different operating systems' directory structure
72 $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');
73
74 /*
75 * Example:
76 * /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif
77 * to
78 * /home/forkcms/frontend/core/layout/images/img.gif
79 */
80 do {
81 $path = preg_replace('/[^\/]+(?<!\.\.)\/\.\.\//', '', $path, -1, $count);
82 } while ($count);
83
84 return $path;
85 }
86
87 /**
88 * Figure out the shared path of 2 locations.
89 *
90 * Example:
91 * /home/forkcms/frontend/core/layout/images/img.gif
92 * and
93 * /home/forkcms/frontend/cache/minified_css
94 * share
95 * /home/forkcms/frontend
96 *
97 * @param string $path1
98 * @param string $path2
99 *
100 * @return string
101 */
102 protected function shared($path1, $path2)
103 {
104 // $path could theoretically be empty (e.g. no path is given), in which
105 // case it shouldn't expand to array(''), which would compare to one's
106 // root /
107 $path1 = $path1 ? explode('/', $path1) : array();
108 $path2 = $path2 ? explode('/', $path2) : array();
109
110 $shared = array();
111
112 // compare paths & strip identical ancestors
113 foreach ($path1 as $i => $chunk) {
114 if (isset($path2[$i]) && $path1[$i] == $path2[$i]) {
115 $shared[] = $chunk;
116 } else {
117 break;
118 }
119 }
120
121 return implode('/', $shared);
122 }
123
124 /**
125 * Convert paths relative from 1 file to another.
126 *
127 * E.g.
128 * ../images/img.gif relative to /home/forkcms/frontend/core/layout/css
129 * should become:
130 * ../../core/layout/images/img.gif relative to
131 * /home/forkcms/frontend/cache/minified_css
132 *
133 * @param string $path The relative path that needs to be converted
134 *
135 * @return string The new relative path
136 */
137 public function convert($path)
138 {
139 // quit early if conversion makes no sense
140 if ($this->from === $this->to) {
141 return $path;
142 }
143
144 $path = $this->normalize($path);
145 // if we're not dealing with a relative path, just return absolute
146 if (strpos($path, '/') === 0) {
147 return $path;
148 }
149
150 // normalize paths
151 $path = $this->normalize($this->from.'/'.$path);
152
153 // strip shared ancestor paths
154 $shared = $this->shared($path, $this->to);
155 $path = mb_substr($path, mb_strlen($shared));
156 $to = mb_substr($this->to, mb_strlen($shared));
157
158 // add .. for every directory that needs to be traversed to new path
159 $to = str_repeat('../', count(array_filter(explode('/', $to))));
160
161 return $to.ltrim($path, '/');
162 }
163
164 /**
165 * Attempt to get the directory name from a path.
166 *
167 * @param string $path
168 *
169 * @return string
170 */
171 protected function dirname($path)
172 {
173 if (@is_file($path)) {
174 return dirname($path);
175 }
176
177 if (@is_dir($path)) {
178 return rtrim($path, '/');
179 }
180
181 // no known file/dir, start making assumptions
182
183 // ends in / = dir
184 if (mb_substr($path, -1) === '/') {
185 return rtrim($path, '/');
186 }
187
188 // has a dot in the name, likely a file
189 if (preg_match('/.*\..*$/', basename($path)) !== 0) {
190 return dirname($path);
191 }
192
193 // you're on your own here!
194 return $path;
195 }
196 }
1 <?php
2
3 namespace FVM\MatthiasMullie\PathConverter;
4
5 /**
6 * Convert file paths.
7 *
8 * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
9 *
10 * @author Matthias Mullie <pathconverter@mullie.eu>
11 * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
12 * @license MIT License
13 */
14 interface ConverterInterface
15 {
16 /**
17 * Convert file paths.
18 *
19 * @param string $path The path to be converted
20 *
21 * @return string The new path
22 */
23 public function convert($path);
24 }
1 <?php
2
3 namespace FVM\MatthiasMullie\PathConverter;
4
5 /**
6 * Don't convert paths.
7 *
8 * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
9 *
10 * @author Matthias Mullie <pathconverter@mullie.eu>
11 * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
12 * @license MIT License
13 */
14 class NoConverter implements ConverterInterface
15 {
16 /**
17 * {@inheritdoc}
18 */
19 public function convert($path)
20 {
21 return $path;
22 }
23 }
1 <?php
2 /**
3 *
4 * Website: https://wpraiser.com/
5 * Author: Raul Peixoto (https://www.upwork.com/fl/raulpeixoto)
6 * Licensed under GPLv2 (or later)
7 * Version 1.0
8 *
9 * Usage: fvm_raisermin_js($js);
10 *
11 */
12
13 # Exit if accessed directly
14 if (!defined('ABSPATH')){ exit(); }
15
16 # minify js, whitespace only
17 function fvm_raisermin_js($code){
18
19 # remove // comments
20 $code = preg_replace('/(^|\s)\/\/(.*)\n/m', '', $code);
21 $code = preg_replace('/(\{|\}|\[|\]|\(|\)|\;)\/\/(.*)\n/m', '$1', $code);
22
23 # remove /* ... */ comments
24 $code = preg_replace('/(^|\s)\/\*(.*)\*\//Us', '', $code);
25 $code = preg_replace('/(\;|\{)\/\*(.*)\*\//Us', '$1', $code);
26
27 # remove sourceMappingURL
28 $code = preg_replace('/(\/\/\s*[#]\s*sourceMappingURL\s*[=]\s*)([a-zA-Z0-9-_\.\/]+)(\.map)/ui', '', $code);
29
30 # uniform line endings, make them all line feed
31 $code = str_replace(array("\r\n", "\r"), "\n", $code);
32
33 # collapse all non-line feed whitespace into a single space
34 $code = preg_replace('/[^\S\n]+/', ' ', $code);
35
36 # strip leading & trailing whitespace
37 $code = str_replace(array(" \n", "\n "), "\n", $code);
38
39 # collapse consecutive line feeds into just 1
40 $code = preg_replace('/\n+/', "\n", $code);
41
42 # process horizontal space
43 $code = preg_replace('/([\[\]\(\)\{\}\;\<\>])(\h+)([\[\]\(\)\{\}\;\<\>])/ui', '$1 $3', $code);
44 $code = preg_replace('/([\)])(\h?)(\.)/ui', '$1$3', $code);
45 $code = preg_replace('/([\)\?])(\h?)(\.)/ui', '$1$3', $code);
46 $code = preg_replace('/(\,)(\h+)/ui', '$1 ', $code);
47 $code = preg_replace('/(\h+)(\,)/ui', ' $2', $code);
48 $code = preg_replace('/([if])(\h+)(\()/ui', '$1$3', $code);
49
50 # trim whitespace on beginning/end
51 return trim($code);
52 }
53
54
55 # remove UTF8 BOM
56 function fvm_min_remove_utf8_bom($text) {
57 $bom = pack('H*','EFBBBF');
58 while (preg_match("/^$bom/", $text)) {
59 $text = preg_replace("/^$bom/ui", '', $text);
60 }
61 return $text;
62 }
63
64
65
66
67 # minify html, don't touch certain tags
68 function fvm_raisermin_html($html) {
69
70 # clone
71 $content = $html;
72
73 # get all scripts
74 $skp = array();
75 preg_match_all('/(\<script(.*?)\<(\s*)\/script(\s*)\>|\<noscript(.*?)\<(\s*)\/noscript(\s*)\>|\<code(.*?)\<(\s*)\/code(\s*)\>|\<pre(.*?)\<(\s*)\/pre(\s*)\>)/uis', $html, $skp);
76
77 # replace all skippable patterns with comment
78 if(is_array($skp) && isset($skp[0]) && count($skp[0]) > 0) {
79 foreach ($skp[0] as $k=>$v) {
80 $content = str_replace($v, '<!-- SKIP '.$k.' -->', $content);
81 }
82 }
83
84 # remove line breaks, and colapse two or more white spaces into one
85 $content = preg_replace('/\s+/u', " ", $content);
86
87 # add linebreaks after html and head tags, for readability
88 $content = str_replace('<head>', PHP_EOL . '<head>' . PHP_EOL, $content);
89 $content = str_replace('</head>', PHP_EOL . '</head>' . PHP_EOL, $content);
90 $content = str_replace('<html', PHP_EOL . '<html', $content);
91 $content = str_replace('</html>', PHP_EOL . '</html>', $content);
92
93 # final readability adjustments
94 $content = str_replace('<meta ', PHP_EOL . '<meta ', $content);
95 $content = str_replace('<link ', PHP_EOL . '<link ', $content);
96 $content = str_replace('<style', PHP_EOL . '<style', $content);
97 $content = str_replace('<noscript', PHP_EOL . '<noscript>', $content);
98
99 # replace markers for scripts last
100 if(is_array($skp) && isset($skp[0]) && count($skp[0]) > 0) {
101 foreach ($skp[0] as $k=>$v) {
102 $content = str_replace('<!-- SKIP '.$k.' -->', PHP_EOL . $v . PHP_EOL, $content);
103 }
104 }
105
106 # no empty lines
107 $lines = explode(PHP_EOL, $content);
108 foreach($lines as $k=>$ln) { $ln = ltrim($ln); if(empty($ln)) { unset($lines[$k]); } else { $lines[$k] = $ln; } }
109 $content = implode(PHP_EOL, $lines);
110
111 # save as html, if not empty
112 if(!empty($content)) {
113 $html = $content;
114 }
115
116 # return
117 return $html;
118 }
1 @font-face {
2 font-family: "Flaticon";
3 src: url("fonts/statics/flaticon.eot");
4 src: url("fonts/statics/flaticon.eot#iefix") format("embedded-opentype"),
5 url("fonts/statics/flaticon.woff") format("woff"),
6 url("fonts/statics/flaticon.ttf") format("truetype"),
7 url("fonts/statics/flaticon.svg") format("svg");
8 font-weight: normal !important;
9 font-style: normal !important;
10 }
11 [class^="flaticon-"]:before, [class*=" flaticon-"]:before,
12 [class^="flaticon-"]:after, [class*=" flaticon-"]:after {
13 font-family: Flaticon;
14 font-size: 40px !important;
15 font-style: normal !important;
16 color: #ff8900 !important;
17 }.flaticon-css4:before {
18 content: "\e000";
19 }
20 .flaticon-desktop1:before {
21 content: "\e001";
22 }
23 .flaticon-js:before {
24 content: "\e002";
25 }
26 .flaticon-smart:before {
27 content: "\e003";
28 }
29
30
31
32
33 @font-face {
34 font-family: "Flaticon";
35 src: url("fonts/db/flaticon.eot");
36 src: url("fonts/db/Flaticon.eot?#iefix") format("embedded-opentype"),
37 url("fonts/db/Flaticon.woff") format("woff"),
38 url("fonts/db/Flaticon.ttf") format("truetype"),
39 url("fonts/db/Flaticon.svg#Flaticon") format("svg");
40 font-weight: normal;
41 font-style: normal;
42 }
43
44 @media screen and (-webkit-min-device-pixel-ratio:0) {
45 @font-face {
46 font-family: "Flaticon";
47 src: url("fonts/db/Flaticon.svg#Flaticon") format("svg");
48 }
49 }
50
51 [class^="flaticon-"]:before, [class*=" flaticon-"]:before,
52 [class^="flaticon-"]:after, [class*=" flaticon-"]:after {
53 font-family: Flaticon;
54 line-height: 44px !important;
55 font-style: normal !important;
56 }
57
58
59 .flaticon-check:before { content: "\f100"; color:#5cab40 !important; font-size: 25px !important;}
60 .flaticon-counterclockwise:before { content: "\f101"; font-weight: bold; font-size: 35px !important;}
61 .flaticon-draft:before { content: "\f102"; font-size: 35px !important;}
62 .flaticon-file:before { content: "\f103"; font-weight: bold; font-size: 35px !important;}
63 .flaticon-interface:before { content: "\f104"; font-weight: bold; font-size: 35px !important;}
64 .flaticon-pingback:before { content: "\f105"; font-weight: bold; font-size: 35px !important;}
65 .flaticon-recycling:before { content: "\f106"; font-weight: bold; font-size: 35px !important;}
66 .flaticon-start-settings:before { content: "\f107"; color:#3498db !important; font-size: 30px !important;}
67 .flaticon-technology:before { content: "\f108"; font-weight: bold; font-size: 35px !important;}
...\ No newline at end of file ...\ No newline at end of file
1 Silence is golden.
...\ No newline at end of file ...\ No newline at end of file
1 #revert-loader-toolbar{
2 display: none;
3 background: rgba(255, 255, 255, .7) url('data:image/gif;base64,R0lGODlhSwBLANUAAP////7+/v39/fz8/Pr6+vn5+ff39/b29vX19fT09PPz8/Ly8vHx8fDw8O/v7+7u7u3t7ezs7Ovr6+rq6unp6ejo6Ofn5+bm5uTk5OPj4+Li4uDg4N3d3dra2tjY2NfX19TU1NHR0c/Pz87Ozs3NzcfHx8XFxcTExMHBwbu7u7q6urW1tbS0tLGxsa+vr6ioqKenp6Kiop6enp2dnZycnJSUlJOTk4qKioCAgHd3d21tbWNjYwAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAAACwAAAAAQwBLAAAG/0CAcEgsGo/FAogVo8VYoAJySq1aj50mbcuNda7g8LXELZdL4rRaCDK7t6C13KrQvssxxXx/JN/daHyCQi9/bi+Dg4ZviVQFCpADSBaLbhZICB6aEnIUICOgoBx6SZVmUkUeNjusrDkqYgcfobSgG0Z2lTFGMq2+rDgaVwchtca3RCimWyhFvb+/OsJVs8bGl0OUy9hCLdDfOFUW1uSoQimmKUQS3+0tVJ/kxhNEBS6LLuYAKe3fOVMF5Fn7Ug/dnRT6ANzo943TEQUCjYU4YsEglxTciOhgCM0DEogRawG0QDIhEY4dP4akFWdPDpS+PB4ZsDIUBz41YLY6MIVDzf8REPiY0LmjBhWQIVvyeQlT5pQNK0nx8QBTxhWoAoMmGsrQKhgLxYyB4NkIgAam0d6JGTChw6cPGxqULSJCBo4dOW6kIDu3r9+/fPgCTjQgQ7wRITZIHSwHQthjkhirwSrvQ2TJYCCsvIn5yoDHEeV2rjLhJ8HRUzr8HHEZtZHVIxa7JgJb9mwhtW8bUf2ztW4ApWue/i3kc03RxIdoDsk5ORHK5Cw7N+KY3Abf04tjOJzYdnYjgr+LH/97AAW3I+Ai72vAgYQLFCIkEJDmAuhQ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01yeBC7e6tUwce/uv38OljNSggmYGf5hgckwIhjQ4Lx+TTVzCiGBQDLVgkg3EcxI1kRtzC9QICyDYgVnRygWLDyZcwY9IBKHNMBhAjcobY8KzmFc4IIXIKFerSJ5UNQ5Pm/GAUCQSlUDk0NRIUqtIGU4dMsAr1Y9YOXKFmFRIWas+pZZWebZo26VqjYNvmHAtgq1yvWaumxUr3aVqpdIUgDcs08BCgVosaJoIBp06ei/lFnky5shgDDiRcoBAhgWUAFCaJnlRhweQDo1NPcrC4gOrXrAOHfq26AF3UtFU/oPsg92u6s32Ptp1VeO2xFYwPHxtBuWi6CZxvDiz9bVNJxvkYdiC8wmTutLVPLtB7NAXPnwEUWJ++vfv38OPLn78xCAA7') no-repeat center;
4 position: fixed;
5 top: 0;
6 left: 0;
7 width: 100%;
8 height: 100%;
9 z-index: 9998;
10 }
11 #wp-admin-bar-wpfc-toolbar-parent, #wp-admin-bar-wpfc-toolbar-parent-delete-cache, #wp-admin-bar-wpfc-toolbar-parent-delete-cache-and-minified{
12 cursor: pointer;
13 }
14
15 @supports not (-ms-high-contrast: none) {
16 #wp-admin-bar-wpfc-toolbar-parent > .ab-empty-item::before{
17 content: url("../images/icon.svg");
18 }
19 }
20
21 #wp-admin-bar-wpfc-toolbar-parent .ab-empty-item:hover{
22 background-color: #FFA100;
23 }
...\ No newline at end of file ...\ No newline at end of file
1 Silence is golden.
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 class WpFastestCacheAdminToolbar{
3 private $is_multi = false;
4
5 public function __construct($is_multi){
6 $this->is_multi = $is_multi;
7 }
8
9 public function add(){
10 if(is_admin()){
11 add_action('wp_before_admin_bar_render', array($this, "wpfc_tweaked_toolbar_on_admin_panel"));
12 add_action('admin_enqueue_scripts', array($this, 'load_toolbar_js'));
13 add_action('admin_enqueue_scripts', array($this, 'load_toolbar_css'));
14 }else{
15 if(is_admin_bar_showing()){
16 add_action('wp_before_admin_bar_render', array($this, "wpfc_tweaked_toolbar_on_frontpage"));
17 add_action('wp_enqueue_scripts', array($this, 'load_toolbar_js'));
18 add_action('wp_enqueue_scripts', array($this, 'load_toolbar_css'));
19 add_action('wp_footer', array($this, 'print_my_inline_script'));
20 }
21 }
22 }
23
24 public function load_toolbar_js(){
25 wp_enqueue_script("wpfc-toolbar", plugins_url("wp-fastest-cache/js/toolbar.js"), array('jquery'), time(), true);
26 }
27
28 public function load_toolbar_css(){
29 wp_enqueue_style("wp-fastest-cache-toolbar", plugins_url("wp-fastest-cache/css/toolbar.css"), array(), time(), "all");
30 }
31
32 public function print_my_inline_script() {
33 ?>
34 <script type="text/javascript">
35 var wpfc_ajaxurl = "<?php echo admin_url( 'admin-ajax.php' ); ?>";
36 var wpfc_nonce = "<?php echo wp_create_nonce("wpfc"); ?>";
37 </script>
38 <?php
39 }
40
41 public function wpfc_tweaked_toolbar_on_frontpage() {
42 global $wp_admin_bar;
43
44 $wp_admin_bar->add_node(array(
45 'id' => 'wpfc-toolbar-parent',
46 'title' => 'Clear Cache'
47 ));
48
49 $wp_admin_bar->add_menu( array(
50 'id' => 'wpfc-toolbar-parent-clear-cache-of-this-page',
51 'title' => 'Clear Cache of This Page',
52 'parent'=> 'wpfc-toolbar-parent',
53 'meta' => array("class" => "wpfc-toolbar-child")
54 ));
55
56 $wp_admin_bar->add_menu( array(
57 'id' => 'wpfc-toolbar-parent-delete-cache',
58 'title' => 'Delete Cache',
59 'parent'=> 'wpfc-toolbar-parent',
60 'meta' => array("class" => "wpfc-toolbar-child")
61 ));
62
63 $wp_admin_bar->add_menu( array(
64 'id' => 'wpfc-toolbar-parent-delete-cache-and-minified',
65 'title' => 'Delete Cache and Minified CSS/JS',
66 'parent'=> 'wpfc-toolbar-parent',
67 'meta' => array("class" => "wpfc-toolbar-child")
68 ));
69
70 if($this->is_multi){
71 $wp_admin_bar->add_menu( array(
72 'id' => 'wpfc-toolbar-parent-clear-cache-of-allsites',
73 'title' => __("Clear Cache of All Sites", "wp-fastest-cache"),
74 'parent'=> 'wpfc-toolbar-parent',
75 'meta' => array("class" => "wpfc-toolbar-child")
76 ));
77 }
78 }
79
80 public function wpfc_tweaked_toolbar_on_admin_panel() {
81 global $wp_admin_bar;
82
83 $wp_admin_bar->add_node(array(
84 'id' => 'wpfc-toolbar-parent',
85 'title' => __("Delete Cache", "wp-fastest-cache"),
86 ));
87
88 $wp_admin_bar->add_menu( array(
89 'id' => 'wpfc-toolbar-parent-delete-cache',
90 'title' => __("Clear All Cache", "wp-fastest-cache"),
91 'parent'=> 'wpfc-toolbar-parent',
92 'meta' => array("class" => "wpfc-toolbar-child")
93 ));
94
95 $wp_admin_bar->add_menu( array(
96 'id' => 'wpfc-toolbar-parent-delete-cache-and-minified',
97 'title' => __("Delete Cache and Minified CSS/JS", "wp-fastest-cache"),
98 'parent'=> 'wpfc-toolbar-parent',
99 'meta' => array("class" => "wpfc-toolbar-child")
100 ));
101
102 if($this->is_multi){
103 $wp_admin_bar->add_menu( array(
104 'id' => 'wpfc-toolbar-parent-clear-cache-of-allsites',
105 'title' => __("Clear Cache of All Sites", "wp-fastest-cache"),
106 'parent'=> 'wpfc-toolbar-parent',
107 'meta' => array("class" => "wpfc-toolbar-child")
108 ));
109 }else{
110 if(isset($_GET["page"]) && $_GET["page"] == "wpfastestcacheoptions"){
111 $wp_admin_bar->add_menu( array(
112 'id' => 'wpfc-toolbar-parent-settings',
113 'title' => __("Settings", "wp-fastest-cache"),
114 'parent'=> 'wpfc-toolbar-parent',
115 'meta' => array("class" => "wpfc-toolbar-child")
116 ));
117 }
118 }
119 }
120 }
121 ?>
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
1 <?php
2 /**
3 * WP-CLI commands for WP Fastest Cache.
4 */
5
6 if(!defined('ABSPATH')){
7 exit;
8 }
9
10 // This is a WP-CLI command, so bail if it's not available.
11 if(!defined('WP_CLI')){
12 return;
13 }
14
15
16 class wpfcCLI extends \WP_CLI_Command
17 {
18 /**
19 * Clears the cache.
20 *
21 * ## EXAMPLES
22 * wp fastest-cache clear all
23 * wp fastest-cache clear all and minified
24 *
25 *
26 * @subcommand clear
27 *
28 * @param array $args Args.
29 * @param array $args_assoc Associative args.
30 *
31 * @return void
32 */
33 public function wrong_usage(){
34 $message = array("*************************************************************************",
35 "* Wrong usage! *",
36 "* Please read: https://www.wpfastestcache.com/features/wp-cli-commands/ *",
37 "*************************************************************************");
38 WP_CLI::error_multi_line($message);
39 }
40
41 public function clear($args, $args_assoc){
42 if(isset($GLOBALS['wp_fastest_cache'])){
43 if(method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')){
44 if(isset($args[0])){
45 if($args[0] == "all"){
46 if(isset($args[1]) && isset($args[2])){
47 if($args[1] == "and" && $args[2] == "minified"){
48 WP_CLI::line("Clearing the ALL cache...");
49 $GLOBALS['wp_fastest_cache']->deleteCache(true);
50 WP_CLI::success("The cache has been cleared!");
51 }else{
52 self::wrong_usage();
53 }
54 }else{
55 WP_CLI::line("Clearing the ALL cache...");
56 $GLOBALS['wp_fastest_cache']->deleteCache();
57 WP_CLI::success("The cache has been cleared!");
58 }
59 }else{
60 self::wrong_usage();
61 }
62 }else{
63 self::wrong_usage();
64 }
65 }else{
66 WP_CLI::error("deleteCache() does not exist!");
67 }
68 }else{
69 WP_CLI::error("GLOBALS['wp_fastest_cache'] has not been defined!");
70 }
71 }
72 }
73
74 WP_CLI::add_command( 'fastest-cache', 'wpfcCLI' );
75
76 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 class WpFastestCacheColumn{
3 public function __construct(){}
4
5 public function add(){
6 add_filter('post_row_actions', array($this, 'add_clear_cache_link'), 10, 2);
7 add_filter('page_row_actions', array($this, 'add_clear_cache_link'), 10, 2);
8
9
10 add_action('admin_enqueue_scripts', array($this, 'load_js'));
11 add_action('wp_ajax_wpfc_clear_cache_column', array($this, "clear_cache_column"));
12 }
13
14 public function add_clear_cache_link($actions, $post){
15 $actions['clear_cache_link'] = '<a data-id="'.$post->ID.'" data-nonce="'.wp_create_nonce('clear-cache_'.$post->ID).'" id="wpfc-clear-cache-link-'.$post->ID.'" style="cursor:pointer;">' . __('Clear Cache') . '</a>';
16 return $actions;
17 }
18
19 public function clear_cache_column(){
20 if(wp_verify_nonce($_GET["nonce"], 'clear-cache_'.$_GET["id"])){
21 $GLOBALS["wp_fastest_cache"]->singleDeleteCache(false, esc_sql($_GET["id"]));
22
23 die(json_encode(array("success" => true)));
24 }else{
25 die(json_encode(array("success" => false)));
26 }
27 }
28
29 public function load_js(){
30 wp_enqueue_script("wpfc-column", plugins_url("wp-fastest-cache/js/column.js"), array(), time(), true);
31 }
32 }
33 ?>
...\ No newline at end of file ...\ No newline at end of file